From 48ad2c292697b71a940bb092f54a4db6ad0baaef Mon Sep 17 00:00:00 2001 From: Sagar Rajput Date: Fri, 5 Jul 2024 16:53:02 +0530 Subject: [PATCH] feat: resovled comments --- frontend/public/locales/en-GB/trace.json | 3 +-- frontend/public/locales/en/common.json | 3 ++- frontend/public/locales/en/trace.json | 3 +-- .../src/container/LogsLoading/LogsLoading.tsx | 6 +++-- .../TracesExplorer/ListView/index.tsx | 24 +++++++++---------- .../TraceLoading/TraceLoading.tsx | 7 ++++-- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/frontend/public/locales/en-GB/trace.json b/frontend/public/locales/en-GB/trace.json index 775ee7dda59..c1e5519141b 100644 --- a/frontend/public/locales/en-GB/trace.json +++ b/frontend/public/locales/en-GB/trace.json @@ -7,6 +7,5 @@ "column": "Column", "maxLines": "Max lines per Row", "addColumn": "Add a column" - }, - "trace_loading_placeholder": "Just a bit of patience, just a little bit’s enough ⎯ we’re getting your traces!" + } } diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json index f167aecffc5..72d9f138106 100644 --- a/frontend/public/locales/en/common.json +++ b/frontend/public/locales/en/common.json @@ -6,5 +6,6 @@ "share": "Share", "save": "Save", "edit": "Edit", - "logged_in": "Logged In" + "logged_in": "Logged In", + "pending_data_placeholder": "Just a bit of patience, just a little bit’s enough ⎯ we’re getting your {{dataSource}}!" } diff --git a/frontend/public/locales/en/trace.json b/frontend/public/locales/en/trace.json index 775ee7dda59..c1e5519141b 100644 --- a/frontend/public/locales/en/trace.json +++ b/frontend/public/locales/en/trace.json @@ -7,6 +7,5 @@ "column": "Column", "maxLines": "Max lines per Row", "addColumn": "Add a column" - }, - "trace_loading_placeholder": "Just a bit of patience, just a little bit’s enough ⎯ we’re getting your traces!" + } } diff --git a/frontend/src/container/LogsLoading/LogsLoading.tsx b/frontend/src/container/LogsLoading/LogsLoading.tsx index 1710cd9f57f..deb4758b6eb 100644 --- a/frontend/src/container/LogsLoading/LogsLoading.tsx +++ b/frontend/src/container/LogsLoading/LogsLoading.tsx @@ -1,8 +1,11 @@ import './LogsLoading.styles.scss'; import { Typography } from 'antd'; +import { useTranslation } from 'react-i18next'; +import { DataSource } from 'types/common/queryBuilder'; export function LogsLoading(): JSX.Element { + const { t } = useTranslation('common'); return (
@@ -13,8 +16,7 @@ export function LogsLoading(): JSX.Element { /> - Just a bit of patience, just a little bit’s enough ⎯ we’re getting your - logs! + {t('pending_data_placeholder', { dataSource: DataSource.LOGS })}
diff --git a/frontend/src/container/TracesExplorer/ListView/index.tsx b/frontend/src/container/TracesExplorer/ListView/index.tsx index 93d65001fc0..2bd7ac7e720 100644 --- a/frontend/src/container/TracesExplorer/ListView/index.tsx +++ b/frontend/src/container/TracesExplorer/ListView/index.tsx @@ -129,6 +129,12 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element { [columns, onDragColumns], ); + const isDataPresent = + !isLoading && + !isFetching && + !isError && + transformedQueryTableData.length === 0; + return ( {transformedQueryTableData.length !== 0 && ( @@ -146,19 +152,11 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element { )} - {!isLoading && - !isFetching && - !isError && - !isFilterApplied && - transformedQueryTableData.length === 0 && ( - - )} - - {!isLoading && - !isFetching && - transformedQueryTableData.length === 0 && - !isError && - isFilterApplied && } + {isDataPresent && !isFilterApplied && ( + + )} + + {isDataPresent && isFilterApplied && } {!isError && transformedQueryTableData.length !== 0 && (
@@ -14,7 +15,9 @@ export function TracesLoading(): JSX.Element { alt="wait-icon" /> - {t('trace_loading_placeholder')} + + {t('pending_data_placeholder', { dataSource: DataSource.TRACES })} +
);