@centreon/ui 23.10.22-MON-18498-cancel-changes.2 → 23.10.22-MON-19279-implement-e2e-tests-from-create-a-new-dashboard.2
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 +60 -62
- package/src/Dashboard/Grid.tsx +1 -1
- package/src/Dashboard/Item.tsx +6 -9
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/DataTable/Item/DataTableItem.tsx +0 -2
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Modal/ModalActions.tsx +3 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "23.10.22-MON-
|
|
3
|
+
"version": "23.10.22-MON-19279-implement-e2e-tests-from-create-a-new-dashboard.2",
|
|
4
4
|
"description": "Centreon UI Components",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
|
|
@@ -2,69 +2,67 @@ import { makeStyles } from 'tss-react/mui';
|
|
|
2
2
|
|
|
3
3
|
import { alpha } from '@mui/material';
|
|
4
4
|
|
|
5
|
-
export const useDashboardLayoutStyles = makeStyles
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
opacity: 1
|
|
64
|
-
}
|
|
5
|
+
export const useDashboardLayoutStyles = makeStyles()((theme) => ({
|
|
6
|
+
container: {
|
|
7
|
+
'& .react-grid-item': {
|
|
8
|
+
borderRadius: theme.shape.borderRadius,
|
|
9
|
+
transition: theme.transitions.create('all', {
|
|
10
|
+
delay: 0,
|
|
11
|
+
duration: 100,
|
|
12
|
+
easing: theme.transitions.easing.easeOut
|
|
13
|
+
})
|
|
14
|
+
},
|
|
15
|
+
'& .react-grid-item.react-draggable-dragging': {
|
|
16
|
+
boxShadow: theme.shadows[3]
|
|
17
|
+
},
|
|
18
|
+
'& .react-grid-item.react-grid-placeholder': {
|
|
19
|
+
backgroundColor: alpha(theme.palette.primary.main, 0.7)
|
|
20
|
+
},
|
|
21
|
+
'& .react-grid-item.resizing': {
|
|
22
|
+
boxShadow: theme.shadows[3]
|
|
23
|
+
},
|
|
24
|
+
'& .react-resizable-handle': {
|
|
25
|
+
backgroundColor: theme.palette.action.focus,
|
|
26
|
+
backgroundImage: 'none',
|
|
27
|
+
borderRadius: theme.shape.borderRadius,
|
|
28
|
+
display: 'block',
|
|
29
|
+
opacity: 0,
|
|
30
|
+
position: 'absolute'
|
|
31
|
+
},
|
|
32
|
+
'& .react-resizable-handle.react-resizable-handle-e': {
|
|
33
|
+
cursor: 'ew-resize',
|
|
34
|
+
height: `calc(100% - ${theme.spacing(3)})`,
|
|
35
|
+
marginTop: 0,
|
|
36
|
+
right: 0,
|
|
37
|
+
top: 0,
|
|
38
|
+
transform: 'rotate(0deg)',
|
|
39
|
+
width: theme.spacing(1)
|
|
40
|
+
},
|
|
41
|
+
'& .react-resizable-handle.react-resizable-handle-s': {
|
|
42
|
+
bottom: 0,
|
|
43
|
+
cursor: 'ns-resize',
|
|
44
|
+
height: theme.spacing(1),
|
|
45
|
+
left: 0,
|
|
46
|
+
marginLeft: 0,
|
|
47
|
+
transform: 'rotate(0deg)',
|
|
48
|
+
width: `calc(100% - ${theme.spacing(3)})`
|
|
49
|
+
},
|
|
50
|
+
'& .react-resizable-handle.react-resizable-handle-se': {
|
|
51
|
+
bottom: 0,
|
|
52
|
+
cursor: 'nwse-resize',
|
|
53
|
+
height: theme.spacing(2),
|
|
54
|
+
right: 0,
|
|
55
|
+
transform: 'rotate(0deg)',
|
|
56
|
+
width: theme.spacing(2)
|
|
57
|
+
},
|
|
58
|
+
'& .react-resizable-handle::after': {
|
|
59
|
+
content: 'none'
|
|
60
|
+
},
|
|
61
|
+
'& .react-resizable-handle:hover': {
|
|
62
|
+
opacity: 1
|
|
65
63
|
}
|
|
66
|
-
}
|
|
67
|
-
);
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
68
66
|
|
|
69
67
|
export const useDashboardItemStyles = makeStyles()((theme) => ({
|
|
70
68
|
widgetContainer: {
|
package/src/Dashboard/Grid.tsx
CHANGED
package/src/Dashboard/Item.tsx
CHANGED
|
@@ -18,7 +18,7 @@ interface DashboardItemProps {
|
|
|
18
18
|
children: ReactElement;
|
|
19
19
|
className?: string;
|
|
20
20
|
header?: ReactElement;
|
|
21
|
-
|
|
21
|
+
key: string;
|
|
22
22
|
onMouseDown?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
23
23
|
onMouseUp?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
24
24
|
onTouchEnd?: (e) => void;
|
|
@@ -29,13 +29,13 @@ const Item = forwardRef(
|
|
|
29
29
|
(
|
|
30
30
|
{
|
|
31
31
|
children,
|
|
32
|
+
key,
|
|
32
33
|
style,
|
|
33
34
|
className,
|
|
34
35
|
header,
|
|
35
36
|
onMouseDown,
|
|
36
37
|
onMouseUp,
|
|
37
|
-
onTouchEnd
|
|
38
|
-
id
|
|
38
|
+
onTouchEnd
|
|
39
39
|
}: DashboardItemProps,
|
|
40
40
|
ref: ForwardedRef<HTMLDivElement>
|
|
41
41
|
): ReactElement => {
|
|
@@ -55,17 +55,14 @@ const Item = forwardRef(
|
|
|
55
55
|
Component: (
|
|
56
56
|
<div
|
|
57
57
|
className={className}
|
|
58
|
+
key={key}
|
|
58
59
|
ref={ref}
|
|
59
60
|
style={style}
|
|
60
61
|
{...cardContainerListeners}
|
|
61
62
|
>
|
|
62
63
|
<Card className={classes.widgetContainer}>
|
|
63
64
|
{header && (
|
|
64
|
-
<div
|
|
65
|
-
{...listeners}
|
|
66
|
-
className={classes.widgetHeader}
|
|
67
|
-
data-testid={`${id}_move_panel`}
|
|
68
|
-
>
|
|
65
|
+
<div {...listeners} className={classes.widgetHeader}>
|
|
69
66
|
{header}
|
|
70
67
|
</div>
|
|
71
68
|
)}
|
|
@@ -73,7 +70,7 @@ const Item = forwardRef(
|
|
|
73
70
|
</Card>
|
|
74
71
|
</div>
|
|
75
72
|
),
|
|
76
|
-
memoProps: [style, className, header]
|
|
73
|
+
memoProps: [key, style, className, header]
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
);
|
|
@@ -59,7 +59,6 @@ const DataTableItem = forwardRef(
|
|
|
59
59
|
<MuiCardActions>
|
|
60
60
|
<IconButton
|
|
61
61
|
aria-label="edit"
|
|
62
|
-
data-testid="edit"
|
|
63
62
|
icon={<EditIcon />}
|
|
64
63
|
size="small"
|
|
65
64
|
variant="primary"
|
|
@@ -67,7 +66,6 @@ const DataTableItem = forwardRef(
|
|
|
67
66
|
/>
|
|
68
67
|
<IconButton
|
|
69
68
|
aria-label="delete"
|
|
70
|
-
data-testid="dashboard-delete"
|
|
71
69
|
icon={<DeleteIcon />}
|
|
72
70
|
size="small"
|
|
73
71
|
variant="ghost"
|
|
@@ -31,17 +31,15 @@ const ModalActions = ({
|
|
|
31
31
|
{children || (
|
|
32
32
|
<>
|
|
33
33
|
<Button
|
|
34
|
-
aria-label=
|
|
35
|
-
data-testid="cancel_confirmation"
|
|
34
|
+
aria-label="cancel"
|
|
36
35
|
size="small"
|
|
37
|
-
variant="
|
|
36
|
+
variant="secondary"
|
|
38
37
|
onClick={() => onCancel?.()}
|
|
39
38
|
>
|
|
40
39
|
{labels?.cancel}
|
|
41
40
|
</Button>
|
|
42
41
|
<Button
|
|
43
|
-
aria-label=
|
|
44
|
-
data-testid="confirm_confirmation"
|
|
42
|
+
aria-label="confirm"
|
|
45
43
|
isDanger={isDanger}
|
|
46
44
|
size="small"
|
|
47
45
|
type="submit"
|