@orchestrator-ui/orchestrator-ui-components 0.2.4 → 0.2.6
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/.storybook/main.js +1 -1
- package/.turbo/turbo-build.log +9 -7
- package/.turbo/turbo-lint.log +3 -6
- package/.turbo/turbo-test.log +17 -9
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1092 -358
- package/dist/index.js +22934 -6399
- package/jest.config.cjs +0 -1
- package/package.json +24 -8
- package/src/api/axios.ts +34 -0
- package/src/api/index.ts +170 -0
- package/src/components/WfoAuth/WfoAuth.tsx +22 -0
- package/src/components/WfoAuth/index.ts +1 -0
- package/src/components/{WFOBadges/WFOBadge/WFOBadge.stories.tsx → WfoBadges/WfoBadge/WfoBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOBadge/WFOBadge.tsx → WfoBadges/WfoBadge/WfoBadge.tsx} +4 -3
- package/src/components/WfoBadges/WfoBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.stories.tsx → WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.tsx → WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.tsx} +13 -7
- package/src/components/WfoBadges/WfoEngineStatusBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.stories.tsx → WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.tsx → WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.tsx} +8 -7
- package/src/components/WfoBadges/WfoEnvironmentBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.stories.tsx +13 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +95 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOHeaderBadge/WFOHeaderBadge.stories.tsx → WfoBadges/WfoHeaderBadge/WfoHeaderBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOHeaderBadge/WFOHeaderBadge.tsx → WfoBadges/WfoHeaderBadge/WfoHeaderBadge.tsx} +6 -4
- package/src/components/WfoBadges/WfoHeaderBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOProcessStatusBadge/WFOProcessStatusBadge.tsx → WfoBadges/WfoProcessStatusBadge/WfoProcessStatusBadge.tsx} +8 -6
- package/src/components/WfoBadges/WfoProcessStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.stories.tsx +16 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +70 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.stories.tsx +22 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +53 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOSubscriptionStatusBadge/WFOSubscriptionStatusBadge.stories.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOSubscriptionStatusBadge/WFOSubscriptionStatusBadge.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx} +12 -10
- package/src/components/WfoBadges/WfoSubscriptionStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/WfoWorkflowTargetBadge.tsx +65 -0
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/index.ts +1 -0
- package/src/components/WfoBadges/index.ts +9 -0
- package/src/components/WfoButtonComboBox/WfoButtonComboBox.tsx +76 -0
- package/src/components/WfoButtonComboBox/styles.ts +13 -0
- package/src/components/WfoDateTime/WfoDateTime.tsx +28 -0
- package/src/components/WfoDateTime/index.ts +1 -0
- package/src/components/WfoDropdownButton/WfoDropdownButton.tsx +67 -0
- package/src/components/WfoDropdownButton/index.ts +1 -0
- package/src/components/{WFOFilterTabs/WFOFilterTabs.tsx → WfoFilterTabs/WfoFilterTabs.tsx} +8 -6
- package/src/components/WfoFilterTabs/index.ts +1 -0
- package/src/components/WfoForms/AutoFieldLoader.tsx +110 -0
- package/src/components/WfoForms/AutoFields.tsx +49 -0
- package/src/components/WfoForms/CreateForm.tsx +71 -0
- package/src/components/WfoForms/UserInputForm.tsx +607 -0
- package/src/components/WfoForms/UserInputFormStyling.ts +80 -0
- package/src/components/WfoForms/UserInputFormWizard.tsx +120 -0
- package/src/components/WfoForms/formFields/AcceptField.tsx +239 -0
- package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +29 -0
- package/src/components/WfoForms/formFields/BoolField.tsx +71 -0
- package/src/components/WfoForms/formFields/BoolFieldStyling.ts +68 -0
- package/src/components/WfoForms/formFields/ContactPersonAutocomplete.tsx +97 -0
- package/src/components/WfoForms/formFields/ContactPersonAutocompleteStyles.ts +40 -0
- package/src/components/WfoForms/formFields/ContactPersonNameField.tsx +253 -0
- package/src/components/WfoForms/formFields/DateField.tsx +72 -0
- package/src/components/WfoForms/formFields/DividerField.tsx +29 -0
- package/src/components/WfoForms/formFields/ErrorField.tsx +40 -0
- package/src/components/WfoForms/formFields/ErrorsField.tsx +34 -0
- package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +110 -0
- package/src/components/WfoForms/formFields/IpNetworkField.tsx +128 -0
- package/src/components/WfoForms/formFields/IpPrefixTableField.tsx +454 -0
- package/src/components/WfoForms/formFields/IpPrefixTableFieldStyling.ts +117 -0
- package/src/components/WfoForms/formFields/LabelField.tsx +39 -0
- package/src/components/WfoForms/formFields/ListAddField.tsx +98 -0
- package/src/components/WfoForms/formFields/ListDelField.tsx +95 -0
- package/src/components/WfoForms/formFields/ListField.tsx +113 -0
- package/src/components/WfoForms/formFields/ListItemField.tsx +40 -0
- package/src/components/WfoForms/formFields/ListSelectField.tsx +92 -0
- package/src/components/WfoForms/formFields/LocationCodeField.tsx +66 -0
- package/src/components/WfoForms/formFields/LongTextField.tsx +68 -0
- package/src/components/WfoForms/formFields/NestField.tsx +107 -0
- package/src/components/WfoForms/formFields/NumField.tsx +75 -0
- package/src/components/WfoForms/formFields/OptGroupField.tsx +74 -0
- package/src/components/WfoForms/formFields/OrganisationField.tsx +57 -0
- package/src/components/WfoForms/formFields/ProductField.tsx +78 -0
- package/src/components/WfoForms/formFields/RadioField.tsx +87 -0
- package/src/components/WfoForms/formFields/SelectField.tsx +152 -0
- package/src/components/WfoForms/formFields/SplitPrefix.tsx +163 -0
- package/src/components/WfoForms/formFields/SplitPrefixStyling.ts +11 -0
- package/src/components/WfoForms/formFields/SubmitField.tsx +50 -0
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +351 -0
- package/src/components/WfoForms/formFields/SubscriptionFieldStyling.ts +33 -0
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +75 -0
- package/src/components/WfoForms/formFields/TextField.tsx +71 -0
- package/src/components/WfoForms/formFields/TimestampField.tsx +103 -0
- package/src/components/WfoForms/formFields/VlanField.tsx +297 -0
- package/src/components/WfoForms/formFields/index.ts +29 -0
- package/src/components/WfoForms/formFields/listFieldStyling.ts +86 -0
- package/src/components/WfoForms/formFields/reactSelectStyles.ts +45 -0
- package/src/components/WfoForms/formFields/surf/types.ts +53 -0
- package/src/components/WfoForms/formFields/surf/utils.ts +1 -0
- package/src/components/WfoForms/formFields/types.ts +50 -0
- package/src/components/WfoForms/formFields/utils.spec.ts +196 -0
- package/src/components/WfoForms/formFields/utils.ts +65 -0
- package/src/components/WfoForms/index.ts +5 -0
- package/src/components/WfoForms/useAxiosApiClient.ts +8 -0
- package/src/components/WfoInsyncIcon/WfoInsyncIcon.stories.tsx +21 -0
- package/src/components/WfoInsyncIcon/WfoInsyncIcon.tsx +26 -0
- package/src/components/WfoInsyncIcon/index.ts +1 -0
- package/src/components/WfoJsonCodeBlock/WfoJsonCodeBlock.tsx +27 -0
- package/src/components/WfoJsonCodeBlock/styles.ts +13 -0
- package/src/components/WfoKeyValueTable/WfoKeyCell.tsx +25 -0
- package/src/components/WfoKeyValueTable/WfoKeyValueTable.tsx +41 -0
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +53 -0
- package/src/components/WfoKeyValueTable/index.ts +3 -0
- package/src/components/WfoKeyValueTable/styles.ts +77 -0
- package/src/components/WfoLoading/WfoLoading.tsx +3 -0
- package/src/components/WfoLoading/index.ts +1 -0
- package/src/components/WfoNoResults/WfoNoResults.stories.tsx +19 -0
- package/src/components/WfoNoResults/WfoNoResults.tsx +22 -0
- package/src/components/WfoNoResults/index.ts +1 -0
- package/src/components/WfoNoResults/styles.ts +22 -0
- package/src/components/WfoPageHeader/WfoPageHeader.tsx +25 -0
- package/src/components/{WFOPageTemplate/WFOBreadcrumbs/WFOBreadcrumbs.tsx → WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx} +5 -2
- package/src/components/WfoPageTemplate/WfoBreadcrumbs/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOPageHeader/WFOPageHeader.stories.tsx → WfoPageTemplate/WfoPageHeader/WfoPageHeader.stories.tsx} +7 -5
- package/src/components/{WFOPageTemplate/WFOPageHeader/WFOPageHeader.tsx → WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx} +26 -11
- package/src/components/WfoPageTemplate/WfoPageHeader/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.stories.tsx → WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.stories.tsx} +8 -6
- package/src/components/{WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.tsx → WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx} +20 -10
- package/src/components/WfoPageTemplate/WfoPageTemplate/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOSidebar/WFOSidebar.stories.tsx → WfoPageTemplate/WfoSidebar/WfoSidebar.stories.tsx} +6 -4
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +161 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +58 -0
- package/src/components/WfoPageTemplate/WfoSidebar/index.ts +1 -0
- package/src/components/WfoPageTemplate/index.ts +4 -0
- package/src/components/{WFOPageTemplate → WfoPageTemplate}/paths.ts +1 -1
- package/src/components/WfoProcessesList/WfoProcessList.tsx +227 -0
- package/src/components/WfoProcessesList/processListObjectMappers.ts +79 -0
- package/src/components/{WFOSearchBar/WFOSearchField.tsx → WfoSearchBar/WfoSearchField.tsx} +4 -3
- package/src/components/WfoSearchBar/index.ts +1 -0
- package/src/components/WfoSettingsModal/WfoInformationModal.tsx +41 -0
- package/src/components/{WFOSettingsModal/WFOSettingsModal.tsx → WfoSettingsModal/WfoSettingsModal.tsx} +3 -2
- package/src/components/WfoSettingsModal/index.tsx +2 -0
- package/src/components/{WFOSettingsPage/WFOEngineStatusButton.tsx → WfoSettingsPage/WfoEngineStatusButton.tsx} +5 -3
- package/src/components/{WFOSettingsPage/WFOFlushSettings.tsx → WfoSettingsPage/WfoFlushSettings.tsx} +19 -30
- package/src/components/{WFOSettingsPage/WFOModifySettings.tsx → WfoSettingsPage/WfoModifySettings.tsx} +7 -5
- package/src/components/{WFOSettingsPage/WFOSettings.tsx → WfoSettingsPage/WfoSettings.tsx} +12 -8
- package/src/components/{WFOSettingsPage/WFOStatus.tsx → WfoSettingsPage/WfoStatus.tsx} +8 -6
- package/src/components/WfoSettingsPage/index.ts +1 -0
- package/src/components/{WFOStartPage/WFOFrequentlyUsed.stories.tsx → WfoStartPage/WfoFrequentlyUsed.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOFrequentlyUsed.tsx → WfoStartPage/WfoFrequentlyUsed.tsx} +4 -3
- package/src/components/{WFOStartPage/WFOListItemStartPage.stories.tsx → WfoStartPage/WfoListItemStartPage.stories.tsx} +6 -4
- package/src/components/{WFOStartPage/WFOListItemStartPage.tsx → WfoStartPage/WfoListItemStartPage.tsx} +9 -6
- package/src/components/{WFOStartPage/WFOListStartPage.stories.tsx → WfoStartPage/WfoListStartPage.stories.tsx} +6 -4
- package/src/components/{WFOStartPage/WFOListStartPage.tsx → WfoStartPage/WfoListStartPage.tsx} +9 -6
- package/src/components/{WFOStartPage/WFOMultiListSection.stories.tsx → WfoStartPage/WfoMultiListSection.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOMultiListSection.tsx → WfoStartPage/WfoMultiListSection.tsx} +9 -6
- package/src/components/WfoStartPage/WfoNewProcessPanel.stories.tsx +13 -0
- package/src/components/{WFOStartPage/WFONewProcessPanel.tsx → WfoStartPage/WfoNewProcessPanel.tsx} +5 -3
- package/src/components/WfoStartPage/WfoStatCards.stories.tsx +13 -0
- package/src/components/{WFOStartPage/WFOStatCards.tsx → WfoStartPage/WfoStatCards.tsx} +6 -4
- package/src/components/WfoStartPage/index.ts +6 -0
- package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +51 -0
- package/src/components/WfoStartTaskButtonComboBox/index.ts +1 -0
- package/src/components/WfoSubscription/SubscriptionKeyValueBlock.tsx +46 -0
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +158 -0
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +192 -0
- package/src/components/WfoSubscription/WfoSubscription.tsx +145 -0
- package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +236 -0
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +161 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +147 -0
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +207 -0
- package/src/components/WfoSubscription/index.ts +8 -0
- package/src/components/WfoSubscription/styles.ts +104 -0
- package/src/components/WfoSubscription/utils/index.ts +1 -0
- package/src/components/WfoSubscription/utils/utils.spec.ts +168 -0
- package/src/components/WfoSubscription/utils/utils.ts +76 -0
- package/src/components/{WFOSubscriptionsList/WFOSubscriptionsList.tsx → WfoSubscriptionsList/WfoSubscriptionsList.tsx} +63 -57
- package/src/components/{WFOSubscriptionsList → WfoSubscriptionsList}/index.ts +1 -2
- package/src/components/{WFOSubscriptionsList → WfoSubscriptionsList}/mapGrapghQlSubscriptionsResultToSubscriptionListItems.ts +16 -7
- package/src/components/{WFOSubscriptionsList → WfoSubscriptionsList}/subscriptionListTabs.ts +18 -18
- package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +178 -0
- package/src/components/{WFOTable/WFOSortDirectionIcon.tsx → WfoTable/WfoBasicTable/WfoSortDirectionIcon.tsx} +8 -8
- package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +21 -0
- package/src/components/WfoTable/WfoBasicTable/WfoTableHeaderCell.tsx +120 -0
- package/src/components/WfoTable/WfoBasicTable/index.ts +4 -0
- package/src/components/WfoTable/WfoBasicTable/styles.ts +73 -0
- package/src/components/{WFOTable/WFODataGridTable/WFODataGridTable.stories.tsx → WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx} +9 -7
- package/src/components/{WFOTable/WFODataGridTable/WFODataGridTable.tsx → WfoTable/WfoDataGridTable/WfoDataGridTable.tsx} +23 -21
- package/src/components/{WFOTable/WFODataGridTable/WFOdataGridColumns.spec.ts → WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts} +7 -7
- package/src/components/{WFOTable/WFODataGridTable/WFOdataGridColumns.ts → WfoTable/WfoDataGridTable/WfodataGridColumns.ts} +8 -7
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +11 -0
- package/src/components/WfoTable/WfoFirstPartUUID/index.ts +1 -0
- package/src/components/WfoTable/WfoSortButtons/WfoSortButton.tsx +31 -0
- package/src/components/WfoTable/WfoSortButtons/WfoSortButtons.tsx +33 -0
- package/src/components/WfoTable/WfoSortButtons/index.ts +2 -0
- package/src/components/WfoTable/WfoSortButtons/styles.ts +20 -0
- package/src/components/{WFOTable/WFOTableSettingsModal/WFOTableSettingsModal.tsx → WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx} +5 -3
- package/src/components/WfoTable/WfoTableSettingsModal/index.ts +1 -0
- package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +253 -0
- package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -0
- package/src/components/WfoTable/index.ts +15 -0
- package/src/components/{WFOTable → WfoTable}/utils/columns.ts +27 -16
- package/src/components/{WFOTable → WfoTable}/utils/constants.ts +3 -1
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +52 -0
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +21 -0
- package/src/components/{WFOTable → WfoTable}/utils/tableConfigPersistence.spec.ts +4 -4
- package/src/components/{WFOTable → WfoTable}/utils/tableConfigPersistence.ts +12 -16
- package/src/components/{WFOTable → WfoTable}/utils/tableUtils.spec.ts +1 -1
- package/src/components/{WFOTable → WfoTable}/utils/tableUtils.ts +6 -25
- package/src/components/WfoTimeline/WfoTimeline.tsx +69 -0
- package/src/components/WfoTimeline/WfoTimelineStep.tsx +57 -0
- package/src/components/WfoTimeline/index.ts +1 -0
- package/src/components/WfoTimeline/mapProcessStepStatusToEuiStepStatus.ts +23 -0
- package/src/components/WfoTimeline/styles.ts +165 -0
- package/src/components/WfoTimeline/timelineUtils.ts +14 -0
- package/src/components/WfoToastsList/WfoToastsList.tsx +22 -0
- package/src/components/WfoToastsList/index.ts +1 -0
- package/src/components/WfoTree/WfoTree.tsx +27 -0
- package/src/components/{WFOTree/WFOTreeBranch.tsx → WfoTree/WfoTreeBranch.tsx} +7 -6
- package/src/components/{WFOTree/WFOTreeNode.tsx → WfoTree/WfoTreeNode.tsx} +28 -13
- package/src/components/WfoTree/index.ts +4 -0
- package/src/components/WfoTree/styles.ts +18 -0
- package/src/components/WfoTree/treeUtils.spec.ts +100 -0
- package/src/components/WfoTree/treeUtils.ts +21 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.stories.tsx +13 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +167 -0
- package/src/components/WfoWorkflowSteps/WfoStep/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +107 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.stories.tsx +16 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +114 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +139 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.stories.tsx +56 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +121 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/index.ts +2 -0
- package/src/components/WfoWorkflowSteps/index.ts +4 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.spec.ts +26 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.ts +56 -0
- package/src/components/WfoWorkflowSteps/styles.ts +121 -0
- package/src/components/confirmationDialog/ConfirmationDialogStyling.ts +12 -0
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +112 -0
- package/src/components/confirmationDialog/index.ts +1 -0
- package/src/components/index.ts +19 -11
- package/src/contexts/ApiClientContext.tsx +30 -0
- package/src/contexts/ConfirmationDialogProvider.tsx +99 -0
- package/src/contexts/OrchestratorConfigContext.tsx +8 -3
- package/src/contexts/ToastContext.tsx +136 -0
- package/src/contexts/TreeContext.tsx +53 -32
- package/src/contexts/index.ts +3 -1
- package/src/graphqlQueries/customersQuery.ts +19 -0
- package/src/graphqlQueries/index.ts +4 -0
- package/src/graphqlQueries/processDetailQuery.ts +45 -0
- package/src/graphqlQueries/processListQuery.ts +17 -7
- package/src/graphqlQueries/productBlocksQuery.ts +13 -1
- package/src/graphqlQueries/productsQuery.ts +5 -1
- package/src/graphqlQueries/relatedSubscriptionsQuery.ts +65 -0
- package/src/graphqlQueries/resourceTypesQuery.ts +13 -2
- package/src/graphqlQueries/subscriptionDetailQuery.ts +62 -0
- package/src/graphqlQueries/subscriptionsDropdownOptionsQuery.ts +47 -0
- package/src/graphqlQueries/subscriptionsListQuery.ts +4 -0
- package/src/graphqlQueries/{workflowsQuery.ts → workflows/workflowsQuery.ts} +9 -3
- package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +41 -0
- package/src/hooks/DataFetchHooks.ts +72 -49
- package/src/hooks/ProcessesHooks/useDeleteProcess.ts +37 -0
- package/src/hooks/index.ts +4 -1
- package/src/hooks/surf/useGetSubscriptionDropdownOptions.ts +47 -0
- package/src/hooks/surf/useIsTaggedPort.ts +29 -0
- package/src/hooks/useDataDisplayParams.ts +1 -1
- package/src/hooks/useEngineStatusQuery.ts +20 -10
- package/src/hooks/useOrchestratorConfig.ts +6 -2
- package/src/hooks/useProcessStatusCountsQuery.ts +8 -23
- package/src/hooks/useQueryWithFetch.ts +33 -0
- package/src/hooks/useQueryWithGraphql.ts +18 -13
- package/src/hooks/useSessionWithToken.ts +14 -0
- package/src/hooks/useStoredTableConfig.ts +43 -0
- package/src/hooks/useSubscriptionActions.ts +3 -3
- package/src/hooks/useToastMessage.ts +5 -0
- package/src/hooks/useWithOrchestratorTheme.ts +10 -0
- package/src/icons/WfoArrowNarrowDown.stories.tsx +13 -0
- package/src/icons/{WFOArrowNarrowDown.tsx → WfoArrowNarrowDown.tsx} +4 -2
- package/src/icons/WfoArrowNarrowUp.stories.tsx +13 -0
- package/src/icons/{WFOArrowNarrowUp.tsx → WfoArrowNarrowUp.tsx} +4 -2
- package/src/icons/WfoArrowsExpand.stories.tsx +13 -0
- package/src/icons/WfoArrowsExpand.tsx +33 -0
- package/src/icons/WfoCheckmarkCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOCheckmarkCircleFill.tsx → WfoCheckmarkCircleFill.tsx} +3 -2
- package/src/icons/WfoChevronDown.stories.tsx +13 -0
- package/src/icons/{WFOChevronDown.tsx → WfoChevronDown.tsx} +3 -2
- package/src/icons/WfoChevronUp.stories.tsx +13 -0
- package/src/icons/WfoChevronUp.tsx +33 -0
- package/src/icons/WfoClipboardCopy.stories.tsx +13 -0
- package/src/icons/WfoClipboardCopy.tsx +33 -0
- package/src/icons/WfoCode.stories.tsx +13 -0
- package/src/icons/WfoCode.tsx +35 -0
- package/src/icons/WfoCogFill.stories.tsx +13 -0
- package/src/icons/WfoCogFill.tsx +35 -0
- package/src/icons/WfoEyeFill.stories.tsx +13 -0
- package/src/icons/WfoEyeFill.tsx +35 -0
- package/src/icons/{WFOIconProps.ts → WfoIconProps.ts} +1 -1
- package/src/icons/WfoLogoutIcon.stories.tsx +13 -0
- package/src/icons/{WFOLogoutIcon.tsx → WfoLogoutIcon.tsx} +3 -2
- package/src/icons/WfoMinusCircleFill.stories.tsx +13 -0
- package/src/icons/WfoMinusCircleFill.tsx +33 -0
- package/src/icons/WfoMinusCircleOutline.stories.tsx +13 -0
- package/src/icons/{WFOMinusCircleOutline.tsx → WfoMinusCircleOutline.tsx} +3 -2
- package/src/icons/WfoPencilAlt.stories.tsx +13 -0
- package/src/icons/WfoPencilAlt.tsx +33 -0
- package/src/icons/WfoPlayFill.stories.tsx +13 -0
- package/src/icons/WfoPlayFill.tsx +35 -0
- package/src/icons/WfoPlusCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOPlusCircleFill.tsx → WfoPlusCircleFill.tsx} +3 -2
- package/src/icons/WfoRefresh.stories.tsx +13 -0
- package/src/icons/WfoRefresh.tsx +35 -0
- package/src/icons/WfoSearchStrikethrough.stories.tsx +13 -0
- package/src/icons/WfoSearchStrikethrough.tsx +33 -0
- package/src/icons/WfoSortAsc.stories.tsx +13 -0
- package/src/icons/WfoSortAsc.tsx +33 -0
- package/src/icons/WfoSortDesc.stories.tsx +13 -0
- package/src/icons/WfoSortDesc.tsx +33 -0
- package/src/icons/WfoStatistic.tsx +41 -0
- package/src/icons/WfoStatusDotIcon.stories.tsx +13 -0
- package/src/icons/{WFOStatusDotIcon.tsx → WfoStatusDotIcon.tsx} +3 -2
- package/src/icons/WfoXCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOXCircleFill.tsx → WfoXCircleFill.tsx} +3 -2
- package/src/icons/index.ts +22 -10
- package/src/index.ts +1 -0
- package/src/messages/en-US.json +173 -20
- package/src/messages/getTranslationMessages.spec.ts +1 -1
- package/src/messages/getTranslationMessages.ts +1 -1
- package/src/messages/nl-NL.json +177 -22
- package/src/pages/index.ts +2 -0
- package/src/pages/metadata/{WFOMetadataPageLayout.tsx → WfoMetadataPageLayout.tsx} +5 -3
- package/src/pages/metadata/WfoProductBlocksPage.tsx +239 -0
- package/src/pages/metadata/{WFOProductsPage.tsx → WfoProductsPage.tsx} +96 -54
- package/src/pages/metadata/WfoResourceTypesPage.tsx +185 -0
- package/src/pages/metadata/WfoWorkflowsPage.tsx +194 -0
- package/src/pages/metadata/index.ts +4 -4
- package/src/pages/metadata/workflowListObjectMapper.ts +43 -0
- package/src/pages/processes/WfoProcessDetail.tsx +327 -0
- package/src/pages/processes/WfoProcessDetailPage.tsx +88 -0
- package/src/pages/processes/WfoProcessListPage.tsx +106 -0
- package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +72 -0
- package/src/pages/processes/getProcessListTabTypeFromString.ts +6 -6
- package/src/pages/processes/index.ts +3 -2
- package/src/pages/processes/tabConfig.ts +28 -10
- package/src/pages/processes/timelineUtils.spec.ts +202 -0
- package/src/pages/processes/timelineUtils.ts +113 -0
- package/src/pages/subscriptions/WfoSubscriptionDetailPage.tsx +19 -0
- package/src/pages/subscriptions/{WFOSubscriptionsListPage.tsx → WfoSubscriptionsListPage.tsx} +40 -20
- package/src/pages/subscriptions/index.ts +2 -1
- package/src/pages/tasks/WfoTaskListPage.tsx +120 -0
- package/src/pages/tasks/index.ts +1 -0
- package/src/pages/workflow/WfoStartWorkflowPage.tsx +176 -0
- package/src/pages/workflow/index.ts +1 -0
- package/src/stories/Button.jsx +45 -39
- package/src/stories/Configure.mdx +48 -43
- package/src/stories/Header.jsx +59 -45
- package/src/stories/Page.jsx +81 -60
- package/src/stories/Page.stories.js +2 -1
- package/src/stories/button.css +18 -18
- package/src/stories/colors.mdx +12 -0
- package/src/stories/colors.tsx +27 -0
- package/src/stories/header.css +18 -18
- package/src/stories/page.css +40 -40
- package/src/theme/defaultOrchestratorTheme.ts +16 -0
- package/src/types/forms.ts +40 -0
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +283 -73
- package/src/utils/date.spec.ts +157 -5
- package/src/utils/date.ts +66 -5
- package/src/utils/environmentVariables.spec.ts +17 -0
- package/src/utils/environmentVariables.ts +12 -0
- package/src/utils/getDefaultTableConfig.ts +101 -0
- package/src/utils/getProductNamesFromProcess.spec.ts +133 -0
- package/src/utils/getProductNamesFromProcess.ts +16 -0
- package/src/utils/getTokenName.ts +2 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/string.spec.ts +24 -1
- package/src/utils/strings.ts +5 -0
- package/tsconfig.build.json +18 -0
- package/tsconfig.json +8 -2
- package/src/components/WFOBadges/WFOBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOEngineStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOEnvironmentBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.stories.tsx +0 -12
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.tsx +0 -63
- package/src/components/WFOBadges/WFOFailedTasksBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOHeaderBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOProcessStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOProductBlockBadge/WFOProductBlockBadge.stories.tsx +0 -15
- package/src/components/WFOBadges/WFOProductBlockBadge/WFOProductBlockBadge.tsx +0 -22
- package/src/components/WFOBadges/WFOProductBlockBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOSubscriptionStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/index.ts +0 -8
- package/src/components/WFOFilterTabs/index.ts +0 -1
- package/src/components/WFOLoading/WFOLoading.tsx +0 -2
- package/src/components/WFOLoading/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOBreadcrumbs/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageHeader/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageTemplate/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOSidebar/WFOSidebar.tsx +0 -161
- package/src/components/WFOPageTemplate/WFOSidebar/index.ts +0 -1
- package/src/components/WFOPageTemplate/index.ts +0 -4
- package/src/components/WFOSearchBar/index.ts +0 -1
- package/src/components/WFOSettingsModal/index.tsx +0 -1
- package/src/components/WFOSettingsPage/index.ts +0 -1
- package/src/components/WFOStartPage/WFONewProcessPanel.stories.tsx +0 -12
- package/src/components/WFOStartPage/WFOStatCards.stories.tsx +0 -12
- package/src/components/WFOStartPage/index.ts +0 -6
- package/src/components/WFOSubscription/WFOFixedInputBlock.tsx +0 -58
- package/src/components/WFOSubscription/WFOProcessesTimeline.tsx +0 -105
- package/src/components/WFOSubscription/WFOProductBlock.tsx +0 -186
- package/src/components/WFOSubscription/WFOSubscriptionActions.tsx +0 -138
- package/src/components/WFOSubscription/WFOSubscriptionBlock.tsx +0 -109
- package/src/components/WFOSubscription/WFOSubscriptionDetailTree.tsx +0 -184
- package/src/components/WFOSubscription/WFOSubscriptionGeneral.tsx +0 -53
- package/src/components/WFOSubscription/index.ts +0 -7
- package/src/components/WFOSubscription/styles.ts +0 -18
- package/src/components/WFOSubscriptionsList/types.ts +0 -11
- package/src/components/WFOTable/WFOTable.tsx +0 -85
- package/src/components/WFOTable/WFOTableHeaderCell.tsx +0 -30
- package/src/components/WFOTable/WFOTableSettingsModal/index.ts +0 -1
- package/src/components/WFOTable/WFOTableWithFilter/WFOTableWithFilter.tsx +0 -174
- package/src/components/WFOTable/WFOTableWithFilter/index.ts +0 -1
- package/src/components/WFOTable/index.ts +0 -14
- package/src/components/WFOTree/WFOTree.tsx +0 -16
- package/src/contexts/SubscriptionContext.tsx +0 -72
- package/src/hooks/useSubscriptionProcesses.ts +0 -45
- package/src/icons/WFOCheckmarkCircleFill.stories.tsx +0 -12
- package/src/icons/WFOLogoutIcon.stories.tsx +0 -12
- package/src/icons/WFOMinusCircleOutline.stories.tsx +0 -12
- package/src/icons/WFOPlusCircleFill.stories.tsx +0 -12
- package/src/icons/WFOStatusDotIcon.stories.tsx +0 -12
- package/src/icons/WFOXCircleFill.stories.tsx +0 -12
- package/src/pages/metadata/WFOProductBlocksPage.tsx +0 -166
- package/src/pages/metadata/WFOResourceTypesPage.tsx +0 -120
- package/src/pages/metadata/WFOWorkflowsPage.tsx +0 -251
- package/src/pages/processes/WFOProcessListPage.tsx +0 -213
- package/src/pages/processes/WFOProcessesListSubscriptionsCell.tsx +0 -28
- package/src/pages/processes/tableConfig.ts +0 -22
- package/src/types/subscription.ts +0 -21
- package/src/components/{WFOTable → WfoTable}/utils/columns.spec.ts +1 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiBasicTable, EuiBasicTableColumn, Pagination } from '@elastic/eui';
|
|
4
|
+
import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table';
|
|
5
|
+
|
|
6
|
+
import { useOrchestratorTheme } from '../../../hooks';
|
|
7
|
+
import { SortOrder } from '../../../types';
|
|
8
|
+
import type {
|
|
9
|
+
TableColumnKeys,
|
|
10
|
+
WfoDataSearch,
|
|
11
|
+
WfoDataSorting,
|
|
12
|
+
} from '../utils/columns';
|
|
13
|
+
import {
|
|
14
|
+
WFO_STATUS_COLOR_FIELD,
|
|
15
|
+
WfoTableControlColumnConfig,
|
|
16
|
+
WfoTableDataColumnConfig,
|
|
17
|
+
} from '../utils/columns';
|
|
18
|
+
import { WfoStatusColorField } from './WfoStatusColorField';
|
|
19
|
+
import { WfoTableHeaderCell } from './WfoTableHeaderCell';
|
|
20
|
+
import { getStyles } from './styles';
|
|
21
|
+
|
|
22
|
+
export type WfoBasicTableColumns<T> = {
|
|
23
|
+
[Property in keyof T]: WfoTableDataColumnConfig<T, Property> & {
|
|
24
|
+
render?: (cellValue: T[Property], row: T) => ReactNode;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type WfoBasicTableColumnsWithControlColumns<T> =
|
|
29
|
+
WfoBasicTableColumns<T> & WfoTableControlColumnConfig<T>;
|
|
30
|
+
|
|
31
|
+
export type WfoBasicTableProps<T> = {
|
|
32
|
+
data: T[];
|
|
33
|
+
columns:
|
|
34
|
+
| WfoBasicTableColumnsWithControlColumns<T>
|
|
35
|
+
| WfoBasicTableColumns<T>;
|
|
36
|
+
hiddenColumns?: TableColumnKeys<T>;
|
|
37
|
+
dataSorting?: WfoDataSorting<T>;
|
|
38
|
+
pagination?: Pagination;
|
|
39
|
+
isLoading?: boolean;
|
|
40
|
+
onCriteriaChange?: (criteria: Criteria<T>) => void;
|
|
41
|
+
onUpdateDataSorting?: (updatedDataSorting: WfoDataSorting<T>) => void;
|
|
42
|
+
onDataSearch?: (updatedDataSearch: WfoDataSearch<T>) => void;
|
|
43
|
+
getStatusColorForRow?: (row: T) => string;
|
|
44
|
+
isExpandable?: boolean;
|
|
45
|
+
itemIdToExpandedRowMap?: Record<string, ReactNode>;
|
|
46
|
+
itemId?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const WfoBasicTable = <T,>({
|
|
50
|
+
data,
|
|
51
|
+
columns,
|
|
52
|
+
hiddenColumns,
|
|
53
|
+
dataSorting,
|
|
54
|
+
pagination,
|
|
55
|
+
isLoading,
|
|
56
|
+
onCriteriaChange,
|
|
57
|
+
onUpdateDataSorting,
|
|
58
|
+
onDataSearch,
|
|
59
|
+
getStatusColorForRow,
|
|
60
|
+
isExpandable,
|
|
61
|
+
itemIdToExpandedRowMap,
|
|
62
|
+
itemId,
|
|
63
|
+
}: WfoBasicTableProps<T>) => {
|
|
64
|
+
const { theme } = useOrchestratorTheme();
|
|
65
|
+
const { basicTableStyle, getStatusColumnStyle } = getStyles(theme);
|
|
66
|
+
|
|
67
|
+
const statusColorColumn: WfoTableControlColumnConfig<T> = {
|
|
68
|
+
statusColorField: {
|
|
69
|
+
field: WFO_STATUS_COLOR_FIELD,
|
|
70
|
+
name: '',
|
|
71
|
+
width: theme.size.xs,
|
|
72
|
+
render: (_, row) =>
|
|
73
|
+
getStatusColorForRow ? (
|
|
74
|
+
<WfoStatusColorField color={getStatusColorForRow(row)} />
|
|
75
|
+
) : (
|
|
76
|
+
<></>
|
|
77
|
+
),
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const allTableColumns:
|
|
82
|
+
| WfoBasicTableColumnsWithControlColumns<T>
|
|
83
|
+
| WfoBasicTableColumns<T> = getStatusColorForRow
|
|
84
|
+
? { ...statusColorColumn, ...columns }
|
|
85
|
+
: { ...columns };
|
|
86
|
+
|
|
87
|
+
const tableStyling = getStatusColorForRow
|
|
88
|
+
? [basicTableStyle, getStatusColumnStyle(1)]
|
|
89
|
+
: basicTableStyle;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<EuiBasicTable
|
|
93
|
+
css={tableStyling}
|
|
94
|
+
items={data}
|
|
95
|
+
columns={mapWfoTableColumnsToEuiColumns(
|
|
96
|
+
allTableColumns,
|
|
97
|
+
hiddenColumns,
|
|
98
|
+
dataSorting,
|
|
99
|
+
onUpdateDataSorting,
|
|
100
|
+
onDataSearch,
|
|
101
|
+
)}
|
|
102
|
+
pagination={pagination}
|
|
103
|
+
onChange={onCriteriaChange}
|
|
104
|
+
loading={isLoading}
|
|
105
|
+
{...(isExpandable && {
|
|
106
|
+
isExpandable,
|
|
107
|
+
itemIdToExpandedRowMap,
|
|
108
|
+
itemId,
|
|
109
|
+
})}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
function mapWfoTableColumnsToEuiColumns<T>(
|
|
115
|
+
tableColumns: WfoBasicTableColumns<T>,
|
|
116
|
+
hiddenColumns?: TableColumnKeys<T>,
|
|
117
|
+
dataSorting?: WfoDataSorting<T>,
|
|
118
|
+
onDataSort?: (updatedDataSorting: WfoDataSorting<T>) => void,
|
|
119
|
+
onDataSearch?: (updatedDataSearch: WfoDataSearch<T>) => void,
|
|
120
|
+
): EuiBasicTableColumn<T>[] {
|
|
121
|
+
function isVisibleColumn(columnKey: string) {
|
|
122
|
+
return !hiddenColumns?.includes(columnKey as keyof T);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function mapColumnKeyToEuiColumn(colKey: string): EuiBasicTableColumn<T> {
|
|
126
|
+
const typedColumnKey = colKey as keyof T;
|
|
127
|
+
const column: WfoBasicTableColumns<T>[keyof T] =
|
|
128
|
+
tableColumns[typedColumnKey];
|
|
129
|
+
const { name, render, width, description, sortable, filterable } =
|
|
130
|
+
column;
|
|
131
|
+
|
|
132
|
+
// In most cases columns are sortable and filterable, making them optional saves some lines in configuring the table
|
|
133
|
+
const isSortable = sortable ?? true;
|
|
134
|
+
const isFilterable = filterable ?? true;
|
|
135
|
+
|
|
136
|
+
const sortOrder =
|
|
137
|
+
dataSorting?.field === colKey ? dataSorting.sortOrder : undefined;
|
|
138
|
+
|
|
139
|
+
const handleOnSetSortOrder = (updatedSortOrder: SortOrder) =>
|
|
140
|
+
onDataSort?.({
|
|
141
|
+
field: typedColumnKey,
|
|
142
|
+
sortOrder: updatedSortOrder,
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
const handleOnSearch = (searchText: string) =>
|
|
146
|
+
onDataSearch?.({
|
|
147
|
+
field: typedColumnKey,
|
|
148
|
+
searchText,
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Not spreading the column object here as it might contain additional props.
|
|
152
|
+
// EUI does not handle extra props well.
|
|
153
|
+
return {
|
|
154
|
+
render,
|
|
155
|
+
width,
|
|
156
|
+
description,
|
|
157
|
+
field: typedColumnKey,
|
|
158
|
+
name: name && (
|
|
159
|
+
<WfoTableHeaderCell
|
|
160
|
+
fieldName={typedColumnKey.toString()}
|
|
161
|
+
sortOrder={sortOrder}
|
|
162
|
+
onSetSortOrder={
|
|
163
|
+
isSortable ? handleOnSetSortOrder : undefined
|
|
164
|
+
}
|
|
165
|
+
onSearch={isFilterable ? handleOnSearch : undefined}
|
|
166
|
+
>
|
|
167
|
+
{name}
|
|
168
|
+
</WfoTableHeaderCell>
|
|
169
|
+
),
|
|
170
|
+
truncateText: true,
|
|
171
|
+
textOnly: true,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return Object.keys(tableColumns)
|
|
176
|
+
.filter(isVisibleColumn)
|
|
177
|
+
.map(mapColumnKeyToEuiColumn);
|
|
178
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
-
import { useOrchestratorTheme } from '../../hooks/useOrchestratorTheme';
|
|
3
|
-
import { WFOArrowNarrowDown } from '../../icons/WFOArrowNarrowDown';
|
|
4
|
-
import { WFOArrowNarrowUp } from '../../icons/WFOArrowNarrowUp';
|
|
5
|
-
import { SortOrder } from '../../types';
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
import { useOrchestratorTheme } from '../../../hooks';
|
|
4
|
+
import { WfoArrowNarrowDown, WfoArrowNarrowUp } from '../../../icons';
|
|
5
|
+
import { SortOrder } from '../../../types';
|
|
6
|
+
|
|
7
|
+
export type WfoSortDirectionIconProps = {
|
|
8
8
|
sortDirection: SortOrder;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const WfoSortDirectionIcon: FC<WfoSortDirectionIconProps> = ({
|
|
12
12
|
sortDirection,
|
|
13
13
|
}) => {
|
|
14
14
|
const { theme } = useOrchestratorTheme();
|
|
15
15
|
|
|
16
16
|
return sortDirection === SortOrder.ASC ? (
|
|
17
|
-
<
|
|
17
|
+
<WfoArrowNarrowUp
|
|
18
18
|
color={theme.colors.subduedText}
|
|
19
19
|
height={24}
|
|
20
20
|
width={24}
|
|
21
21
|
/>
|
|
22
22
|
) : (
|
|
23
|
-
<
|
|
23
|
+
<WfoArrowNarrowDown
|
|
24
24
|
color={theme.colors.subduedText}
|
|
25
25
|
height={24}
|
|
26
26
|
width={24}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiFlexItem, tint } from '@elastic/eui';
|
|
4
|
+
|
|
5
|
+
export type WfoStatusColorFieldProps = {
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const toStatusColorFieldColor = (color: string) => tint(color, 0.3);
|
|
10
|
+
|
|
11
|
+
export const WfoStatusColorField = ({ color }: WfoStatusColorFieldProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<EuiFlexItem
|
|
14
|
+
css={{
|
|
15
|
+
backgroundColor: toStatusColorFieldColor(color),
|
|
16
|
+
height: '100%',
|
|
17
|
+
width: '100%',
|
|
18
|
+
}}
|
|
19
|
+
></EuiFlexItem>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { FC, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
EuiFieldSearch,
|
|
7
|
+
EuiHorizontalRule,
|
|
8
|
+
EuiPopover,
|
|
9
|
+
EuiText,
|
|
10
|
+
useGeneratedHtmlId,
|
|
11
|
+
} from '@elastic/eui';
|
|
12
|
+
|
|
13
|
+
import { useWithOrchestratorTheme } from '../../../hooks';
|
|
14
|
+
import { SortOrder } from '../../../types';
|
|
15
|
+
import { WfoSortButtons } from '../WfoSortButtons';
|
|
16
|
+
import { WfoSortDirectionIcon } from './WfoSortDirectionIcon';
|
|
17
|
+
import { getStyles } from './styles';
|
|
18
|
+
|
|
19
|
+
export type WfoTableHeaderCellProps = {
|
|
20
|
+
fieldName: string;
|
|
21
|
+
sortOrder?: SortOrder;
|
|
22
|
+
onSetSortOrder?: (updatedSortOrder: SortOrder) => void;
|
|
23
|
+
onSearch?: (searchText: string) => void;
|
|
24
|
+
children: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const WfoTableHeaderCell: FC<WfoTableHeaderCellProps> = ({
|
|
28
|
+
fieldName,
|
|
29
|
+
sortOrder,
|
|
30
|
+
children,
|
|
31
|
+
onSetSortOrder,
|
|
32
|
+
onSearch,
|
|
33
|
+
}) => {
|
|
34
|
+
const {
|
|
35
|
+
headerCellContentStyle,
|
|
36
|
+
headerCellPopoverHeaderStyle,
|
|
37
|
+
headerCellPopoverHeaderTitleStyle,
|
|
38
|
+
headerCellPopoverContentStyle,
|
|
39
|
+
getHeaderCellButtonStyle,
|
|
40
|
+
} = useWithOrchestratorTheme(getStyles);
|
|
41
|
+
const t = useTranslations('common');
|
|
42
|
+
|
|
43
|
+
const isSortable = !!onSetSortOrder;
|
|
44
|
+
const isFilterable = !!onSearch;
|
|
45
|
+
const shouldShowPopover = isSortable || isFilterable;
|
|
46
|
+
|
|
47
|
+
const smallContextMenuPopoverId = useGeneratedHtmlId({
|
|
48
|
+
prefix: 'smallContextMenuPopover',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const [isPopoverOpen, setPopover] = useState(false);
|
|
52
|
+
const handleButtonClick = () => setPopover(!isPopoverOpen);
|
|
53
|
+
const closePopover = () => setPopover(false);
|
|
54
|
+
|
|
55
|
+
const handleChangeSortOrder = (updatedSortOrder: SortOrder) => {
|
|
56
|
+
onSetSortOrder?.(updatedSortOrder);
|
|
57
|
+
closePopover();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const handleSearch = (searchText: string) => {
|
|
61
|
+
onSearch?.(searchText);
|
|
62
|
+
closePopover();
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const WfoHeaderCellContentButton = () => (
|
|
66
|
+
<button onClick={handleButtonClick} disabled={!shouldShowPopover}>
|
|
67
|
+
<div css={getHeaderCellButtonStyle(shouldShowPopover)}>
|
|
68
|
+
<div css={headerCellContentStyle}>{children}</div>
|
|
69
|
+
{sortOrder && (
|
|
70
|
+
<WfoSortDirectionIcon sortDirection={sortOrder} />
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
</button>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const WfoPopoverHeader = () => (
|
|
77
|
+
<div css={headerCellPopoverHeaderStyle}>
|
|
78
|
+
<EuiText size="xs" css={headerCellPopoverHeaderTitleStyle}>
|
|
79
|
+
{children}
|
|
80
|
+
</EuiText>
|
|
81
|
+
{isSortable && (
|
|
82
|
+
<WfoSortButtons
|
|
83
|
+
sortOrder={sortOrder}
|
|
84
|
+
onChangeSortOrder={handleChangeSortOrder}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const WfoPopoverContent = () => (
|
|
91
|
+
<div css={headerCellPopoverContentStyle}>
|
|
92
|
+
<EuiFieldSearch
|
|
93
|
+
className={fieldName}
|
|
94
|
+
placeholder={t('search')}
|
|
95
|
+
onSearch={handleSearch}
|
|
96
|
+
isClearable={false}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<EuiPopover
|
|
103
|
+
initialFocus={`.euiPanel .euiFieldSearch.${fieldName}`}
|
|
104
|
+
id={smallContextMenuPopoverId}
|
|
105
|
+
button={<WfoHeaderCellContentButton />}
|
|
106
|
+
isOpen={isPopoverOpen}
|
|
107
|
+
closePopover={closePopover}
|
|
108
|
+
panelPaddingSize="none"
|
|
109
|
+
anchorPosition="downLeft"
|
|
110
|
+
>
|
|
111
|
+
<WfoPopoverHeader />
|
|
112
|
+
{isFilterable && (
|
|
113
|
+
<>
|
|
114
|
+
<EuiHorizontalRule margin="none" />
|
|
115
|
+
<WfoPopoverContent />
|
|
116
|
+
</>
|
|
117
|
+
)}
|
|
118
|
+
</EuiPopover>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
export const getStyles = (theme: EuiThemeComputed) => {
|
|
5
|
+
const radius = theme.border.radius.medium;
|
|
6
|
+
|
|
7
|
+
const basicTableStyle = css({
|
|
8
|
+
'.euiTableCellContent__text': {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
},
|
|
11
|
+
thead: {
|
|
12
|
+
backgroundColor: theme.colors.lightShade,
|
|
13
|
+
'tr>:first-child': {
|
|
14
|
+
borderTopLeftRadius: radius,
|
|
15
|
+
},
|
|
16
|
+
'tr>:last-child': {
|
|
17
|
+
borderTopRightRadius: radius,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
'tr.euiTableRow:hover': {
|
|
21
|
+
backgroundColor: theme.colors.lightestShade,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const getStatusColumnStyle = (columnNumber: number) =>
|
|
26
|
+
css({
|
|
27
|
+
[`tbody tr td:nth-child(${columnNumber}) .euiTableCellContent`]: {
|
|
28
|
+
padding: 0,
|
|
29
|
+
'.euiTableCellContent__text': {
|
|
30
|
+
flex: 1,
|
|
31
|
+
'> *': {
|
|
32
|
+
paddingBlock: theme.base * 1.25,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const headerCellContentStyle = css({
|
|
39
|
+
fontWeight: theme.font.weight.semiBold,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const headerCellPopoverHeaderStyle = css({
|
|
43
|
+
margin: theme.size.m,
|
|
44
|
+
display: 'flex',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const headerCellPopoverHeaderTitleStyle = css({
|
|
50
|
+
fontWeight: theme.font.weight.medium,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const headerCellPopoverContentStyle = css({
|
|
54
|
+
margin: theme.size.m,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const getHeaderCellButtonStyle = (isSortable: boolean) =>
|
|
58
|
+
css({
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
cursor: isSortable ? 'pointer' : 'not-allowed',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
basicTableStyle,
|
|
66
|
+
headerCellContentStyle,
|
|
67
|
+
headerCellPopoverHeaderStyle,
|
|
68
|
+
headerCellPopoverHeaderTitleStyle,
|
|
69
|
+
headerCellPopoverContentStyle,
|
|
70
|
+
getHeaderCellButtonStyle,
|
|
71
|
+
getStatusColumnStyle,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react';
|
|
2
1
|
import React, { useState } from 'react';
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react';
|
|
4
|
+
|
|
4
5
|
import { SortOrder } from '../../../types';
|
|
5
|
-
import {
|
|
6
|
+
import { WfoDataSorting } from '../utils/columns';
|
|
7
|
+
import { WfoDataGridTable } from './WfoDataGridTable';
|
|
6
8
|
|
|
7
9
|
const extractedArr = (arr, start, howMany) =>
|
|
8
10
|
arr.filter((_, index) => index >= start && index < howMany + start);
|
|
@@ -32,7 +34,7 @@ const TableWithEvents = (args) => {
|
|
|
32
34
|
setPageSize(updatedPageSize);
|
|
33
35
|
};
|
|
34
36
|
|
|
35
|
-
const updateDataSorting = (dataSorting:
|
|
37
|
+
const updateDataSorting = (dataSorting: WfoDataSorting<unknown>) => {
|
|
36
38
|
setSorting(dataSorting);
|
|
37
39
|
|
|
38
40
|
const sortData = args.data.sort((a, b) => {
|
|
@@ -46,7 +48,7 @@ const TableWithEvents = (args) => {
|
|
|
46
48
|
setData(extractedArr(sortData, pageIndex, pageIndex + pageSize));
|
|
47
49
|
};
|
|
48
50
|
return (
|
|
49
|
-
<
|
|
51
|
+
<WfoDataGridTable
|
|
50
52
|
{...args}
|
|
51
53
|
data={data}
|
|
52
54
|
pagination={{
|
|
@@ -62,9 +64,9 @@ const TableWithEvents = (args) => {
|
|
|
62
64
|
);
|
|
63
65
|
};
|
|
64
66
|
|
|
65
|
-
const Story: Meta<typeof
|
|
67
|
+
const Story: Meta<typeof WfoDataGridTable> = {
|
|
66
68
|
component: TableWithEvents,
|
|
67
|
-
title: 'Tables/
|
|
69
|
+
title: 'Tables/WfoDataGridTable',
|
|
68
70
|
parameters: { actions: { argTypesRegex: '^on*' } },
|
|
69
71
|
};
|
|
70
72
|
export default Story;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import {
|
|
3
5
|
EuiDataGrid,
|
|
4
6
|
EuiDataGridCellValueElementProps,
|
|
5
7
|
EuiDataGridStyle,
|
|
6
8
|
} from '@elastic/eui';
|
|
7
|
-
import { useRef, useState } from 'react';
|
|
8
|
-
import {
|
|
9
|
-
mapColumnSortToEuiDataGridSorting,
|
|
10
|
-
WFOControlColumn,
|
|
11
|
-
getInitialColumnOrder,
|
|
12
|
-
WFODataGridTableColumns,
|
|
13
|
-
} from './WFOdataGridColumns';
|
|
14
9
|
import {
|
|
15
10
|
EuiDataGridControlColumn,
|
|
16
11
|
EuiDataGridPaginationProps,
|
|
17
12
|
} from '@elastic/eui/src/components/datagrid/data_grid_types';
|
|
18
|
-
|
|
13
|
+
|
|
14
|
+
import { TableColumnKeys, WfoDataSorting } from '../utils/columns';
|
|
15
|
+
import { DEFAULT_PAGE_SIZE } from '../utils/constants';
|
|
16
|
+
import {
|
|
17
|
+
WfoControlColumn,
|
|
18
|
+
WfoDataGridTableColumns,
|
|
19
|
+
getInitialColumnOrder,
|
|
20
|
+
mapColumnSortToEuiDataGridSorting,
|
|
21
|
+
} from './WfodataGridColumns';
|
|
19
22
|
|
|
20
23
|
// Total height of grid button bar, table header and pagination bar
|
|
21
24
|
const EUI_DATA_GRID_HEIGHT_OFFSET = 103;
|
|
@@ -35,19 +38,19 @@ export type Pagination = EuiDataGridPaginationProps & {
|
|
|
35
38
|
totalRecords: number;
|
|
36
39
|
};
|
|
37
40
|
|
|
38
|
-
export type
|
|
41
|
+
export type WfoDataGridTableProps<T> = {
|
|
39
42
|
data: T[];
|
|
40
43
|
pagination: Pagination;
|
|
41
|
-
columns:
|
|
42
|
-
leadingControlColumns?:
|
|
43
|
-
trailingControlColumns?:
|
|
44
|
+
columns: WfoDataGridTableColumns<T>;
|
|
45
|
+
leadingControlColumns?: WfoControlColumn<T>[];
|
|
46
|
+
trailingControlColumns?: WfoControlColumn<T>[];
|
|
44
47
|
initialColumnOrder: TableColumnKeys<T>;
|
|
45
|
-
dataSorting?:
|
|
48
|
+
dataSorting?: WfoDataSorting<T>;
|
|
46
49
|
handleRowClick?: (row: T) => void;
|
|
47
|
-
updateDataSorting?: (updatedDataSorting:
|
|
50
|
+
updateDataSorting?: (updatedDataSorting: WfoDataSorting<T>) => void;
|
|
48
51
|
};
|
|
49
52
|
|
|
50
|
-
export const
|
|
53
|
+
export const WfoDataGridTable = <T,>({
|
|
51
54
|
data,
|
|
52
55
|
pagination,
|
|
53
56
|
columns,
|
|
@@ -57,7 +60,7 @@ export const WFODataGridTable = <T,>({
|
|
|
57
60
|
dataSorting,
|
|
58
61
|
handleRowClick,
|
|
59
62
|
updateDataSorting,
|
|
60
|
-
}:
|
|
63
|
+
}: WfoDataGridTableProps<T>) => {
|
|
61
64
|
const initialColumnOrderRef = useRef(
|
|
62
65
|
getInitialColumnOrder(columns, initialColumnOrder),
|
|
63
66
|
);
|
|
@@ -66,13 +69,14 @@ export const WFODataGridTable = <T,>({
|
|
|
66
69
|
.filter((columnId) => !columns[columnId].isHiddenByDefault)
|
|
67
70
|
.map((columnId) => columnId.toString());
|
|
68
71
|
const [visibleColumns, setVisibleColumns] = useState(defaultVisibleColumns);
|
|
72
|
+
const pageSize = pagination.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
73
|
+
const { pageIndex } = pagination;
|
|
69
74
|
|
|
70
75
|
const renderCellValue = ({
|
|
71
76
|
rowIndex,
|
|
72
77
|
columnId,
|
|
73
78
|
setCellProps,
|
|
74
79
|
}: EuiDataGridCellValueElementProps) => {
|
|
75
|
-
const { pageSize, pageIndex } = pagination;
|
|
76
80
|
const rowIndexOnPage = rowIndex - pageIndex * pageSize;
|
|
77
81
|
|
|
78
82
|
const dataRow = data[rowIndexOnPage];
|
|
@@ -96,13 +100,12 @@ export const WFODataGridTable = <T,>({
|
|
|
96
100
|
};
|
|
97
101
|
|
|
98
102
|
const mapControlColumnToEuiDataGridControlColumn: (
|
|
99
|
-
controlColumn:
|
|
103
|
+
controlColumn: WfoControlColumn<T>,
|
|
100
104
|
) => EuiDataGridControlColumn = ({ id, width, rowCellRender }) => ({
|
|
101
105
|
id,
|
|
102
106
|
width,
|
|
103
107
|
headerCellRender: () => null,
|
|
104
108
|
rowCellRender: ({ rowIndex }: { rowIndex: number }) => {
|
|
105
|
-
const { pageSize, pageIndex } = pagination;
|
|
106
109
|
const rowIndexOnPage = rowIndex - pageIndex * pageSize;
|
|
107
110
|
|
|
108
111
|
const dataRow = data[rowIndexOnPage];
|
|
@@ -120,8 +123,7 @@ export const WFODataGridTable = <T,>({
|
|
|
120
123
|
);
|
|
121
124
|
|
|
122
125
|
const gridHeightValue =
|
|
123
|
-
|
|
124
|
-
EUI_DATA_GRID_HEIGHT_OFFSET;
|
|
126
|
+
pageSize * EUI_DATA_GRID_ROW_HEIGHT + EUI_DATA_GRID_HEIGHT_OFFSET;
|
|
125
127
|
|
|
126
128
|
return (
|
|
127
129
|
<EuiDataGrid
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { SortOrder } from '../../../types';
|
|
2
|
+
import { WfoDataSorting } from '../utils/columns';
|
|
1
3
|
import {
|
|
4
|
+
WfoDataGridTableColumns,
|
|
2
5
|
getInitialColumnOrder,
|
|
3
6
|
mapColumnSortToEuiDataGridSorting,
|
|
4
|
-
|
|
5
|
-
} from './WFOdataGridColumns';
|
|
6
|
-
import { WFODataSorting } from '../utils/columns';
|
|
7
|
-
import { SortOrder } from '../../../types';
|
|
7
|
+
} from './WfodataGridColumns';
|
|
8
8
|
|
|
9
9
|
interface TestColumn {
|
|
10
10
|
id: string;
|
|
@@ -12,7 +12,7 @@ interface TestColumn {
|
|
|
12
12
|
date: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const columns:
|
|
15
|
+
const columns: WfoDataGridTableColumns<TestColumn> = {
|
|
16
16
|
id: {
|
|
17
17
|
displayAsText: 'id',
|
|
18
18
|
initialWidth: 100,
|
|
@@ -94,11 +94,11 @@ describe('dataGridColumns', () => {
|
|
|
94
94
|
|
|
95
95
|
describe('columnSortToEuiDataGridSorting', () => {
|
|
96
96
|
it('should return sort dict with columns and onsort', () => {
|
|
97
|
-
const sortBy:
|
|
97
|
+
const sortBy: WfoDataSorting<TestColumn> = {
|
|
98
98
|
field: 'id',
|
|
99
99
|
sortOrder: SortOrder.ASC,
|
|
100
100
|
};
|
|
101
|
-
const onSort = (dataSorting:
|
|
101
|
+
const onSort = (dataSorting: WfoDataSorting<TestColumn>) => {
|
|
102
102
|
sortBy.field = dataSorting.field;
|
|
103
103
|
sortBy.sortOrder = dataSorting.sortOrder;
|
|
104
104
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { EuiDataGridColumn } from '@elastic/eui';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiDataGridColumn } from '@elastic/eui';
|
|
3
4
|
import {
|
|
4
5
|
EuiDataGridControlColumn,
|
|
5
6
|
EuiDataGridSorting,
|
|
6
7
|
} from '@elastic/eui/src/components/datagrid/data_grid_types';
|
|
7
8
|
|
|
8
|
-
import { WFODataSorting, TableColumnKeys } from '../utils/columns';
|
|
9
9
|
import { SortOrder } from '../../../types';
|
|
10
|
+
import { TableColumnKeys, WfoDataSorting } from '../utils/columns';
|
|
10
11
|
|
|
11
|
-
export type
|
|
12
|
+
export type WfoDataGridTableColumns<T> = {
|
|
12
13
|
[Property in keyof T]: Omit<EuiDataGridColumn, 'id'> & {
|
|
13
14
|
renderCell?: (cellValue: T[Property], row: T) => ReactNode;
|
|
14
15
|
isHiddenByDefault?: boolean;
|
|
15
16
|
};
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
export type
|
|
19
|
+
export type WfoControlColumn<T> = Omit<
|
|
19
20
|
EuiDataGridControlColumn,
|
|
20
21
|
| 'rowCellRender'
|
|
21
22
|
| 'headerCellRender'
|
|
@@ -27,7 +28,7 @@ export type WFOControlColumn<T> = Omit<
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export const getInitialColumnOrder = <T>(
|
|
30
|
-
columns:
|
|
31
|
+
columns: WfoDataGridTableColumns<T>,
|
|
31
32
|
initialColumnOrder: TableColumnKeys<T>,
|
|
32
33
|
) => {
|
|
33
34
|
const euiDataGridColumns: EuiDataGridColumn[] = Object.keys(columns).map(
|
|
@@ -53,8 +54,8 @@ export const getInitialColumnOrder = <T>(
|
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export const mapColumnSortToEuiDataGridSorting = <T>(
|
|
56
|
-
columnSort?:
|
|
57
|
-
updateColumnSort?: (columnSort:
|
|
57
|
+
columnSort?: WfoDataSorting<T>,
|
|
58
|
+
updateColumnSort?: (columnSort: WfoDataSorting<T>) => void,
|
|
58
59
|
): EuiDataGridSorting => ({
|
|
59
60
|
columns: columnSort
|
|
60
61
|
? [
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { getFirstUuidPart } from '../../../utils';
|
|
4
|
+
|
|
5
|
+
export type WfoFirstUUIDPartProps = {
|
|
6
|
+
UUID: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const WfoFirstPartUUID: FC<WfoFirstUUIDPartProps> = ({ UUID }) => (
|
|
10
|
+
<span title={UUID}>{getFirstUuidPart(UUID)}</span>
|
|
11
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoFirstPartUUID';
|