@centreon/ui 24.4.1-MON-23368-containers.53 → 24.4.1-MON-21278-Delete-a-basic-token.0
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 +20 -3
- package/src/Dialog/index.tsx +8 -1
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-21278-Delete-a-basic-token.0",
|
|
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,22 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ButtonProps,
|
|
3
|
+
DialogContentText,
|
|
4
|
+
Typography,
|
|
5
|
+
TypographyProps
|
|
6
|
+
} from '@mui/material';
|
|
2
7
|
|
|
3
8
|
import Dialog, { Props as DialogProps } from '..';
|
|
4
9
|
|
|
5
10
|
type Props = DialogProps & {
|
|
6
11
|
children?: JSX.Element;
|
|
7
12
|
labelMessage?: string | null;
|
|
13
|
+
labelMessageProps?: TypographyProps;
|
|
8
14
|
labelSecondMessage?: string | null;
|
|
15
|
+
restCancelButtonProps?: ButtonProps;
|
|
16
|
+
restConfirmButtonProps?: ButtonProps;
|
|
9
17
|
};
|
|
10
18
|
|
|
11
19
|
const Confirm = ({
|
|
12
20
|
labelMessage,
|
|
13
21
|
labelSecondMessage,
|
|
14
22
|
children,
|
|
23
|
+
restCancelButtonProps,
|
|
24
|
+
restConfirmButtonProps,
|
|
25
|
+
labelMessageProps,
|
|
15
26
|
...rest
|
|
16
27
|
}: Props): JSX.Element => (
|
|
17
|
-
<Dialog
|
|
28
|
+
<Dialog
|
|
29
|
+
restCancelButtonProps={restCancelButtonProps}
|
|
30
|
+
restConfirmButtonProps={restConfirmButtonProps}
|
|
31
|
+
{...rest}
|
|
32
|
+
>
|
|
18
33
|
<DialogContentText>
|
|
19
|
-
{labelMessage &&
|
|
34
|
+
{labelMessage && (
|
|
35
|
+
<Typography {...labelMessageProps}>{labelMessage}</Typography>
|
|
36
|
+
)}
|
|
20
37
|
{labelSecondMessage && <Typography>{labelSecondMessage}</Typography>}
|
|
21
38
|
{children}
|
|
22
39
|
</DialogContentText>
|
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>
|