@centreon/ui 23.10.121 → 24.4.1-0
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 +59 -41
- package/public/mockServiceWorker.js +2 -2
- package/src/ActionsList/ActionsList.styles.ts +40 -71
- package/src/Button/Icon/index.stories.tsx +1 -1
- package/src/Button/Icon/index.tsx +2 -2
- package/src/Button/Save/StartIcon.tsx +3 -3
- package/src/Button/Save/index.tsx +9 -5
- package/src/Checkbox/Checkbox.tsx +2 -2
- package/src/Checkbox/CheckboxGroup/index.tsx +2 -2
- package/src/Checkbox/fonts/roboto-bold-webfont.ttf +0 -0
- package/src/Checkbox/fonts/roboto-bold-webfont.woff +0 -0
- package/src/Checkbox/fonts/roboto-bold-webfont.woff2 +0 -0
- package/src/Checkbox/fonts/roboto-light-webfont.ttf +0 -0
- package/src/Checkbox/fonts/roboto-light-webfont.woff +0 -0
- package/src/Checkbox/fonts/roboto-light-webfont.woff2 +0 -0
- package/src/Checkbox/fonts/roboto-medium-webfont.ttf +0 -0
- package/src/Checkbox/fonts/roboto-medium-webfont.woff +0 -0
- package/src/Checkbox/fonts/roboto-medium-webfont.woff2 +0 -0
- package/src/Checkbox/fonts/roboto-regular-webfont.ttf +0 -0
- package/src/Checkbox/fonts/roboto-regular-webfont.woff +0 -0
- package/src/Checkbox/fonts/roboto-regular-webfont.woff2 +0 -0
- package/src/Dashboard/Dashboard.styles.ts +6 -5
- package/src/Dashboard/Item.tsx +1 -1
- package/src/Dashboard/Layout.tsx +2 -2
- package/src/Dashboard/utils.ts +1 -1
- package/src/Dialog/Confirm/index.tsx +10 -2
- package/src/Dialog/UnsavedChanges/index.tsx +21 -20
- package/src/Dialog/UnsavedChanges/translatedLabels.ts +4 -6
- package/src/Dialog/index.tsx +9 -2
- package/src/FallbackPage/FallbackPage.tsx +3 -3
- package/src/FileDropZone/index.tsx +3 -1
- package/src/Form/Form.cypress.spec.tsx +133 -0
- package/src/Form/Inputs/Grid.tsx +8 -4
- package/src/Form/Inputs/List/Content.tsx +62 -0
- package/src/Form/Inputs/List/List.styles.ts +29 -0
- package/src/Form/Inputs/List/List.tsx +58 -0
- package/src/Form/Inputs/List/useList.ts +81 -0
- package/src/Form/Inputs/Text.tsx +3 -1
- package/src/Form/Inputs/index.tsx +3 -1
- package/src/Form/Inputs/models.ts +23 -13
- package/src/Graph/BarStack/BarStack.cypress.spec.tsx +139 -0
- package/src/Graph/BarStack/BarStack.stories.tsx +123 -0
- package/src/Graph/BarStack/BarStack.styles.ts +37 -0
- package/src/Graph/BarStack/BarStack.tsx +14 -0
- package/src/Graph/BarStack/ResponsiveBarStack.tsx +211 -0
- package/src/Graph/BarStack/index.ts +1 -0
- package/src/Graph/BarStack/models.ts +20 -0
- package/src/Graph/BarStack/useResponsiveBarStack.ts +131 -0
- package/src/Graph/Gauge/Gauge.cypress.spec.tsx +102 -0
- package/src/Graph/Gauge/Gauge.tsx +1 -1
- package/src/Graph/HeatMap/HeatMap.cypress.spec.tsx +145 -0
- package/src/Graph/HeatMap/HeatMap.stories.tsx +0 -25
- package/src/Graph/HeatMap/HeatMap.styles.tsx +1 -0
- package/src/Graph/HeatMap/ResponsiveHeatMap.tsx +20 -10
- package/src/Graph/HeatMap/model.ts +1 -0
- package/src/Graph/Legend/Legend.tsx +21 -0
- package/src/Graph/Legend/index.ts +1 -0
- package/src/Graph/Legend/models.ts +11 -0
- package/src/Graph/LineChart/BasicComponents/Lines/RegularLines/index.tsx +2 -1
- package/src/Graph/LineChart/BasicComponents/Lines/StackedLines/index.tsx +3 -4
- package/src/Graph/LineChart/BasicComponents/Lines/Threshold/Circle.tsx +2 -2
- package/src/Graph/LineChart/BasicComponents/ThresholdLine.tsx +3 -1
- package/src/Graph/LineChart/BasicComponents/Thresholds.tsx +2 -2
- package/src/Graph/LineChart/BasicComponents/useFilterLines.ts +3 -5
- package/src/Graph/LineChart/Header/index.tsx +3 -31
- package/src/Graph/LineChart/Icons/Downtime.tsx +3 -3
- package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/GuidingLines.tsx +2 -2
- package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/useTickGraph.ts +9 -11
- package/src/Graph/LineChart/InteractiveComponents/Annotations/EventAnnotations.tsx +1 -1
- package/src/Graph/LineChart/InteractiveComponents/GraphValueTooltip/GraphValueTooltip.tsx +68 -0
- package/src/Graph/LineChart/InteractiveComponents/GraphValueTooltip/useGraphValueTooltip.ts +27 -0
- package/src/Graph/LineChart/InteractiveComponents/GraphValueTooltip/useGraphValueTooltipStyles.ts +31 -0
- package/src/Graph/LineChart/InteractiveComponents/ZoomPreview/index.tsx +2 -1
- package/src/Graph/LineChart/InteractiveComponents/index.tsx +132 -17
- package/src/Graph/LineChart/InteractiveComponents/interactionWithGraphAtoms.ts +7 -27
- package/src/Graph/LineChart/Legend/Legend.styles.ts +75 -33
- package/src/Graph/LineChart/Legend/LegendContent.tsx +12 -6
- package/src/Graph/LineChart/Legend/LegendHeader.tsx +66 -27
- package/src/Graph/LineChart/Legend/index.tsx +35 -45
- package/src/Graph/LineChart/Legend/models.ts +5 -0
- package/src/Graph/LineChart/Legend/useLegend.ts +12 -13
- package/src/Graph/LineChart/LineChart.cypress.spec.tsx +144 -0
- package/src/Graph/LineChart/LineChart.styles.ts +8 -0
- package/src/Graph/LineChart/LineChart.tsx +118 -117
- package/src/Graph/LineChart/LoadingSkeleton.tsx +2 -2
- package/src/Graph/LineChart/helpers/doc.ts +16 -13
- package/src/Graph/LineChart/helpers/index.ts +1 -1
- package/src/Graph/LineChart/index.stories.tsx +17 -2
- package/src/Graph/LineChart/index.tsx +6 -7
- package/src/Graph/LineChart/mockedData/curvesWithSameColor.json +252 -0
- package/src/Graph/LineChart/mockedData/lastDayWithIncompleteValues.json +1320 -0
- package/src/Graph/LineChart/mockedData/lastDayWithNullValues.json +1314 -0
- package/src/Graph/LineChart/models.ts +12 -1
- package/src/Graph/LineChart/useLineChartData.ts +57 -18
- package/src/Graph/PieChart/PieChart.cypress.spec.tsx +154 -0
- package/src/Graph/PieChart/PieChart.stories.tsx +194 -0
- package/src/Graph/PieChart/PieChart.styles.ts +39 -0
- package/src/Graph/PieChart/PieChart.tsx +14 -0
- package/src/Graph/PieChart/ResponsivePie.tsx +245 -0
- package/src/Graph/PieChart/index.ts +1 -0
- package/src/Graph/PieChart/models.ts +20 -0
- package/src/Graph/PieChart/useResponsivePie.ts +81 -0
- package/src/Graph/SingleBar/SingleBar.cypress.spec.tsx +121 -0
- package/src/Graph/SingleBar/Thresholds.tsx +2 -2
- package/src/Graph/Text/Text.cypress.spec.tsx +101 -0
- package/src/Graph/Text/Text.stories.tsx +60 -4
- package/src/Graph/Text/Text.styles.ts +12 -1
- package/src/Graph/Text/Text.tsx +17 -12
- package/src/Graph/Tree/DescendantNodes.tsx +88 -0
- package/src/Graph/Tree/Links.tsx +64 -0
- package/src/Graph/Tree/StandaloneTree.tsx +32 -0
- package/src/Graph/Tree/Tree.cypress.spec.tsx +171 -0
- package/src/Graph/Tree/Tree.stories.tsx +144 -0
- package/src/Graph/Tree/Tree.tsx +116 -0
- package/src/Graph/Tree/constants.ts +2 -0
- package/src/Graph/Tree/index.ts +4 -0
- package/src/Graph/Tree/models.ts +52 -0
- package/src/Graph/Tree/stories/contents.tsx +164 -0
- package/src/Graph/Tree/stories/datas.ts +305 -0
- package/src/Graph/Tree/utils.ts +49 -0
- package/src/Graph/common/testUtils.ts +71 -0
- package/src/Graph/common/timeSeries/index.ts +53 -15
- package/src/Graph/common/utils.ts +68 -1
- package/src/Graph/index.ts +4 -0
- package/src/Icon/BaseIcon.tsx +32 -0
- package/src/Icon/DowntimeIcon.tsx +14 -0
- package/src/InputField/Number/Number.cypress.spec.tsx +85 -0
- package/src/InputField/Number/Number.stories.tsx +66 -0
- package/src/InputField/Number/Number.tsx +74 -0
- package/src/InputField/Search/index.tsx +2 -2
- package/src/InputField/Select/Autocomplete/Connected/Multi/index.test.tsx +1 -0
- package/src/InputField/Select/Autocomplete/Connected/index.test.tsx +1 -0
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +25 -10
- package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/index.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Multi/index.tsx +4 -2
- package/src/InputField/Select/Autocomplete/index.tsx +129 -116
- package/src/InputField/Select/IconPopover/index.tsx +3 -3
- package/src/InputField/Select/index.tsx +15 -2
- package/src/InputField/Text/index.tsx +46 -41
- package/src/Listing/ActionBar/index.tsx +11 -10
- package/src/Listing/Cell/DataCell.styles.ts +3 -0
- package/src/Listing/Cell/DataCell.tsx +23 -5
- package/src/Listing/Header/ListingHeader.tsx +1 -1
- package/src/Listing/Listing.cypress.spec.tsx +218 -33
- package/src/Listing/Listing.styles.ts +4 -7
- package/src/Listing/Row/Row.tsx +7 -3
- package/src/Listing/index.stories.tsx +39 -5
- package/src/Listing/index.test.tsx +1 -1
- package/src/Listing/index.tsx +207 -149
- package/src/Listing/models.ts +1 -0
- package/src/Listing/useStyleTable.ts +1 -0
- package/src/Module/LicensedModule/LicenseCheck/index.tsx +24 -9
- package/src/Module/LicensedModule/index.tsx +7 -1
- package/src/Module/Module.cypress.spec.tsx +129 -0
- package/src/Module/index.tsx +2 -4
- package/src/Panel/index.tsx +1 -1
- package/src/PopoverMenu/index.tsx +9 -8
- package/src/RichTextEditor/ContentEditable.tsx +195 -195
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +100 -52
- package/src/RichTextEditor/RichTextEditor.tsx +21 -4
- package/src/RichTextEditor/plugins/ToolbarPlugin/AlignPicker.tsx +21 -20
- package/src/RichTextEditor/plugins/ToolbarPlugin/BlockButtons.tsx +35 -77
- package/src/RichTextEditor/plugins/ToolbarPlugin/FormatButtons.tsx +29 -83
- package/src/RichTextEditor/plugins/ToolbarPlugin/LinkButton.tsx +106 -0
- package/src/RichTextEditor/plugins/ToolbarPlugin/ListButton.tsx +155 -0
- package/src/RichTextEditor/plugins/ToolbarPlugin/MacrosButton.tsx +23 -39
- package/src/RichTextEditor/plugins/ToolbarPlugin/ToolbarPlugin.styles.ts +24 -14
- package/src/RichTextEditor/plugins/ToolbarPlugin/UndoRedoButtons.tsx +6 -0
- package/src/RichTextEditor/plugins/ToolbarPlugin/index.tsx +5 -10
- package/src/RichTextEditor/translatedLabels.ts +3 -0
- package/src/SortableItems/index.tsx +2 -7
- package/src/StoryBookThemeProvider/index.tsx +35 -36
- package/src/ThemeProvider/index.tsx +39 -12
- package/src/ThemeProvider/palettes.ts +15 -12
- package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.styles.ts +6 -7
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +8 -3
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +0 -2
- package/src/TimePeriods/DateTimePickerInput.tsx +56 -19
- package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +12 -9
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +9 -33
- package/src/TimePeriods/helpers/index.ts +1 -1
- package/src/TimePeriods/index.stories.tsx +12 -4
- package/src/TimePeriods/index.tsx +2 -2
- package/src/TopCounterElements/TopCounterLayout.tsx +3 -0
- package/src/TopCounterElements/useCloseOnLegacyPage.tsx +42 -0
- package/src/Typography/FluidTypography/FluidTypography.cypress.spec.tsx +27 -0
- package/src/Typography/FluidTypography/index.stories.tsx +2 -2
- package/src/Typography/FluidTypography/index.tsx +21 -28
- package/src/Typography/Subtitle.tsx +55 -0
- package/src/api/QueryProvider.tsx +1 -1
- package/src/api/TestQueryProvider.tsx +1 -1
- package/src/api/buildListingEndpoint/models.ts +2 -1
- package/src/api/customFetch.ts +12 -3
- package/src/api/index.ts +3 -3
- package/src/api/useFetchQuery/index.ts +49 -28
- package/src/api/useGraphQuery/index.ts +26 -5
- package/src/api/useGraphQuery/models.ts +5 -0
- package/src/api/useMutationQuery/index.test.ts +4 -4
- package/src/api/useMutationQuery/index.ts +65 -20
- package/src/components/Button/Icon/IconButton.tsx +6 -2
- package/src/components/CollapsibleItem/CollapsibleItem.cypress.spec.tsx +76 -0
- package/src/components/CollapsibleItem/CollapsibleItem.stories.tsx +26 -0
- package/src/components/CollapsibleItem/CollapsibleItem.tsx +43 -14
- package/src/components/CollapsibleItem/useCollapsibleItemStyles.ts +24 -1
- package/src/components/DataTable/DataListing.tsx +6 -0
- package/src/components/DataTable/DataTable.cypress.spec.tsx +174 -0
- package/src/components/DataTable/DataTable.stories.tsx +40 -0
- package/src/components/DataTable/DataTable.styles.ts +3 -0
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/DataTable/Item/DataTableItem.styles.ts +7 -2
- package/src/components/DataTable/Item/DataTableItem.tsx +4 -60
- package/src/components/DataTable/index.ts +3 -1
- package/src/components/Form/AccessRights/AccessRights.cypress.spec.tsx +373 -0
- package/src/components/Form/AccessRights/AccessRights.stories.tsx +119 -0
- package/src/components/Form/AccessRights/AccessRights.styles.ts +10 -0
- package/src/components/Form/AccessRights/AccessRights.tsx +60 -0
- package/src/components/Form/AccessRights/Actions/Actions.styles.ts +14 -0
- package/src/components/Form/AccessRights/Actions/Actions.tsx +81 -0
- package/src/components/Form/AccessRights/Actions/useActions.ts +79 -0
- package/src/components/Form/AccessRights/List/Item.tsx +90 -0
- package/src/components/Form/AccessRights/List/List.styles.tsx +45 -0
- package/src/components/Form/AccessRights/List/List.tsx +52 -0
- package/src/components/Form/AccessRights/List/ListItemSkeleton.tsx +18 -0
- package/src/components/Form/AccessRights/List/ListSkeleton.tsx +22 -0
- package/src/components/Form/AccessRights/List/RemoveAccessRight.tsx +38 -0
- package/src/components/Form/AccessRights/List/StateChip.tsx +28 -0
- package/src/components/Form/AccessRights/List/useItem.ts +64 -0
- package/src/components/Form/AccessRights/Provider.tsx +15 -0
- package/src/components/Form/AccessRights/ShareInput/ContactSwitch.tsx +50 -0
- package/src/components/Form/AccessRights/ShareInput/ShareInput.styles.ts +17 -0
- package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +78 -0
- package/src/components/Form/AccessRights/ShareInput/useShareInput.tsx +113 -0
- package/src/components/Form/AccessRights/Stats/Stats.tsx +36 -0
- package/src/components/Form/AccessRights/atoms.ts +97 -0
- package/src/components/Form/AccessRights/common/RoleSelectField.styles.tsx +7 -0
- package/src/components/Form/AccessRights/common/RoleSelectField.tsx +45 -0
- package/src/components/Form/AccessRights/models.ts +55 -0
- package/src/components/Form/AccessRights/storiesData.ts +222 -0
- package/src/components/Form/AccessRights/useAccessRightsInitValues.ts +51 -0
- package/src/components/Form/Dashboard/DashboardDuplicationForm.tsx +85 -0
- package/src/components/Form/Dashboard/DashboardForm.tsx +15 -12
- package/src/components/Form/Dashboard/index.ts +1 -0
- package/src/components/Form/FormActions.tsx +7 -2
- package/src/components/Form/index.ts +2 -1
- package/src/components/ItemComposition/Item.tsx +1 -1
- package/src/components/ItemComposition/ItemComposition.cypress.spec.tsx +113 -0
- package/src/components/ItemComposition/ItemComposition.stories.tsx +14 -0
- package/src/components/ItemComposition/ItemComposition.styles.ts +36 -3
- package/src/components/ItemComposition/ItemComposition.tsx +41 -17
- package/src/components/Layout/PageLayout/PageLayout.tsx +1 -1
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +1 -0
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +1 -0
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +5 -1
- package/src/components/Layout/PageLayout/PageQuickAccess.tsx +76 -0
- package/src/components/Layout/PageLayout/index.ts +3 -1
- package/src/components/Layout/PageLayout.cypress.spec.tsx +66 -0
- package/src/components/List/Item/ListItem.styles.ts +6 -0
- package/src/components/List/Item/ListItem.tsx +6 -4
- package/src/components/List/Item/Text.tsx +5 -3
- package/src/components/Menu/Button/MenuButton.tsx +4 -2
- package/src/components/Menu/MenuItem.tsx +5 -3
- package/src/components/Menu/MenuItems.tsx +4 -3
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.cypress.spec.tsx +168 -0
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.stories.tsx +62 -0
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.tsx +87 -0
- package/src/components/Modal/Modal.styles.ts +10 -2
- package/src/components/Modal/ModalActions.tsx +4 -2
- package/src/components/Modal/index.ts +2 -0
- package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.stories.tsx +3 -3
- package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.tsx +1 -1
- package/src/components/Tooltip/ConfirmationTooltip/models.ts +1 -1
- package/src/components/Zoom/Minimap.tsx +127 -0
- package/src/components/Zoom/Zoom.cypress.spec.tsx +246 -0
- package/src/components/Zoom/Zoom.stories.tsx +115 -0
- package/src/components/Zoom/Zoom.styles.tsx +68 -0
- package/src/components/Zoom/Zoom.tsx +61 -0
- package/src/components/Zoom/ZoomContent.tsx +167 -0
- package/src/components/Zoom/constants.ts +2 -0
- package/src/components/Zoom/localPoint.ts +51 -0
- package/src/components/Zoom/models.ts +25 -0
- package/src/components/Zoom/useMinimap.ts +156 -0
- package/src/components/Zoom/useZoom.ts +70 -0
- package/src/components/Zoom/utils.ts +55 -0
- package/src/components/index.ts +1 -0
- package/src/fonts/roboto-bold-webfont.ttf +0 -0
- package/src/fonts/roboto-bold-webfont.woff +0 -0
- package/src/fonts/roboto-bold-webfont.woff2 +0 -0
- package/src/fonts/roboto-light-webfont.ttf +0 -0
- package/src/fonts/roboto-light-webfont.woff +0 -0
- package/src/fonts/roboto-light-webfont.woff2 +0 -0
- package/src/fonts/roboto-medium-webfont.ttf +0 -0
- package/src/fonts/roboto-medium-webfont.woff +0 -0
- package/src/fonts/roboto-medium-webfont.woff2 +0 -0
- package/src/fonts/roboto-regular-webfont.ttf +0 -0
- package/src/fonts/roboto-regular-webfont.woff +0 -0
- package/src/fonts/roboto-regular-webfont.woff2 +0 -0
- package/src/index.ts +6 -0
- package/src/queryParameters/url/index.ts +5 -1
- package/src/utils/index.ts +3 -1
- package/src/utils/useFullscreen/Fullscreen.cypress.spec.tsx +130 -0
- package/src/utils/useFullscreen/atoms.ts +3 -0
- package/src/utils/useFullscreen/index.ts +2 -0
- package/src/utils/useFullscreen/translatedLabels.ts +1 -0
- package/src/utils/useFullscreen/useFullscreen.ts +73 -0
- package/src/utils/useFullscreen/useFullscreenListener.ts +62 -0
- package/src/utils/useInfiniteScrollListing.ts +31 -8
- package/src/utils/{useLicenseExpirationWarning.cypress.spec.tsx → useLicenseExpirationWarning.test.tsx} +48 -37
- package/src/utils/useLicenseExpirationWarning.ts +18 -18
- package/src/utils/useLocaleDateTimeFormat/index.ts +3 -0
- package/src/utils/usePluralizedTranslation.ts +21 -0
- package/src/@assets/icons/downtime.icon.svg +0 -1
- package/src/Graph/LineChart/BasicComponents/LoadingProgress.tsx +0 -46
- package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/TooltipAnchorPoint.tsx +0 -96
- package/src/Graph/LineChart/InteractiveComponents/AnchorPoint/useTooltipAnchorPoint.ts +0 -107
- package/src/Graph/LineChart/Legend/InteractiveValue.tsx +0 -22
- package/src/Graph/LineChart/Legend/Marker.tsx +0 -43
- package/src/Graph/LineChart/Legend/useInteractiveValues.ts +0 -99
- package/src/Typography/FluidTypography/useFluidResizeObserver.ts +0 -56
- package/src/components/Form/AccessRights/AccessRights.resource.ts +0 -45
- package/src/components/Form/AccessRights/AccessRightsForm.stories.tsx +0 -59
- package/src/components/Form/AccessRights/AccessRightsForm.styles.ts +0 -21
- package/src/components/Form/AccessRights/AccessRightsForm.tsx +0 -67
- package/src/components/Form/AccessRights/AccessRightsFormActions.tsx +0 -80
- package/src/components/Form/AccessRights/Input/AddAction.tsx +0 -31
- package/src/components/Form/AccessRights/Input/ContactAccessRightInput.stories.tsx +0 -54
- package/src/components/Form/AccessRights/Input/ContactAccessRightInput.tsx +0 -72
- package/src/components/Form/AccessRights/Input/ContactAccessRightsInput.styles.ts +0 -22
- package/src/components/Form/AccessRights/Input/ContactInputField.tsx +0 -105
- package/src/components/Form/AccessRights/Input/RoleInputField.tsx +0 -29
- package/src/components/Form/AccessRights/List/ContactAccessRightsList.stories.tsx +0 -97
- package/src/components/Form/AccessRights/List/ContactAccessRightsList.styles.ts +0 -71
- package/src/components/Form/AccessRights/List/ContactAccessRightsList.tsx +0 -51
- package/src/components/Form/AccessRights/List/ContactAccessRightsListItem.stories.tsx +0 -116
- package/src/components/Form/AccessRights/List/ContactAccessRightsListItem.tsx +0 -118
- package/src/components/Form/AccessRights/List/ContactAccessRightsListItemSkeleton.tsx +0 -26
- package/src/components/Form/AccessRights/List/ContactAccessRightsListSkeleton.tsx +0 -28
- package/src/components/Form/AccessRights/Stats/AccessRightsStats.styles.ts +0 -18
- package/src/components/Form/AccessRights/Stats/AccessRightsStats.tsx +0 -41
- package/src/components/Form/AccessRights/__fixtures__/contactAccessRight.mock.ts +0 -52
- package/src/components/Form/AccessRights/common/GroupLabel.styles.ts +0 -18
- package/src/components/Form/AccessRights/common/GroupLabel.tsx +0 -15
- package/src/components/Form/AccessRights/common/Input.styles.ts +0 -48
- package/src/components/Form/AccessRights/common/RoleInputSelect.styles.ts +0 -11
- package/src/components/Form/AccessRights/common/RoleInputSelect.tsx +0 -57
- package/src/components/Form/AccessRights/index.ts +0 -3
- package/src/components/Form/AccessRights/useAccessRightsForm.test.tsx +0 -531
- package/src/components/Form/AccessRights/useAccessRightsForm.tsx +0 -282
- package/src/components/Form/AccessRights/useAccessRightsForm.utils.ts +0 -41
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +0 -108
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +0 -281
- package/src/utils/useDateTimePickerAdapter.ts +0 -309
- /package/{public → src/Button}/fonts/roboto-bold-webfont.ttf +0 -0
- /package/{public → src/Button}/fonts/roboto-bold-webfont.woff +0 -0
- /package/{public → src/Button}/fonts/roboto-bold-webfont.woff2 +0 -0
- /package/{public → src/Button}/fonts/roboto-light-webfont.ttf +0 -0
- /package/{public → src/Button}/fonts/roboto-light-webfont.woff +0 -0
- /package/{public → src/Button}/fonts/roboto-light-webfont.woff2 +0 -0
- /package/{public → src/Button}/fonts/roboto-medium-webfont.ttf +0 -0
- /package/{public → src/Button}/fonts/roboto-medium-webfont.woff +0 -0
- /package/{public → src/Button}/fonts/roboto-medium-webfont.woff2 +0 -0
- /package/{public → src/Button}/fonts/roboto-regular-webfont.ttf +0 -0
- /package/{public → src/Button}/fonts/roboto-regular-webfont.woff +0 -0
- /package/{public → src/Button}/fonts/roboto-regular-webfont.woff2 +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import dataLastWeek from '../LineChart/mockedData/lastWeek.json';
|
|
2
|
+
import {
|
|
3
|
+
criticalThresholds,
|
|
4
|
+
rangedThresholds,
|
|
5
|
+
successThresholds,
|
|
6
|
+
warningThresholds
|
|
7
|
+
} from '../common/testUtils';
|
|
8
|
+
|
|
9
|
+
import { Props, Gauge } from './Gauge';
|
|
10
|
+
|
|
11
|
+
const initialize = (
|
|
12
|
+
args: Omit<Props, 'data' | 'labels' | 'baseColor'>
|
|
13
|
+
): void => {
|
|
14
|
+
cy.mount({
|
|
15
|
+
Component: (
|
|
16
|
+
<div style={{ height: '100vh', width: '100vw' }}>
|
|
17
|
+
<Gauge
|
|
18
|
+
baseColor="#000"
|
|
19
|
+
data={dataLastWeek}
|
|
20
|
+
labels={{
|
|
21
|
+
critical: 'Critical',
|
|
22
|
+
warning: 'Warning'
|
|
23
|
+
}}
|
|
24
|
+
{...args}
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
describe('Gauge', () => {
|
|
32
|
+
it('does not display the gauge when there is no data', () => {
|
|
33
|
+
initialize({ data: undefined, thresholds: successThresholds });
|
|
34
|
+
|
|
35
|
+
cy.contains('0.41 s').should('not.exist');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('displays the gauge as success when corresponding thresholds are set', () => {
|
|
39
|
+
initialize({ thresholds: successThresholds });
|
|
40
|
+
|
|
41
|
+
cy.contains('0.41 s').should('have.css', 'fill', 'rgb(136, 185, 34)');
|
|
42
|
+
cy.findByTestId('1.1500000000000001-arc').should('be.visible');
|
|
43
|
+
cy.findByTestId('0.15000000000000013-arc').should('be.visible');
|
|
44
|
+
|
|
45
|
+
cy.makeSnapshot();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('displays the gauge as warning when corresponding thresholds are set', () => {
|
|
49
|
+
initialize({ thresholds: warningThresholds });
|
|
50
|
+
|
|
51
|
+
cy.contains('0.41 s').should('have.css', 'fill', 'rgb(253, 155, 39)');
|
|
52
|
+
cy.findByTestId('1.25-arc').should('be.visible');
|
|
53
|
+
cy.findByTestId('0.15000000000000013-arc').should('be.visible');
|
|
54
|
+
|
|
55
|
+
cy.makeSnapshot();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('displays the gauge as critical when corresponding thresholds are set', () => {
|
|
59
|
+
initialize({ thresholds: criticalThresholds });
|
|
60
|
+
|
|
61
|
+
cy.contains('0.41 s').should('have.css', 'fill', 'rgb(255, 74, 74)');
|
|
62
|
+
cy.findByTestId('0.6399999999999999-arc').should('be.visible');
|
|
63
|
+
cy.findByTestId('0.54-arc').should('be.visible');
|
|
64
|
+
|
|
65
|
+
cy.makeSnapshot();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('displays ranged thresholds', () => {
|
|
69
|
+
initialize({ thresholds: rangedThresholds });
|
|
70
|
+
|
|
71
|
+
cy.findByTestId('0.37-arc').should('be.visible');
|
|
72
|
+
cy.findByTestId('0.09999999999999998-arc').should('be.visible');
|
|
73
|
+
|
|
74
|
+
cy.makeSnapshot();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('displays the threshold tooltip when a threshold is hovered', () => {
|
|
78
|
+
initialize({ thresholds: successThresholds });
|
|
79
|
+
|
|
80
|
+
cy.findByTestId('1.1500000000000001-arc').trigger('mouseover', {
|
|
81
|
+
force: true
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
cy.contains('Warning').should('be.visible');
|
|
85
|
+
|
|
86
|
+
cy.findByTestId('0.15000000000000013-arc').trigger('mouseover', {
|
|
87
|
+
force: true
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
cy.contains('Critical').should('be.visible');
|
|
91
|
+
|
|
92
|
+
cy.makeSnapshot();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('displays the value as raw when the prop is set', () => {
|
|
96
|
+
initialize({ displayAsRaw: true, thresholds: successThresholds });
|
|
97
|
+
|
|
98
|
+
cy.contains('0.40663333333 s').should('be.visible');
|
|
99
|
+
|
|
100
|
+
cy.makeSnapshot();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { pluck } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { Box, Typography } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
import EllipsisTypography from '../../Typography/EllipsisTypography';
|
|
6
|
+
|
|
7
|
+
import HeatMap from './HeatMap';
|
|
8
|
+
import heatMapData from './HeatMapData.json';
|
|
9
|
+
import { HeatMapProps } from './model';
|
|
10
|
+
|
|
11
|
+
const dataIds = pluck('id', heatMapData);
|
|
12
|
+
|
|
13
|
+
interface Data {
|
|
14
|
+
counter: number;
|
|
15
|
+
host: string;
|
|
16
|
+
service: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const TileContent = ({
|
|
20
|
+
isSmallestSize,
|
|
21
|
+
data
|
|
22
|
+
}: {
|
|
23
|
+
data: Data;
|
|
24
|
+
isSmallestSize: boolean;
|
|
25
|
+
}): JSX.Element | false =>
|
|
26
|
+
!isSmallestSize && (
|
|
27
|
+
<Box
|
|
28
|
+
sx={{
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
color: 'common.black',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column',
|
|
33
|
+
width: '100%'
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<EllipsisTypography textAlign="center">{data.host}</EllipsisTypography>
|
|
37
|
+
<EllipsisTypography textAlign="center">{data.service}</EllipsisTypography>
|
|
38
|
+
<EllipsisTypography textAlign="center">{data.counter}</EllipsisTypography>
|
|
39
|
+
</Box>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const initialize = ({
|
|
43
|
+
width = '100vw',
|
|
44
|
+
height = '100vh',
|
|
45
|
+
...args
|
|
46
|
+
}: Omit<HeatMapProps<Data>, 'tiles' | 'children'> & {
|
|
47
|
+
height?: string;
|
|
48
|
+
width?: string;
|
|
49
|
+
}): void => {
|
|
50
|
+
cy.mount({
|
|
51
|
+
Component: (
|
|
52
|
+
<div style={{ height, width }}>
|
|
53
|
+
<HeatMap tiles={heatMapData} {...args}>
|
|
54
|
+
{TileContent}
|
|
55
|
+
</HeatMap>
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
describe('HeatMap', () => {
|
|
62
|
+
it('displays tiles', () => {
|
|
63
|
+
initialize({});
|
|
64
|
+
dataIds.forEach((id) => {
|
|
65
|
+
cy.findByTestId(id).should('be.visible');
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('does not display the tooltip when the prop is not set and the tile is hovered', () => {
|
|
70
|
+
initialize({});
|
|
71
|
+
|
|
72
|
+
cy.findByTestId(dataIds[0]).trigger('mouseover');
|
|
73
|
+
|
|
74
|
+
cy.findByTestId(`tooltip-${dataIds[0]}`).should('not.exist');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('displays the tooltip when the prop is set and the tile is hovered', () => {
|
|
78
|
+
initialize({
|
|
79
|
+
tooltipContent: ({ data }) => (
|
|
80
|
+
<Typography>
|
|
81
|
+
This is the tooltip for {data.host}-{data.service}-{data.counter}
|
|
82
|
+
</Typography>
|
|
83
|
+
)
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
cy.findByTestId(dataIds[0]).trigger('mouseover');
|
|
87
|
+
|
|
88
|
+
cy.contains(`This is the tooltip for Server-Service Counter-53`).should(
|
|
89
|
+
'be.visible'
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('displays the tooltip conditionally when the prop is set and the tile is hovered', () => {
|
|
94
|
+
initialize({
|
|
95
|
+
displayTooltipCondition: ({ counter }) => counter > 100,
|
|
96
|
+
tooltipContent: ({ data }) => (
|
|
97
|
+
<Typography>
|
|
98
|
+
This is the tooltip for {data.host}-{data.service}-{data.counter}
|
|
99
|
+
</Typography>
|
|
100
|
+
)
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
cy.findByTestId(dataIds[0]).trigger('mouseover');
|
|
104
|
+
|
|
105
|
+
cy.contains(`This is the tooltip for Server-Service Counter-53`).should(
|
|
106
|
+
'not.exist'
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
cy.findByTestId(dataIds[1]).trigger('mouseover');
|
|
110
|
+
|
|
111
|
+
cy.contains(`This is the tooltip for Server-Service Counter-779`).should(
|
|
112
|
+
'be.visible'
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('displays tiles with fixed size', () => {
|
|
117
|
+
initialize({ height: '200px', tileSizeFixed: true, width: '590px' });
|
|
118
|
+
dataIds.forEach((id) => {
|
|
119
|
+
cy.findByTestId(id).should('be.visible');
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('displays tiles as small when the container width is under the breakpoint', () => {
|
|
124
|
+
initialize({ height: '200px', width: '590px' });
|
|
125
|
+
dataIds.forEach((id) => {
|
|
126
|
+
cy.findByTestId(id).should('be.visible');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
cy.makeSnapshot();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('does not display tiles as small when the contains width is 0', () => {
|
|
133
|
+
initialize({ height: '200px', width: '0px' });
|
|
134
|
+
dataIds.forEach((id) => {
|
|
135
|
+
cy.findByTestId(id).should('not.exist');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
cy.makeSnapshot();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('displays a single tile', () => {
|
|
142
|
+
initialize({ tiles: [heatMapData[0]] });
|
|
143
|
+
cy.findByTestId(dataIds[0]).should('be.visible');
|
|
144
|
+
});
|
|
145
|
+
});
|
|
@@ -3,8 +3,6 @@ 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
|
-
|
|
8
6
|
import heatMapData from './HeatMapData.json';
|
|
9
7
|
|
|
10
8
|
import { HeatMap } from '.';
|
|
@@ -22,29 +20,6 @@ const meta: Meta<typeof HeatMap<Data>> = {
|
|
|
22
20
|
export default meta;
|
|
23
21
|
type Story = StoryObj<typeof HeatMap<Data>>;
|
|
24
22
|
|
|
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
|
-
|
|
48
23
|
const TooltipContent = ({ data }: { data: Data }): JSX.Element => {
|
|
49
24
|
return (
|
|
50
25
|
<Box sx={{ backgroundColor: 'common.white', color: 'common.black' }}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { scaleLinear } from '@visx/scale';
|
|
4
|
-
import { equals, gt, lt } from 'ramda';
|
|
4
|
+
import { T, equals, gt, lt } from 'ramda';
|
|
5
5
|
|
|
6
6
|
import { Box } from '@mui/material';
|
|
7
7
|
|
|
@@ -20,7 +20,8 @@ const ResponsiveHeatMap = <TData,>({
|
|
|
20
20
|
tiles,
|
|
21
21
|
arrowClassName,
|
|
22
22
|
tooltipContent,
|
|
23
|
-
tileSizeFixed
|
|
23
|
+
tileSizeFixed,
|
|
24
|
+
displayTooltipCondition = T
|
|
24
25
|
}: HeatMapProps<TData> & { width: number }): JSX.Element | null => {
|
|
25
26
|
const { classes, cx } = useHeatMapStyles();
|
|
26
27
|
|
|
@@ -39,7 +40,7 @@ const ResponsiveHeatMap = <TData,>({
|
|
|
39
40
|
const theoricalTotalTilesWidth =
|
|
40
41
|
tilesLength * tileWidth + (tilesLength - 1) * gap;
|
|
41
42
|
|
|
42
|
-
if (lt(width, 680) && gt(maxTotalTilesWidth, width)) {
|
|
43
|
+
if (lt(width, 680) && gt(maxTotalTilesWidth, width) && !tileSizeFixed) {
|
|
43
44
|
return smallestTileSize;
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -65,20 +66,29 @@ const ResponsiveHeatMap = <TData,>({
|
|
|
65
66
|
}}
|
|
66
67
|
>
|
|
67
68
|
{tiles.map(({ backgroundColor, id, data }) => (
|
|
68
|
-
<Box
|
|
69
|
+
<Box
|
|
70
|
+
className={classes.heatMapTile}
|
|
71
|
+
data-testid={id}
|
|
72
|
+
key={id}
|
|
73
|
+
sx={{ backgroundColor }}
|
|
74
|
+
>
|
|
69
75
|
<Tooltip
|
|
70
76
|
hasCaret
|
|
71
77
|
classes={{
|
|
72
78
|
arrow: cx(classes.heatMapTooltipArrow, arrowClassName),
|
|
73
79
|
tooltip: classes.heatMapTooltip
|
|
74
80
|
}}
|
|
81
|
+
data-testid={`tooltip-${data?.id}`}
|
|
75
82
|
followCursor={false}
|
|
76
|
-
label={
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
label={
|
|
84
|
+
displayTooltipCondition?.(data) &&
|
|
85
|
+
tooltipContent?.({
|
|
86
|
+
backgroundColor,
|
|
87
|
+
data,
|
|
88
|
+
id,
|
|
89
|
+
isSmallestSize
|
|
90
|
+
})
|
|
91
|
+
}
|
|
82
92
|
position="right-start"
|
|
83
93
|
>
|
|
84
94
|
<div className={classes.heatMapTileContent}>
|
|
@@ -21,6 +21,7 @@ export interface HeatMapProps<TData> {
|
|
|
21
21
|
data,
|
|
22
22
|
isSmallestSize
|
|
23
23
|
}: ChildrenProps<TData>) => ReactElement | boolean | null;
|
|
24
|
+
displayTooltipCondition?: (data: TData) => boolean;
|
|
24
25
|
tileSizeFixed?: boolean;
|
|
25
26
|
tiles: Array<Tile<TData>>;
|
|
26
27
|
tooltipContent?: ({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LegendOrdinal } from '@visx/legend';
|
|
2
|
+
import { scaleOrdinal } from '@visx/scale';
|
|
3
|
+
|
|
4
|
+
import { LegendProps } from './models';
|
|
5
|
+
|
|
6
|
+
const Legend = ({ scale, direction = 'column' }: LegendProps): JSX.Element => {
|
|
7
|
+
const legendScale = scaleOrdinal({
|
|
8
|
+
domain: scale.domain,
|
|
9
|
+
range: scale.range
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<LegendOrdinal
|
|
14
|
+
direction={direction}
|
|
15
|
+
labelMargin="0 16px 0 0"
|
|
16
|
+
scale={legendScale}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default Legend;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Legend } from './Legend';
|
|
@@ -55,6 +55,7 @@ const RegularLine = ({
|
|
|
55
55
|
if (filled) {
|
|
56
56
|
return (
|
|
57
57
|
<Shape.AreaClosed<TimeValue>
|
|
58
|
+
data-metric={metric_id}
|
|
58
59
|
fill={getFillColor({ areaColor, transparency })}
|
|
59
60
|
fillRule="nonzero"
|
|
60
61
|
key={metric_id}
|
|
@@ -65,7 +66,7 @@ const RegularLine = ({
|
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
return <Shape.LinePath<TimeValue> {...props} />;
|
|
69
|
+
return <Shape.LinePath<TimeValue> data-metric={metric_id} {...props} />;
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
export default memo(RegularLine, (prevProps, nextProps) => {
|
|
@@ -45,10 +45,8 @@ const StackLines = ({
|
|
|
45
45
|
>
|
|
46
46
|
{({ stacks, path: linePath }): Array<JSX.Element> => {
|
|
47
47
|
return stacks.map((stack, index) => {
|
|
48
|
-
const { areaColor, transparency, lineColor, highlight } =
|
|
49
|
-
index,
|
|
50
|
-
lines
|
|
51
|
-
) as Line;
|
|
48
|
+
const { areaColor, transparency, lineColor, highlight, metric_id } =
|
|
49
|
+
nth(index, lines) as Line;
|
|
52
50
|
|
|
53
51
|
return (
|
|
54
52
|
<g key={`stack-${prop('key', stack)}`}>
|
|
@@ -65,6 +63,7 @@ const StackLines = ({
|
|
|
65
63
|
)}
|
|
66
64
|
<path
|
|
67
65
|
d={linePath(stack) || ''}
|
|
66
|
+
data-metric={metric_id}
|
|
68
67
|
fill={getFillColor({ areaColor, transparency })}
|
|
69
68
|
opacity={highlight === false ? 0.3 : 1}
|
|
70
69
|
stroke={lineColor}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Shape } from '@visx/visx';
|
|
2
2
|
import { isEmpty, isNil } from 'ramda';
|
|
3
3
|
|
|
4
|
-
import { Circle } from './models';
|
|
4
|
+
import { Circle as CircleModel } 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
|
-
}:
|
|
14
|
+
}: CircleModel): JSX.Element | null => {
|
|
15
15
|
const coordinates = useCoordinateCircle({
|
|
16
16
|
getCountDisplayedCircles,
|
|
17
17
|
getX,
|
|
@@ -2,6 +2,8 @@ import { equals } from 'ramda';
|
|
|
2
2
|
|
|
3
3
|
import { useTheme } from '@mui/material';
|
|
4
4
|
|
|
5
|
+
import { margin } from '../common';
|
|
6
|
+
|
|
5
7
|
interface Props {
|
|
6
8
|
hideTooltip: () => void;
|
|
7
9
|
label: string;
|
|
@@ -28,7 +30,7 @@ export const ThresholdLine = ({
|
|
|
28
30
|
const onMouseEnter = (): void =>
|
|
29
31
|
showTooltip({
|
|
30
32
|
tooltipData: label,
|
|
31
|
-
tooltipLeft:
|
|
33
|
+
tooltipLeft: -(margin.left + margin.right),
|
|
32
34
|
tooltipTop: scaledValue
|
|
33
35
|
});
|
|
34
36
|
|
|
@@ -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 } from '../../common/models';
|
|
5
|
+
import { Thresholds as ThresholdsModel } 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:
|
|
16
|
+
thresholds: ThresholdsModel;
|
|
17
17
|
width: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { equals, propEq, reject } from 'ramda';
|
|
4
4
|
|
|
5
5
|
import { Line } from '../../common/timeSeries/models';
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ const useFilterLines = ({
|
|
|
28
28
|
linesGraph,
|
|
29
29
|
setLinesGraph
|
|
30
30
|
}: UseFilterLines): Result => {
|
|
31
|
-
const displayedLines = reject(propEq('display'
|
|
31
|
+
const displayedLines = reject(propEq(false, 'display'), linesGraph ?? lines);
|
|
32
32
|
const filterLines = (): Array<Line> => {
|
|
33
33
|
const lineOriginMetric = findLineOfOriginMetricThreshold(lines);
|
|
34
34
|
|
|
@@ -51,9 +51,7 @@ const useFilterLines = ({
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setLinesGraph(sortedLines);
|
|
54
|
+
setLinesGraph(filteredLines);
|
|
57
55
|
}, [lines, displayThreshold]);
|
|
58
56
|
|
|
59
57
|
return { displayedLines, newLines: linesGraph ?? lines };
|
|
@@ -1,41 +1,17 @@
|
|
|
1
|
-
import { ScaleLinear } from 'd3-scale';
|
|
2
|
-
import { isNil } from 'ramda';
|
|
3
|
-
|
|
4
1
|
import Typography from '@mui/material/Typography';
|
|
5
2
|
|
|
6
|
-
import {
|
|
3
|
+
import { useMemoComponent } from '@centreon/ui';
|
|
7
4
|
|
|
8
5
|
import { useStyles } from '../LineChart.styles';
|
|
9
|
-
import useTickGraph from '../InteractiveComponents/AnchorPoint/useTickGraph';
|
|
10
6
|
import { LineChartHeader } from '../models';
|
|
11
|
-
import { TimeValue } from '../../common/timeSeries/models';
|
|
12
7
|
|
|
13
8
|
interface Props {
|
|
14
|
-
displayTimeTick?: boolean;
|
|
15
9
|
header?: LineChartHeader;
|
|
16
|
-
timeSeries: Array<TimeValue>;
|
|
17
10
|
title: string;
|
|
18
|
-
xScale: ScaleLinear<number, number>;
|
|
19
11
|
}
|
|
20
12
|
|
|
21
|
-
const Header = ({
|
|
22
|
-
title,
|
|
23
|
-
displayTimeTick = true,
|
|
24
|
-
header,
|
|
25
|
-
timeSeries,
|
|
26
|
-
xScale
|
|
27
|
-
}: Props): JSX.Element => {
|
|
13
|
+
const Header = ({ title, header }: Props): JSX.Element => {
|
|
28
14
|
const { classes } = useStyles();
|
|
29
|
-
const { toDateTime } = useLocaleDateTimeFormat();
|
|
30
|
-
|
|
31
|
-
const { tickAxisBottom } = useTickGraph({
|
|
32
|
-
timeSeries,
|
|
33
|
-
xScale
|
|
34
|
-
});
|
|
35
|
-
const time =
|
|
36
|
-
displayTimeTick && !isNil(tickAxisBottom)
|
|
37
|
-
? toDateTime(tickAxisBottom)
|
|
38
|
-
: null;
|
|
39
15
|
|
|
40
16
|
const displayTitle = header?.displayTitle ?? true;
|
|
41
17
|
|
|
@@ -49,16 +25,12 @@ const Header = ({
|
|
|
49
25
|
{title}
|
|
50
26
|
</Typography>
|
|
51
27
|
)}
|
|
52
|
-
|
|
53
|
-
<Typography align="center" style={{ height: 20 }} variant="body1">
|
|
54
|
-
{time}
|
|
55
|
-
</Typography>
|
|
56
28
|
</div>
|
|
57
29
|
{header?.extraComponent}
|
|
58
30
|
</div>
|
|
59
31
|
),
|
|
60
32
|
|
|
61
|
-
memoProps: [
|
|
33
|
+
memoProps: [title, header]
|
|
62
34
|
});
|
|
63
35
|
};
|
|
64
36
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvgIconProps } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { DowntimeIcon } from '../../../Icon/DowntimeIcon';
|
|
4
4
|
|
|
5
5
|
const Downtime = (props: SvgIconProps): JSX.Element => (
|
|
6
|
-
<
|
|
6
|
+
<DowntimeIcon {...props} />
|
|
7
7
|
);
|
|
8
8
|
|
|
9
9
|
export default Downtime;
|
|
@@ -2,7 +2,7 @@ import { Shape } from '@visx/visx';
|
|
|
2
2
|
|
|
3
3
|
import { grey } from '@mui/material/colors';
|
|
4
4
|
|
|
5
|
-
import { GuidingLines } from './models';
|
|
5
|
+
import { GuidingLines as GuidingLinesModel } 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
|
-
}:
|
|
13
|
+
}: GuidingLinesModel): JSX.Element | null => {
|
|
14
14
|
const { positionX, positionY } = useTickGraph({
|
|
15
15
|
timeSeries,
|
|
16
16
|
xScale
|
|
@@ -2,13 +2,12 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { ScaleLinear } from 'd3-scale';
|
|
4
4
|
import { useAtomValue } from 'jotai';
|
|
5
|
-
import { isEmpty, isNil, not } from 'ramda';
|
|
6
5
|
|
|
7
6
|
import useAxisY from '../../BasicComponents/Axes/useAxisY';
|
|
8
7
|
import { margin } from '../../common';
|
|
9
|
-
import {
|
|
8
|
+
import { getTimeValue } from '../../../common/timeSeries';
|
|
10
9
|
import { Line, TimeValue } from '../../../common/timeSeries/models';
|
|
11
|
-
import { mousePositionAtom
|
|
10
|
+
import { mousePositionAtom } from '../interactionWithGraphAtoms';
|
|
12
11
|
|
|
13
12
|
interface AnchorPointResult {
|
|
14
13
|
positionX?: number;
|
|
@@ -42,14 +41,13 @@ const useTickGraph = ({
|
|
|
42
41
|
const { axisRight, axisLeft } = useAxisY({ data: { baseAxis, lines } });
|
|
43
42
|
|
|
44
43
|
const mousePosition = useAtomValue(mousePositionAtom);
|
|
45
|
-
const timeValueData = useAtomValue(timeValueAtom);
|
|
46
44
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const positionX = mousePosition
|
|
46
|
+
? mousePosition[0] - margin.left - 4
|
|
47
|
+
: undefined;
|
|
48
|
+
const positionY = mousePosition
|
|
49
|
+
? mousePosition[1] - margin.top + 2
|
|
50
|
+
: undefined;
|
|
53
51
|
|
|
54
52
|
useEffect(() => {
|
|
55
53
|
if (!mousePosition) {
|
|
@@ -62,7 +60,7 @@ const useTickGraph = ({
|
|
|
62
60
|
const mousePositionTimeTick = mousePosition
|
|
63
61
|
? getTimeValue({ timeSeries, x: mousePosition[0], xScale }).timeTick
|
|
64
62
|
: 0;
|
|
65
|
-
const timeTickValue =
|
|
63
|
+
const timeTickValue = mousePosition
|
|
66
64
|
? new Date(mousePositionTimeTick)
|
|
67
65
|
: null;
|
|
68
66
|
|