@centreon/ui 24.4.36 → 24.4.38

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.
Files changed (156) hide show
  1. package/package.json +14 -19
  2. package/public/mockServiceWorker.js +1 -1
  3. package/src/Button/Icon/index.stories.tsx +1 -1
  4. package/src/Button/Icon/index.tsx +2 -2
  5. package/src/Button/Save/StartIcon.tsx +3 -3
  6. package/src/Button/Save/index.tsx +5 -9
  7. package/src/Checkbox/Checkbox.tsx +2 -2
  8. package/src/Checkbox/CheckboxGroup/index.tsx +2 -2
  9. package/src/Dashboard/Item.tsx +1 -1
  10. package/src/Dashboard/Layout.tsx +2 -2
  11. package/src/Dialog/index.tsx +1 -1
  12. package/src/FallbackPage/FallbackPage.tsx +3 -3
  13. package/src/FileDropZone/index.tsx +1 -3
  14. package/src/Form/Inputs/CheckboxGroup.tsx +4 -1
  15. package/src/Form/Inputs/index.tsx +1 -3
  16. package/src/Form/Inputs/models.ts +1 -9
  17. package/src/Graph/LineChart/BasicComponents/Lines/Threshold/Circle.tsx +2 -2
  18. package/src/Graph/LineChart/BasicComponents/Lines/Threshold/index.tsx +4 -5
  19. package/src/Graph/LineChart/BasicComponents/Thresholds.tsx +2 -2
  20. package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +1 -1
  21. package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/GuidingLines.tsx +2 -2
  22. package/src/Graph/LineChart/InteractiveComponents/Annotations/Annotation/index.tsx +3 -2
  23. package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
  24. package/src/Graph/LineChart/Legend/useLegend.ts +3 -3
  25. package/src/Graph/LineChart/helpers/doc.ts +13 -16
  26. package/src/Graph/LineChart/helpers/index.ts +1 -1
  27. package/src/Graph/LineChart/index.stories.tsx +2 -4
  28. package/src/Graph/SingleBar/Thresholds.tsx +2 -2
  29. package/src/Graph/Text/Text.stories.tsx +4 -60
  30. package/src/Graph/common/timeSeries/index.ts +3 -3
  31. package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -10
  32. package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
  33. package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
  34. package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
  35. package/src/InputField/Select/Autocomplete/index.tsx +115 -121
  36. package/src/InputField/Select/IconPopover/index.tsx +3 -3
  37. package/src/InputField/Select/index.tsx +1 -1
  38. package/src/InputField/Text/index.tsx +2 -2
  39. package/src/Listing/ActionBar/index.tsx +1 -2
  40. package/src/Listing/Cell/DataCell.tsx +1 -15
  41. package/src/Listing/Header/ListingHeader.tsx +1 -1
  42. package/src/Listing/Listing.styles.ts +3 -2
  43. package/src/Listing/index.stories.tsx +1 -12
  44. package/src/Listing/index.tsx +2 -1
  45. package/src/Module/index.tsx +4 -2
  46. package/src/Panel/index.tsx +1 -1
  47. package/src/RichTextEditor/RichTextEditor.tsx +1 -12
  48. package/src/SortableItems/index.tsx +7 -2
  49. package/src/ThemeProvider/index.tsx +0 -24
  50. package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.styles.ts +7 -6
  51. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -8
  52. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +2 -0
  53. package/src/TimePeriods/DateTimePickerInput.tsx +19 -56
  54. package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +9 -12
  55. package/src/TimePeriods/TimePeriods.cypress.spec.tsx +33 -9
  56. package/src/TimePeriods/helpers/index.ts +1 -1
  57. package/src/TimePeriods/index.stories.tsx +4 -12
  58. package/src/TimePeriods/index.tsx +2 -2
  59. package/src/api/QueryProvider.tsx +1 -1
  60. package/src/api/TestQueryProvider.tsx +1 -1
  61. package/src/api/useFetchQuery/index.ts +23 -27
  62. package/src/api/useMutationQuery/index.ts +21 -45
  63. package/src/components/Button/Icon/IconButton.tsx +2 -6
  64. package/src/components/DataTable/DataTable.stories.tsx +0 -40
  65. package/src/components/DataTable/DataTable.styles.ts +0 -3
  66. package/src/components/DataTable/DataTable.tsx +3 -3
  67. package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -7
  68. package/src/components/DataTable/Item/DataTableItem.tsx +4 -4
  69. package/src/components/DataTable/index.ts +1 -3
  70. package/src/components/Form/{AccessRightsV2 → AccessRights}/AccessRights.cypress.spec.tsx +23 -0
  71. package/src/components/Form/{AccessRightsV2 → AccessRights}/ShareInput/ContactSwitch.tsx +9 -1
  72. package/src/components/Form/{AccessRightsV2 → AccessRights}/ShareInput/ShareInput.styles.ts +8 -0
  73. package/src/components/Form/{AccessRightsV2 → AccessRights}/ShareInput/useShareInput.tsx +4 -0
  74. package/src/components/Form/{AccessRightsV2 → AccessRights}/models.ts +1 -0
  75. package/src/components/Form/{AccessRightsV2 → AccessRights}/storiesData.ts +1 -0
  76. package/src/components/Form/Dashboard/DashboardForm.tsx +12 -15
  77. package/src/components/Form/index.ts +2 -2
  78. package/src/components/Layout/PageLayout/PageLayout.tsx +1 -1
  79. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -1
  80. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -1
  81. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +1 -5
  82. package/src/components/Layout/PageLayout/index.ts +1 -3
  83. package/src/components/Modal/Modal.styles.ts +1 -1
  84. package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.stories.tsx +3 -3
  85. package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.tsx +1 -1
  86. package/src/components/Tooltip/ConfirmationTooltip/models.ts +1 -1
  87. package/src/index.ts +2 -2
  88. package/src/queryParameters/url/index.ts +1 -5
  89. package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
  90. package/src/screens/dashboard/DashboardsOverview.stories.tsx +281 -0
  91. package/src/utils/index.ts +1 -2
  92. package/src/utils/useDateTimePickerAdapter.ts +309 -0
  93. package/src/utils/{useLicenseExpirationWarning.test.tsx → useLicenseExpirationWarning.cypress.spec.tsx} +37 -48
  94. package/src/utils/useLicenseExpirationWarning.ts +18 -18
  95. package/src/Form/Form.cypress.spec.tsx +0 -133
  96. package/src/Form/Inputs/List/Content.tsx +0 -62
  97. package/src/Form/Inputs/List/List.styles.ts +0 -29
  98. package/src/Form/Inputs/List/List.tsx +0 -58
  99. package/src/Form/Inputs/List/useList.ts +0 -81
  100. package/src/Module/Module.cypress.spec.tsx +0 -129
  101. package/src/components/DataTable/DataListing.tsx +0 -6
  102. package/src/components/DataTable/DataTable.cypress.spec.tsx +0 -193
  103. package/src/components/Form/AccessRights/AccessRights.resource.ts +0 -45
  104. package/src/components/Form/AccessRights/AccessRightsForm.stories.tsx +0 -59
  105. package/src/components/Form/AccessRights/AccessRightsForm.styles.ts +0 -21
  106. package/src/components/Form/AccessRights/AccessRightsForm.tsx +0 -67
  107. package/src/components/Form/AccessRights/AccessRightsFormActions.tsx +0 -80
  108. package/src/components/Form/AccessRights/Input/AddAction.tsx +0 -31
  109. package/src/components/Form/AccessRights/Input/ContactAccessRightInput.stories.tsx +0 -54
  110. package/src/components/Form/AccessRights/Input/ContactAccessRightInput.tsx +0 -72
  111. package/src/components/Form/AccessRights/Input/ContactAccessRightsInput.styles.ts +0 -22
  112. package/src/components/Form/AccessRights/Input/ContactInputField.tsx +0 -105
  113. package/src/components/Form/AccessRights/Input/RoleInputField.tsx +0 -29
  114. package/src/components/Form/AccessRights/List/ContactAccessRightsList.stories.tsx +0 -97
  115. package/src/components/Form/AccessRights/List/ContactAccessRightsList.styles.ts +0 -71
  116. package/src/components/Form/AccessRights/List/ContactAccessRightsList.tsx +0 -51
  117. package/src/components/Form/AccessRights/List/ContactAccessRightsListItem.stories.tsx +0 -116
  118. package/src/components/Form/AccessRights/List/ContactAccessRightsListItem.tsx +0 -118
  119. package/src/components/Form/AccessRights/List/ContactAccessRightsListItemSkeleton.tsx +0 -26
  120. package/src/components/Form/AccessRights/List/ContactAccessRightsListSkeleton.tsx +0 -28
  121. package/src/components/Form/AccessRights/Stats/AccessRightsStats.styles.ts +0 -18
  122. package/src/components/Form/AccessRights/Stats/AccessRightsStats.tsx +0 -41
  123. package/src/components/Form/AccessRights/__fixtures__/contactAccessRight.mock.ts +0 -54
  124. package/src/components/Form/AccessRights/common/GroupLabel.styles.ts +0 -18
  125. package/src/components/Form/AccessRights/common/GroupLabel.tsx +0 -15
  126. package/src/components/Form/AccessRights/common/Input.styles.ts +0 -48
  127. package/src/components/Form/AccessRights/common/RoleInputSelect.styles.ts +0 -11
  128. package/src/components/Form/AccessRights/common/RoleInputSelect.tsx +0 -57
  129. package/src/components/Form/AccessRights/index.ts +0 -3
  130. package/src/components/Form/AccessRights/useAccessRightsForm.test.tsx +0 -531
  131. package/src/components/Form/AccessRights/useAccessRightsForm.tsx +0 -282
  132. package/src/components/Form/AccessRights/useAccessRightsForm.utils.ts +0 -41
  133. package/src/components/Layout/PageLayout/PageQuickAccess.tsx +0 -76
  134. package/src/components/Layout/PageLayout.cypress.spec.tsx +0 -66
  135. package/src/utils/usePluralizedTranslation.ts +0 -21
  136. /package/src/components/Form/{AccessRightsV2 → AccessRights}/AccessRights.stories.tsx +0 -0
  137. /package/src/components/Form/{AccessRightsV2 → AccessRights}/AccessRights.styles.ts +0 -0
  138. /package/src/components/Form/{AccessRightsV2 → AccessRights}/AccessRights.tsx +0 -0
  139. /package/src/components/Form/{AccessRightsV2 → AccessRights}/Actions/Actions.styles.ts +0 -0
  140. /package/src/components/Form/{AccessRightsV2 → AccessRights}/Actions/Actions.tsx +0 -0
  141. /package/src/components/Form/{AccessRightsV2 → AccessRights}/Actions/useActions.ts +0 -0
  142. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/Item.tsx +0 -0
  143. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/List.styles.tsx +0 -0
  144. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/List.tsx +0 -0
  145. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/ListItemSkeleton.tsx +0 -0
  146. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/ListSkeleton.tsx +0 -0
  147. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/RemoveAccessRight.tsx +0 -0
  148. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/StateChip.tsx +0 -0
  149. /package/src/components/Form/{AccessRightsV2 → AccessRights}/List/useItem.ts +0 -0
  150. /package/src/components/Form/{AccessRightsV2 → AccessRights}/Provider.tsx +0 -0
  151. /package/src/components/Form/{AccessRightsV2 → AccessRights}/ShareInput/ShareInput.tsx +0 -0
  152. /package/src/components/Form/{AccessRightsV2 → AccessRights}/Stats/Stats.tsx +0 -0
  153. /package/src/components/Form/{AccessRightsV2 → AccessRights}/atoms.ts +0 -0
  154. /package/src/components/Form/{AccessRightsV2 → AccessRights}/common/RoleSelectField.styles.tsx +0 -0
  155. /package/src/components/Form/{AccessRightsV2 → AccessRights}/common/RoleSelectField.tsx +0 -0
  156. /package/src/components/Form/{AccessRightsV2 → AccessRights}/useAccessRightsInitValues.ts +0 -0
@@ -1,54 +0,0 @@
1
- import { faker } from '@faker-js/faker';
2
-
3
- import {
4
- ContactAccessRightResource,
5
- ContactGroupResource,
6
- ContactResource,
7
- RoleResource
8
- } from '../AccessRights.resource';
9
-
10
- faker.seed(42);
11
-
12
- export const rolesMock = (): Array<RoleResource> => [
13
- { role: 'viewer' },
14
- { role: 'editor' }
15
- ];
16
-
17
- export const contactMock = (): ContactResource => ({
18
- email: faker.internet.email(),
19
- id: faker.string.uuid(),
20
- name: faker.person.fullName(),
21
- type: 'contact'
22
- });
23
-
24
- export const contactsMock = (length: number): Array<ContactResource> =>
25
- [...Array(length).keys()].map(contactMock);
26
-
27
- export const contactGroupMock = (): ContactGroupResource => ({
28
- id: faker.string.uuid(),
29
- name: faker.company.name(),
30
- type: 'contact_group'
31
- });
32
- export const contactGroupsMock = (
33
- length: number
34
- ): Array<ContactGroupResource> =>
35
- [...Array(length).keys()].map(contactGroupMock);
36
-
37
- export const contactsAndGroupsMock = (
38
- length: number
39
- ): Array<ContactResource | ContactGroupResource> =>
40
- [...Array(length).keys()].map(
41
- () =>
42
- faker.helpers.maybe(contactGroupMock, { probability: 0.2 }) ??
43
- contactMock()
44
- );
45
-
46
- export const contactAccessRightsMock = (
47
- length: number
48
- ): Array<ContactAccessRightResource> =>
49
- [...Array(length).keys()].map(() => ({
50
- contact:
51
- faker.helpers.maybe(contactGroupMock, { probability: 0.2 }) ??
52
- contactMock(),
53
- role: faker.helpers.arrayElement(rolesMock().map(({ role }) => role))
54
- }));
@@ -1,18 +0,0 @@
1
- import { makeStyles } from 'tss-react/mui';
2
-
3
- const useStyles = makeStyles()((theme) => ({
4
- groupLabel: {
5
- backgroundColor: theme.palette.chip.color.neutral,
6
- borderRadius: '0.1875rem',
7
- color: theme.palette.primary.contrastText,
8
- fontSize: '0.5625rem',
9
- fontWeight: 500,
10
- letterSpacing: '0.05rem',
11
- marginLeft: theme.spacing(1),
12
- padding: theme.spacing(0.125, 0.5),
13
- textTransform: 'uppercase',
14
- verticalAlign: 'middle'
15
- }
16
- }));
17
-
18
- export { useStyles };
@@ -1,15 +0,0 @@
1
- import { ReactElement } from 'react';
2
-
3
- import { useStyles } from './GroupLabel.styles';
4
-
5
- export type GroupLabelProps = {
6
- label: string;
7
- };
8
-
9
- const GroupLabel = ({ label }: GroupLabelProps): ReactElement => {
10
- const { classes } = useStyles();
11
-
12
- return <span className={classes.groupLabel}>{label}</span>;
13
- };
14
-
15
- export { GroupLabel };
@@ -1,48 +0,0 @@
1
- import { makeStyles } from 'tss-react/mui';
2
-
3
- const useInputStyles = makeStyles()((theme) => ({
4
- inputDropdown: {
5
- '& .MuiMenuItem-root': {
6
- '& > .MuiTouchRipple-root': {
7
- display: 'none'
8
- },
9
-
10
- '&.Mui-disabled': {
11
- opacity: 0.5
12
- },
13
- '&.Mui-selected, &.Mui-selected:hover, &.MuiAutocomplete-option[aria-selected="true"], &.MuiAutocomplete-option[aria-selected="true"].Mui-focused':
14
- {
15
- '&.Mui-disabled': {
16
- opacity: 1
17
- },
18
- backgroundColor: theme.palette.menu.item.background.active,
19
- color: theme.palette.menu.item.color.active,
20
- opacity: 1
21
- },
22
- '&:hover, &.MuiAutocomplete-option.Mui-focused:not(&[aria-selected="true"])':
23
- {
24
- backgroundColor: theme.palette.menu.item.background.hover,
25
- color: theme.palette.menu.item.color.hover
26
- },
27
- backgroundColor: theme.palette.menu.item.background.default,
28
- color: theme.palette.menu.item.color.default,
29
- fontSize: '0.875rem',
30
-
31
- minHeight: 'unset',
32
-
33
- padding: theme.spacing(0.75, 2)
34
- },
35
- '&.MuiAutocomplete-popper > .MuiPaper-root, &.MuiPopover-root > .MuiPaper-root':
36
- {
37
- '& > ul.MuiAutocomplete-listbox, & > ul.MuiList-root': {
38
- padding: theme.spacing(1, 0)
39
- },
40
- backgroundColor: theme.palette.menu.background,
41
- borderRadius: '4px',
42
-
43
- boxShadow: theme.shadows[8]
44
- }
45
- }
46
- }));
47
-
48
- export { useInputStyles };
@@ -1,11 +0,0 @@
1
- import { makeStyles } from 'tss-react/mui';
2
-
3
- const useStyles = makeStyles()(() => ({
4
- roleInputSelect: {
5
- flexShrink: 0,
6
- lineHeight: '1.5',
7
- minWidth: '6rem'
8
- }
9
- }));
10
-
11
- export { useStyles };
@@ -1,57 +0,0 @@
1
- import { ReactElement, useCallback } from 'react';
2
-
3
- import {
4
- MenuItem as MuiMenuItem,
5
- Select as MuiSelect,
6
- SelectProps as MuiSelectProps
7
- } from '@mui/material';
8
-
9
- import { useAccessRightsForm } from '../useAccessRightsForm';
10
- import { RoleResource } from '../AccessRights.resource';
11
-
12
- import { useStyles } from './RoleInputSelect.styles';
13
- import { useInputStyles } from './Input.styles';
14
-
15
- type RoleInputSelectProps = {
16
- id: string;
17
- label?: string;
18
- name: string;
19
- onChange?: (value: RoleResource['role']) => void;
20
- } & Pick<MuiSelectProps, 'value' | 'defaultValue' | 'disabled'>;
21
-
22
- const RoleInputSelect = ({
23
- label,
24
- onChange,
25
- ...props
26
- }: RoleInputSelectProps): ReactElement => {
27
- const { classes } = useStyles();
28
- const { classes: inputClasses } = useInputStyles();
29
-
30
- const {
31
- options: { roles }
32
- } = useAccessRightsForm();
33
-
34
- const onInputChange = useCallback((e) => onChange?.(e), [onChange]);
35
-
36
- return (
37
- <MuiSelect
38
- size="small"
39
- {...props}
40
- {...(label && { label })}
41
- MenuProps={{
42
- className: inputClasses.inputDropdown
43
- }}
44
- className={classes.roleInputSelect}
45
- data-testid="role-input"
46
- onChange={onInputChange}
47
- >
48
- {roles.map(({ role }) => (
49
- <MuiMenuItem key={role} value={role}>
50
- {role}
51
- </MuiMenuItem>
52
- ))}
53
- </MuiSelect>
54
- );
55
- };
56
-
57
- export { RoleInputSelect };
@@ -1,3 +0,0 @@
1
- export * from './AccessRightsForm';
2
- export * from './AccessRights.resource';
3
- export * from './useAccessRightsForm.utils';