Skip to content

Commit

Permalink
feat: resovled comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarRajput-7 committed Jul 5, 2024
1 parent 7862db5 commit 48ad2c2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
3 changes: 1 addition & 2 deletions frontend/public/locales/en-GB/trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
3 changes: 2 additions & 1 deletion frontend/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}!"
}
3 changes: 1 addition & 2 deletions frontend/public/locales/en/trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
6 changes: 4 additions & 2 deletions frontend/src/container/LogsLoading/LogsLoading.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="loading-logs">
<div className="loading-logs-content">
Expand All @@ -13,8 +16,7 @@ export function LogsLoading(): JSX.Element {
/>

<Typography>
Just a bit of patience, just a little bit’s enough ⎯ we’re getting your
logs!
{t('pending_data_placeholder', { dataSource: DataSource.LOGS })}
</Typography>
</div>
</div>
Expand Down
24 changes: 11 additions & 13 deletions frontend/src/container/TracesExplorer/ListView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element {
[columns, onDragColumns],
);

const isDataPresent =
!isLoading &&
!isFetching &&
!isError &&
transformedQueryTableData.length === 0;

return (
<Container>
{transformedQueryTableData.length !== 0 && (
Expand All @@ -146,19 +152,11 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element {
<TracesLoading />
)}

{!isLoading &&
!isFetching &&
!isError &&
!isFilterApplied &&
transformedQueryTableData.length === 0 && (
<NoLogs dataSource={DataSource.TRACES} />
)}

{!isLoading &&
!isFetching &&
transformedQueryTableData.length === 0 &&
!isError &&
isFilterApplied && <EmptyLogsSearch />}
{isDataPresent && !isFilterApplied && (
<NoLogs dataSource={DataSource.TRACES} />
)}

{isDataPresent && isFilterApplied && <EmptyLogsSearch />}

{!isError && transformedQueryTableData.length !== 0 && (
<ResizeTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import './TraceLoading.styles.scss';

import { Typography } from 'antd';
import { useTranslation } from 'react-i18next';
import { DataSource } from 'types/common/queryBuilder';

export function TracesLoading(): JSX.Element {
const { t } = useTranslation('trace');
const { t } = useTranslation('common');
return (
<div className="loading-traces">
<div className="loading-traces-content">
Expand All @@ -14,7 +15,9 @@ export function TracesLoading(): JSX.Element {
alt="wait-icon"
/>

<Typography>{t('trace_loading_placeholder')}</Typography>
<Typography>
{t('pending_data_placeholder', { dataSource: DataSource.TRACES })}
</Typography>
</div>
</div>
);
Expand Down

0 comments on commit 48ad2c2

Please sign in to comment.