@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.
- package/package.json +3 -1
- package/src/@types/globals.d.ts +21 -0
- package/src/Colors/index.tsx +1 -1
- package/src/Dashboard/Item.tsx +3 -3
- package/src/Dialog/Duplicate/index.tsx +1 -1
- package/src/FileDropZone/useDropzone.test.ts +18 -15
- package/src/Form/Inputs/Checkbox.tsx +6 -3
- package/src/Form/Inputs/CheckboxGroup.tsx +8 -8
- package/src/Form/Inputs/ConnectedAutocomplete.tsx +9 -3
- package/src/Form/Inputs/FieldsTable/FieldsTable.tsx +1 -1
- package/src/Form/Inputs/File.tsx +3 -1
- package/src/Form/Inputs/Grid.tsx +1 -1
- package/src/Form/Inputs/List/List.tsx +8 -7
- package/src/Form/Inputs/List/useList.ts +12 -6
- package/src/Form/Inputs/Radio.tsx +7 -1
- package/src/Form/Inputs/Text.tsx +1 -1
- package/src/Form/Inputs/index.tsx +7 -2
- package/src/Form/storiesData.tsx +5 -2
- package/src/Graph/BarChart/Bar.tsx +2 -2
- package/src/Graph/BarChart/BarChart.tsx +2 -0
- package/src/Graph/BarChart/BarGroup.tsx +3 -0
- package/src/Graph/BarChart/BarStack.tsx +1 -0
- package/src/Graph/BarChart/MemoizedGroup.tsx +3 -1
- package/src/Graph/BarChart/ResponsiveBarChart.tsx +5 -0
- package/src/Graph/BarChart/Tooltip/BarChartTooltip.tsx +4 -0
- package/src/Graph/BarStack/Graph.tsx +3 -0
- package/src/Graph/Chart/BasicComponents/Lines/RegularLines/index.tsx +4 -1
- package/src/Graph/Chart/BasicComponents/Lines/StackedLines/index.tsx +7 -1
- package/src/Graph/Chart/BasicComponents/Lines/Threshold/BasicThreshold.tsx +1 -0
- package/src/Graph/Chart/BasicComponents/Lines/index.tsx +11 -1
- package/src/Graph/Chart/Chart.tsx +9 -0
- package/src/Graph/Chart/InteractiveComponents/AnchorPoint/StackedAnchorPoint.tsx +2 -0
- package/src/Graph/Chart/InteractiveComponents/AnchorPoint/useTickGraph.ts +2 -0
- package/src/Graph/Chart/InteractiveComponents/Annotations/annotationsAtoms.ts +5 -0
- package/src/Graph/Chart/InteractiveComponents/GraphValueTooltip/GraphValueTooltip.tsx +3 -0
- package/src/Graph/Chart/Legend/LegendHeader.tsx +1 -0
- package/src/Graph/Chart/Legend/index.tsx +6 -1
- package/src/Graph/Chart/useChartData.ts +6 -0
- package/src/Graph/Gauge/AnimatedPie.tsx +3 -0
- package/src/Graph/Gauge/PieData.tsx +5 -0
- package/src/Graph/Gauge/ResponsiveGauge.tsx +2 -0
- package/src/Graph/Gauge/Thresholds.tsx +1 -0
- package/src/Graph/HeatMap/ResponsiveHeatMap.tsx +1 -0
- package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +2 -0
- package/src/Graph/Timeline/ResponsiveTimeline.tsx +1 -0
- package/src/Graph/Tree/Links.tsx +1 -0
- package/src/Graph/Tree/Tree.tsx +1 -0
- package/src/Graph/Tree/stories/datas.ts +2 -0
- package/src/Graph/common/Axes/index.tsx +3 -3
- package/src/Graph/common/BaseChart/BaseChart.tsx +3 -0
- package/src/Graph/common/BaseChart/ChartSvgWrapper.tsx +1 -0
- package/src/Graph/common/BaseChart/Header/models.ts +1 -0
- package/src/Graph/common/timeSeries/index.test.ts +17 -1
- package/src/Graph/common/timeSeries/index.ts +12 -0
- package/src/Graph/common/utils.ts +6 -2
- package/src/InputField/Number/Number.tsx +10 -4
- package/src/InputField/Search/PersistentTooltip.tsx +6 -5
- package/src/InputField/Select/Autocomplete/Connected/Single.tsx +3 -1
- package/src/InputField/Select/Autocomplete/Connected/index.test.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +5 -1
- package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +4 -5
- package/src/InputField/Select/Autocomplete/Draggable/index.tsx +4 -5
- package/src/InputField/Select/Autocomplete/Multi/Listbox.tsx +16 -1
- package/src/InputField/Select/Autocomplete/Multi/Multi.tsx +44 -30
- package/src/InputField/Select/Autocomplete/Multi/index.tsx +1 -0
- package/src/InputField/Select/Autocomplete/index.tsx +7 -1
- package/src/InputField/Select/IconPopover/index.tsx +0 -3
- package/src/InputField/Select/Option.tsx +6 -1
- package/src/InputField/Select/index.tsx +3 -3
- package/src/InputField/Text/index.tsx +11 -3
- package/src/InputField/Text/useAutoSize.ts +2 -2
- package/src/Listing/ActionBar/index.tsx +2 -3
- package/src/Listing/Cell/index.tsx +24 -22
- package/src/Listing/Header/Cell/ListingHeaderCell.styles.ts +7 -0
- package/src/Listing/Header/ListingHeader.tsx +2 -2
- package/src/Listing/Header/_internals/PredefinedSelectionList.tsx +3 -3
- package/src/Listing/index.tsx +29 -34
- package/src/Listing/useStyleTable.ts +1 -1
- package/src/Module/index.tsx +3 -3
- package/src/MultiSelectEntries/index.tsx +1 -1
- package/src/Pagination/Pagination.tsx +1 -1
- package/src/ParentSize/ParentSize.tsx +2 -1
- package/src/PopoverMenu/index.tsx +1 -7
- package/src/RichTextEditor/ContentEditable.tsx +2 -0
- package/src/RichTextEditor/RichTextEditor.tsx +1 -0
- package/src/RichTextEditor/plugins/FloatingLinkEditorPlugin.tsx +1 -0
- package/src/RichTextEditor/plugins/ToolbarPlugin/BlockButtons.tsx +1 -0
- package/src/RichTextEditor/plugins/ToolbarPlugin/ListButton.tsx +2 -0
- package/src/Snackbar/index.tsx +3 -1
- package/src/SortableItems/Item.tsx +8 -7
- package/src/SortableItems/index.tsx +1 -1
- package/src/ThemeProvider/index.tsx +5 -3
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +3 -2
- package/src/TimePeriods/SelectedTimePeriod.tsx +1 -1
- package/src/TimePeriods/timePeriodsAtoms.ts +1 -1
- package/src/TimePeriods/useSortTimePeriods.ts +1 -1
- package/src/Typography/Subtitle.tsx +3 -1
- package/src/Typography/story.utils.tsx +3 -2
- package/src/Wizard/ActionsBar.tsx +2 -2
- package/src/api/QueryProvider.tsx +1 -2
- package/src/api/buildListingEndpoint/getSearchQueryParameterValue.ts +4 -2
- package/src/api/useGraphQuery/index.ts +4 -2
- package/src/api/useMutationQuery/index.ts +11 -7
- package/src/api/useMutationQuery/useOptimisticMutation.ts +34 -16
- package/src/api/useRequest/index.test.ts +1 -1
- package/src/api/useRequest/index.ts +1 -1
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/CrudPage/Actions/Filters.tsx +1 -1
- package/src/components/CrudPage/Actions/useSearch.tsx +1 -1
- package/src/components/CrudPage/Columns/Actions.tsx +2 -2
- package/src/components/CrudPage/CrudPageRoot.tsx +1 -1
- package/src/components/CrudPage/DeleteModal.tsx +14 -6
- package/src/components/CrudPage/Form/AddModal.tsx +16 -4
- package/src/components/CrudPage/Form/UpdateModal.tsx +2 -2
- package/src/components/CrudPage/Listing.tsx +2 -1
- package/src/components/CrudPage/hooks/useDeleteItem.ts +5 -1
- package/src/components/CrudPage/hooks/useGetItem.ts +3 -3
- package/src/components/DataTable/DataListing.tsx +1 -1
- package/src/components/ExpandableContainer/ExpandableContainer.tsx +1 -0
- package/src/components/Form/AccessRights/Actions/Actions.tsx +1 -1
- package/src/components/Form/AccessRights/Actions/useActions.ts +1 -4
- package/src/components/Form/AccessRights/List/StateChip.tsx +1 -1
- package/src/components/Form/AccessRights/Stats/Stats.tsx +1 -1
- package/src/components/Form/AccessRights/common/RoleSelectField.tsx +4 -6
- package/src/components/Form/Dashboard/DashboardForm.tsx +2 -2
- package/src/components/Header/PageHeader/PageHeader.styles.ts +26 -20
- package/src/components/Menu/useMenu.tsx +3 -3
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.tsx +14 -9
- package/src/components/Modal/Modal.tsx +5 -3
- package/src/components/Modal/ModalActions.tsx +1 -1
- package/src/components/Modal/ModalBody.tsx +2 -2
- package/src/components/Modal/ModalHeader.tsx +2 -2
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +8 -2
- package/src/index.ts +1 -1
- package/src/utils/sanitizedHTML.ts +1 -1
- package/src/utils/useDebounce.ts +3 -1
- package/src/utils/useLicenseExpirationWarning.ts +11 -6
- package/src/utils/useLocaleDateTimeFormat/index.test.tsx +3 -1
- package/src/utils/useLocaleDateTimeFormat/localeFallback.test.tsx +3 -1
- package/src/utils/useMemoComponent.ts +1 -1
- 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,
|