@centreon/ui 24.4.1-MON-23368-containers.76 → 24.4.1-MON-24235-Filter-App-token.13
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 +26 -24
- package/src/Dialog/Confirm/index.tsx +10 -2
- package/src/Dialog/index.tsx +8 -1
- package/src/Form/Inputs/CheckboxGroup.tsx +1 -4
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/index.tsx +5 -4
- package/src/Graph/LineChart/InteractiveComponents/Annotations/Annotation/index.tsx +2 -3
- package/src/InputField/Select/Autocomplete/Multi/index.tsx +4 -2
- package/src/InputField/Select/Autocomplete/index.tsx +2 -1
- package/src/components/List/Item/ListItem.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "24.4.1-MON-
|
|
3
|
+
"version": "24.4.1-MON-24235-Filter-App-token.13",
|
|
4
4
|
"description": "Centreon UI Components",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"test/*"
|
|
48
48
|
],
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@cypress/react": "^
|
|
51
|
-
"@cypress/webpack-dev-server": "^3.
|
|
50
|
+
"@cypress/react": "^7.0.2",
|
|
51
|
+
"@cypress/webpack-dev-server": "^3.2.3",
|
|
52
52
|
"@faker-js/faker": "^8.0.2",
|
|
53
|
-
"@mdx-js/react": "^
|
|
54
|
-
"@simonsmith/cypress-image-snapshot": "^
|
|
53
|
+
"@mdx-js/react": "^2.1.4",
|
|
54
|
+
"@simonsmith/cypress-image-snapshot": "^6.1.0",
|
|
55
55
|
"@storybook/addon-a11y": "^7.0.9",
|
|
56
56
|
"@storybook/addon-docs": "^7.0.9",
|
|
57
57
|
"@storybook/addon-essentials": "^7.0.9",
|
|
@@ -72,15 +72,16 @@
|
|
|
72
72
|
"@testing-library/jest-dom": "^5.16.5",
|
|
73
73
|
"@testing-library/react": "^13.4.0",
|
|
74
74
|
"@testing-library/react-hooks": "^8.0.1",
|
|
75
|
-
"@types/
|
|
75
|
+
"@types/cypress": "^1.1.3",
|
|
76
|
+
"@types/jest": "^27.5.0",
|
|
76
77
|
"@types/mocha": "^10.0.6",
|
|
77
|
-
"@types/ramda": "^0.29.
|
|
78
|
-
"@types/react": "^18.
|
|
79
|
-
"@types/testing-library__jest-dom": "^
|
|
78
|
+
"@types/ramda": "^0.29.6",
|
|
79
|
+
"@types/react": "^18.0.26",
|
|
80
|
+
"@types/testing-library__jest-dom": "^5.14.6",
|
|
80
81
|
"@vitejs/plugin-react": "^4.0.0",
|
|
81
82
|
"@vitejs/plugin-react-swc": "^3.3.0",
|
|
82
|
-
"axios-mock-adapter": "^1.
|
|
83
|
-
"cypress": "^13.
|
|
83
|
+
"axios-mock-adapter": "^1.21.4",
|
|
84
|
+
"cypress": "^13.3.1",
|
|
84
85
|
"identity-obj-proxy": "^3.0.0",
|
|
85
86
|
"jest-transform-stub": "^2.0.0",
|
|
86
87
|
"mochawesome": "^7.1.3",
|
|
@@ -91,26 +92,27 @@
|
|
|
91
92
|
"react-dom": "^18.2.0",
|
|
92
93
|
"react-test-renderer": "^18.2.0",
|
|
93
94
|
"remark-gfm": "^3.0.1",
|
|
95
|
+
"sass": "^1.62.1",
|
|
94
96
|
"speed-measure-vite-plugin": "^0.1.2",
|
|
95
|
-
"storybook": "^7.
|
|
97
|
+
"storybook": "^7.0.9",
|
|
96
98
|
"storybook-addon-mock": "^4.0.0",
|
|
97
|
-
"storybook-dark-mode": "^3.0.
|
|
99
|
+
"storybook-dark-mode": "^3.0.0",
|
|
98
100
|
"style-dictionary": "^3.8.0",
|
|
99
|
-
"ts-node": "^10.9.
|
|
101
|
+
"ts-node": "^10.9.1",
|
|
100
102
|
"use-resize-observer": "^9.1.0",
|
|
101
103
|
"vite": "^4.3.5",
|
|
102
104
|
"vite-plugin-istanbul": "^5.0.0",
|
|
103
105
|
"vite-plugin-svgr": "^3.2.0",
|
|
104
|
-
"vite-plugin-turbosnap": "^1.0.
|
|
106
|
+
"vite-plugin-turbosnap": "^1.0.2"
|
|
105
107
|
},
|
|
106
108
|
"dependencies": {
|
|
107
|
-
"@lexical/html": "^0.12.
|
|
108
|
-
"@lexical/link": "^0.12.
|
|
109
|
-
"@lexical/list": "^0.12.
|
|
110
|
-
"@lexical/react": "^0.12.
|
|
111
|
-
"@lexical/rich-text": "^0.12.
|
|
112
|
-
"@lexical/selection": "^0.12.
|
|
113
|
-
"@lexical/utils": "^0.12.
|
|
109
|
+
"@lexical/html": "^0.12.2",
|
|
110
|
+
"@lexical/link": "^0.12.2",
|
|
111
|
+
"@lexical/list": "^0.12.2",
|
|
112
|
+
"@lexical/react": "^0.12.2",
|
|
113
|
+
"@lexical/rich-text": "^0.12.2",
|
|
114
|
+
"@lexical/selection": "^0.12.2",
|
|
115
|
+
"@lexical/utils": "^0.12.2",
|
|
114
116
|
"@react-spring/web": "^9.7.3",
|
|
115
117
|
"@visx/curve": "^2.1.0",
|
|
116
118
|
"@visx/group": "^3.3.0",
|
|
@@ -120,9 +122,9 @@
|
|
|
120
122
|
"@visx/threshold": "^2.12.2",
|
|
121
123
|
"@visx/visx": "2.16.0",
|
|
122
124
|
"anylogger": "^1.0.11",
|
|
123
|
-
"d3-array": "3.2.
|
|
125
|
+
"d3-array": "3.2.0",
|
|
124
126
|
"humanize-duration": "^3.27.3",
|
|
125
|
-
"lexical": "^0.12.
|
|
127
|
+
"lexical": "^0.12.2",
|
|
126
128
|
"notistack": "^3.0.1",
|
|
127
129
|
"ramda": "0.29.1",
|
|
128
130
|
"react-grid-layout": "^1.3.4",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogContentText, Typography } from '@mui/material';
|
|
1
|
+
import { ButtonProps, DialogContentText, Typography } from '@mui/material';
|
|
2
2
|
|
|
3
3
|
import Dialog, { Props as DialogProps } from '..';
|
|
4
4
|
|
|
@@ -6,15 +6,23 @@ type Props = DialogProps & {
|
|
|
6
6
|
children?: JSX.Element;
|
|
7
7
|
labelMessage?: string | null;
|
|
8
8
|
labelSecondMessage?: string | null;
|
|
9
|
+
restCancelButtonProps?: ButtonProps;
|
|
10
|
+
restConfirmButtonProps?: ButtonProps;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
const Confirm = ({
|
|
12
14
|
labelMessage,
|
|
13
15
|
labelSecondMessage,
|
|
14
16
|
children,
|
|
17
|
+
restCancelButtonProps,
|
|
18
|
+
restConfirmButtonProps,
|
|
15
19
|
...rest
|
|
16
20
|
}: Props): JSX.Element => (
|
|
17
|
-
<Dialog
|
|
21
|
+
<Dialog
|
|
22
|
+
restCancelButtonProps={restCancelButtonProps}
|
|
23
|
+
restConfirmButtonProps={restConfirmButtonProps}
|
|
24
|
+
{...rest}
|
|
25
|
+
>
|
|
18
26
|
<DialogContentText>
|
|
19
27
|
{labelMessage && <Typography>{labelMessage}</Typography>}
|
|
20
28
|
{labelSecondMessage && <Typography>{labelSecondMessage}</Typography>}
|
package/src/Dialog/index.tsx
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
DialogContent,
|
|
10
10
|
DialogActions,
|
|
11
11
|
DialogProps,
|
|
12
|
-
CircularProgress
|
|
12
|
+
CircularProgress,
|
|
13
|
+
ButtonProps
|
|
13
14
|
} from '@mui/material';
|
|
14
15
|
|
|
15
16
|
import { DataTestAttributes } from '../@types/data-attributes';
|
|
@@ -48,6 +49,8 @@ export type Props = {
|
|
|
48
49
|
onClose?: () => void;
|
|
49
50
|
onConfirm: (event, value?) => void;
|
|
50
51
|
open: boolean;
|
|
52
|
+
restCancelButtonProps?: ButtonProps;
|
|
53
|
+
restConfirmButtonProps?: ButtonProps;
|
|
51
54
|
submitting?: boolean;
|
|
52
55
|
} & DialogProps &
|
|
53
56
|
DataTestAttributes;
|
|
@@ -70,6 +73,8 @@ const Dialog = ({
|
|
|
70
73
|
dialogContentClassName,
|
|
71
74
|
dialogActionsClassName,
|
|
72
75
|
dialogConfirmButtonClassName,
|
|
76
|
+
restCancelButtonProps,
|
|
77
|
+
restConfirmButtonProps,
|
|
73
78
|
...rest
|
|
74
79
|
}: Props): JSX.Element => {
|
|
75
80
|
const { classes, cx } = useStyles({ contentWidth });
|
|
@@ -101,6 +106,7 @@ const Dialog = ({
|
|
|
101
106
|
data-testid="Cancel"
|
|
102
107
|
disabled={cancelDisabled}
|
|
103
108
|
onClick={onCancel}
|
|
109
|
+
{...restCancelButtonProps}
|
|
104
110
|
>
|
|
105
111
|
{labelCancel}
|
|
106
112
|
</Button>
|
|
@@ -113,6 +119,7 @@ const Dialog = ({
|
|
|
113
119
|
disabled={confirmDisabled}
|
|
114
120
|
endIcon={submitting && <CircularProgress size={15} />}
|
|
115
121
|
onClick={onConfirm}
|
|
122
|
+
{...restConfirmButtonProps}
|
|
116
123
|
>
|
|
117
124
|
{labelConfirm}
|
|
118
125
|
</Button>
|
|
@@ -130,10 +130,11 @@ const WrapperThresholdLines = ({
|
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
132
|
<g>
|
|
133
|
-
{filteredThresholdLines.map(
|
|
134
|
-
element
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
{filteredThresholdLines.map(
|
|
134
|
+
(element) =>
|
|
135
|
+
element?.map(({ Component, props, key }) => (
|
|
136
|
+
<Component {...props} id={key} key={key} />
|
|
137
|
+
))
|
|
137
138
|
)}
|
|
138
139
|
</g>
|
|
139
140
|
);
|
|
@@ -43,9 +43,8 @@ const Annotation = ({
|
|
|
43
43
|
|
|
44
44
|
const setAnnotationHovered = useSetAtom(annotationHoveredAtom);
|
|
45
45
|
|
|
46
|
-
const content = `${truncate(event.content)} (${t(labelBy)} ${
|
|
47
|
-
|
|
48
|
-
})`;
|
|
46
|
+
const content = `${truncate(event.content)} (${t(labelBy)} ${event.contact
|
|
47
|
+
?.name})`;
|
|
49
48
|
|
|
50
49
|
return (
|
|
51
50
|
<g>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { includes, map, prop, reject } from 'ramda';
|
|
1
|
+
import { includes, map, prop, reject, sortBy, toLower, compose } from 'ramda';
|
|
2
2
|
import { makeStyles } from 'tss-react/mui';
|
|
3
3
|
|
|
4
4
|
import { Chip, ChipProps, Tooltip } from '@mui/material';
|
|
@@ -85,9 +85,11 @@ const MultiAutocompleteField = ({
|
|
|
85
85
|
return includes(id, valueIds);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
const sortByName = sortBy(compose(toLower, prop('name')));
|
|
89
|
+
|
|
88
90
|
const autocompleteOptions = disableSortedOptions
|
|
89
91
|
? options
|
|
90
|
-
: [...values, ...reject(isOptionSelected, options)];
|
|
92
|
+
: sortByName([...values, ...reject(isOptionSelected, options)]);
|
|
91
93
|
|
|
92
94
|
return (
|
|
93
95
|
<Autocomplete
|
|
@@ -216,7 +216,8 @@ const AutocompleteField = React.forwardRef(
|
|
|
216
216
|
...params.inputProps,
|
|
217
217
|
'aria-label': label,
|
|
218
218
|
'data-testid': dataTestId || label,
|
|
219
|
-
id: getNormalizedId(label || '')
|
|
219
|
+
id: getNormalizedId(label || ''),
|
|
220
|
+
...autocompleteProps?.inputProps
|
|
220
221
|
}}
|
|
221
222
|
label={label}
|
|
222
223
|
placeholder={isNil(placeholder) ? t(searchLabel) : placeholder}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ForwardedRef, forwardRef, ReactElement, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { ListItem as MuiListItem } from '@mui/material';
|
|
3
|
+
import { ListItemProps, ListItem as MuiListItem } from '@mui/material';
|
|
4
4
|
|
|
5
5
|
import { useStyles } from './ListItem.styles';
|
|
6
6
|
|
|
7
|
-
type
|
|
7
|
+
type Props = {
|
|
8
8
|
action?: ReactElement;
|
|
9
9
|
children: ReactNode | Array<ReactNode>;
|
|
10
10
|
className?: string;
|
|
@@ -12,7 +12,7 @@ type ListItemProps = {
|
|
|
12
12
|
|
|
13
13
|
export const ListItem = forwardRef(
|
|
14
14
|
(
|
|
15
|
-
{ action, children, className, ...attr }: ListItemProps,
|
|
15
|
+
{ action, children, className, ...attr }: Props & ListItemProps,
|
|
16
16
|
ref?: ForwardedRef<HTMLLIElement>
|
|
17
17
|
) => {
|
|
18
18
|
const { classes, cx } = useStyles();
|