@centreon/ui 25.1.7 → 25.1.9
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
CHANGED
|
@@ -5,13 +5,13 @@ import { Modal } from '../../components/Modal';
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
labelDiscard,
|
|
8
|
-
|
|
9
|
-
labelDoYouWantToResolveErrors,
|
|
8
|
+
labelDoYouWantToQuit,
|
|
10
9
|
labelDoYouWantToSaveChanges,
|
|
11
10
|
labelIfYouClickOnDiscard,
|
|
12
|
-
|
|
11
|
+
labelLeave,
|
|
13
12
|
labelSave,
|
|
14
|
-
|
|
13
|
+
labelStay,
|
|
14
|
+
labelYourFormHasUnsavedChanges
|
|
15
15
|
} from './translatedLabels';
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
@@ -32,15 +32,17 @@ const UnsavedChangesDialog = ({
|
|
|
32
32
|
dialogOpened
|
|
33
33
|
}: Props): JSX.Element | null => {
|
|
34
34
|
const { t } = useTranslation();
|
|
35
|
+
|
|
35
36
|
const labelTitle = isValidForm
|
|
36
37
|
? labelDoYouWantToSaveChanges
|
|
37
|
-
:
|
|
38
|
+
: labelDoYouWantToQuit;
|
|
38
39
|
|
|
39
|
-
const
|
|
40
|
+
const lebelConfirm = isValidForm ? labelSave : labelLeave;
|
|
41
|
+
const labelCancel = isValidForm ? labelDiscard : labelStay;
|
|
40
42
|
|
|
41
43
|
const labelMessage = isValidForm
|
|
42
44
|
? labelIfYouClickOnDiscard
|
|
43
|
-
:
|
|
45
|
+
: labelYourFormHasUnsavedChanges;
|
|
44
46
|
|
|
45
47
|
if (not(dialogOpened)) {
|
|
46
48
|
return null;
|
|
@@ -58,11 +60,11 @@ const UnsavedChangesDialog = ({
|
|
|
58
60
|
<Modal.Actions
|
|
59
61
|
disabled={isSubmitting}
|
|
60
62
|
labels={{
|
|
61
|
-
cancel: t(
|
|
62
|
-
confirm: t(
|
|
63
|
+
cancel: t(labelCancel),
|
|
64
|
+
confirm: t(lebelConfirm)
|
|
63
65
|
}}
|
|
64
|
-
onCancel={discardChanges}
|
|
65
|
-
onConfirm={isValidForm ? saveChanges :
|
|
66
|
+
onCancel={isValidForm ? discardChanges : closeDialog}
|
|
67
|
+
onConfirm={isValidForm ? saveChanges : discardChanges}
|
|
66
68
|
/>
|
|
67
69
|
</Modal>
|
|
68
70
|
);
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
export const labelDiscard = 'Discard';
|
|
2
|
-
export const
|
|
2
|
+
export const labelSave = 'Save';
|
|
3
|
+
|
|
4
|
+
export const labelLeave = 'Leave';
|
|
5
|
+
export const labelStay = 'Stay';
|
|
6
|
+
|
|
3
7
|
export const labelIfYouClickOnDiscard =
|
|
4
8
|
'If you click on Discard, your changes will not be saved.';
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
export const labelDoYouWantToQuit = 'Do you want to leave this page?';
|
|
10
|
+
|
|
11
|
+
export const labelYourFormHasUnsavedChanges =
|
|
12
|
+
'Your changes will not be saved if you leave this page.';
|
|
8
13
|
export const labelDoYouWantToSaveChanges = 'Do you want to save the changes?';
|
|
9
|
-
export const labelDoYouWantToResolveErrors =
|
|
10
|
-
'Do you want to resolve the errors?';
|
|
11
|
-
export const labelSave = 'Save';
|
|
12
14
|
|
|
13
15
|
export default {
|
|
14
16
|
labelDiscard,
|
|
15
|
-
labelDoYouWantToQuitWithoutResolving,
|
|
16
|
-
labelDoYouWantToResolveErrors,
|
|
17
|
-
labelDoYouWantToSaveChanges,
|
|
18
|
-
labelIfYouClickOnDiscard,
|
|
19
|
-
labelResolve,
|
|
20
17
|
labelSave,
|
|
21
|
-
|
|
18
|
+
labelLeave,
|
|
19
|
+
labelStay,
|
|
20
|
+
labelIfYouClickOnDiscard,
|
|
21
|
+
labelDoYouWantToQuit,
|
|
22
|
+
labelYourFormHasUnsavedChanges,
|
|
23
|
+
labelDoYouWantToSaveChanges
|
|
22
24
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvgIconProps } from '@mui/material';
|
|
2
|
+
|
|
3
|
+
import BaseIcon from './BaseIcon';
|
|
4
|
+
|
|
5
|
+
const icon = (
|
|
6
|
+
<g>
|
|
7
|
+
<path d="M22 10.07c-2.24 0-4.01-1.04-5.72-2.04-1.61-.94-3.13-1.83-4.96-1.83s-3.18.92-4.57 1.9c-1.33 1.16-3 1.85-4.76 1.97v-.83c1.7 0 2.95-.88 4.28-1.82 1.41-1.22 3.19-2.05 5.05-2.05 1.95 0 3.8.82 5.38 1.95 1.56 1.11 3.39 1.78 5.3 1.92v.83Z" />
|
|
8
|
+
<path d="M22 14.07c-2.24 0-4.01-1.04-5.72-2.04-1.61-.94-3.13-1.83-4.96-1.83s-3.18.92-4.57 1.9c-1.33 1.16-3 1.85-4.76 1.97v-.83c1.7 0 2.95-.88 4.28-1.82 1.41-1.22 3.18-2.05 5.05-2.05 1.87 0 3.8.82 5.38 1.95 1.56 1.11 3.39 1.78 5.3 1.92v.83Z" />
|
|
9
|
+
<path d="M22 18.07c-2.24 0-4.01-1.04-5.72-2.04-1.61-.94-3.13-1.83-4.96-1.83s-3.18.92-4.57 1.9c-1.33 1.16-3 1.85-4.76 1.97v-.83c1.7 0 2.95-.88 4.28-1.82 1.41-1.22 3.18-2.07 5.05-2.05 1.87.02 3.8.82 5.38 1.95 1.56 1.11 3.39 1.78 5.3 1.92v.83Z" />
|
|
10
|
+
</g>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const FlappingIcon = (props: SvgIconProps): JSX.Element => (
|
|
14
|
+
<BaseIcon
|
|
15
|
+
{...props}
|
|
16
|
+
dataTestId="FlappingIcon"
|
|
17
|
+
Icon={icon}
|
|
18
|
+
height="24"
|
|
19
|
+
viewBox="0 0 24 24"
|
|
20
|
+
width="24"
|
|
21
|
+
/>
|
|
22
|
+
);
|
package/src/Icon/index.ts
CHANGED
|
@@ -27,6 +27,8 @@ declare module '@mui/material/styles/createPalette' {
|
|
|
27
27
|
acknowledgedBackground: string;
|
|
28
28
|
inDowntime: string;
|
|
29
29
|
inDowntimeBackground: string;
|
|
30
|
+
inFlapping: string;
|
|
31
|
+
inFlappingBackground: string;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -159,6 +161,8 @@ export const lightPalette: PaletteOptions = {
|
|
|
159
161
|
action: {
|
|
160
162
|
acknowledged: '#745F35',
|
|
161
163
|
acknowledgedBackground: '#DFD2B9',
|
|
164
|
+
inFlapping: '#064A3F',
|
|
165
|
+
inFlappingBackground: '#D8F3EF',
|
|
162
166
|
activatedOpacity: 0.12,
|
|
163
167
|
active: '#666666',
|
|
164
168
|
disabled: '#999999',
|
|
@@ -299,6 +303,8 @@ export const darkPalette: PaletteOptions = {
|
|
|
299
303
|
action: {
|
|
300
304
|
acknowledged: '#DFD2B9',
|
|
301
305
|
acknowledgedBackground: '#745F35',
|
|
306
|
+
inFlapping: '#D8F3EF',
|
|
307
|
+
inFlappingBackground: '#064A3F',
|
|
302
308
|
activatedOpacity: 0.3,
|
|
303
309
|
active: '#B5B5B5',
|
|
304
310
|
disabled: '#999999',
|