From a4346a2d93e55533ee0b691246c41223b1825294 Mon Sep 17 00:00:00 2001 From: Marius Kimmina <38843153+mariuskimmina@users.noreply.github.com> Date: Tue, 10 Jan 2023 19:24:14 +0100 Subject: [PATCH] fix(FE): show no No Data on default Dashboards (#2003) * fix(FE): show no No Data on default Dashboards Signed-off-by: Marius Kimmina * chore: removed un used styles Signed-off-by: Marius Kimmina Co-authored-by: Vishal Sharma Co-authored-by: Palash Gupta --- .../Graph/FullView/index.metricsBuilder.tsx | 13 ++----------- .../GridGraphLayout/Graph/FullView/styles.ts | 9 --------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/frontend/src/container/GridGraphLayout/Graph/FullView/index.metricsBuilder.tsx b/frontend/src/container/GridGraphLayout/Graph/FullView/index.metricsBuilder.tsx index df8ea6c22d..5aa298b76b 100644 --- a/frontend/src/container/GridGraphLayout/Graph/FullView/index.metricsBuilder.tsx +++ b/frontend/src/container/GridGraphLayout/Graph/FullView/index.metricsBuilder.tsx @@ -1,4 +1,4 @@ -import { Button, Typography } from 'antd'; +import { Button } from 'antd'; import { GraphOnClickHandler } from 'components/Graph'; import Spinner from 'components/Spinner'; import TimePreference from 'components/TimePreferenceDropDown'; @@ -19,7 +19,7 @@ import { Widgets } from 'types/api/dashboard/getAll'; import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange'; import { GlobalReducer } from 'types/reducer/globalTime'; -import { NotFoundContainer, TimeContainer } from './styles'; +import { TimeContainer } from './styles'; function FullView({ widget, @@ -57,20 +57,11 @@ function FullView({ }), ); - const isError = response?.error; const isLoading = response.isLoading === true; - const errorMessage = isError instanceof Error ? isError?.message : ''; if (isLoading) { return ; } - if (isError || !response?.data?.payload?.data?.result) { - return ( - - {errorMessage} - - ); - } return ( <> diff --git a/frontend/src/container/GridGraphLayout/Graph/FullView/styles.ts b/frontend/src/container/GridGraphLayout/Graph/FullView/styles.ts index 7b85723a29..4fbc1a18c0 100644 --- a/frontend/src/container/GridGraphLayout/Graph/FullView/styles.ts +++ b/frontend/src/container/GridGraphLayout/Graph/FullView/styles.ts @@ -1,14 +1,5 @@ import styled from 'styled-components'; -export const GraphContainer = styled.div` - min-height: 70vh; - align-items: center; - justify-content: center; - display: flex; - flex-direction: column; - width: 100%; -`; - export const NotFoundContainer = styled.div` display: flex; justify-content: center;