@centreon/ui 24.4.57 → 24.4.59

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 (147) hide show
  1. package/package.json +31 -38
  2. package/public/mockServiceWorker.js +1 -1
  3. package/src/Button/Icon/index.tsx +1 -1
  4. package/src/Button/Save/StartIcon.tsx +3 -3
  5. package/src/Button/Save/index.tsx +5 -9
  6. package/src/Checkbox/Checkbox.tsx +2 -2
  7. package/src/Checkbox/CheckboxGroup/index.tsx +2 -2
  8. package/src/Dashboard/Item.tsx +1 -1
  9. package/src/Dashboard/Layout.tsx +2 -2
  10. package/src/Dialog/Confirm/index.tsx +2 -10
  11. package/src/Dialog/index.tsx +2 -9
  12. package/src/FallbackPage/FallbackPage.tsx +3 -3
  13. package/src/FileDropZone/index.tsx +1 -3
  14. package/src/Form/Inputs/index.tsx +1 -3
  15. package/src/Form/Inputs/models.ts +1 -9
  16. package/src/Graph/Gauge/Gauge.tsx +1 -1
  17. package/src/Graph/HeatMap/HeatMap.stories.tsx +25 -0
  18. package/src/Graph/HeatMap/ResponsiveHeatMap.tsx +2 -8
  19. package/src/Graph/LineChart/BasicComponents/Lines/Threshold/Circle.tsx +2 -2
  20. package/src/Graph/LineChart/BasicComponents/Thresholds.tsx +2 -2
  21. package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +1 -1
  22. package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/GuidingLines.tsx +2 -2
  23. package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
  24. package/src/Graph/LineChart/Legend/Legend.styles.ts +1 -1
  25. package/src/Graph/LineChart/Legend/LegendHeader.tsx +1 -1
  26. package/src/Graph/LineChart/Legend/useInteractiveValues.ts +2 -2
  27. package/src/Graph/LineChart/Legend/useLegend.ts +3 -3
  28. package/src/Graph/LineChart/helpers/doc.ts +13 -16
  29. package/src/Graph/LineChart/helpers/index.ts +1 -1
  30. package/src/Graph/LineChart/index.stories.tsx +2 -4
  31. package/src/Graph/LineChart/index.tsx +1 -1
  32. package/src/Graph/SingleBar/Thresholds.tsx +2 -2
  33. package/src/Graph/Text/Text.stories.tsx +4 -60
  34. package/src/Graph/Text/Text.tsx +1 -1
  35. package/src/Graph/common/timeSeries/index.ts +14 -22
  36. package/src/Graph/common/utils.ts +0 -19
  37. package/src/Graph/index.ts +0 -3
  38. package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -10
  39. package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
  40. package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
  41. package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
  42. package/src/InputField/Select/Autocomplete/Multi/index.tsx +2 -4
  43. package/src/InputField/Select/Autocomplete/index.tsx +116 -129
  44. package/src/InputField/Select/IconPopover/index.tsx +2 -2
  45. package/src/InputField/Select/index.tsx +1 -12
  46. package/src/InputField/Text/index.tsx +2 -2
  47. package/src/Listing/ActionBar/index.tsx +8 -9
  48. package/src/Listing/Cell/DataCell.styles.ts +0 -3
  49. package/src/Listing/Cell/DataCell.tsx +5 -23
  50. package/src/Listing/Header/ListingHeader.tsx +1 -1
  51. package/src/Listing/Listing.cypress.spec.tsx +4 -80
  52. package/src/Listing/Listing.styles.ts +7 -4
  53. package/src/Listing/index.stories.tsx +3 -37
  54. package/src/Listing/index.test.tsx +1 -1
  55. package/src/Listing/index.tsx +3 -4
  56. package/src/Listing/models.ts +0 -1
  57. package/src/Module/index.tsx +4 -2
  58. package/src/PopoverMenu/index.tsx +5 -6
  59. package/src/RichTextEditor/RichTextEditor.tsx +1 -12
  60. package/src/SortableItems/index.tsx +7 -2
  61. package/src/ThemeProvider/index.tsx +0 -24
  62. package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.styles.ts +7 -6
  63. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -8
  64. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +2 -0
  65. package/src/TimePeriods/DateTimePickerInput.tsx +19 -56
  66. package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +9 -12
  67. package/src/TimePeriods/TimePeriods.cypress.spec.tsx +33 -9
  68. package/src/TimePeriods/helpers/index.ts +1 -1
  69. package/src/TimePeriods/index.stories.tsx +4 -12
  70. package/src/TimePeriods/index.tsx +2 -2
  71. package/src/Typography/FluidTypography/index.stories.tsx +2 -2
  72. package/src/Typography/FluidTypography/index.tsx +28 -21
  73. package/src/Typography/FluidTypography/useFluidResizeObserver.ts +56 -0
  74. package/src/api/QueryProvider.tsx +1 -1
  75. package/src/api/TestQueryProvider.tsx +1 -1
  76. package/src/api/index.ts +3 -3
  77. package/src/api/useFetchQuery/index.ts +23 -27
  78. package/src/api/useMutationQuery/index.test.ts +4 -4
  79. package/src/api/useMutationQuery/index.ts +25 -60
  80. package/src/components/Button/Icon/IconButton.tsx +2 -6
  81. package/src/components/DataTable/DataTable.stories.tsx +0 -40
  82. package/src/components/DataTable/DataTable.styles.ts +0 -3
  83. package/src/components/DataTable/DataTable.tsx +3 -3
  84. package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -7
  85. package/src/components/DataTable/Item/DataTableItem.tsx +28 -9
  86. package/src/components/DataTable/index.ts +1 -3
  87. package/src/components/Form/AccessRights/ShareInput/ContactSwitch.tsx +3 -3
  88. package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +0 -1
  89. package/src/components/Form/Dashboard/DashboardForm.tsx +12 -15
  90. package/src/components/Layout/PageLayout/PageLayout.tsx +1 -1
  91. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -1
  92. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -1
  93. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +1 -5
  94. package/src/components/Layout/PageLayout/index.ts +1 -3
  95. package/src/components/List/Item/ListItem.tsx +3 -3
  96. package/src/components/Modal/Modal.styles.ts +3 -8
  97. package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.stories.tsx +3 -3
  98. package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.tsx +1 -1
  99. package/src/components/Tooltip/ConfirmationTooltip/models.ts +1 -1
  100. package/src/index.ts +2 -2
  101. package/src/queryParameters/url/index.ts +1 -5
  102. package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
  103. package/src/screens/dashboard/DashboardsOverview.stories.tsx +281 -0
  104. package/src/utils/index.ts +1 -1
  105. package/src/utils/useDateTimePickerAdapter.ts +309 -0
  106. package/src/utils/useFullscreen/Fullscreen.cypress.spec.tsx +3 -1
  107. package/src/utils/useFullscreen/useFullscreenListener.ts +7 -10
  108. package/src/utils/useInfiniteScrollListing.ts +1 -4
  109. package/src/utils/{useLicenseExpirationWarning.test.tsx → useLicenseExpirationWarning.cypress.spec.tsx} +37 -48
  110. package/src/utils/useLicenseExpirationWarning.ts +18 -18
  111. package/src/Form/Form.cypress.spec.tsx +0 -133
  112. package/src/Form/Inputs/List/Content.tsx +0 -62
  113. package/src/Form/Inputs/List/List.styles.ts +0 -29
  114. package/src/Form/Inputs/List/List.tsx +0 -58
  115. package/src/Form/Inputs/List/useList.ts +0 -81
  116. package/src/Graph/BarStack/BarStack.cypress.spec.tsx +0 -154
  117. package/src/Graph/BarStack/BarStack.stories.tsx +0 -123
  118. package/src/Graph/BarStack/BarStack.styles.ts +0 -37
  119. package/src/Graph/BarStack/BarStack.tsx +0 -14
  120. package/src/Graph/BarStack/ResponsiveBarStack.tsx +0 -222
  121. package/src/Graph/BarStack/index.ts +0 -1
  122. package/src/Graph/BarStack/models.ts +0 -20
  123. package/src/Graph/BarStack/useResponsiveBarStack.ts +0 -137
  124. package/src/Graph/Gauge/Gauge.cypress.spec.tsx +0 -102
  125. package/src/Graph/HeatMap/HeatMap.cypress.spec.tsx +0 -145
  126. package/src/Graph/Legend/Legend.tsx +0 -21
  127. package/src/Graph/Legend/index.ts +0 -1
  128. package/src/Graph/Legend/models.ts +0 -11
  129. package/src/Graph/PieChart/PieChart.cypress.spec.tsx +0 -169
  130. package/src/Graph/PieChart/PieChart.stories.tsx +0 -194
  131. package/src/Graph/PieChart/PieChart.styles.ts +0 -39
  132. package/src/Graph/PieChart/PieChart.tsx +0 -14
  133. package/src/Graph/PieChart/ResponsivePie.tsx +0 -254
  134. package/src/Graph/PieChart/index.ts +0 -1
  135. package/src/Graph/PieChart/models.ts +0 -20
  136. package/src/Graph/PieChart/useResponsivePie.ts +0 -85
  137. package/src/Graph/SingleBar/SingleBar.cypress.spec.tsx +0 -121
  138. package/src/Graph/Text/Text.cypress.spec.tsx +0 -101
  139. package/src/Graph/common/testUtils.ts +0 -71
  140. package/src/Graph/translatedLabels.ts +0 -1
  141. package/src/Module/Module.cypress.spec.tsx +0 -129
  142. package/src/Typography/FluidTypography/FluidTypography.cypress.spec.tsx +0 -27
  143. package/src/components/DataTable/DataListing.tsx +0 -6
  144. package/src/components/DataTable/DataTable.cypress.spec.tsx +0 -193
  145. package/src/components/Layout/PageLayout/PageQuickAccess.tsx +0 -76
  146. package/src/components/Layout/PageLayout.cypress.spec.tsx +0 -66
  147. package/src/utils/usePluralizedTranslation.ts +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centreon/ui",
3
- "version": "24.4.57",
3
+ "version": "24.4.59",
4
4
  "description": "Centreon UI Components",
5
5
  "scripts": {
6
6
  "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
@@ -12,7 +12,6 @@
12
12
  "test:ci": "jest --silent --reporter=jest-junit",
13
13
  "cypress:ui": "cypress open --component --browser=chrome",
14
14
  "cypress:cli:updateSnapshot": "pnpm cypress:cli --env updateSnapshots=true",
15
- "cypress:run:coverage": "cypress run --component --browser=chrome --env codeCoverageTasksRegistered=true",
16
15
  "cypress:cli": "cypress run --component --browser=chrome",
17
16
  "tokens:transform": "TS_NODE_PROJECT=tsconfig.node.json ts-node style-dictionary.transform.ts"
18
17
  },
@@ -28,7 +27,6 @@
28
27
  "author": {
29
28
  "name": "centreon@centreon.com"
30
29
  },
31
- "baseCodeCoveragePercentage": 60,
32
30
  "license": "GPL-2.0",
33
31
  "bugs": {
34
32
  "url": "https://github.com/centreon/centreon/issues"
@@ -48,11 +46,11 @@
48
46
  "test/*"
49
47
  ],
50
48
  "devDependencies": {
51
- "@cypress/react": "^8.0.0",
52
- "@cypress/webpack-dev-server": "^3.7.3",
49
+ "@cypress/react": "^7.0.2",
50
+ "@cypress/webpack-dev-server": "^3.2.3",
53
51
  "@faker-js/faker": "^8.0.2",
54
- "@mdx-js/react": "^3.0.0",
55
- "@simonsmith/cypress-image-snapshot": "^9.0.1",
52
+ "@mdx-js/react": "^2.1.4",
53
+ "@simonsmith/cypress-image-snapshot": "^6.1.0",
56
54
  "@storybook/addon-a11y": "^7.0.9",
57
55
  "@storybook/addon-docs": "^7.0.9",
58
56
  "@storybook/addon-essentials": "^7.0.9",
@@ -66,69 +64,64 @@
66
64
  "@storybook/preview-api": "^7.0.9",
67
65
  "@storybook/react": "^7.0.9",
68
66
  "@storybook/react-vite": "^7.0.9",
69
- "@storybook/test-runner": "^0.16.0",
67
+ "@storybook/test-runner": "^0.10.0",
70
68
  "@storybook/testing-library": "^0.1.0",
71
69
  "@storybook/theming": "^7.0.9",
72
70
  "@testing-library/cypress": "^8.0.7",
73
71
  "@testing-library/jest-dom": "^5.16.5",
74
72
  "@testing-library/react": "^13.4.0",
75
73
  "@testing-library/react-hooks": "^8.0.1",
76
- "@types/jest": "^29.5.11",
77
- "@types/mocha": "^10.0.6",
78
- "@types/ramda": "^0.29.9",
79
- "@types/react": "^18.2.48",
80
- "@types/testing-library__jest-dom": "^6.0.0",
74
+ "@types/cypress": "^1.1.3",
75
+ "@types/jest": "^27.5.0",
76
+ "@types/ramda": "^0.28.12",
77
+ "@types/react": "^18.0.26",
78
+ "@types/testing-library__jest-dom": "^5.14.6",
81
79
  "@vitejs/plugin-react": "^4.0.0",
82
80
  "@vitejs/plugin-react-swc": "^3.3.0",
83
- "axios-mock-adapter": "^1.22.0",
84
- "cypress": "^13.6.2",
81
+ "axios-mock-adapter": "^1.21.4",
82
+ "cypress": "^12.8.0",
85
83
  "identity-obj-proxy": "^3.0.0",
86
84
  "jest-transform-stub": "^2.0.0",
87
85
  "mochawesome": "^7.1.3",
88
- "msw": "1.3.2",
89
- "msw-storybook-addon": "^1.10.0",
90
86
  "puppeteer": "^13.7.0",
91
87
  "react": "^18.2.0",
92
88
  "react-dom": "^18.2.0",
93
89
  "react-test-renderer": "^18.2.0",
94
90
  "remark-gfm": "^3.0.1",
91
+ "sass": "^1.62.1",
95
92
  "speed-measure-vite-plugin": "^0.1.2",
96
- "storybook": "^7.6.8",
93
+ "storybook": "^7.0.9",
97
94
  "storybook-addon-mock": "^4.0.0",
98
- "storybook-dark-mode": "^3.0.3",
95
+ "storybook-dark-mode": "^3.0.0",
99
96
  "style-dictionary": "^3.8.0",
100
- "ts-node": "^10.9.2",
97
+ "ts-node": "^10.9.1",
101
98
  "use-resize-observer": "^9.1.0",
102
99
  "vite": "^4.3.5",
103
- "vite-plugin-istanbul": "^5.0.0",
104
100
  "vite-plugin-svgr": "^3.2.0",
105
- "vite-plugin-turbosnap": "^1.0.3"
101
+ "vite-plugin-turbosnap": "^1.0.2"
106
102
  },
107
103
  "dependencies": {
108
- "@lexical/html": "^0.12.6",
109
- "@lexical/link": "^0.12.6",
110
- "@lexical/list": "^0.12.6",
111
- "@lexical/react": "^0.12.6",
112
- "@lexical/rich-text": "^0.12.6",
113
- "@lexical/selection": "^0.12.6",
114
- "@lexical/utils": "^0.12.6",
104
+ "@lexical/link": "0.11.3",
105
+ "@lexical/list": "^0.11.3",
106
+ "@lexical/react": "0.11.3",
107
+ "@lexical/rich-text": "^0.11.3",
108
+ "@lexical/selection": "0.11.3",
109
+ "@lexical/utils": "0.11.3",
115
110
  "@react-spring/web": "^9.7.3",
116
111
  "@visx/curve": "^2.1.0",
117
112
  "@visx/group": "^3.3.0",
118
- "@visx/legend": "^3.5.0",
119
113
  "@visx/pattern": "^3.0.0",
120
114
  "@visx/scale": "^3.0.0",
121
115
  "@visx/shape": "^2.12.2",
122
- "@visx/text": "^3.3.0",
123
116
  "@visx/threshold": "^2.12.2",
124
117
  "@visx/visx": "2.16.0",
125
118
  "anylogger": "^1.0.11",
126
- "d3-array": "3.2.4",
119
+ "d3-array": "3.2.0",
127
120
  "humanize-duration": "^3.27.3",
128
- "lexical": "^0.12.6",
129
- "notistack": "^3.0.1",
130
- "numeral": "^2.0.6",
131
- "ramda": "0.29.1",
121
+ "lexical": "0.11.3",
122
+ "msw": "0.49.1",
123
+ "msw-storybook-addon": "^1.10.0",
124
+ "notistack": "^2.0.8",
132
125
  "react-grid-layout": "^1.3.4",
133
126
  "react-html-parser": "^2.0.2",
134
127
  "react-resizable": "^3.0.5",
@@ -144,8 +137,8 @@
144
137
  "@mui/icons-material": "5.x",
145
138
  "@mui/material": "5.x",
146
139
  "@mui/styles": "5.x",
147
- "@tanstack/react-query": "5.x",
148
- "axios": ">= 1.6.4",
140
+ "@tanstack/react-query": "4.x",
141
+ "axios": "0.x",
149
142
  "dayjs": "1.x",
150
143
  "formik": "2.x",
151
144
  "jotai": "2.x",
@@ -2,7 +2,7 @@
2
2
  /* tslint:disable */
3
3
 
4
4
  /**
5
- * Mock Service Worker (1.3.2).
5
+ * Mock Service Worker (0.49.1).
6
6
  * @see https://github.com/mswjs/msw
7
7
  * - Please do NOT modify this file.
8
8
  * - Please do NOT serve this file on production.
@@ -21,7 +21,7 @@ type Props = {
21
21
  ariaLabel?: string;
22
22
  className?: string;
23
23
  onClick: (event) => void;
24
- title?: string | JSX.Element;
24
+ title?: string;
25
25
  tooltipClassName?: string;
26
26
  tooltipPlacement?:
27
27
  | 'bottom'
@@ -15,9 +15,9 @@ interface Props {
15
15
 
16
16
  const StartIcon = ({ startIconConfig }: Props): JSX.Element | null =>
17
17
  cond<Array<StartIconConfigProps>, JSX.Element | null>([
18
- [pipe(propEq(true, 'hasLabel'), not), always(null)],
19
- [propEq(true, 'succeeded'), always(<CheckIcon />)],
20
- [propEq(true, 'loading'), always(<SaveIcon />)],
18
+ [pipe(propEq('hasLabel', true), not), always(null)],
19
+ [propEq('succeeded', true), always(<CheckIcon />)],
20
+ [propEq('loading', true), always(<SaveIcon />)],
21
21
  [T, always(<SaveIcon />)]
22
22
  ])(startIconConfig);
23
23
 
@@ -1,13 +1,13 @@
1
1
  import { any, isEmpty, isNil, not, or, pipe } from 'ramda';
2
2
  import { makeStyles } from 'tss-react/mui';
3
3
 
4
- import { LoadingButton, LoadingButtonProps } from '@mui/lab';
5
4
  import { Theme, Tooltip } from '@mui/material';
5
+ import { LoadingButton } from '@mui/lab';
6
6
 
7
7
  import { getNormalizedId } from '../../utils';
8
8
 
9
- import Content from './Content';
10
9
  import StartIcon from './StartIcon';
10
+ import Content from './Content';
11
11
 
12
12
  const useStyles = makeStyles()((theme: Theme) => ({
13
13
  loadingButton: {
@@ -15,14 +15,13 @@ const useStyles = makeStyles()((theme: Theme) => ({
15
15
  }
16
16
  }));
17
17
 
18
- interface Props {
18
+ interface Props extends Record<string, unknown> {
19
19
  className?: string;
20
20
  labelLoading?: string;
21
21
  labelSave?: string;
22
22
  labelSucceeded?: string;
23
23
  loading?: boolean;
24
24
  size?: 'small' | 'medium' | 'large';
25
- startIcon?: boolean;
26
25
  succeeded?: boolean;
27
26
  tooltip?: string;
28
27
  tooltipLabel?: string;
@@ -46,9 +45,8 @@ const SaveButton = ({
46
45
  labelSave = '',
47
46
  size = 'small',
48
47
  className,
49
- startIcon = true,
50
48
  ...rest
51
- }: Props & LoadingButtonProps): JSX.Element => {
49
+ }: Props): JSX.Element => {
52
50
  const { classes, cx } = useStyles();
53
51
  const hasLabel = hasValue([labelLoading, labelSave, labelSucceeded]);
54
52
 
@@ -75,9 +73,7 @@ const SaveButton = ({
75
73
  loading={loading}
76
74
  loadingPosition={labelLoading ? 'start' : 'center'}
77
75
  size={size}
78
- startIcon={
79
- startIcon && <StartIcon startIconConfig={startIconConfig} />
80
- }
76
+ startIcon={<StartIcon startIconConfig={startIconConfig} />}
81
77
  variant="contained"
82
78
  {...rest}
83
79
  >
@@ -2,7 +2,7 @@ import { makeStyles } from 'tss-react/mui';
2
2
  import { T, always, cond, equals } from 'ramda';
3
3
 
4
4
  import { SvgIconComponent } from '@mui/icons-material';
5
- import Typography, { TypographyProps } from '@mui/material/Typography';
5
+ import Typography, { TypographyTypeMap } from '@mui/material/Typography';
6
6
  import { FormControlLabel, Checkbox as MuiCheckbox, Box } from '@mui/material';
7
7
 
8
8
  export type LabelPlacement = 'bottom' | 'top' | 'end' | 'start' | undefined;
@@ -56,7 +56,7 @@ interface Props {
56
56
  disabled?: boolean;
57
57
  label: string;
58
58
  labelPlacement?: LabelPlacement;
59
- labelProps?: TypographyProps;
59
+ labelProps?: TypographyTypeMap['props'];
60
60
  onChange?: (e) => void;
61
61
  }
62
62
 
@@ -2,7 +2,7 @@ import { equals, includes } from 'ramda';
2
2
  import { makeStyles } from 'tss-react/mui';
3
3
 
4
4
  import FormGroup, { FormGroupProps } from '@mui/material/FormGroup';
5
- import { TypographyProps } from '@mui/material/Typography';
5
+ import { TypographyTypeMap } from '@mui/material/Typography';
6
6
 
7
7
  import Checkbox, { LabelPlacement } from '../Checkbox';
8
8
 
@@ -13,7 +13,7 @@ interface Props {
13
13
  disabled?: boolean;
14
14
  formGroupProps?: FormGroupProps;
15
15
  labelPlacement?: LabelPlacement;
16
- labelProps?: TypographyProps;
16
+ labelProps?: TypographyTypeMap['props'];
17
17
  onChange?: (e) => void;
18
18
  options: Array<string>;
19
19
  values: Array<string>;
@@ -27,7 +27,7 @@ interface DashboardItemProps {
27
27
  style?: CSSProperties;
28
28
  }
29
29
 
30
- const Item = forwardRef<HTMLDivElement, DashboardItemProps>(
30
+ const Item = forwardRef(
31
31
  (
32
32
  {
33
33
  children,
@@ -23,7 +23,7 @@ interface DashboardLayoutProps<T> {
23
23
  layout: Array<T>;
24
24
  }
25
25
 
26
- const DashboardLayout = <T extends Layout>({
26
+ const Layout = <T extends Layout>({
27
27
  children,
28
28
  changeLayout,
29
29
  displayGrid,
@@ -76,4 +76,4 @@ const DashboardLayout = <T extends Layout>({
76
76
  });
77
77
  };
78
78
 
79
- export default DashboardLayout;
79
+ export default Layout;
@@ -1,4 +1,4 @@
1
- import { ButtonProps, DialogContentText, Typography } from '@mui/material';
1
+ import { DialogContentText, Typography } from '@mui/material';
2
2
 
3
3
  import Dialog, { Props as DialogProps } from '..';
4
4
 
@@ -6,23 +6,15 @@ type Props = DialogProps & {
6
6
  children?: JSX.Element;
7
7
  labelMessage?: string | null;
8
8
  labelSecondMessage?: string | null;
9
- restCancelButtonProps?: ButtonProps;
10
- restConfirmButtonProps?: ButtonProps;
11
9
  };
12
10
 
13
11
  const Confirm = ({
14
12
  labelMessage,
15
13
  labelSecondMessage,
16
14
  children,
17
- restCancelButtonProps,
18
- restConfirmButtonProps,
19
15
  ...rest
20
16
  }: Props): JSX.Element => (
21
- <Dialog
22
- restCancelButtonProps={restCancelButtonProps}
23
- restConfirmButtonProps={restConfirmButtonProps}
24
- {...rest}
25
- >
17
+ <Dialog {...rest}>
26
18
  <DialogContentText>
27
19
  {labelMessage && <Typography>{labelMessage}</Typography>}
28
20
  {labelSecondMessage && <Typography>{labelSecondMessage}</Typography>}
@@ -9,8 +9,7 @@ import {
9
9
  DialogContent,
10
10
  DialogActions,
11
11
  DialogProps,
12
- CircularProgress,
13
- ButtonProps
12
+ CircularProgress
14
13
  } from '@mui/material';
15
14
 
16
15
  import { DataTestAttributes } from '../@types/data-attributes';
@@ -44,13 +43,11 @@ export type Props = {
44
43
  dialogTitleClassName?: string;
45
44
  labelCancel?: string | null;
46
45
  labelConfirm?: string | null;
47
- labelTitle?: ReactNode;
46
+ labelTitle?: string | null;
48
47
  onCancel?: () => void;
49
48
  onClose?: () => void;
50
49
  onConfirm: (event, value?) => void;
51
50
  open: boolean;
52
- restCancelButtonProps?: ButtonProps;
53
- restConfirmButtonProps?: ButtonProps;
54
51
  submitting?: boolean;
55
52
  } & DialogProps &
56
53
  DataTestAttributes;
@@ -73,8 +70,6 @@ const Dialog = ({
73
70
  dialogContentClassName,
74
71
  dialogActionsClassName,
75
72
  dialogConfirmButtonClassName,
76
- restCancelButtonProps,
77
- restConfirmButtonProps,
78
73
  ...rest
79
74
  }: Props): JSX.Element => {
80
75
  const { classes, cx } = useStyles({ contentWidth });
@@ -106,7 +101,6 @@ const Dialog = ({
106
101
  data-testid="Cancel"
107
102
  disabled={cancelDisabled}
108
103
  onClick={onCancel}
109
- {...restCancelButtonProps}
110
104
  >
111
105
  {labelCancel}
112
106
  </Button>
@@ -119,7 +113,6 @@ const Dialog = ({
119
113
  disabled={confirmDisabled}
120
114
  endIcon={submitting && <CircularProgress size={15} />}
121
115
  onClick={onConfirm}
122
- {...restConfirmButtonProps}
123
116
  >
124
117
  {labelConfirm}
125
118
  </Button>
@@ -17,7 +17,7 @@ const useStyles = makeStyles()((theme) => ({
17
17
  logo: {
18
18
  alignSelf: 'flex-end',
19
19
  height: theme.spacing(11),
20
- width: '239px'
20
+ width: '22rem'
21
21
  },
22
22
  message: {
23
23
  color: theme.palette.text.primary
@@ -66,9 +66,9 @@ export const FallbackPage: FC<FallbackPageProps> = typedMemo(
66
66
 
67
67
  return (
68
68
  <div className={classes.notAuthorizedContainer}>
69
- <div className={classes.logo}>
69
+ <section className={classes.logo}>
70
70
  <CentreonLogo />
71
- </div>
71
+ </section>
72
72
  <section className={classes.messageBlock}>
73
73
  <header>
74
74
  <Typography color="primary" fontWeight="bold" variant="h3">
@@ -98,9 +98,7 @@ const getExtensions = cond([
98
98
  [T, identity]
99
99
  ]) as (accept: string) => Array<string>;
100
100
 
101
- export const transformFileListToArray = (
102
- files: FileList | null
103
- ): Array<File> =>
101
+ export const transformFileListToArray = (files: FileList | null): Array<File> =>
104
102
  isNil(files)
105
103
  ? []
106
104
  : (Array(files.length)
@@ -21,7 +21,6 @@ import CheckboxGroup from './CheckboxGroup';
21
21
  import Checkbox from './Checkbox';
22
22
  import Custom from './Custom';
23
23
  import LoadingSkeleton from './LoadingSkeleton';
24
- import List from './List/List';
25
24
 
26
25
  export const getInput = R.cond<
27
26
  Array<InputType>,
@@ -67,7 +66,6 @@ export const getInput = R.cond<
67
66
  R.equals(InputType.CheckboxGroup) as (b: InputType) => boolean,
68
67
  R.always(CheckboxGroup)
69
68
  ],
70
- [R.equals(InputType.List) as (b: InputType) => boolean, R.always(List)],
71
69
  [R.T, R.always(TextInput)]
72
70
  ]);
73
71
 
@@ -187,7 +185,7 @@ const Inputs = ({
187
185
  const hasGroupTitle = R.not(R.isNil(groupName));
188
186
 
189
187
  const groupProps = hasGroupTitle
190
- ? R.find(R.propEq(groupName, 'name'), groups)
188
+ ? R.find(R.propEq('name', groupName), groups)
191
189
  : ({} as Group);
192
190
 
193
191
  const isFirstElement = areGroupsOpen || R.equals(index, 0);
@@ -18,8 +18,7 @@ export enum InputType {
18
18
  Grid,
19
19
  Custom,
20
20
  Checkbox,
21
- CheckboxGroup,
22
- List
21
+ CheckboxGroup
23
22
  }
24
23
 
25
24
  interface FieldsTableGetRequiredProps {
@@ -77,13 +76,6 @@ export interface InputProps {
77
76
  hideInput?: (values: FormikValues) => boolean;
78
77
  inputClassName?: string;
79
78
  label: string;
80
- list?: {
81
- AddItem: React.ComponentType<{ addItem }>;
82
- SortContent: React.ComponentType<object>;
83
- addItemLabel?: string;
84
- itemProps: Array<string>;
85
- sortLabel?: string;
86
- };
87
79
  radio?: {
88
80
  options?: Array<{
89
81
  label: string | JSX.Element;
@@ -5,7 +5,7 @@ import { Metric } from '../common/timeSeries/models';
5
5
 
6
6
  import ResponsiveGauge from './ResponsiveGauge';
7
7
 
8
- export interface Props {
8
+ interface Props {
9
9
  baseColor?: string;
10
10
  data?: LineChartData;
11
11
  displayAsRaw?: boolean;
@@ -3,6 +3,8 @@ import { makeStyles } from 'tss-react/mui';
3
3
 
4
4
  import { Box, Typography } from '@mui/material';
5
5
 
6
+ import EllipsisTypography from '../../Typography/EllipsisTypography';
7
+
6
8
  import heatMapData from './HeatMapData.json';
7
9
 
8
10
  import { HeatMap } from '.';
@@ -20,6 +22,29 @@ const meta: Meta<typeof HeatMap<Data>> = {
20
22
  export default meta;
21
23
  type Story = StoryObj<typeof HeatMap<Data>>;
22
24
 
25
+ const TileContent = ({
26
+ isSmallestSize,
27
+ data
28
+ }: {
29
+ data: Data;
30
+ isSmallestSize: boolean;
31
+ }): JSX.Element | false =>
32
+ !isSmallestSize && (
33
+ <Box
34
+ sx={{
35
+ alignItems: 'center',
36
+ color: 'common.black',
37
+ display: 'flex',
38
+ flexDirection: 'column',
39
+ width: '100%'
40
+ }}
41
+ >
42
+ <EllipsisTypography textAlign="center">{data.host}</EllipsisTypography>
43
+ <EllipsisTypography textAlign="center">{data.service}</EllipsisTypography>
44
+ <EllipsisTypography textAlign="center">{data.counter}</EllipsisTypography>
45
+ </Box>
46
+ );
47
+
23
48
  const TooltipContent = ({ data }: { data: Data }): JSX.Element => {
24
49
  return (
25
50
  <Box sx={{ backgroundColor: 'common.white', color: 'common.black' }}>
@@ -40,7 +40,7 @@ const ResponsiveHeatMap = <TData,>({
40
40
  const theoricalTotalTilesWidth =
41
41
  tilesLength * tileWidth + (tilesLength - 1) * gap;
42
42
 
43
- if (lt(width, 680) && gt(maxTotalTilesWidth, width) && !tileSizeFixed) {
43
+ if (lt(width, 680) && gt(maxTotalTilesWidth, width)) {
44
44
  return smallestTileSize;
45
45
  }
46
46
 
@@ -66,19 +66,13 @@ const ResponsiveHeatMap = <TData,>({
66
66
  }}
67
67
  >
68
68
  {tiles.map(({ backgroundColor, id, data }) => (
69
- <Box
70
- className={classes.heatMapTile}
71
- data-testid={id}
72
- key={id}
73
- sx={{ backgroundColor }}
74
- >
69
+ <Box className={classes.heatMapTile} key={id} sx={{ backgroundColor }}>
75
70
  <Tooltip
76
71
  hasCaret
77
72
  classes={{
78
73
  arrow: cx(classes.heatMapTooltipArrow, arrowClassName),
79
74
  tooltip: classes.heatMapTooltip
80
75
  }}
81
- data-testid={`tooltip-${data?.id}`}
82
76
  followCursor={false}
83
77
  label={
84
78
  displayTooltipCondition?.(data) &&
@@ -1,7 +1,7 @@
1
1
  import { Shape } from '@visx/visx';
2
2
  import { isEmpty, isNil } from 'ramda';
3
3
 
4
- import { Circle as CircleModel } from './models';
4
+ import { Circle } from './models';
5
5
  import useCoordinateCircle from './useCoordinateCircle';
6
6
 
7
7
  const Circle = ({
@@ -11,7 +11,7 @@ const Circle = ({
11
11
  timeSeries,
12
12
  getX,
13
13
  getCountDisplayedCircles
14
- }: CircleModel): JSX.Element | null => {
14
+ }: Circle): JSX.Element | null => {
15
15
  const coordinates = useCoordinateCircle({
16
16
  getCountDisplayedCircles,
17
17
  getX,
@@ -2,7 +2,7 @@ import { equals, isNil } from 'ramda';
2
2
 
3
3
  import { getUnits, getYScale } from '../../common/timeSeries';
4
4
  import { Line } from '../../common/timeSeries/models';
5
- import { Thresholds as ThresholdsModel } from '../../common/models';
5
+ import { Thresholds } from '../../common/models';
6
6
 
7
7
  import { ThresholdLine } from './ThresholdLine';
8
8
 
@@ -13,7 +13,7 @@ interface Props {
13
13
  rightScale: (value: number) => number;
14
14
  showTooltip: (props) => void;
15
15
  thresholdUnit?: string;
16
- thresholds: ThresholdsModel;
16
+ thresholds: Thresholds;
17
17
  width: number;
18
18
  }
19
19
 
@@ -28,7 +28,7 @@ const useFilterLines = ({
28
28
  linesGraph,
29
29
  setLinesGraph
30
30
  }: UseFilterLines): Result => {
31
- const displayedLines = reject(propEq(false, 'display'), linesGraph ?? lines);
31
+ const displayedLines = reject(propEq('display', false), linesGraph ?? lines);
32
32
  const filterLines = (): Array<Line> => {
33
33
  const lineOriginMetric = findLineOfOriginMetricThreshold(lines);
34
34
 
@@ -2,7 +2,7 @@ import { Shape } from '@visx/visx';
2
2
 
3
3
  import { grey } from '@mui/material/colors';
4
4
 
5
- import { GuidingLines as GuidingLinesModel } from './models';
5
+ import { GuidingLines } from './models';
6
6
  import useTickGraph from './useTickGraph';
7
7
 
8
8
  const GuidingLines = ({
@@ -10,7 +10,7 @@ const GuidingLines = ({
10
10
  xScale,
11
11
  graphHeight,
12
12
  graphWidth
13
- }: GuidingLinesModel): JSX.Element | null => {
13
+ }: GuidingLines): JSX.Element | null => {
14
14
  const { positionX, positionY } = useTickGraph({
15
15
  timeSeries,
16
16
  xScale
@@ -26,7 +26,7 @@ const EventAnnotations = ({
26
26
  color,
27
27
  annotationHoveredId
28
28
  }: Props): JSX.Element => {
29
- const events = filter(propEq(type, 'type'), data);
29
+ const events = filter(propEq('type', type), data);
30
30
 
31
31
  return (
32
32
  <>
@@ -8,7 +8,7 @@ interface MakeStylesProps {
8
8
 
9
9
  export const legendWidth = 21;
10
10
  const legendItemHeight = 5.25;
11
- const legendItemHeightCompact = 2;
11
+ const legendItemHeightCompact = 1.75;
12
12
 
13
13
  export const useStyles = makeStyles<MakeStylesProps>()(
14
14
  (theme, { limitLegendRows }) => ({
@@ -38,7 +38,7 @@ const LegendHeader = ({
38
38
 
39
39
  const getEndText = (): string => {
40
40
  if (value) {
41
- return value;
41
+ return `${value}${hasUnit ? ` ${unit}` : ''}`;
42
42
  }
43
43
 
44
44
  return hasUnit ? ` ${unitName}` : '';
@@ -5,7 +5,7 @@ import { equals, find, isNil } from 'ramda';
5
5
 
6
6
  import { mousePositionAtom } from '../InteractiveComponents/interactionWithGraphAtoms';
7
7
  import {
8
- formatMetricValueWithUnit,
8
+ formatMetricValue,
9
9
  getLineForMetric,
10
10
  getMetrics,
11
11
  getTimeValue
@@ -73,7 +73,7 @@ const useInteractiveValues = ({
73
73
  metric_id
74
74
  }) as Line;
75
75
 
76
- const formattedValue = formatMetricValueWithUnit({
76
+ const formattedValue = formatMetricValue({
77
77
  base,
78
78
  unit,
79
79
  value