From f9eddc9b18f6dc7ba9aebfca690876688da2b6ab Mon Sep 17 00:00:00 2001 From: Yunus M Date: Mon, 26 Feb 2024 12:09:31 +0530 Subject: [PATCH] fix: update no logs text and link based on the datasource (#4594) --- .../src/container/LogsExplorerList/index.tsx | 2 +- .../src/container/LogsExplorerViews/index.tsx | 1 + frontend/src/container/NoLogs/NoLogs.tsx | 16 +++++++++++----- .../container/TimeSeriesView/TimeSeriesView.tsx | 5 ++++- frontend/src/container/TimeSeriesView/index.tsx | 1 + 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/frontend/src/container/LogsExplorerList/index.tsx b/frontend/src/container/LogsExplorerList/index.tsx index c4bba5291b..dbc38b7923 100644 --- a/frontend/src/container/LogsExplorerList/index.tsx +++ b/frontend/src/container/LogsExplorerList/index.tsx @@ -161,7 +161,7 @@ function LogsExplorerList({ !isFetching && !isError && !isFilterApplied && - logs.length === 0 && } + logs.length === 0 && } {!isLoading && !isFetching && diff --git a/frontend/src/container/LogsExplorerViews/index.tsx b/frontend/src/container/LogsExplorerViews/index.tsx index 4b639ed505..49b5842908 100644 --- a/frontend/src/container/LogsExplorerViews/index.tsx +++ b/frontend/src/container/LogsExplorerViews/index.tsx @@ -611,6 +611,7 @@ function LogsExplorerViews({ data={data} isError={isError} isFilterApplied={!isEmpty(listQuery?.filters.items)} + dataSource={DataSource.LOGS} /> )} diff --git a/frontend/src/container/NoLogs/NoLogs.tsx b/frontend/src/container/NoLogs/NoLogs.tsx index 1274bdb20a..7745d130f3 100644 --- a/frontend/src/container/NoLogs/NoLogs.tsx +++ b/frontend/src/container/NoLogs/NoLogs.tsx @@ -2,25 +2,31 @@ import './NoLogs.styles.scss'; import { Typography } from 'antd'; import { ArrowUpRight } from 'lucide-react'; +import { DataSource } from 'types/common/queryBuilder'; -export default function NoLogs(): JSX.Element { +export default function NoLogs({ + dataSource, +}: { + dataSource: DataSource; +}): JSX.Element { return (
eyes emoji - No logs yet. + No {dataSource} yet. - When we receive logs, they would show up here + {' '} + When we receive {dataSource}, they would show up here - Sending Logs to SigNoz + Sending {dataSource} to SigNoz
diff --git a/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx b/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx index 8bac60b425..bd7f32b153 100644 --- a/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx +++ b/frontend/src/container/TimeSeriesView/TimeSeriesView.tsx @@ -14,6 +14,7 @@ import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import { SuccessResponse } from 'types/api'; import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange'; +import { DataSource } from 'types/common/queryBuilder'; import { GlobalReducer } from 'types/reducer/globalTime'; import { getTimeRange } from 'utils/getTimeRange'; @@ -25,6 +26,7 @@ function TimeSeriesView({ isError, yAxisUnit, isFilterApplied, + dataSource, }: TimeSeriesViewProps): JSX.Element { const graphRef = useRef(null); @@ -93,7 +95,7 @@ function TimeSeriesView({ chartData[0]?.length === 0 && !isLoading && !isError && - !isFilterApplied && } + !isFilterApplied && } {!isLoading && !isError && @@ -111,6 +113,7 @@ interface TimeSeriesViewProps { isLoading: boolean; isError: boolean; isFilterApplied: boolean; + dataSource: DataSource; } TimeSeriesView.defaultProps = { diff --git a/frontend/src/container/TimeSeriesView/index.tsx b/frontend/src/container/TimeSeriesView/index.tsx index b2c6b3f01f..4acffd7e61 100644 --- a/frontend/src/container/TimeSeriesView/index.tsx +++ b/frontend/src/container/TimeSeriesView/index.tsx @@ -74,6 +74,7 @@ function TimeSeriesViewContainer({ isLoading={isLoading} data={responseData} yAxisUnit={isValidToConvertToMs ? 'ms' : 'short'} + dataSource={dataSource} /> ); }