@centreon/ui 26.7.0 → 26.7.1
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 +1 -1
- package/src/Graph/BarChart/ResponsiveBarChart.tsx +0 -1
- package/src/Graph/Chart/Chart.tsx +0 -1
- package/src/Graph/Gauge/AnimatedPie.tsx +3 -1
- package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +3 -1
- package/src/Graph/common/BaseChart/ChartSvgWrapper.tsx +2 -2
- package/src/Graph/common/timeSeries/index.ts +8 -13
- package/src/Listing/ActionBar/PaginationActions.tsx +10 -1
- package/src/Listing/Header/Cell/SelectActionListingHeaderCell.tsx +1 -1
- package/src/api/useFetchQuery/index.ts +10 -6
- package/src/components/Tabs/Tab.styles.ts +0 -3
- package/src/components/Tabs/TabPanel.tsx +5 -15
package/package.json
CHANGED
|
@@ -8,6 +8,8 @@ import type { Thresholds } from '../common/models';
|
|
|
8
8
|
|
|
9
9
|
type AnimatedStyles = { endAngle: number; opacity: number; startAngle: number };
|
|
10
10
|
|
|
11
|
+
const AnimatedPath = animated('path');
|
|
12
|
+
|
|
11
13
|
const fromLeaveTransition = ({
|
|
12
14
|
endAngle
|
|
13
15
|
}: {
|
|
@@ -63,7 +65,7 @@ const AnimatedPie = <Datum,>({
|
|
|
63
65
|
|
|
64
66
|
return transitions((props, arc, { key }) => (
|
|
65
67
|
<g key={key}>
|
|
66
|
-
<
|
|
68
|
+
<AnimatedPath
|
|
67
69
|
d={to([props.startAngle, props.endAngle], (startAngle, endAngle) =>
|
|
68
70
|
path({
|
|
69
71
|
...arc,
|
|
@@ -20,6 +20,8 @@ import type { SingleBarProps } from './models';
|
|
|
20
20
|
import { barHeights, lineMargins } from './ThresholdLine';
|
|
21
21
|
import Thresholds, { groupMargin } from './Thresholds';
|
|
22
22
|
|
|
23
|
+
const AnimatedRect = animated('rect');
|
|
24
|
+
|
|
23
25
|
interface Props extends SingleBarProps {
|
|
24
26
|
height: number;
|
|
25
27
|
width: number;
|
|
@@ -176,7 +178,7 @@ const ResponsiveSingleBar = ({
|
|
|
176
178
|
<title>single bar</title>
|
|
177
179
|
<Group.Group>
|
|
178
180
|
{text}
|
|
179
|
-
<
|
|
181
|
+
<AnimatedRect
|
|
180
182
|
data-testid={`${latestMetricData}-bar-${barColor}`}
|
|
181
183
|
fill={barColor}
|
|
182
184
|
height={realBarHeight}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Group } from '@visx/visx';
|
|
2
2
|
import type { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
|
|
3
3
|
import { equals } from 'ramda';
|
|
4
|
-
import type { MutableRefObject, ReactElement } from 'react';
|
|
4
|
+
import type { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
import { margin } from '../../Chart/common';
|
|
7
7
|
import type { ChartAxis } from '../../Chart/models';
|
|
@@ -15,7 +15,7 @@ interface Props {
|
|
|
15
15
|
allUnits: Array<string>;
|
|
16
16
|
axis?: ChartAxis;
|
|
17
17
|
base?: number;
|
|
18
|
-
children:
|
|
18
|
+
children: ReactNode;
|
|
19
19
|
displayedLines: Array<Line>;
|
|
20
20
|
graphHeight: number;
|
|
21
21
|
graphWidth: number;
|
|
@@ -343,19 +343,14 @@ const getTimeSeriesForLines = ({
|
|
|
343
343
|
return map(
|
|
344
344
|
({ timeTick, ...metricsValue }): TimeValue => ({
|
|
345
345
|
...reduce(
|
|
346
|
-
(acc, metric_id): Omit<TimeValue, 'timePick'> => {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
[metric_id]
|
|
350
|
-
|
|
351
|
-
metricsValue[metric_id]
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
: metricsValue[metric_id]
|
|
355
|
-
};
|
|
356
|
-
},
|
|
357
|
-
// @ts-expect-error - suppressing pre-existing type mismatch
|
|
358
|
-
{},
|
|
346
|
+
(acc, metric_id): Omit<TimeValue, 'timePick'> => ({
|
|
347
|
+
...acc,
|
|
348
|
+
[metric_id]:
|
|
349
|
+
invert && metricsValue[metric_id] && gt(metricsValue[metric_id], 0)
|
|
350
|
+
? negate(metricsValue[metric_id])
|
|
351
|
+
: metricsValue[metric_id]
|
|
352
|
+
}),
|
|
353
|
+
{} as Omit<TimeValue, 'timePick'>,
|
|
359
354
|
metrics
|
|
360
355
|
),
|
|
361
356
|
timeTick
|
|
@@ -3,7 +3,16 @@ import KeyboardArrowLeft from '@mui/icons-material/KeyboardArrowLeft';
|
|
|
3
3
|
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
|
|
4
4
|
import LastPageIcon from '@mui/icons-material/LastPage';
|
|
5
5
|
import IconButton from '@mui/material/IconButton';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
type TablePaginationActionsProps = {
|
|
8
|
+
count: number;
|
|
9
|
+
onPageChange: (
|
|
10
|
+
event: React.MouseEvent<HTMLButtonElement> | null,
|
|
11
|
+
page: number
|
|
12
|
+
) => void;
|
|
13
|
+
page: number;
|
|
14
|
+
rowsPerPage: number;
|
|
15
|
+
};
|
|
7
16
|
|
|
8
17
|
import { useTranslation } from 'react-i18next';
|
|
9
18
|
|
|
@@ -48,7 +48,7 @@ const SelectActionListingHeaderCell = ({
|
|
|
48
48
|
icon={<ArrowDropDownIcon />}
|
|
49
49
|
title={labelPredefinedRowsSelectionMenu}
|
|
50
50
|
>
|
|
51
|
-
{(props): JSX.Element => (
|
|
51
|
+
{(props: { close?: () => void } | undefined): JSX.Element => (
|
|
52
52
|
<PredefinedSelectionList
|
|
53
53
|
close={props?.close ?? ((): void => undefined)}
|
|
54
54
|
onSelectRowsWithCondition={onSelectRowsWithCondition}
|
|
@@ -38,16 +38,16 @@ export interface UseFetchQueryProps<T> {
|
|
|
38
38
|
useLongCache?: boolean;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export interface PrefetchPageParams {
|
|
42
|
-
getPrefetchQueryKey: (page: number) => QueryKey;
|
|
43
|
-
page: number;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
41
|
export interface PrefetchQueryParams {
|
|
47
42
|
endpointParams?: PrefetchEndpointParams;
|
|
48
43
|
queryKey: QueryKey;
|
|
49
44
|
}
|
|
50
45
|
|
|
46
|
+
export interface PrefetchPageParams {
|
|
47
|
+
getPrefetchQueryKey: (page: number) => QueryKey;
|
|
48
|
+
page: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
51
|
export type UseFetchQueryState<T> = {
|
|
52
52
|
data?: T;
|
|
53
53
|
error: Omit<ResponseError, 'isError'> | null;
|
|
@@ -82,7 +82,11 @@ const useFetchQuery = <T extends object>({
|
|
|
82
82
|
|
|
83
83
|
const { showErrorMessage } = useSnackbar();
|
|
84
84
|
|
|
85
|
-
const isCypressTest = equals(
|
|
85
|
+
const isCypressTest = equals(
|
|
86
|
+
(window as Window & { Cypress?: { testingType: string } }).Cypress
|
|
87
|
+
?.testingType,
|
|
88
|
+
'component'
|
|
89
|
+
);
|
|
86
90
|
|
|
87
91
|
const cacheOptions =
|
|
88
92
|
!isCypressTest && useLongCache ? { gcTime: 60 * 1000 } : {};
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import { TabPanel as MuiTabPanel } from '@mui/lab';
|
|
2
2
|
|
|
3
|
-
import { useTabsStyles } from './Tab.styles';
|
|
4
|
-
|
|
5
3
|
type Props = {
|
|
6
4
|
children: JSX.Element;
|
|
7
5
|
value: string;
|
|
8
6
|
};
|
|
9
7
|
|
|
10
|
-
export const TabPanel = ({ children, value }: Props): JSX.Element =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
className={classes.tabPanel}
|
|
16
|
-
data-tabPanel={value}
|
|
17
|
-
value={value}
|
|
18
|
-
>
|
|
19
|
-
{children}
|
|
20
|
-
</MuiTabPanel>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
8
|
+
export const TabPanel = ({ children, value }: Props): JSX.Element => (
|
|
9
|
+
<MuiTabPanel className="p-0 pt-2" data-tabPanel={value} value={value}>
|
|
10
|
+
{children}
|
|
11
|
+
</MuiTabPanel>
|
|
12
|
+
);
|