@orchestrator-ui/orchestrator-ui-components 0.2.3 → 0.2.5
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 +1116 -359
- package/dist/index.js +23126 -6279
- 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/WFOStatusBadge/WFOStatusBadge.stories.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOStatusBadge/WFOStatusBadge.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx} +14 -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/{WFOBreadcrumbs/WFOBreadcrumbs.tsx → WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx} +6 -3
- 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 -8
- 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/paths.ts +11 -0
- 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} +7 -5
- package/src/components/{WFOStartPage/WFOMultiListSection.stories.tsx → WfoStartPage/WfoMultiListSection.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOMultiListSection.tsx → WfoStartPage/WfoMultiListSection.tsx} +7 -5
- 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} +4 -2
- 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 +205 -0
- package/src/components/WfoSubscriptionsList/index.ts +3 -0
- package/src/components/WfoSubscriptionsList/mapGrapghQlSubscriptionsResultToSubscriptionListItems.ts +43 -0
- package/src/{pages/subscriptions → components/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 +5 -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 +6 -1
- package/src/graphqlQueries/processDetailQuery.ts +45 -0
- package/src/graphqlQueries/processListQuery.ts +19 -12
- package/src/graphqlQueries/productBlocksQuery.ts +13 -1
- package/src/graphqlQueries/productsQuery.ts +7 -4
- 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 +59 -0
- package/src/graphqlQueries/{workflowsQuery.ts → workflows/workflowsQuery.ts} +10 -5
- 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 +2 -0
- package/src/messages/en-US.json +175 -21
- package/src/messages/getTranslationMessages.spec.ts +1 -1
- package/src/messages/getTranslationMessages.ts +1 -1
- package/src/messages/nl-NL.json +179 -23
- 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 -52
- 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 +105 -0
- package/src/pages/subscriptions/index.ts +2 -2
- 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 +1 -0
- package/src/types/types.ts +457 -0
- 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 +14 -0
- package/tsconfig.json +4 -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/WFOStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/index.ts +0 -8
- package/src/components/WFOBreadcrumbs/index.ts +0 -1
- 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/WFOPageHeader/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageTemplate/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOSidebar/WFOSidebar.tsx +0 -159
- package/src/components/WFOPageTemplate/WFOSidebar/index.ts +0 -1
- package/src/components/WFOPageTemplate/index.ts +0 -3
- 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 -108
- 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/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 -164
- package/src/pages/metadata/WFOResourceTypesPage.tsx +0 -120
- package/src/pages/metadata/WFOWorkflowsPage.tsx +0 -251
- package/src/pages/processes/WFOProcessListPage.tsx +0 -209
- package/src/pages/processes/WFOProcessesListSubscriptionsCell.tsx +0 -28
- package/src/pages/processes/tableConfig.ts +0 -22
- package/src/pages/subscriptions/types.ts +0 -13
- package/src/types.ts +0 -250
- package/src/components/{WFOTable → WfoTable}/utils/columns.spec.ts +1 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Criteria } from '@elastic/eui';
|
|
2
|
-
import { SortOrder } from '../../../types';
|
|
3
2
|
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '../../../hooks';
|
|
3
|
+
import type { DataDisplayReturnValues } from '../../../hooks';
|
|
4
|
+
import { SortOrder } from '../../../types';
|
|
5
|
+
import { WfoDataSorting } from './columns';
|
|
8
6
|
|
|
9
7
|
export const determinePageIndex = (pageIndex: number, pageSize: number) =>
|
|
10
8
|
Math.floor(pageIndex / pageSize);
|
|
@@ -25,29 +23,12 @@ export const determineNewSortOrder = <T>(
|
|
|
25
23
|
|
|
26
24
|
export const getDataSortHandler =
|
|
27
25
|
<Type>(
|
|
28
|
-
dataDisplayParams: DataDisplayParams<Type>,
|
|
29
26
|
setDataDisplayParam: DataDisplayReturnValues<Type>['setDataDisplayParam'],
|
|
30
27
|
) =>
|
|
31
|
-
(
|
|
32
|
-
const newOrder = (() => {
|
|
33
|
-
if (
|
|
34
|
-
dataDisplayParams.sortBy &&
|
|
35
|
-
dataDisplayParams.sortBy.order &&
|
|
36
|
-
dataDisplayParams.sortBy.field
|
|
37
|
-
) {
|
|
38
|
-
return determineNewSortOrder<Type>(
|
|
39
|
-
dataDisplayParams.sortBy.field,
|
|
40
|
-
dataDisplayParams.sortBy.order,
|
|
41
|
-
newSortField,
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return SortOrder.ASC;
|
|
46
|
-
})();
|
|
47
|
-
|
|
28
|
+
({ field, sortOrder }: WfoDataSorting<Type>) => {
|
|
48
29
|
setDataDisplayParam('sortBy', {
|
|
49
|
-
field:
|
|
50
|
-
order:
|
|
30
|
+
field: field,
|
|
31
|
+
order: sortOrder,
|
|
51
32
|
});
|
|
52
33
|
};
|
|
53
34
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { useEuiScrollBar } from '@elastic/eui';
|
|
5
|
+
|
|
6
|
+
import { useOrchestratorTheme } from '../../hooks';
|
|
7
|
+
import { StepStatus } from '../../types';
|
|
8
|
+
import { WfoTimelineStep } from './WfoTimelineStep';
|
|
9
|
+
import { getStyles } from './styles';
|
|
10
|
+
import { getTimelinePosition } from './timelineUtils';
|
|
11
|
+
|
|
12
|
+
export enum TimelinePosition {
|
|
13
|
+
PAST = 'past',
|
|
14
|
+
CURRENT = 'current',
|
|
15
|
+
FUTURE = 'future',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type TimelineItem = {
|
|
19
|
+
id?: string;
|
|
20
|
+
processStepStatus: StepStatus;
|
|
21
|
+
stepDetail?: string | ReactNode;
|
|
22
|
+
value?: string | ReactNode;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type WfoTimelineProps = {
|
|
26
|
+
timelineItems: TimelineItem[];
|
|
27
|
+
indexOfCurrentStep?: number;
|
|
28
|
+
onStepClick: (timelineItem: TimelineItem) => void;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const WfoTimeline: FC<WfoTimelineProps> = ({
|
|
32
|
+
timelineItems,
|
|
33
|
+
indexOfCurrentStep = 0,
|
|
34
|
+
onStepClick,
|
|
35
|
+
}) => {
|
|
36
|
+
const { theme } = useOrchestratorTheme();
|
|
37
|
+
const { timelinePanelStyle } = getStyles(theme);
|
|
38
|
+
|
|
39
|
+
const mapTimelineItemToStep = (
|
|
40
|
+
timelineItem: TimelineItem,
|
|
41
|
+
index: number,
|
|
42
|
+
allTimelineItems: TimelineItem[],
|
|
43
|
+
) => {
|
|
44
|
+
const { id, stepDetail, processStepStatus, value } = timelineItem;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<WfoTimelineStep
|
|
48
|
+
key={index}
|
|
49
|
+
isFirstStep={index === 0}
|
|
50
|
+
isLastStep={index === allTimelineItems.length - 1}
|
|
51
|
+
stepStatus={processStepStatus}
|
|
52
|
+
tooltipContent={stepDetail}
|
|
53
|
+
timelinePosition={getTimelinePosition(
|
|
54
|
+
index,
|
|
55
|
+
indexOfCurrentStep,
|
|
56
|
+
)}
|
|
57
|
+
onClick={id ? () => onStepClick(timelineItem) : undefined}
|
|
58
|
+
>
|
|
59
|
+
{value}
|
|
60
|
+
</WfoTimelineStep>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div css={[timelinePanelStyle, useEuiScrollBar()]}>
|
|
66
|
+
{timelineItems.map(mapTimelineItemToStep)}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiToolTip } from '@elastic/eui';
|
|
4
|
+
|
|
5
|
+
import { useOrchestratorTheme } from '../../hooks';
|
|
6
|
+
import { StepStatus } from '../../types';
|
|
7
|
+
import { TimelinePosition } from './WfoTimeline';
|
|
8
|
+
import { getStyles } from './styles';
|
|
9
|
+
|
|
10
|
+
export type WfoTimelineStepProps = {
|
|
11
|
+
stepStatus: StepStatus;
|
|
12
|
+
timelinePosition: TimelinePosition;
|
|
13
|
+
tooltipContent?: string | ReactNode;
|
|
14
|
+
isFirstStep?: boolean;
|
|
15
|
+
isLastStep?: boolean;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const WfoTimelineStep = ({
|
|
21
|
+
stepStatus,
|
|
22
|
+
timelinePosition,
|
|
23
|
+
tooltipContent,
|
|
24
|
+
isFirstStep = false,
|
|
25
|
+
isLastStep = false,
|
|
26
|
+
children,
|
|
27
|
+
onClick,
|
|
28
|
+
}: WfoTimelineStepProps) => {
|
|
29
|
+
const { theme } = useOrchestratorTheme();
|
|
30
|
+
const {
|
|
31
|
+
stepStyle,
|
|
32
|
+
clickableStyle,
|
|
33
|
+
notClickableStyle,
|
|
34
|
+
getStepLineStyle,
|
|
35
|
+
getStepOuterCircleStyle,
|
|
36
|
+
getStepInnerCircleStyle,
|
|
37
|
+
} = getStyles(theme);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<button
|
|
41
|
+
css={[
|
|
42
|
+
stepStyle,
|
|
43
|
+
onClick ? clickableStyle : notClickableStyle,
|
|
44
|
+
getStepLineStyle(timelinePosition, isFirstStep, isLastStep),
|
|
45
|
+
]}
|
|
46
|
+
onClick={() => onClick && onClick()}
|
|
47
|
+
>
|
|
48
|
+
<EuiToolTip position="top" content={tooltipContent}>
|
|
49
|
+
<div css={getStepOuterCircleStyle(!!children)}>
|
|
50
|
+
<div css={getStepInnerCircleStyle(stepStatus, !!children)}>
|
|
51
|
+
{children}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</EuiToolTip>
|
|
55
|
+
</button>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoTimeline';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EuiStepStatus } from '@elastic/eui/src/components/steps/step_number';
|
|
2
|
+
|
|
3
|
+
import { StepStatus } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const mapProcessStepStatusToEuiStepStatus = (
|
|
6
|
+
processStepStatus: StepStatus,
|
|
7
|
+
): EuiStepStatus => {
|
|
8
|
+
switch (processStepStatus) {
|
|
9
|
+
case StepStatus.SUCCESS:
|
|
10
|
+
case StepStatus.SKIPPED:
|
|
11
|
+
case StepStatus.COMPLETE:
|
|
12
|
+
return 'complete';
|
|
13
|
+
case StepStatus.FAILED:
|
|
14
|
+
return 'danger';
|
|
15
|
+
case StepStatus.RUNNING:
|
|
16
|
+
return 'loading';
|
|
17
|
+
case StepStatus.SUSPEND:
|
|
18
|
+
return 'warning';
|
|
19
|
+
case StepStatus.PENDING:
|
|
20
|
+
default:
|
|
21
|
+
return 'incomplete';
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { makeHighContrastColor } from '@elastic/eui';
|
|
2
|
+
import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
|
|
5
|
+
import { StepStatus } from '../../types';
|
|
6
|
+
import { TimelinePosition } from './WfoTimeline';
|
|
7
|
+
|
|
8
|
+
export const getStyles = (theme: EuiThemeComputed) => {
|
|
9
|
+
const emptyStepOuterDiameter = theme.base;
|
|
10
|
+
const emptyStepInnerDiameter = theme.base / 2;
|
|
11
|
+
const stepWithValueOuterDiameter = theme.base * 1.5;
|
|
12
|
+
const stepWithValueInnerDiameter = theme.base;
|
|
13
|
+
const minimalLineLengthBetweenSteps = theme.base / 2;
|
|
14
|
+
|
|
15
|
+
const getColorForStepStatus = (processStepStatus: StepStatus) => {
|
|
16
|
+
switch (processStepStatus) {
|
|
17
|
+
case StepStatus.SUSPEND:
|
|
18
|
+
return theme.colors.warning;
|
|
19
|
+
case StepStatus.FAILED:
|
|
20
|
+
return theme.colors.danger;
|
|
21
|
+
case StepStatus.SUCCESS:
|
|
22
|
+
case StepStatus.SKIPPED:
|
|
23
|
+
case StepStatus.COMPLETE:
|
|
24
|
+
return theme.colors.primary;
|
|
25
|
+
case StepStatus.RUNNING:
|
|
26
|
+
case StepStatus.PENDING:
|
|
27
|
+
default:
|
|
28
|
+
return theme.colors.mediumShade;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const timelinePanelStyle = css({
|
|
33
|
+
backgroundColor: theme.colors.body,
|
|
34
|
+
borderRadius: theme.border.radius.medium,
|
|
35
|
+
overflow: 'auto',
|
|
36
|
+
scrollbarWidth: 'auto',
|
|
37
|
+
paddingTop: theme.font.baseline * 2,
|
|
38
|
+
paddingBottom: theme.font.baseline * 2,
|
|
39
|
+
paddingLeft: theme.font.baseline * 4,
|
|
40
|
+
paddingRight: theme.font.baseline * 4,
|
|
41
|
+
display: 'flex',
|
|
42
|
+
|
|
43
|
+
'& > button': {
|
|
44
|
+
flexGrow: 2,
|
|
45
|
+
},
|
|
46
|
+
'& > button:first-child, & > button:last-child': {
|
|
47
|
+
flexGrow: 1,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const getHorizontalLineStyle = (color: string) =>
|
|
52
|
+
css({
|
|
53
|
+
content: '""',
|
|
54
|
+
height: theme.border.width.thick,
|
|
55
|
+
backgroundColor: color,
|
|
56
|
+
flexGrow: 1,
|
|
57
|
+
minWidth: minimalLineLengthBetweenSteps,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const getStepLineStyle = (
|
|
61
|
+
timelinePosition: TimelinePosition,
|
|
62
|
+
isFirstStep: boolean,
|
|
63
|
+
isLastStep: boolean,
|
|
64
|
+
) => {
|
|
65
|
+
const getBeforeLineColor = (timelinePosition: TimelinePosition) => {
|
|
66
|
+
switch (timelinePosition) {
|
|
67
|
+
case TimelinePosition.PAST:
|
|
68
|
+
case TimelinePosition.CURRENT:
|
|
69
|
+
return theme.colors.primary;
|
|
70
|
+
case TimelinePosition.FUTURE:
|
|
71
|
+
default:
|
|
72
|
+
return theme.colors.lightShade;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const getAfterLineColor = (timelinePosition: TimelinePosition) => {
|
|
77
|
+
switch (timelinePosition) {
|
|
78
|
+
case TimelinePosition.PAST:
|
|
79
|
+
return theme.colors.primary;
|
|
80
|
+
case TimelinePosition.CURRENT:
|
|
81
|
+
case TimelinePosition.FUTURE:
|
|
82
|
+
default:
|
|
83
|
+
return theme.colors.lightShade;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return css([
|
|
88
|
+
!isFirstStep && {
|
|
89
|
+
'::before': {
|
|
90
|
+
...getHorizontalLineStyle(
|
|
91
|
+
getBeforeLineColor(timelinePosition),
|
|
92
|
+
),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
!isLastStep && {
|
|
96
|
+
'::after': {
|
|
97
|
+
...getHorizontalLineStyle(
|
|
98
|
+
getAfterLineColor(timelinePosition),
|
|
99
|
+
),
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const getStepOuterCircleStyle = (hasContent: boolean) =>
|
|
106
|
+
css({
|
|
107
|
+
display: 'flex',
|
|
108
|
+
justifyContent: 'center',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
borderRadius: '50%',
|
|
111
|
+
backgroundColor: theme.colors.emptyShade,
|
|
112
|
+
height: hasContent
|
|
113
|
+
? stepWithValueOuterDiameter
|
|
114
|
+
: emptyStepOuterDiameter,
|
|
115
|
+
width: hasContent
|
|
116
|
+
? stepWithValueOuterDiameter
|
|
117
|
+
: emptyStepOuterDiameter,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const getStepInnerCircleStyle = (
|
|
121
|
+
stepStatus: StepStatus,
|
|
122
|
+
hasContent: boolean,
|
|
123
|
+
) => {
|
|
124
|
+
const diameter = hasContent
|
|
125
|
+
? stepWithValueInnerDiameter
|
|
126
|
+
: emptyStepInnerDiameter;
|
|
127
|
+
|
|
128
|
+
return css({
|
|
129
|
+
borderRadius: '50%',
|
|
130
|
+
backgroundColor: getColorForStepStatus(stepStatus),
|
|
131
|
+
height: diameter,
|
|
132
|
+
width: diameter,
|
|
133
|
+
display: 'flex',
|
|
134
|
+
alignItems: 'center',
|
|
135
|
+
justifyContent: 'center',
|
|
136
|
+
color: makeHighContrastColor(theme.colors.text)(
|
|
137
|
+
getColorForStepStatus(stepStatus),
|
|
138
|
+
),
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const stepStyle = css({
|
|
143
|
+
display: 'flex',
|
|
144
|
+
flexDirection: 'row',
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const clickableStyle = css({
|
|
149
|
+
cursor: 'pointer',
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const notClickableStyle = css({
|
|
153
|
+
cursor: 'auto',
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
timelinePanelStyle,
|
|
158
|
+
stepStyle,
|
|
159
|
+
clickableStyle,
|
|
160
|
+
notClickableStyle,
|
|
161
|
+
getStepLineStyle,
|
|
162
|
+
getStepOuterCircleStyle,
|
|
163
|
+
getStepInnerCircleStyle,
|
|
164
|
+
};
|
|
165
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TimelinePosition } from './WfoTimeline';
|
|
2
|
+
|
|
3
|
+
export const getTimelinePosition = (
|
|
4
|
+
index: number,
|
|
5
|
+
indexOfCurrentStep: number,
|
|
6
|
+
) => {
|
|
7
|
+
if (index === indexOfCurrentStep) {
|
|
8
|
+
return TimelinePosition.CURRENT;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return index < indexOfCurrentStep
|
|
12
|
+
? TimelinePosition.PAST
|
|
13
|
+
: TimelinePosition.FUTURE;
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiGlobalToastList } from '@elastic/eui';
|
|
4
|
+
import type { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
|
|
5
|
+
|
|
6
|
+
import { ToastContext } from '../../contexts';
|
|
7
|
+
|
|
8
|
+
export const ToastsList = () => {
|
|
9
|
+
const toastContext = useContext(ToastContext);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
toastContext.toasts && (
|
|
13
|
+
<EuiGlobalToastList
|
|
14
|
+
toasts={toastContext.toasts}
|
|
15
|
+
dismissToast={(toast: Toast) =>
|
|
16
|
+
toastContext.removeToast(toast.id)
|
|
17
|
+
}
|
|
18
|
+
toastLifeTimeMs={5000}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoToastsList';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { FC, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { TreeContext, TreeContextType } from '../../contexts';
|
|
4
|
+
import { TreeBlock } from '../../types';
|
|
5
|
+
import { WfoTreeBranch } from './WfoTreeBranch';
|
|
6
|
+
|
|
7
|
+
type WfoTreeProps = {
|
|
8
|
+
data: TreeBlock[];
|
|
9
|
+
depthList: number[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const WfoTree: FC<WfoTreeProps> = ({ data, depthList }) => {
|
|
13
|
+
const { setDepths } = React.useContext(TreeContext) as TreeContextType;
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
setDepths(depthList);
|
|
17
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
+
}, [setDepths, TreeContext]);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div style={{ width: '500px' }}>
|
|
22
|
+
{data.map((item) => (
|
|
23
|
+
<WfoTreeBranch key={item.id} item={item} level={0} />
|
|
24
|
+
))}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
|
|
2
3
|
import { EuiListGroup } from '@elastic/eui';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
+
import { TreeContext, TreeContextType } from '../../contexts';
|
|
5
6
|
import { TreeBlock } from '../../types';
|
|
6
|
-
import {
|
|
7
|
+
import { WfoTreeNode } from './WfoTreeNode';
|
|
7
8
|
|
|
8
|
-
type
|
|
9
|
+
type WfoTreeBranchProps = {
|
|
9
10
|
item: TreeBlock;
|
|
10
11
|
level: number;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export const
|
|
14
|
+
export const WfoTreeBranch: FC<WfoTreeBranchProps> = ({ item, level }) => {
|
|
14
15
|
const { expandedIds } = React.useContext(TreeContext) as TreeContextType;
|
|
15
16
|
const selected = expandedIds.includes(item.id);
|
|
16
17
|
|
|
@@ -21,7 +22,7 @@ export const WFOTreeBranch: FC<WFOTreeBranchProps> = ({ item, level }) => {
|
|
|
21
22
|
const newLevel = level + 1;
|
|
22
23
|
|
|
23
24
|
return item.children.map((child) => (
|
|
24
|
-
<
|
|
25
|
+
<WfoTreeBranch key={child.id} item={child} level={newLevel} />
|
|
25
26
|
));
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -31,7 +32,7 @@ export const WFOTreeBranch: FC<WFOTreeBranchProps> = ({ item, level }) => {
|
|
|
31
32
|
return (
|
|
32
33
|
<>
|
|
33
34
|
<EuiListGroup flush={true} color="primary" maxWidth={455}>
|
|
34
|
-
<
|
|
35
|
+
<WfoTreeNode
|
|
35
36
|
item={item}
|
|
36
37
|
hasChildren={hasChildren}
|
|
37
38
|
level={level}
|
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
|
|
2
3
|
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
EuiFlexGroup,
|
|
5
7
|
EuiFlexItem,
|
|
6
|
-
EuiToken,
|
|
7
8
|
EuiIcon,
|
|
8
9
|
EuiListGroupItem,
|
|
10
|
+
EuiToken,
|
|
9
11
|
} from '@elastic/eui';
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
import { TreeContext, TreeContextType } from '../../contexts';
|
|
14
|
+
import { useOrchestratorTheme } from '../../hooks';
|
|
15
|
+
import { getStyles } from './styles';
|
|
11
16
|
|
|
12
17
|
type Item = {
|
|
13
18
|
id: number;
|
|
14
19
|
icon: string;
|
|
15
|
-
label: string;
|
|
20
|
+
label: string | number | boolean;
|
|
16
21
|
};
|
|
17
22
|
|
|
18
|
-
type
|
|
23
|
+
type WfoTreeNodeProps = {
|
|
19
24
|
item: Item;
|
|
20
25
|
hasChildren: boolean;
|
|
21
26
|
level: number;
|
|
22
27
|
};
|
|
23
28
|
|
|
24
|
-
export const
|
|
29
|
+
export const WfoTreeNode: FC<WfoTreeNodeProps> = ({
|
|
25
30
|
item,
|
|
26
31
|
hasChildren,
|
|
27
32
|
level,
|
|
28
33
|
}) => {
|
|
34
|
+
const { theme } = useOrchestratorTheme();
|
|
35
|
+
const { expandIconContainerStyle, treeContainerStyle } = getStyles(theme);
|
|
29
36
|
const t = useTranslations('common');
|
|
30
|
-
const {
|
|
31
|
-
|
|
37
|
+
const {
|
|
38
|
+
expandedIds,
|
|
39
|
+
collapseNode,
|
|
40
|
+
expandNode,
|
|
41
|
+
selectedIds,
|
|
42
|
+
toggleSelectedId,
|
|
43
|
+
} = React.useContext(TreeContext) as TreeContextType;
|
|
32
44
|
const expanded = expandedIds.includes(item.id);
|
|
33
45
|
const selected = selectedIds.includes(item.id);
|
|
34
46
|
|
|
@@ -38,16 +50,19 @@ export const WFOTreeNode: FC<WFOTreeNodeProps> = ({
|
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
return (
|
|
41
|
-
<div style={{ paddingLeft: `${level *
|
|
53
|
+
<div style={{ paddingLeft: `${level * parseInt(theme.size.m)}px` }}>
|
|
42
54
|
<EuiFlexGroup>
|
|
43
|
-
<EuiFlexItem
|
|
44
|
-
grow={false}
|
|
45
|
-
style={{ width: 0, marginTop: 8, marginRight: -8 }}
|
|
46
|
-
>
|
|
55
|
+
<EuiFlexItem grow={false} css={treeContainerStyle}>
|
|
47
56
|
{hasChildren ? (
|
|
48
57
|
<EuiIcon
|
|
49
58
|
type={expandIcon}
|
|
50
|
-
|
|
59
|
+
css={expandIconContainerStyle}
|
|
60
|
+
cursor={'hand'}
|
|
61
|
+
onClick={() =>
|
|
62
|
+
expanded
|
|
63
|
+
? collapseNode(item.id)
|
|
64
|
+
: expandNode(item.id)
|
|
65
|
+
}
|
|
51
66
|
/>
|
|
52
67
|
) : (
|
|
53
68
|
<EuiToken iconType={item.icon} />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
2
|
+
|
|
3
|
+
export const getStyles = (theme: EuiThemeComputed) => {
|
|
4
|
+
const expandIconContainerStyle = {
|
|
5
|
+
cursor: 'pointer',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const treeContainerStyle = {
|
|
9
|
+
width: 0,
|
|
10
|
+
marginTop: theme.size.s,
|
|
11
|
+
marginRight: `-${theme.size.s}`,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
expandIconContainerStyle: expandIconContainerStyle,
|
|
16
|
+
treeContainerStyle: treeContainerStyle,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { FieldValue, TreeBlock } from '../../types';
|
|
2
|
+
import { getWfoTreeNodeDepth } from './treeUtils';
|
|
3
|
+
|
|
4
|
+
describe('getWfoTreeNodeDepth', () => {
|
|
5
|
+
const field: FieldValue = { field: 'test', value: 'test' };
|
|
6
|
+
const sampleTree: TreeBlock = {
|
|
7
|
+
id: 1,
|
|
8
|
+
ownerSubscriptionId: 'subscription-1',
|
|
9
|
+
subscriptionInstanceId: 'subscription-1',
|
|
10
|
+
parent: null,
|
|
11
|
+
icon: 'folder',
|
|
12
|
+
label: 'Root',
|
|
13
|
+
callback: jest.fn(),
|
|
14
|
+
productBlockInstanceValues: [field],
|
|
15
|
+
inUseByRelations: [],
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
id: 2,
|
|
19
|
+
ownerSubscriptionId: 'subscription-2',
|
|
20
|
+
subscriptionInstanceId: 'subscription-2',
|
|
21
|
+
parent: 1,
|
|
22
|
+
icon: 'file',
|
|
23
|
+
label: 'File 1',
|
|
24
|
+
callback: jest.fn(),
|
|
25
|
+
productBlockInstanceValues: [field],
|
|
26
|
+
inUseByRelations: [],
|
|
27
|
+
children: [],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 3,
|
|
31
|
+
ownerSubscriptionId: 'subscription-3',
|
|
32
|
+
subscriptionInstanceId: 'subscription-3',
|
|
33
|
+
parent: 1,
|
|
34
|
+
icon: 'file',
|
|
35
|
+
label: 'File 2',
|
|
36
|
+
callback: jest.fn(),
|
|
37
|
+
productBlockInstanceValues: [field],
|
|
38
|
+
inUseByRelations: [],
|
|
39
|
+
children: [
|
|
40
|
+
{
|
|
41
|
+
id: 4,
|
|
42
|
+
ownerSubscriptionId: 'subscription-4',
|
|
43
|
+
subscriptionInstanceId: 'subscription-4',
|
|
44
|
+
parent: 3,
|
|
45
|
+
icon: 'file',
|
|
46
|
+
label: 'File 2.1',
|
|
47
|
+
callback: jest.fn(),
|
|
48
|
+
productBlockInstanceValues: [field],
|
|
49
|
+
inUseByRelations: [],
|
|
50
|
+
children: [],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const idToNodeMap = {
|
|
58
|
+
1: sampleTree,
|
|
59
|
+
2: sampleTree.children[0],
|
|
60
|
+
3: sampleTree.children[1],
|
|
61
|
+
4: sampleTree.children[1].children[0],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
it('should return 0 for the root node', () => {
|
|
65
|
+
const rootDepth = getWfoTreeNodeDepth(sampleTree, idToNodeMap);
|
|
66
|
+
expect(rootDepth).toBe(0);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('should return the correct depth for a child node', () => {
|
|
70
|
+
const depth2 = getWfoTreeNodeDepth(sampleTree.children[0], idToNodeMap);
|
|
71
|
+
const depth3 = getWfoTreeNodeDepth(sampleTree.children[1], idToNodeMap);
|
|
72
|
+
const depth4 = getWfoTreeNodeDepth(
|
|
73
|
+
sampleTree.children[1].children[0],
|
|
74
|
+
idToNodeMap,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
expect(depth2).toBe(1);
|
|
78
|
+
expect(depth3).toBe(1);
|
|
79
|
+
expect(depth4).toBe(2);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should throw an error if the parent node is not found', () => {
|
|
83
|
+
const invalidNode = {
|
|
84
|
+
id: 1,
|
|
85
|
+
ownerSubscriptionId: 'subscription-1',
|
|
86
|
+
subscriptionInstanceId: 'subscription-1',
|
|
87
|
+
parent: 99, // Parent ID that does not exist
|
|
88
|
+
icon: 'file',
|
|
89
|
+
label: 'Invalid Node',
|
|
90
|
+
callback: jest.fn(),
|
|
91
|
+
productBlockInstanceValues: [field],
|
|
92
|
+
inUseByRelations: [],
|
|
93
|
+
children: [],
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
expect(() =>
|
|
97
|
+
getWfoTreeNodeDepth(invalidNode, idToNodeMap),
|
|
98
|
+
).toThrowError('Parent node for 1 not found.');
|
|
99
|
+
});
|
|
100
|
+
});
|