mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 22:39:01 +08:00
fix(FE): show no No Data on default Dashboards (#2003)
* fix(FE): show no No Data on default Dashboards Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com> * chore: removed un used styles Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com> Co-authored-by: Vishal Sharma <makeavish786@gmail.com> Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
44360ecacf
commit
a4346a2d93
@ -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 <Spinner height="100%" size="large" tip="Loading..." />;
|
||||
}
|
||||
if (isError || !response?.data?.payload?.data?.result) {
|
||||
return (
|
||||
<NotFoundContainer>
|
||||
<Typography>{errorMessage}</Typography>
|
||||
</NotFoundContainer>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user