@centreon/ui 26.3.7 → 26.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,6 +5,8 @@ import 'dayjs/locale/es';
|
|
|
5
5
|
import 'dayjs/locale/fr';
|
|
6
6
|
import 'dayjs/locale/pt';
|
|
7
7
|
|
|
8
|
+
import { NoData } from '@centreon/ui';
|
|
9
|
+
|
|
8
10
|
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
9
11
|
import timezonePlugin from 'dayjs/plugin/timezone';
|
|
10
12
|
import utcPlugin from 'dayjs/plugin/utc';
|
|
@@ -81,7 +83,6 @@ const WrapperChart = ({
|
|
|
81
83
|
...rest
|
|
82
84
|
}: Props): JSX.Element | null => {
|
|
83
85
|
const { classes, cx } = useChartStyles();
|
|
84
|
-
|
|
85
86
|
const { adjustedData } = useChartData({ data, end, start });
|
|
86
87
|
|
|
87
88
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -112,7 +113,7 @@ const WrapperChart = ({
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
if (!adjustedData) {
|
|
115
|
-
return <
|
|
116
|
+
return <NoData />;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
return (
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Typography } from '@mui/material';
|
|
2
|
+
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
import { labelNoDataForThisPeriod } from '../../Chart/translatedLabels';
|
|
6
|
+
|
|
7
|
+
const NoData = () => {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
return (
|
|
10
|
+
<div className={'flex items-center justify-center h-full'}>
|
|
11
|
+
<Typography align="center" variant="body1">
|
|
12
|
+
{t(labelNoDataForThisPeriod)}
|
|
13
|
+
</Typography>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default NoData;
|
package/src/Graph/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as ThresholdLines } from './Chart/BasicComponents/Lines/Thresho
|
|
|
7
7
|
export * from './Chart/models';
|
|
8
8
|
export { default as useLineChartData } from './Chart/useChartData';
|
|
9
9
|
export { default as Header } from './common/BaseChart/Header';
|
|
10
|
+
export { default as NoData } from './common/Error/NoData';
|
|
10
11
|
export type { LineChartData, Threshold, Thresholds } from './common/models';
|
|
11
12
|
export * from './common/timeSeries';
|
|
12
13
|
export type { Metric } from './common/timeSeries/models';
|