@centreon/ui 26.5.9 → 26.5.10

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 (141) hide show
  1. package/package.json +3 -1
  2. package/src/@types/globals.d.ts +21 -0
  3. package/src/Colors/index.tsx +1 -1
  4. package/src/Dashboard/Item.tsx +3 -3
  5. package/src/Dialog/Duplicate/index.tsx +1 -1
  6. package/src/FileDropZone/useDropzone.test.ts +18 -15
  7. package/src/Form/Inputs/Checkbox.tsx +6 -3
  8. package/src/Form/Inputs/CheckboxGroup.tsx +8 -8
  9. package/src/Form/Inputs/ConnectedAutocomplete.tsx +9 -3
  10. package/src/Form/Inputs/FieldsTable/FieldsTable.tsx +1 -1
  11. package/src/Form/Inputs/File.tsx +3 -1
  12. package/src/Form/Inputs/Grid.tsx +1 -1
  13. package/src/Form/Inputs/List/List.tsx +8 -7
  14. package/src/Form/Inputs/List/useList.ts +12 -6
  15. package/src/Form/Inputs/Radio.tsx +7 -1
  16. package/src/Form/Inputs/Text.tsx +1 -1
  17. package/src/Form/Inputs/index.tsx +7 -2
  18. package/src/Form/storiesData.tsx +5 -2
  19. package/src/Graph/BarChart/Bar.tsx +2 -2
  20. package/src/Graph/BarChart/BarChart.tsx +2 -0
  21. package/src/Graph/BarChart/BarGroup.tsx +3 -0
  22. package/src/Graph/BarChart/BarStack.tsx +1 -0
  23. package/src/Graph/BarChart/MemoizedGroup.tsx +3 -1
  24. package/src/Graph/BarChart/ResponsiveBarChart.tsx +5 -0
  25. package/src/Graph/BarChart/Tooltip/BarChartTooltip.tsx +4 -0
  26. package/src/Graph/BarStack/Graph.tsx +3 -0
  27. package/src/Graph/Chart/BasicComponents/Lines/RegularLines/index.tsx +4 -1
  28. package/src/Graph/Chart/BasicComponents/Lines/StackedLines/index.tsx +7 -1
  29. package/src/Graph/Chart/BasicComponents/Lines/Threshold/BasicThreshold.tsx +1 -0
  30. package/src/Graph/Chart/BasicComponents/Lines/index.tsx +11 -1
  31. package/src/Graph/Chart/Chart.tsx +9 -0
  32. package/src/Graph/Chart/InteractiveComponents/AnchorPoint/StackedAnchorPoint.tsx +2 -0
  33. package/src/Graph/Chart/InteractiveComponents/AnchorPoint/useTickGraph.ts +2 -0
  34. package/src/Graph/Chart/InteractiveComponents/Annotations/annotationsAtoms.ts +5 -0
  35. package/src/Graph/Chart/InteractiveComponents/GraphValueTooltip/GraphValueTooltip.tsx +3 -0
  36. package/src/Graph/Chart/Legend/LegendHeader.tsx +1 -0
  37. package/src/Graph/Chart/Legend/index.tsx +6 -1
  38. package/src/Graph/Chart/useChartData.ts +6 -0
  39. package/src/Graph/Gauge/AnimatedPie.tsx +3 -0
  40. package/src/Graph/Gauge/PieData.tsx +5 -0
  41. package/src/Graph/Gauge/ResponsiveGauge.tsx +2 -0
  42. package/src/Graph/Gauge/Thresholds.tsx +1 -0
  43. package/src/Graph/HeatMap/ResponsiveHeatMap.tsx +1 -0
  44. package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +2 -0
  45. package/src/Graph/Timeline/ResponsiveTimeline.tsx +1 -0
  46. package/src/Graph/Tree/Links.tsx +1 -0
  47. package/src/Graph/Tree/Tree.tsx +1 -0
  48. package/src/Graph/Tree/stories/datas.ts +2 -0
  49. package/src/Graph/common/Axes/index.tsx +3 -3
  50. package/src/Graph/common/BaseChart/BaseChart.tsx +3 -0
  51. package/src/Graph/common/BaseChart/ChartSvgWrapper.tsx +1 -0
  52. package/src/Graph/common/BaseChart/Header/models.ts +1 -0
  53. package/src/Graph/common/timeSeries/index.test.ts +17 -1
  54. package/src/Graph/common/timeSeries/index.ts +12 -0
  55. package/src/Graph/common/utils.ts +6 -2
  56. package/src/InputField/Number/Number.tsx +10 -4
  57. package/src/InputField/Search/PersistentTooltip.tsx +6 -5
  58. package/src/InputField/Select/Autocomplete/Connected/Single.tsx +3 -1
  59. package/src/InputField/Select/Autocomplete/Connected/index.test.tsx +1 -1
  60. package/src/InputField/Select/Autocomplete/Connected/index.tsx +5 -1
  61. package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +4 -5
  62. package/src/InputField/Select/Autocomplete/Draggable/index.tsx +4 -5
  63. package/src/InputField/Select/Autocomplete/Multi/Listbox.tsx +16 -1
  64. package/src/InputField/Select/Autocomplete/Multi/Multi.tsx +44 -30
  65. package/src/InputField/Select/Autocomplete/Multi/index.tsx +1 -0
  66. package/src/InputField/Select/Autocomplete/index.tsx +7 -1
  67. package/src/InputField/Select/IconPopover/index.tsx +0 -3
  68. package/src/InputField/Select/Option.tsx +6 -1
  69. package/src/InputField/Select/index.tsx +3 -3
  70. package/src/InputField/Text/index.tsx +11 -3
  71. package/src/InputField/Text/useAutoSize.ts +2 -2
  72. package/src/Listing/ActionBar/index.tsx +2 -3
  73. package/src/Listing/Cell/index.tsx +24 -22
  74. package/src/Listing/Header/Cell/ListingHeaderCell.styles.ts +7 -0
  75. package/src/Listing/Header/ListingHeader.tsx +2 -2
  76. package/src/Listing/Header/_internals/PredefinedSelectionList.tsx +3 -3
  77. package/src/Listing/index.tsx +29 -34
  78. package/src/Listing/useStyleTable.ts +1 -1
  79. package/src/Module/index.tsx +3 -3
  80. package/src/MultiSelectEntries/index.tsx +1 -1
  81. package/src/Pagination/Pagination.tsx +1 -1
  82. package/src/ParentSize/ParentSize.tsx +2 -1
  83. package/src/PopoverMenu/index.tsx +1 -7
  84. package/src/RichTextEditor/ContentEditable.tsx +2 -0
  85. package/src/RichTextEditor/RichTextEditor.tsx +1 -0
  86. package/src/RichTextEditor/plugins/FloatingLinkEditorPlugin.tsx +1 -0
  87. package/src/RichTextEditor/plugins/ToolbarPlugin/BlockButtons.tsx +1 -0
  88. package/src/RichTextEditor/plugins/ToolbarPlugin/ListButton.tsx +2 -0
  89. package/src/Snackbar/index.tsx +3 -1
  90. package/src/SortableItems/Item.tsx +8 -7
  91. package/src/SortableItems/index.tsx +1 -1
  92. package/src/ThemeProvider/index.tsx +5 -3
  93. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -2
  94. package/src/TimePeriods/SelectedTimePeriod.tsx +1 -1
  95. package/src/TimePeriods/timePeriodsAtoms.ts +1 -1
  96. package/src/TimePeriods/useSortTimePeriods.ts +1 -1
  97. package/src/Typography/Subtitle.tsx +3 -1
  98. package/src/Typography/story.utils.tsx +3 -2
  99. package/src/Wizard/ActionsBar.tsx +2 -2
  100. package/src/api/QueryProvider.tsx +1 -2
  101. package/src/api/buildListingEndpoint/getSearchQueryParameterValue.ts +4 -2
  102. package/src/api/useGraphQuery/index.ts +4 -2
  103. package/src/api/useMutationQuery/index.ts +11 -7
  104. package/src/api/useMutationQuery/useOptimisticMutation.ts +34 -16
  105. package/src/api/useRequest/index.test.ts +1 -1
  106. package/src/api/useRequest/index.ts +1 -1
  107. package/src/components/Button/Button.tsx +2 -2
  108. package/src/components/CrudPage/Actions/Filters.tsx +1 -1
  109. package/src/components/CrudPage/Actions/useSearch.tsx +1 -1
  110. package/src/components/CrudPage/Columns/Actions.tsx +2 -2
  111. package/src/components/CrudPage/CrudPageRoot.tsx +1 -1
  112. package/src/components/CrudPage/DeleteModal.tsx +14 -6
  113. package/src/components/CrudPage/Form/AddModal.tsx +16 -4
  114. package/src/components/CrudPage/Form/UpdateModal.tsx +2 -2
  115. package/src/components/CrudPage/Listing.tsx +2 -1
  116. package/src/components/CrudPage/hooks/useDeleteItem.ts +5 -1
  117. package/src/components/CrudPage/hooks/useGetItem.ts +3 -3
  118. package/src/components/DataTable/DataListing.tsx +1 -1
  119. package/src/components/ExpandableContainer/ExpandableContainer.tsx +1 -0
  120. package/src/components/Form/AccessRights/Actions/Actions.tsx +1 -1
  121. package/src/components/Form/AccessRights/Actions/useActions.ts +1 -4
  122. package/src/components/Form/AccessRights/List/StateChip.tsx +1 -1
  123. package/src/components/Form/AccessRights/Stats/Stats.tsx +1 -1
  124. package/src/components/Form/AccessRights/common/RoleSelectField.tsx +4 -6
  125. package/src/components/Form/Dashboard/DashboardForm.tsx +2 -2
  126. package/src/components/Header/PageHeader/PageHeader.styles.ts +26 -20
  127. package/src/components/Menu/useMenu.tsx +3 -3
  128. package/src/components/Modal/ConfirmationModal/ConfirmationModal.tsx +14 -9
  129. package/src/components/Modal/Modal.tsx +5 -3
  130. package/src/components/Modal/ModalActions.tsx +1 -1
  131. package/src/components/Modal/ModalBody.tsx +2 -2
  132. package/src/components/Modal/ModalHeader.tsx +2 -2
  133. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +8 -2
  134. package/src/index.ts +1 -1
  135. package/src/utils/sanitizedHTML.ts +1 -1
  136. package/src/utils/useDebounce.ts +3 -1
  137. package/src/utils/useLicenseExpirationWarning.ts +11 -6
  138. package/src/utils/useLocaleDateTimeFormat/index.test.tsx +3 -1
  139. package/src/utils/useLocaleDateTimeFormat/localeFallback.test.tsx +3 -1
  140. package/src/utils/useMemoComponent.ts +1 -1
  141. package/src/utils/usePluralizedTranslation.test.ts +2 -0
@@ -2,7 +2,7 @@ import dayjs from "dayjs";
2
2
  import { useEffect } from "react";
3
3
  import "dayjs/locale/en";
4
4
 
5
- import { ThemeMode, userAtom } from "@centreon/ui-context";
5
+ import { ListingVariant, ThemeMode, userAtom } from "@centreon/ui-context";
6
6
  import { type RenderResult, render } from "@testing-library/react";
7
7
  import localizedFormatPlugin from "dayjs/plugin/localizedFormat";
8
8
  import timezonePlugin from "dayjs/plugin/timezone";
@@ -25,6 +25,7 @@ const TestComponent = (): JSX.Element => {
25
25
  useEffect(() => {
26
26
  setUser({
27
27
  alias: "admin",
28
+ canManageApiTokens: false,
28
29
  default_page: "/monitoring/resources",
29
30
  isExportButtonEnabled: false,
30
31
  locale: "en",
@@ -32,6 +33,7 @@ const TestComponent = (): JSX.Element => {
32
33
  themeMode: ThemeMode.light,
33
34
  timezone: "Europe/Paris",
34
35
  use_deprecated_pages: false,
36
+ user_interface_density: ListingVariant.compact,
35
37
  });
36
38
  }, [setUser]);
37
39
 
@@ -2,7 +2,7 @@ import dayjs from "dayjs";
2
2
  import { useEffect } from "react";
3
3
  import "dayjs/locale/en";
4
4
 
5
- import { ThemeMode, userAtom } from "@centreon/ui-context";
5
+ import { ListingVariant, ThemeMode, userAtom } from "@centreon/ui-context";
6
6
  import { type RenderResult, render } from "@testing-library/react";
7
7
  import localizedFormatPlugin from "dayjs/plugin/localizedFormat";
8
8
  import timezonePlugin from "dayjs/plugin/timezone";
@@ -25,6 +25,7 @@ const TestComponent = (): JSX.Element => {
25
25
  useEffect(() => {
26
26
  setUser({
27
27
  alias: "admin",
28
+ canManageApiTokens: false,
28
29
  default_page: "/monitoring/resources",
29
30
  isExportButtonEnabled: false,
30
31
  locale: "unsupported_locale",
@@ -32,6 +33,7 @@ const TestComponent = (): JSX.Element => {
32
33
  themeMode: ThemeMode.light,
33
34
  timezone: "Europe/Paris",
34
35
  use_deprecated_pages: false,
36
+ user_interface_density: ListingVariant.compact,
35
37
  });
36
38
  }, [setUser]);
37
39
 
@@ -2,7 +2,7 @@ import { equals } from 'ramda';
2
2
  import { type DependencyList, type ReactElement, useMemo, useRef } from 'react';
3
3
 
4
4
  export const useDeepCompare = (value: DependencyList): Array<number> => {
5
- const ref = useRef<React.DependencyList>();
5
+ const ref = useRef<React.DependencyList>(undefined);
6
6
  const signalRef = useRef<number>(0);
7
7
 
8
8
  if (!equals(value, ref.current)) {
@@ -7,7 +7,9 @@ import { usePluralizedTranslation } from './usePluralizedTranslation';
7
7
 
8
8
  const baseUser = {
9
9
  alias: 'admin',
10
+ canManageApiTokens: false,
10
11
  isExportButtonEnabled: false,
12
+ locale: 'en' as string | null,
11
13
  name: 'admin',
12
14
  timezone: 'Europe/Paris',
13
15
  use_deprecated_pages: false,