@centreon/ui 24.4.46 → 24.4.48

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 (139) hide show
  1. package/package.json +14 -23
  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/index.tsx +1 -1
  11. package/src/FallbackPage/FallbackPage.tsx +3 -3
  12. package/src/FileDropZone/index.tsx +1 -3
  13. package/src/Form/Inputs/CheckboxGroup.tsx +4 -1
  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/Lines/Threshold/index.tsx +4 -5
  21. package/src/Graph/LineChart/BasicComponents/Thresholds.tsx +2 -2
  22. package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +1 -1
  23. package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/GuidingLines.tsx +2 -2
  24. package/src/Graph/LineChart/InteractiveComponents/Annotations/Annotation/index.tsx +3 -2
  25. package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
  26. package/src/Graph/LineChart/Legend/Legend.styles.ts +1 -1
  27. package/src/Graph/LineChart/Legend/LegendHeader.tsx +1 -1
  28. package/src/Graph/LineChart/Legend/useInteractiveValues.ts +2 -2
  29. package/src/Graph/LineChart/Legend/useLegend.ts +3 -3
  30. package/src/Graph/LineChart/helpers/doc.ts +13 -16
  31. package/src/Graph/LineChart/helpers/index.ts +1 -1
  32. package/src/Graph/LineChart/index.stories.tsx +2 -4
  33. package/src/Graph/LineChart/index.tsx +1 -1
  34. package/src/Graph/SingleBar/Thresholds.tsx +2 -2
  35. package/src/Graph/Text/Text.stories.tsx +4 -60
  36. package/src/Graph/Text/Text.tsx +1 -1
  37. package/src/Graph/common/timeSeries/index.ts +14 -22
  38. package/src/Graph/common/utils.ts +0 -19
  39. package/src/Graph/index.ts +0 -3
  40. package/src/InputField/Select/Autocomplete/Connected/index.tsx +7 -10
  41. package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
  42. package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
  43. package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
  44. package/src/InputField/Select/Autocomplete/index.tsx +115 -121
  45. package/src/InputField/Select/IconPopover/index.tsx +2 -2
  46. package/src/InputField/Select/index.tsx +1 -1
  47. package/src/InputField/Text/index.tsx +2 -2
  48. package/src/Listing/ActionBar/index.tsx +8 -9
  49. package/src/Listing/Cell/DataCell.styles.ts +0 -3
  50. package/src/Listing/Cell/DataCell.tsx +5 -23
  51. package/src/Listing/Header/ListingHeader.tsx +1 -1
  52. package/src/Listing/Listing.cypress.spec.tsx +4 -80
  53. package/src/Listing/Listing.styles.ts +7 -4
  54. package/src/Listing/index.stories.tsx +3 -37
  55. package/src/Listing/index.test.tsx +1 -1
  56. package/src/Listing/index.tsx +3 -4
  57. package/src/Listing/models.ts +0 -1
  58. package/src/Module/index.tsx +4 -2
  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/api/QueryProvider.tsx +1 -1
  72. package/src/api/TestQueryProvider.tsx +1 -1
  73. package/src/api/useFetchQuery/index.ts +23 -27
  74. package/src/api/useMutationQuery/index.test.ts +4 -4
  75. package/src/api/useMutationQuery/index.ts +25 -60
  76. package/src/components/Button/Icon/IconButton.tsx +2 -6
  77. package/src/components/DataTable/DataTable.stories.tsx +0 -40
  78. package/src/components/DataTable/DataTable.styles.ts +0 -3
  79. package/src/components/DataTable/DataTable.tsx +3 -3
  80. package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -7
  81. package/src/components/DataTable/Item/DataTableItem.tsx +4 -4
  82. package/src/components/DataTable/index.ts +1 -3
  83. package/src/components/Form/AccessRights/ShareInput/ContactSwitch.tsx +3 -3
  84. package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +0 -1
  85. package/src/components/Form/Dashboard/DashboardForm.tsx +12 -15
  86. package/src/components/Layout/PageLayout/PageLayout.tsx +1 -1
  87. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -1
  88. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -1
  89. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +1 -5
  90. package/src/components/Layout/PageLayout/index.ts +1 -3
  91. package/src/components/Modal/Modal.styles.ts +1 -1
  92. package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.stories.tsx +3 -3
  93. package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.tsx +1 -1
  94. package/src/components/Tooltip/ConfirmationTooltip/models.ts +1 -1
  95. package/src/index.ts +2 -2
  96. package/src/queryParameters/url/index.ts +1 -5
  97. package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
  98. package/src/screens/dashboard/DashboardsOverview.stories.tsx +281 -0
  99. package/src/utils/index.ts +1 -1
  100. package/src/utils/useDateTimePickerAdapter.ts +309 -0
  101. package/src/utils/useFullscreen/useFullscreenListener.ts +7 -10
  102. package/src/utils/{useLicenseExpirationWarning.test.tsx → useLicenseExpirationWarning.cypress.spec.tsx} +37 -48
  103. package/src/utils/useLicenseExpirationWarning.ts +18 -18
  104. package/src/Form/Form.cypress.spec.tsx +0 -133
  105. package/src/Form/Inputs/List/Content.tsx +0 -62
  106. package/src/Form/Inputs/List/List.styles.ts +0 -29
  107. package/src/Form/Inputs/List/List.tsx +0 -58
  108. package/src/Form/Inputs/List/useList.ts +0 -81
  109. package/src/Graph/BarStack/BarStack.cypress.spec.tsx +0 -154
  110. package/src/Graph/BarStack/BarStack.stories.tsx +0 -123
  111. package/src/Graph/BarStack/BarStack.styles.ts +0 -36
  112. package/src/Graph/BarStack/BarStack.tsx +0 -14
  113. package/src/Graph/BarStack/ResponsiveBarStack.tsx +0 -208
  114. package/src/Graph/BarStack/index.ts +0 -1
  115. package/src/Graph/BarStack/models.ts +0 -19
  116. package/src/Graph/BarStack/useResponsiveBarStack.ts +0 -139
  117. package/src/Graph/Gauge/Gauge.cypress.spec.tsx +0 -102
  118. package/src/Graph/HeatMap/HeatMap.cypress.spec.tsx +0 -145
  119. package/src/Graph/Legend/Legend.tsx +0 -21
  120. package/src/Graph/Legend/index.ts +0 -1
  121. package/src/Graph/Legend/models.ts +0 -11
  122. package/src/Graph/PieChart/PieChart.cypress.spec.tsx +0 -169
  123. package/src/Graph/PieChart/PieChart.stories.tsx +0 -194
  124. package/src/Graph/PieChart/PieChart.styles.ts +0 -39
  125. package/src/Graph/PieChart/PieChart.tsx +0 -14
  126. package/src/Graph/PieChart/ResponsivePie.tsx +0 -251
  127. package/src/Graph/PieChart/index.ts +0 -1
  128. package/src/Graph/PieChart/models.ts +0 -19
  129. package/src/Graph/PieChart/useResponsivePie.ts +0 -86
  130. package/src/Graph/SingleBar/SingleBar.cypress.spec.tsx +0 -121
  131. package/src/Graph/Text/Text.cypress.spec.tsx +0 -101
  132. package/src/Graph/common/testUtils.ts +0 -71
  133. package/src/Graph/translatedLabels.ts +0 -1
  134. package/src/Module/Module.cypress.spec.tsx +0 -129
  135. package/src/components/DataTable/DataListing.tsx +0 -6
  136. package/src/components/DataTable/DataTable.cypress.spec.tsx +0 -193
  137. package/src/components/Layout/PageLayout/PageQuickAccess.tsx +0 -76
  138. package/src/components/Layout/PageLayout.cypress.spec.tsx +0 -66
  139. package/src/utils/usePluralizedTranslation.ts +0 -21
@@ -46,7 +46,7 @@ const DataCell = ({
46
46
  labelCollapse,
47
47
  labelExpand
48
48
  }: Props): JSX.Element | null => {
49
- const { classes, cx } = useStyles();
49
+ const { classes } = useStyles();
50
50
  const { dataStyle } = useStyleTable({ listingVariant });
51
51
 
52
52
  const commonCellProps = {
@@ -64,7 +64,7 @@ const DataCell = ({
64
64
 
65
65
  const cellByColumnType = {
66
66
  [ColumnType.string]: (): JSX.Element => {
67
- const { getFormattedString, isTruncated, getColSpan, align } = column;
67
+ const { getFormattedString, isTruncated, getColSpan } = column;
68
68
 
69
69
  const colSpan = getColSpan?.(isRowSelected);
70
70
 
@@ -87,7 +87,6 @@ const DataCell = ({
87
87
  isRowHighlighted={isRowHighlighted}
88
88
  listingVariant={listingVariant}
89
89
  style={{
90
- alignItems: align,
91
90
  gridColumn
92
91
  }}
93
92
  {...commonCellProps}
@@ -100,7 +99,7 @@ const DataCell = ({
100
99
  );
101
100
  },
102
101
  [ColumnType.component]: (): JSX.Element | null => {
103
- const { getHiddenCondition, clickable, align } = column;
102
+ const { getHiddenCondition, clickable } = column;
104
103
  const Component = column.Component as (
105
104
  props: ComponentColumnProps
106
105
  ) => JSX.Element;
@@ -108,31 +107,14 @@ const DataCell = ({
108
107
  const isCellHidden = getHiddenCondition?.(isRowSelected);
109
108
 
110
109
  if (isCellHidden) {
111
- return (
112
- <Cell
113
- className={classes.cell}
114
- isRowHighlighted={isRowHighlighted}
115
- listingVariant={listingVariant}
116
- onClick={(e): void => {
117
- if (!clickable) {
118
- return;
119
- }
120
- e.preventDefault();
121
- e.stopPropagation();
122
- }}
123
- {...commonCellProps}
124
- />
125
- );
110
+ return null;
126
111
  }
127
112
 
128
113
  return (
129
114
  <Cell
130
- className={cx(classes.cell, clickable && classes.clickable)}
115
+ className={classes.cell}
131
116
  isRowHighlighted={isRowHighlighted}
132
117
  listingVariant={listingVariant}
133
- style={{
134
- alignItems: align
135
- }}
136
118
  onClick={(e): void => {
137
119
  if (!clickable) {
138
120
  return;
@@ -71,7 +71,7 @@ const ListingHeader = ({
71
71
  });
72
72
 
73
73
  const getColumnById = (id: string): Column => {
74
- return find(propEq(id, 'id'), columns) as Column;
74
+ return find(propEq('id', id), columns) as Column;
75
75
  };
76
76
 
77
77
  const Content = React.useCallback(
@@ -1,6 +1,4 @@
1
- import { Button, Typography } from '@mui/material';
2
-
3
- import { ListingVariant } from '@centreon/ui-context';
1
+ import { Button } from '@mui/material';
4
2
 
5
3
  import { ColumnType } from './models';
6
4
 
@@ -14,12 +12,6 @@ const ButtonColumn = ({ row }: Props): JSX.Element => (
14
12
  <Button size="small">Click to reveal details about {row.name}</Button>
15
13
  );
16
14
 
17
- const LargeText = (): JSX.Element => (
18
- <Typography sx={{ whiteSpace: 'normal' }}>
19
- This is a large text that fills the content
20
- </Typography>
21
- );
22
-
23
15
  const generateSubItems = (parentIndex: number): Array<unknown> => {
24
16
  return tenElements.map((__, subIndex) => ({
25
17
  active: false,
@@ -45,28 +37,6 @@ const listingWithSubItems = tenElements.map((_, index) => ({
45
37
  subItems: index % 2 === 0 ? generateSubItems(index) : undefined
46
38
  }));
47
39
 
48
- const defaultColumn = [
49
- {
50
- getFormattedString: ({ name }): string => name,
51
- id: 'name',
52
- label: 'Name',
53
- type: ColumnType.string
54
- },
55
- {
56
- getFormattedString: ({ description }): string => description,
57
- id: 'description',
58
- label: 'Description',
59
- type: ColumnType.string
60
- },
61
- {
62
- Component: LargeText,
63
- id: '#',
64
- label: 'Custom',
65
- type: ColumnType.component,
66
- width: '100px'
67
- }
68
- ];
69
-
70
40
  const columnsWithSubItems = [
71
41
  {
72
42
  getFormattedString: ({ name }): string => name,
@@ -92,27 +62,7 @@ const columnsWithSubItems = [
92
62
 
93
63
  const expandedItems = [0, 8];
94
64
 
95
- const mountListingResponsive = (listingVariant: ListingVariant): void => {
96
- cy.viewport('macbook-13');
97
-
98
- cy.mount({
99
- Component: (
100
- <div style={{ height: '100vh' }}>
101
- <Listing
102
- isResponsive
103
- columns={defaultColumn}
104
- currentPage={1}
105
- limit={10}
106
- listingVariant={listingVariant}
107
- rows={listingWithSubItems}
108
- totalRows={10}
109
- />
110
- </div>
111
- )
112
- });
113
- };
114
-
115
- const mountListingForSubItems = (): void => {
65
+ const mountListing = (): void => {
116
66
  cy.viewport('macbook-13');
117
67
 
118
68
  cy.mount({
@@ -139,9 +89,9 @@ const mountListingForSubItems = (): void => {
139
89
  };
140
90
 
141
91
  describe('Listing', () => {
142
- it('expands the row when the corresponding icon si clicked', () => {
143
- mountListingForSubItems();
92
+ beforeEach(mountListing);
144
93
 
94
+ it('expands the row when the corresponding icon si clicked', () => {
145
95
  cy.contains('E0').should('be.visible');
146
96
 
147
97
  expandedItems.forEach((index) => {
@@ -161,8 +111,6 @@ describe('Listing', () => {
161
111
  });
162
112
 
163
113
  it('collapses the row when the corresponding icon si clicked', () => {
164
- mountListingForSubItems();
165
-
166
114
  cy.contains('Sub item 100').should('be.visible');
167
115
 
168
116
  cy.findByLabelText('Collapse 0').click();
@@ -171,28 +119,4 @@ describe('Listing', () => {
171
119
 
172
120
  cy.makeSnapshot();
173
121
  });
174
-
175
- it('displays the last column on several lines in compact mode when the isResponsive prop is set', () => {
176
- mountListingResponsive(ListingVariant.compact);
177
-
178
- cy.get('.MuiTable-root').should(
179
- 'have.css',
180
- 'grid-template-rows',
181
- '30px 85px 85px 85px 85px 85px 85px 85px 85px 85px 85px'
182
- );
183
-
184
- cy.makeSnapshot();
185
- });
186
-
187
- it('displays the last column on several lines in extended mode when the isResponsive prop is set', () => {
188
- mountListingResponsive(ListingVariant.extended);
189
-
190
- cy.get('.MuiTable-root').should(
191
- 'have.css',
192
- 'grid-template-rows',
193
- '38px 85px 85px 85px 85px 85px 85px 85px 85px 85px 85px'
194
- );
195
-
196
- cy.makeSnapshot();
197
- });
198
122
  });
@@ -1,5 +1,7 @@
1
1
  import { makeStyles } from 'tss-react/mui';
2
2
 
3
+ import { ListingVariant } from '@centreon/ui-context';
4
+
3
5
  import { TableStyleAtom as TableStyle } from './models';
4
6
 
5
7
  const loadingIndicatorHeight = 3;
@@ -7,12 +9,13 @@ const loadingIndicatorHeight = 3;
7
9
  interface StylesProps {
8
10
  dataStyle: TableStyle;
9
11
  getGridTemplateColumn: string;
10
- isResponsive: string;
12
+ limit: number;
13
+ listingVariant: ListingVariant;
11
14
  rows: Array<unknown>;
12
15
  }
13
16
 
14
17
  const useListingStyles = makeStyles<StylesProps>()(
15
- (theme, { dataStyle, getGridTemplateColumn, rows, isResponsive }) => ({
18
+ (theme, { dataStyle, getGridTemplateColumn, rows, limit }) => ({
16
19
  actionBar: {
17
20
  alignItems: 'center',
18
21
  display: 'flex'
@@ -53,8 +56,8 @@ const useListingStyles = makeStyles<StylesProps>()(
53
56
  display: 'grid',
54
57
  gridTemplateColumns: getGridTemplateColumn,
55
58
  gridTemplateRows: `${theme.spacing(dataStyle.header.height / 8)} repeat(${
56
- rows?.length || 1
57
- }, ${isResponsive ? 'auto' : `${dataStyle.body.height}px`})`,
59
+ rows?.length || limit
60
+ }, ${dataStyle.body.height}px)`,
58
61
  position: 'relative'
59
62
  },
60
63
  tableBody: {
@@ -40,7 +40,7 @@ const useStyles = makeStyles()((theme) => ({
40
40
  }));
41
41
 
42
42
  const ComponentColumn = ({ row, isSelected }): JSX.Element => (
43
- <div style={{ display: 'flex', flexDirection: 'row', flexWrap: 'wrap' }}>
43
+ <>
44
44
  <span>
45
45
  {'I am '}
46
46
  <b>{`${isSelected ? 'selected' : 'not selected'}`}</b>
@@ -50,7 +50,7 @@ const ComponentColumn = ({ row, isSelected }): JSX.Element => (
50
50
  {'I am '}
51
51
  <b>{`${row.active ? 'active' : 'not active'}`}</b>
52
52
  </span>
53
- </div>
53
+ </>
54
54
  );
55
55
 
56
56
  const ButtonColumn = ({ row }): JSX.Element => (
@@ -366,16 +366,6 @@ const columnsWithSubItems = [
366
366
  }
367
367
  ];
368
368
 
369
- const TemplateSubItems = (args): JSX.Element => {
370
- const { classes } = useStyles();
371
-
372
- return (
373
- <div className={classes.listing}>
374
- <Listing {...args} />
375
- </div>
376
- );
377
- };
378
-
379
369
  export const ListingWithSubItems = {
380
370
  args: {
381
371
  checkable: true,
@@ -392,29 +382,5 @@ export const ListingWithSubItems = {
392
382
  labelExpand: 'Expand'
393
383
  },
394
384
  totalRows: 10
395
- },
396
- render: TemplateSubItems
397
- };
398
-
399
- export const ListingWithResponsive = {
400
- args: {
401
- checkable: true,
402
- columns: [
403
- ...defaultColumns,
404
- {
405
- Component: ComponentColumn,
406
- id: '##',
407
- label: 'Responsive',
408
- type: ColumnType.component,
409
- width: '140px'
410
- }
411
- ],
412
- currentPage: 1,
413
- isResponsive: true,
414
- limit: 10,
415
- loading: false,
416
- rows: listingWithSubItems,
417
- totalRows: 10
418
- },
419
- render: TemplateSubItems
385
+ }
420
386
  };
@@ -216,7 +216,7 @@ describe('Listing', () => {
216
216
  <Listing
217
217
  columnConfiguration={{
218
218
  selectedColumnIds: columns.map(prop('id')),
219
- sortable: true
219
+ sortable: false
220
220
  }}
221
221
  columns={columns}
222
222
  rows={rows}
@@ -69,7 +69,7 @@ const getVisibleColumns = ({
69
69
  }
70
70
 
71
71
  return selectedColumnIds.map((id) =>
72
- columns.find(propEq(id, 'id'))
72
+ columns.find(propEq('id', id))
73
73
  ) as Array<Column>;
74
74
  };
75
75
 
@@ -102,7 +102,6 @@ export interface Props<TRow> {
102
102
  getId?: (row: TRow) => RowId;
103
103
  headerMemoProps?: Array<unknown>;
104
104
  innerScrollDisabled?: boolean;
105
- isResponsive?: boolean;
106
105
  limit?: number;
107
106
  listingVariant?: ListingVariant;
108
107
  loading?: boolean;
@@ -148,7 +147,6 @@ const Listing = <TRow extends { id: RowId }>({
148
147
  columns,
149
148
  columnConfiguration = defaultColumnConfiguration,
150
149
  customPaginationClassName,
151
- isResponsive = false,
152
150
  onResetColumns,
153
151
  onSelectColumns,
154
152
  rows = [],
@@ -235,7 +233,8 @@ const Listing = <TRow extends { id: RowId }>({
235
233
  const { classes } = useListingStyles({
236
234
  dataStyle,
237
235
  getGridTemplateColumn,
238
- isResponsive,
236
+ limit,
237
+ listingVariant,
239
238
  rows: rowsToDisplay
240
239
  });
241
240
 
@@ -15,7 +15,6 @@ export interface ComponentColumnProps {
15
15
 
16
16
  export interface Column {
17
17
  Component?: (props: ComponentColumnProps) => JSX.Element | null;
18
- align?: 'start' | 'end' | 'center';
19
18
  clickable?: boolean;
20
19
  compact?: boolean;
21
20
  disablePadding?: boolean;
@@ -1,3 +1,5 @@
1
+ import * as React from 'react';
2
+
1
3
  import { Provider as JotaiProvider, createStore } from 'jotai';
2
4
 
3
5
  import { createGenerateClassName, StylesProvider } from '@mui/styles';
@@ -7,7 +9,7 @@ import SnackbarProvider from '../Snackbar/SnackbarProvider';
7
9
 
8
10
  export interface ModuleProps {
9
11
  children: React.ReactElement;
10
- maxSnackbars?: number;
12
+ maxSnackbars: number;
11
13
  seedName: string;
12
14
  store: ReturnType<typeof createStore>;
13
15
  }
@@ -15,7 +17,7 @@ export interface ModuleProps {
15
17
  const Module = ({
16
18
  children,
17
19
  seedName,
18
- maxSnackbars = 3,
20
+ maxSnackbars,
19
21
  store
20
22
  }: ModuleProps): JSX.Element => {
21
23
  const generateClassName = createGenerateClassName({
@@ -12,7 +12,6 @@ import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
12
12
  import { equals } from 'ramda';
13
13
  import { ListPlugin } from '@lexical/react/LexicalListPlugin';
14
14
  import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
15
- import { $generateHtmlFromNodes } from '@lexical/html';
16
15
 
17
16
  import { Typography } from '@mui/material';
18
17
 
@@ -39,7 +38,6 @@ export interface RichTextEditorProps {
39
38
  openLinkInNewTab?: boolean;
40
39
  placeholder?: string;
41
40
  resetEditorToInitialStateCondition?: () => boolean;
42
- setHtmlString?: (htmlString: string) => void;
43
41
  toolbarClassName?: string;
44
42
  toolbarPositions?: 'start' | 'end';
45
43
  }
@@ -145,7 +143,6 @@ const RichTextEditor = ({
145
143
  openLinkInNewTab = true,
146
144
  initialize,
147
145
  displayBlockButtons = true,
148
- setHtmlString,
149
146
  toolbarClassName
150
147
  }: RichTextEditorProps): JSX.Element => {
151
148
  const { classes } = useStyles({ toolbarPositions });
@@ -181,13 +178,6 @@ const RichTextEditor = ({
181
178
  }
182
179
  };
183
180
 
184
- const change = (state: EditorState, editor: LexicalEditor): void => {
185
- editor.update(() => {
186
- setHtmlString?.($generateHtmlFromNodes(editor, null));
187
- });
188
- getEditorState?.(state, editor);
189
- };
190
-
191
181
  return (
192
182
  <LexicalComposer initialConfig={initialConfig}>
193
183
  <div className={classes.container}>
@@ -220,7 +210,6 @@ const RichTextEditor = ({
220
210
  resetEditorToInitialStateCondition={
221
211
  resetEditorToInitialStateCondition
222
212
  }
223
- setHtmlString={setHtmlString}
224
213
  onBlur={onBlur}
225
214
  />
226
215
  }
@@ -229,7 +218,7 @@ const RichTextEditor = ({
229
218
  <HistoryPlugin />
230
219
  <LinkPlugin />
231
220
  <ListPlugin />
232
- <OnChangePlugin onChange={change} />
221
+ <OnChangePlugin onChange={getEditorState} />
233
222
  <AutoCompleteLinkPlugin openLinkInNewTab={openLinkInNewTab} />
234
223
  <FloatingLinkEditorPlugin
235
224
  editable={editable}
@@ -15,7 +15,11 @@ import {
15
15
  DragEndEvent,
16
16
  Over
17
17
  } from '@dnd-kit/core';
18
- import { SortableContext, SortingStrategy } from '@dnd-kit/sortable';
18
+ import {
19
+ SortableContext,
20
+ sortableKeyboardCoordinates,
21
+ SortingStrategy
22
+ } from '@dnd-kit/sortable';
19
23
  import {
20
24
  equals,
21
25
  find,
@@ -113,6 +117,7 @@ const SortableItems = <T extends { [propertyToFilterItemsOn]: string }>({
113
117
  useSensor(MouseSensor),
114
118
  useSensor(PointerSensor),
115
119
  useSensor(KeyboardSensor, {
120
+ coordinateGetter: sortableKeyboardCoordinates,
116
121
  keyboardCodes: {
117
122
  cancel: ['Escape'],
118
123
  end: ['Space', 'Enter'],
@@ -164,7 +169,7 @@ const SortableItems = <T extends { [propertyToFilterItemsOn]: string }>({
164
169
  };
165
170
 
166
171
  const getItemById = (id): T | undefined =>
167
- find(propEq(id, propertyToFilterItemsOn), items);
172
+ find(propEq(propertyToFilterItemsOn, id), items);
168
173
 
169
174
  const activeItem = getItemById(activeId) as Record<string, unknown>;
170
175
 
@@ -147,30 +147,6 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
147
147
  },
148
148
  MuiCssBaseline: {
149
149
  styleOverrides: (theme) => `
150
- ::-webkit-scrollbar {
151
- height: ${theme.spacing(1)};
152
- width: ${theme.spacing(1)};
153
- background-color: transparent;
154
- }
155
- ::-webkit-scrollbar-thumb {
156
- background-color: ${
157
- equals(mode, 'dark')
158
- ? theme.palette.divider
159
- : theme.palette.text.disabled
160
- };
161
- border-radius: ${theme.spacing(0.5)};
162
- }
163
- ::-webkit-scrollbar-thumb:hover {
164
- background-color: ${theme.palette.primary.main};
165
- }
166
- * {
167
- scrollbar-color: ${
168
- equals(mode, 'dark')
169
- ? theme.palette.divider
170
- : theme.palette.text.disabled
171
- } ${theme.palette.background.default};
172
- scrollbar-width: thin;
173
- }
174
150
  html {
175
151
  margin: 0;
176
152
  padding: 0;
@@ -12,21 +12,22 @@ const useStyles = makeStyles()((theme) => ({
12
12
  },
13
13
  containerDates: {
14
14
  display: 'flex',
15
+ gap: theme.spacing(0.5),
15
16
  [theme.breakpoints.down('sm')]: {
16
- flexDirection: 'column',
17
- gap: theme.spacing(0.5)
17
+ columnGap: theme.spacing(0.5),
18
+ flexDirection: 'column'
18
19
  }
19
20
  },
20
21
  date: {
21
- minWidth: theme.spacing(12),
22
+ minWidth: theme.spacing(12.5),
22
23
  textAlign: 'start'
23
24
  },
24
25
  error: {
25
26
  textAlign: 'center'
26
27
  },
27
28
  label: {
28
- minWidth: theme.spacing(3.5),
29
- textAlign: 'end'
29
+ minWidth: theme.spacing(3),
30
+ textAlign: 'start'
30
31
  },
31
32
 
32
33
  picker: {
@@ -38,7 +39,7 @@ const useStyles = makeStyles()((theme) => ({
38
39
  },
39
40
  timeContainer: {
40
41
  alignItems: 'center',
41
- columnGap: theme.spacing(0.5),
42
+ columnGap: theme.spacing(1),
42
43
  display: 'flex',
43
44
  flexDirection: 'row',
44
45
  [theme.breakpoints.down('sm')]: {
@@ -2,15 +2,12 @@ import { useAtomValue } from 'jotai';
2
2
  import { makeStyles } from 'tss-react/mui';
3
3
  import { equals } from 'ramda';
4
4
  import { useTranslation } from 'react-i18next';
5
- import dayjs from 'dayjs';
6
- import utc from 'dayjs/plugin/utc';
7
- import timezone from 'dayjs/plugin/timezone';
8
5
 
9
- import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
10
6
  import { Typography } from '@mui/material';
11
7
  import { LocalizationProvider } from '@mui/x-date-pickers';
12
8
 
13
9
  import { userAtom } from '@centreon/ui-context';
10
+ import { useDateTimePickerAdapter } from '@centreon/ui';
14
11
 
15
12
  import DateTimePickerInput from '../../DateTimePickerInput';
16
13
  import {
@@ -23,9 +20,6 @@ import ErrorText from './ErrorText';
23
20
  import { PickersData, PickersStartEndDateDirection } from './models';
24
21
  import { PickersStartEndDateModel } from './usePickersStartEndDate';
25
22
 
26
- dayjs.extend(utc);
27
- dayjs.extend(timezone);
28
-
29
23
  const useStyles = makeStyles()((theme) => ({
30
24
  error: {
31
25
  textAlign: 'center'
@@ -110,6 +104,7 @@ const PickersStartEndDate = ({
110
104
  direction = PickersStartEndDateDirection.column
111
105
  }: Props): JSX.Element => {
112
106
  const { classes, cx } = useStyles();
107
+ const { Adapter } = useDateTimePickerAdapter();
113
108
 
114
109
  const { locale } = useAtomValue(userAtom);
115
110
  const error = useAtomValue(errorTimePeriodAtom);
@@ -131,7 +126,7 @@ const PickersStartEndDate = ({
131
126
  return (
132
127
  <LocalizationProvider
133
128
  adapterLocale={locale.substring(0, 2)}
134
- dateAdapter={AdapterDayjs}
129
+ dateAdapter={Adapter}
135
130
  >
136
131
  <div className={styleContainer}>
137
132
  <PickerDateWithLabel
@@ -18,6 +18,8 @@ export interface PickersData {
18
18
  getError?: (value: boolean) => void;
19
19
  isDisabledEndPicker?: boolean;
20
20
  isDisabledStartPicker?: boolean;
21
+ onCloseEndPicker?: (isClosed: boolean) => void;
22
+ onCloseStartPicker?: (isClosed: boolean) => void;
21
23
  rangeEndDate?: RangeDate;
22
24
  rangeStartDate?: RangeDate;
23
25
  }