@centreon/ui 24.11.11 → 24.11.12
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/Dashboard/Dashboard.styles.ts +1 -1
- package/src/Dashboard/Grid.tsx +2 -8
- package/src/Dashboard/Layout.tsx +40 -43
- package/src/Form/Inputs/Autocomplete.tsx +4 -2
- package/src/Form/Inputs/ConnectedAutocomplete.tsx +1 -1
- package/src/Form/Inputs/Radio.tsx +1 -1
- package/src/Form/Inputs/Text.tsx +1 -1
- package/src/Graph/BarChart/BarChart.cypress.spec.tsx +1 -1
- package/src/Graph/Chart/Chart.tsx +5 -2
- package/src/Graph/Chart/InteractiveComponents/index.tsx +1 -1
- package/src/Graph/Chart/index.tsx +1 -1
- package/src/Graph/common/utils.ts +2 -2
- package/src/Icon/BusinessActivityIcon.tsx +12 -0
- package/src/Icon/ContainerIcon.tsx +20 -0
- package/src/Icon/DowntimeIcon.tsx +8 -1
- package/src/Icon/HostGroupIcon.tsx +8 -0
- package/src/Icon/MetaServiceIcon.tsx +12 -0
- package/src/Icon/ServiceGroupIcon.tsx +8 -0
- package/src/Icon/index.ts +7 -2
- package/src/Listing/index.tsx +26 -27
- package/src/Typography/EllipsisTypography.tsx +7 -3
- package/src/components/Layout/PageLayout/PageLayout.styles.ts +1 -1
- /package/src/Icon/{AcnowledgementIcon.tsx → AcknowledgementIcon.tsx} +0 -0
package/package.json
CHANGED
package/src/Dashboard/Grid.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { scaleLinear } from '@visx/scale';
|
|
4
4
|
import { Grid as VisxGrid } from '@visx/visx';
|
|
@@ -13,15 +13,9 @@ interface Props {
|
|
|
13
13
|
columns: number;
|
|
14
14
|
height: number;
|
|
15
15
|
width: number;
|
|
16
|
-
containerRef: MutableRefObject<HTMLDivElement | null>;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
const Grid = ({
|
|
20
|
-
width,
|
|
21
|
-
height,
|
|
22
|
-
columns,
|
|
23
|
-
containerRef
|
|
24
|
-
}: Props): ReactElement => {
|
|
18
|
+
const Grid = ({ width, height, columns }: Props): ReactElement => {
|
|
25
19
|
const theme = useTheme();
|
|
26
20
|
|
|
27
21
|
const xScale = useMemo(
|
package/src/Dashboard/Layout.tsx
CHANGED
|
@@ -4,10 +4,7 @@ import { useSetAtom } from 'jotai';
|
|
|
4
4
|
import GridLayout, { Layout, WidthProvider } from 'react-grid-layout';
|
|
5
5
|
import 'react-grid-layout/css/styles.css';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
ParentSize,
|
|
9
|
-
useMemoComponent
|
|
10
|
-
} from '..';
|
|
7
|
+
import { ParentSize, useMemoComponent } from '..';
|
|
11
8
|
|
|
12
9
|
import { Box } from '@mui/material';
|
|
13
10
|
import { useDashboardLayoutStyles } from './Dashboard.styles';
|
|
@@ -33,10 +30,10 @@ const bottom = (layout: Array<Layout>): number => {
|
|
|
33
30
|
layout.forEach((panel) => {
|
|
34
31
|
bottomY = panel.y + panel.h;
|
|
35
32
|
if (bottomY > max) max = bottomY;
|
|
36
|
-
})
|
|
33
|
+
});
|
|
37
34
|
|
|
38
35
|
return max;
|
|
39
|
-
}
|
|
36
|
+
};
|
|
40
37
|
|
|
41
38
|
const DashboardLayout = <T extends Layout>({
|
|
42
39
|
children,
|
|
@@ -67,14 +64,10 @@ const DashboardLayout = <T extends Layout>({
|
|
|
67
64
|
}, []);
|
|
68
65
|
|
|
69
66
|
const containerHeight = useMemo((): number | undefined => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(nbRow - 1) * 20 +
|
|
75
|
-
containerPaddingY * 2
|
|
76
|
-
);
|
|
77
|
-
}, [layout, rowHeight])
|
|
67
|
+
const nbRow = bottom(getLayout(layout));
|
|
68
|
+
const containerPaddingY = 4;
|
|
69
|
+
return nbRow * rowHeight + (nbRow - 1) * 20 + containerPaddingY * 2;
|
|
70
|
+
}, [layout, rowHeight]) ?? 0;
|
|
78
71
|
|
|
79
72
|
useEffect(() => {
|
|
80
73
|
window.addEventListener('resize', resize);
|
|
@@ -86,36 +79,40 @@ const DashboardLayout = <T extends Layout>({
|
|
|
86
79
|
|
|
87
80
|
return useMemoComponent({
|
|
88
81
|
Component: (
|
|
89
|
-
<Box
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
cols={columns}
|
|
103
|
-
containerPadding={[4, 0]}
|
|
104
|
-
layout={getLayout(layout)}
|
|
105
|
-
margin={[20, 20]}
|
|
106
|
-
resizeHandles={['s', 'e', 'se']}
|
|
107
|
-
rowHeight={rowHeight}
|
|
82
|
+
<Box
|
|
83
|
+
ref={dashboardContainerRef}
|
|
84
|
+
sx={{ overflowY: 'auto', overflowX: 'hidden' }}
|
|
85
|
+
>
|
|
86
|
+
<ParentSize>
|
|
87
|
+
{({ width, height }): JSX.Element => (
|
|
88
|
+
<Box className={classes.container}>
|
|
89
|
+
{displayGrid && (
|
|
90
|
+
<Grid
|
|
91
|
+
columns={columns}
|
|
92
|
+
height={
|
|
93
|
+
containerHeight > height ? containerHeight : height
|
|
94
|
+
}
|
|
108
95
|
width={width}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
<ReactGridLayout
|
|
99
|
+
cols={columns}
|
|
100
|
+
containerPadding={[4, 0]}
|
|
101
|
+
layout={getLayout(layout)}
|
|
102
|
+
margin={[20, 20]}
|
|
103
|
+
resizeHandles={['s', 'e', 'se']}
|
|
104
|
+
rowHeight={rowHeight}
|
|
105
|
+
width={width}
|
|
106
|
+
onLayoutChange={changeLayout}
|
|
107
|
+
onResizeStart={startResize}
|
|
108
|
+
onResizeStop={stopResize}
|
|
109
|
+
>
|
|
110
|
+
{children}
|
|
111
|
+
</ReactGridLayout>
|
|
112
|
+
</Box>
|
|
113
|
+
)}
|
|
114
|
+
</ParentSize>
|
|
115
|
+
</Box>
|
|
119
116
|
),
|
|
120
117
|
memoProps: [columns, layout, displayGrid, isStatic, ...additionalMemoProps]
|
|
121
118
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
-
import { equals, isNil, map, not,
|
|
4
|
+
import { path, equals, isNil, map, not, prop, type } from 'ramda';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
7
|
import { FormHelperText, Stack } from '@mui/material';
|
|
@@ -188,7 +188,9 @@ const Autocomplete = ({
|
|
|
188
188
|
value={getValues() ?? null}
|
|
189
189
|
onChange={changeValues}
|
|
190
190
|
onTextChange={textChange}
|
|
191
|
-
style={{
|
|
191
|
+
style={{
|
|
192
|
+
width: (autocomplete?.fullWidth ?? true) ? 'auto' : '180px'
|
|
193
|
+
}}
|
|
192
194
|
/>
|
|
193
195
|
{inputErrors && (
|
|
194
196
|
<Stack>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
-
import { equals, isEmpty,
|
|
4
|
+
import { path, equals, isEmpty, propEq, reject, split } from 'ramda';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
7
|
import {
|
package/src/Form/Inputs/Text.tsx
CHANGED
|
@@ -62,14 +62,17 @@ interface Props extends LineChartProps {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const filterLines = (
|
|
65
|
+
const filterLines = (
|
|
66
|
+
lines: Array<Line>,
|
|
67
|
+
displayThreshold: boolean
|
|
68
|
+
): Array<Line> => {
|
|
66
69
|
if (!displayThreshold) {
|
|
67
70
|
return lines;
|
|
68
71
|
}
|
|
69
72
|
const lineOriginMetric = findLineOfOriginMetricThreshold(lines);
|
|
70
73
|
|
|
71
74
|
if (isEmpty(lineOriginMetric)) {
|
|
72
|
-
|
|
75
|
+
return lines;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
const findLinesUpperLower = lines.map((line) =>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import AccountTreeIcon from '@mui/icons-material/AccountTree';
|
|
2
|
+
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
import BaseIcon from './BaseIcon';
|
|
5
|
+
|
|
6
|
+
export const BusinessActivityIcon = (props: SvgIconProps): JSX.Element => (
|
|
7
|
+
<BaseIcon
|
|
8
|
+
Icon={AccountTreeIcon}
|
|
9
|
+
dataTestId="BusinessActivityIcon"
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvgIconProps } from '@mui/material';
|
|
2
|
+
|
|
3
|
+
import BaseIcon from './BaseIcon';
|
|
4
|
+
|
|
5
|
+
const icon = (
|
|
6
|
+
<g>
|
|
7
|
+
<path d="M301 745.9L28 662.4c-7.4-2.3-12.5-9.2-12.5-16.9V270.4c0-5.7 2.7-10.9 7.3-14.3 4.6-3.3 10.4-4.2 15.8-2.5l273.1 88.5c7.3 2.4 12.2 9.1 12.2 16.8V729c0 5.6-2.7 10.9-7.2 14.2-3.1 2.3-6.8 3.5-10.5 3.5-1.8-.1-3.5-.3-5.2-.8zm5.2-16.9l5.2-16.9-5.2 16.9zM50.8 632.4l237.8 72.7V371.7l-237.8-77v337.7z" />
|
|
8
|
+
<path d="M295.7 743.2c-4.5-3.3-7.2-8.6-7.2-14.2V358.8c0-7.6 4.9-14.4 12.2-16.8l273.1-88.5c5.4-1.8 11.3-.8 15.8 2.5 4.6 3.4 7.3 8.7 7.3 14.3v375.1c0 7.8-5 14.6-12.5 16.9l-273.1 83.4-5.2-16.9 5.2 16.9c-1.7.5-3.4.8-5.2.8-3.6.1-7.3-1-10.4-3.3zm28.2-371.5V705l237.8-72.7V294.7l-237.8 77zM16.3 275.9c-3-9.3 2.1-19.3 11.4-22.3L300.8 165c9.2-3 19.2 2.1 22.2 11.3 3 9.3-2.1 19.3-11.3 22.2L38.6 287.2c-1.8.6-3.7.9-5.5.9-7.4-.1-14.3-4.8-16.8-12.2z" />
|
|
9
|
+
<path d="M573.9 287.2l-273-88.5c-9.3-3-14.4-13-11.4-22.2 3-9.3 13-14.4 22.2-11.3l273.1 88.5c9.3 3 14.4 13 11.4 22.3-2.4 7.4-9.4 12.2-16.8 12.2-1.9-.1-3.7-.5-5.5-1zm-131.3 42.5l-273.1-88.5c-9.3-3-14.4-13-11.4-22.2 3-9.3 12.9-14.4 22.3-11.4l273 88.5c9.3 3 14.4 13 11.4 22.3-2.4 7.4-9.3 12.2-16.8 12.2-1.7 0-3.5-.3-5.4-.9z" />
|
|
10
|
+
</g>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const ContainerIcon = (props: SvgIconProps): JSX.Element => (
|
|
14
|
+
<BaseIcon
|
|
15
|
+
{...props}
|
|
16
|
+
dataTestId="ContainerIcon"
|
|
17
|
+
Icon={icon}
|
|
18
|
+
viewBox="6 156 600 600"
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
@@ -10,5 +10,12 @@ const icon = (
|
|
|
10
10
|
);
|
|
11
11
|
|
|
12
12
|
export const DowntimeIcon = (props: SvgIconProps): JSX.Element => (
|
|
13
|
-
<BaseIcon
|
|
13
|
+
<BaseIcon
|
|
14
|
+
{...props}
|
|
15
|
+
dataTestId="DowntimeIcon"
|
|
16
|
+
Icon={icon}
|
|
17
|
+
height="24"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
width="24"
|
|
20
|
+
/>
|
|
14
21
|
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BusinessIcon from '@mui/icons-material/Business';
|
|
2
|
+
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
import BaseIcon from './BaseIcon';
|
|
5
|
+
|
|
6
|
+
export const HostGroupIcon = (props: SvgIconProps): JSX.Element => (
|
|
7
|
+
<BaseIcon Icon={BusinessIcon} dataTestId="HostGroupIcon" {...props} />
|
|
8
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import SettingsInputSvideoIcon from '@mui/icons-material/SettingsInputSvideo';
|
|
2
|
+
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
import BaseIcon from './BaseIcon';
|
|
5
|
+
|
|
6
|
+
export const MetaServiceIcon = (props: SvgIconProps): JSX.Element => (
|
|
7
|
+
<BaseIcon
|
|
8
|
+
Icon={SettingsInputSvideoIcon}
|
|
9
|
+
dataTestId="MetaServiceIcon"
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import LinearScaleIcon from '@mui/icons-material/LinearScale';
|
|
2
|
+
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
import BaseIcon from './BaseIcon';
|
|
5
|
+
|
|
6
|
+
export const ServiceGroupIcon = (props: SvgIconProps): JSX.Element => (
|
|
7
|
+
<BaseIcon Icon={LinearScaleIcon} dataTestId="ServiceGroupIcon" {...props} />
|
|
8
|
+
);
|
package/src/Icon/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
export { DowntimeIcon } from './DowntimeIcon';
|
|
2
|
+
export { AcknowledgementIcon } from './AcknowledgementIcon';
|
|
1
3
|
export { HostIcon } from './HostIcon';
|
|
2
4
|
export { ServiceIcon } from './ServiceIcon';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
+
export { BusinessActivityIcon } from './BusinessActivityIcon';
|
|
6
|
+
export { HostGroupIcon } from './HostGroupIcon';
|
|
7
|
+
export { ServiceGroupIcon } from './ServiceGroupIcon';
|
|
8
|
+
export { MetaServiceIcon } from './MetaServiceIcon';
|
|
9
|
+
export { ContainerIcon } from './ContainerIcon';
|
package/src/Listing/index.tsx
CHANGED
|
@@ -526,33 +526,32 @@ const Listing = <
|
|
|
526
526
|
className={classes.container}
|
|
527
527
|
ref={containerRef as RefObject<HTMLDivElement>}
|
|
528
528
|
>
|
|
529
|
-
{
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}
|
|
529
|
+
{isActionBarVisible && (
|
|
530
|
+
<div
|
|
531
|
+
className={classes.actionBar}
|
|
532
|
+
ref={actionBarRef as RefObject<HTMLDivElement>}
|
|
533
|
+
>
|
|
534
|
+
<ListingActionBar
|
|
535
|
+
actions={actions}
|
|
536
|
+
actionsBarMemoProps={actionsBarMemoProps}
|
|
537
|
+
columnConfiguration={columnConfiguration}
|
|
538
|
+
columns={columns}
|
|
539
|
+
currentPage={currentPage}
|
|
540
|
+
customPaginationClassName={customPaginationClassName}
|
|
541
|
+
limit={limit}
|
|
542
|
+
listingVariant={listingVariant}
|
|
543
|
+
moveTablePagination={moveTablePagination}
|
|
544
|
+
paginated={paginated}
|
|
545
|
+
totalRows={totalRows}
|
|
546
|
+
viewerModeConfiguration={viewerModeConfiguration}
|
|
547
|
+
widthToMoveTablePagination={widthToMoveTablePagination}
|
|
548
|
+
onLimitChange={changeLimit}
|
|
549
|
+
onPaginate={onPaginate}
|
|
550
|
+
onResetColumns={onResetColumns}
|
|
551
|
+
onSelectColumns={onSelectColumns}
|
|
552
|
+
/>
|
|
553
|
+
</div>
|
|
554
|
+
)}
|
|
556
555
|
|
|
557
556
|
<ParentSize
|
|
558
557
|
parentSizeStyles={{
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ForwardedRef, forwardRef } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Box, Typography, type TypographyProps } from '@mui/material';
|
|
4
4
|
|
|
5
5
|
const EllipsisTypography = forwardRef(
|
|
6
6
|
(
|
|
7
|
-
{
|
|
8
|
-
|
|
7
|
+
{
|
|
8
|
+
containerClassname,
|
|
9
|
+
...props
|
|
10
|
+
}: TypographyProps & { containerClassname?: string },
|
|
11
|
+
ref?: ForwardedRef<HTMLSpanElement>
|
|
12
|
+
) => {
|
|
9
13
|
return (
|
|
10
14
|
<Box className={containerClassname} sx={{ width: '100%' }}>
|
|
11
15
|
<Typography
|
|
@@ -24,7 +24,7 @@ export const useStyles = makeStyles()((theme) => ({
|
|
|
24
24
|
backgroundColor: theme.palette.layout.body.background
|
|
25
25
|
},
|
|
26
26
|
'&[data-has-actions="true"]': {
|
|
27
|
-
gridTemplateRows: 'min-content auto'
|
|
27
|
+
gridTemplateRows: 'min-content auto'
|
|
28
28
|
},
|
|
29
29
|
display: 'grid',
|
|
30
30
|
gridTemplateRows: 'auto',
|
|
File without changes
|