@orchestrator-ui/orchestrator-ui-components 0.2.4 → 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 +6 -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} +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 → 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 +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/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
package/src/types/types.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { _EuiThemeColorsMode } from '@elastic/eui/src/global_styling/variables/colors';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
export type UnionOfInterfaceTypes<T> = T[keyof T];
|
|
4
4
|
|
|
5
5
|
export type Nullable<T> = T | null;
|
|
6
6
|
|
|
7
7
|
type GenericField = { [key: string]: number | string | boolean };
|
|
8
8
|
|
|
9
|
-
export type
|
|
9
|
+
export type FieldValue = {
|
|
10
|
+
field: string;
|
|
11
|
+
value: string | number | boolean;
|
|
12
|
+
};
|
|
10
13
|
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
14
|
+
export type KeyValue = {
|
|
15
|
+
key: string;
|
|
16
|
+
value: string | number | boolean | undefined;
|
|
17
|
+
};
|
|
15
18
|
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
endDate?: string | null;
|
|
24
|
-
} & GenericField;
|
|
19
|
+
export type EngineStatusValue = 'RUNNING' | 'PAUSING' | 'PAUSED';
|
|
20
|
+
|
|
21
|
+
export type Customer = {
|
|
22
|
+
fullname: string;
|
|
23
|
+
identifier: string;
|
|
24
|
+
shortcode: string;
|
|
25
|
+
};
|
|
25
26
|
|
|
26
27
|
export type ResourceTypeBase = {
|
|
27
28
|
name: string;
|
|
@@ -31,17 +32,25 @@ export type ResourceTypeBase = {
|
|
|
31
32
|
label?: string;
|
|
32
33
|
} & GenericField;
|
|
33
34
|
|
|
34
|
-
export type
|
|
35
|
+
export type InUseByRelation = {
|
|
36
|
+
subscription_instance_id: string;
|
|
37
|
+
subscription_id: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type ProductBlockInstance = {
|
|
35
41
|
id: number;
|
|
36
42
|
ownerSubscriptionId: string;
|
|
43
|
+
subscriptionInstanceId: string;
|
|
37
44
|
parent: Nullable<number>;
|
|
38
|
-
|
|
45
|
+
productBlockInstanceValues: FieldValue[];
|
|
46
|
+
inUseByRelations: InUseByRelation[];
|
|
39
47
|
};
|
|
40
48
|
|
|
41
49
|
export interface ResourceTypeDefinition {
|
|
42
50
|
description: string;
|
|
43
51
|
resourceType: string;
|
|
44
52
|
resourceTypeId: string;
|
|
53
|
+
productBlocks: ProductBlockDefinition[];
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
export interface ProductBlockDefinition {
|
|
@@ -49,10 +58,27 @@ export interface ProductBlockDefinition {
|
|
|
49
58
|
name: string;
|
|
50
59
|
tag: string;
|
|
51
60
|
description: string;
|
|
52
|
-
status:
|
|
53
|
-
createdAt:
|
|
54
|
-
endDate:
|
|
61
|
+
status: ProductLifecycleStatus;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
endDate: string | null;
|
|
55
64
|
resourceTypes: ResourceTypeDefinition[];
|
|
65
|
+
dependsOn: ProductBlockDefinition[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export enum ProductLifecycleStatus {
|
|
69
|
+
ACTIVE = 'active',
|
|
70
|
+
PRE_PRODUCTION = 'pre production',
|
|
71
|
+
PHASE_OUT = 'phase out',
|
|
72
|
+
END_OF_LIFE = 'end of life',
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export enum BadgeType {
|
|
76
|
+
WORKFLOW = 'workflow',
|
|
77
|
+
FIXED_INPUT = 'fixed_input',
|
|
78
|
+
RESOURCE_TYPE = 'resource_type',
|
|
79
|
+
PRODUCT_BLOCK = 'product_block',
|
|
80
|
+
PRODUCT_BLOCK_TAG = 'product_block_tag',
|
|
81
|
+
PRODUCT_TAG = 'product_tag',
|
|
56
82
|
}
|
|
57
83
|
|
|
58
84
|
export type FixedInputsBase = GenericField;
|
|
@@ -69,36 +95,9 @@ export interface FixedInputDefinition {
|
|
|
69
95
|
required: boolean;
|
|
70
96
|
}
|
|
71
97
|
|
|
72
|
-
export
|
|
73
|
-
externalServiceKey: string;
|
|
74
|
-
externalServiceId: string;
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
-
externalServiceData: any;
|
|
77
|
-
} & GenericField;
|
|
78
|
-
|
|
79
|
-
export type SubscriptionDetailBase = {
|
|
80
|
-
// Top level subscription fields
|
|
81
|
-
subscriptionId: string;
|
|
82
|
-
description: string;
|
|
83
|
-
customerId?: string | null;
|
|
84
|
-
insync: boolean;
|
|
85
|
-
status: string;
|
|
86
|
-
startDate?: string | null;
|
|
87
|
-
endDate?: string | null;
|
|
88
|
-
note?: string;
|
|
89
|
-
|
|
90
|
-
// Nested attributes
|
|
91
|
-
product: ProductBase;
|
|
92
|
-
fixedInputs: FixedInputsBase;
|
|
93
|
-
customer?: CustomerBase;
|
|
94
|
-
productBlocks: ProductBlockBase[];
|
|
95
|
-
|
|
96
|
-
externalServices?: ExternalServiceBase[];
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export interface TreeBlock extends ProductBlockBase {
|
|
98
|
+
export interface TreeBlock extends ProductBlockInstance {
|
|
100
99
|
icon: string;
|
|
101
|
-
label: string;
|
|
100
|
+
label: string | number | boolean;
|
|
102
101
|
callback: () => void;
|
|
103
102
|
children: TreeBlock[];
|
|
104
103
|
}
|
|
@@ -140,36 +139,129 @@ export interface ProductDefinition {
|
|
|
140
139
|
tag: string;
|
|
141
140
|
createdAt: string;
|
|
142
141
|
productType: string;
|
|
143
|
-
status:
|
|
142
|
+
status: ProductLifecycleStatus;
|
|
144
143
|
productBlocks: Pick<ProductBlockDefinition, 'name'>[];
|
|
145
144
|
fixedInputs: Pick<FixedInputDefinition, 'name' | 'value'>[];
|
|
146
145
|
}
|
|
147
146
|
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
export enum WorkflowTarget {
|
|
148
|
+
CREATE = 'create',
|
|
149
|
+
MODIFY = 'modify',
|
|
150
|
+
TERMINATE = 'terminate',
|
|
151
|
+
SYSTEM = 'system',
|
|
152
|
+
}
|
|
153
|
+
|
|
150
154
|
export type Process = {
|
|
151
155
|
workflowName: string;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
workflowTarget:
|
|
155
|
-
product
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
lastStep: string;
|
|
157
|
+
lastStatus: ProcessStatus;
|
|
158
|
+
workflowTarget: WorkflowTarget;
|
|
159
|
+
product?: {
|
|
160
|
+
name: string;
|
|
161
|
+
tag: string;
|
|
162
|
+
};
|
|
163
|
+
customer: {
|
|
164
|
+
fullname: string;
|
|
165
|
+
shortcode: string;
|
|
160
166
|
};
|
|
161
167
|
createdBy: string;
|
|
162
168
|
assignee: string;
|
|
163
169
|
processId: string;
|
|
164
|
-
|
|
165
|
-
|
|
170
|
+
startedAt: string;
|
|
171
|
+
lastModifiedAt: string;
|
|
172
|
+
subscriptions: {
|
|
173
|
+
page: Pick<Subscription, 'subscriptionId' | 'description'>[];
|
|
174
|
+
};
|
|
166
175
|
};
|
|
167
176
|
|
|
177
|
+
// These step statusses match the ones in the backend
|
|
178
|
+
export enum StepStatus {
|
|
179
|
+
FORM = 'form', // Only this one is frontend only
|
|
180
|
+
SUCCESS = 'success',
|
|
181
|
+
FAILED = 'failed',
|
|
182
|
+
PENDING = 'pending',
|
|
183
|
+
RUNNING = 'running',
|
|
184
|
+
SKIPPED = 'skipped',
|
|
185
|
+
SUSPEND = 'suspend',
|
|
186
|
+
WAITING = 'waiting',
|
|
187
|
+
AWAITING_CALLBACK = 'awaiting_callback',
|
|
188
|
+
ABORT = 'abort',
|
|
189
|
+
COMPLETE = 'complete',
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface ProcessDetail {
|
|
193
|
+
processId: Process['processId'];
|
|
194
|
+
lastStatus: Process['lastStatus'];
|
|
195
|
+
createdBy: Process['createdBy'];
|
|
196
|
+
startedAt: Process['startedAt'];
|
|
197
|
+
lastStep: string;
|
|
198
|
+
lastModifiedAt: Process['lastModifiedAt'];
|
|
199
|
+
workflowName: string;
|
|
200
|
+
isTask: boolean;
|
|
201
|
+
steps: Step[];
|
|
202
|
+
subscriptions: {
|
|
203
|
+
page: {
|
|
204
|
+
product: Pick<ProductDefinition, 'name'>;
|
|
205
|
+
description: Subscription['description'];
|
|
206
|
+
subscriptionId: Subscription['subscriptionId'];
|
|
207
|
+
}[];
|
|
208
|
+
};
|
|
209
|
+
customer: {
|
|
210
|
+
fullname: string;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// From backend
|
|
215
|
+
export enum ProcessStatus {
|
|
216
|
+
CREATE = 'create', // Frontend only
|
|
217
|
+
CREATED = 'created',
|
|
218
|
+
RUNNING = 'running',
|
|
219
|
+
SUSPENDED = 'suspended',
|
|
220
|
+
WAITING = 'waiting',
|
|
221
|
+
AWAITING_CALLBACK = 'awaiting_callback',
|
|
222
|
+
ABORTED = 'aborted',
|
|
223
|
+
FAILED = 'failed',
|
|
224
|
+
RESUMED = 'resumed',
|
|
225
|
+
API_UNAVAILABLE = 'api_unavailable',
|
|
226
|
+
INCONSISTENT_DATA = 'inconsistent_data',
|
|
227
|
+
COMPLETED = 'completed',
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export const ProcessDoneStatuses = [
|
|
231
|
+
ProcessStatus.COMPLETED,
|
|
232
|
+
ProcessStatus.ABORTED,
|
|
233
|
+
];
|
|
234
|
+
|
|
235
|
+
export interface StepState {
|
|
236
|
+
[index: string]: object | boolean | string | number | [];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface EmailAddress {
|
|
240
|
+
name: string;
|
|
241
|
+
email: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface EmailState {
|
|
245
|
+
to: EmailAddress[];
|
|
246
|
+
cc: EmailAddress[];
|
|
247
|
+
message: string;
|
|
248
|
+
subject: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface Step {
|
|
252
|
+
name: string;
|
|
253
|
+
status: StepStatus;
|
|
254
|
+
stepId: string; // sic backend
|
|
255
|
+
executed: string;
|
|
256
|
+
state: StepState;
|
|
257
|
+
stateDelta: StepState;
|
|
258
|
+
}
|
|
259
|
+
|
|
168
260
|
export interface WorkflowDefinition {
|
|
169
261
|
name: string;
|
|
170
|
-
description
|
|
171
|
-
target:
|
|
172
|
-
|
|
262
|
+
description?: string;
|
|
263
|
+
target: WorkflowTarget;
|
|
264
|
+
products: Pick<ProductDefinition, 'tag' | 'productId' | 'name'>[];
|
|
173
265
|
createdAt: string;
|
|
174
266
|
}
|
|
175
267
|
|
|
@@ -193,8 +285,8 @@ export type GraphqlFilter<Type> = {
|
|
|
193
285
|
};
|
|
194
286
|
|
|
195
287
|
export type GraphqlQueryVariables<Type> = {
|
|
196
|
-
first
|
|
197
|
-
after
|
|
288
|
+
first?: number;
|
|
289
|
+
after?: number;
|
|
198
290
|
sortBy?: GraphQLSort<Type>;
|
|
199
291
|
filterBy?: GraphqlFilter<Type>[];
|
|
200
292
|
};
|
|
@@ -202,15 +294,25 @@ export type GraphqlQueryVariables<Type> = {
|
|
|
202
294
|
export type GraphQLPageInfo = {
|
|
203
295
|
hasNextPage: boolean;
|
|
204
296
|
hasPreviousPage: boolean;
|
|
205
|
-
startCursor
|
|
206
|
-
totalItems
|
|
207
|
-
endCursor
|
|
297
|
+
startCursor: number | null;
|
|
298
|
+
totalItems: number | null;
|
|
299
|
+
endCursor: number | null;
|
|
300
|
+
sortFields: string[];
|
|
301
|
+
filterFields: string[];
|
|
208
302
|
};
|
|
209
303
|
|
|
210
304
|
export interface SubscriptionsResult {
|
|
211
305
|
subscriptions: GraphQlResultPage<Subscription>;
|
|
212
306
|
}
|
|
213
307
|
|
|
308
|
+
export interface SubscriptionDropdownOptionsResult {
|
|
309
|
+
subscriptions: GraphQlSinglePage<SubscriptionDropdownOption>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface SubscriptionDetailResult {
|
|
313
|
+
subscriptions: GraphQlResultPage<SubscriptionDetail>;
|
|
314
|
+
}
|
|
315
|
+
|
|
214
316
|
export interface ProductDefinitionsResult {
|
|
215
317
|
products: GraphQlResultPage<ProductDefinition>;
|
|
216
318
|
}
|
|
@@ -227,8 +329,24 @@ export interface ProcessesResult {
|
|
|
227
329
|
processes: GraphQlResultPage<Process>;
|
|
228
330
|
}
|
|
229
331
|
|
|
230
|
-
export interface
|
|
231
|
-
|
|
332
|
+
export interface ProcessesDetailResult {
|
|
333
|
+
processes: GraphQlSinglePage<ProcessDetail>;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface CustomersResult {
|
|
337
|
+
customers: GraphQlSinglePage<Customer>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface WorkflowDefinitionsResult<T = WorkflowDefinition> {
|
|
341
|
+
workflows: GraphQlResultPage<T>;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface RelatedSubscriptionsResult {
|
|
345
|
+
subscriptions: GraphQlSinglePage<
|
|
346
|
+
Pick<Subscription, 'subscriptionId'> & {
|
|
347
|
+
inUseBySubscriptions: GraphQlResultPage<RelatedSubscription>;
|
|
348
|
+
}
|
|
349
|
+
>;
|
|
232
350
|
}
|
|
233
351
|
|
|
234
352
|
interface GraphQlResultPage<T> {
|
|
@@ -236,6 +354,10 @@ interface GraphQlResultPage<T> {
|
|
|
236
354
|
pageInfo: GraphQLPageInfo;
|
|
237
355
|
}
|
|
238
356
|
|
|
357
|
+
interface GraphQlSinglePage<T> {
|
|
358
|
+
page: T[];
|
|
359
|
+
}
|
|
360
|
+
|
|
239
361
|
export interface CacheOption {
|
|
240
362
|
value: string;
|
|
241
363
|
label: string;
|
|
@@ -245,3 +367,91 @@ export enum Locale {
|
|
|
245
367
|
enUS = 'en-Us',
|
|
246
368
|
nlNL = 'nl-NL',
|
|
247
369
|
}
|
|
370
|
+
|
|
371
|
+
export enum SubscriptionStatus {
|
|
372
|
+
INITIAL = 'initial',
|
|
373
|
+
ACTIVE = 'active',
|
|
374
|
+
MIGRATING = 'migrating',
|
|
375
|
+
DISABLED = 'disabled',
|
|
376
|
+
TERMINATED = 'terminated',
|
|
377
|
+
PROVISIONING = 'provisioning',
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export type Subscription = {
|
|
381
|
+
subscriptionId: string;
|
|
382
|
+
description: string;
|
|
383
|
+
note: string | null;
|
|
384
|
+
startDate: string | null;
|
|
385
|
+
endDate: string | null;
|
|
386
|
+
insync: boolean;
|
|
387
|
+
status: SubscriptionStatus;
|
|
388
|
+
product: Pick<ProductDefinition, 'name' | 'tag' | 'productType'>;
|
|
389
|
+
productBlockInstances: ProductBlockInstance[];
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export type SubscriptionDropdownOption = {
|
|
393
|
+
description: Subscription['description'];
|
|
394
|
+
subscriptionId: Subscription['subscriptionId'];
|
|
395
|
+
product: Pick<ProductDefinition, 'tag' | 'productId'>;
|
|
396
|
+
customer: Pick<Customer, 'fullname' | 'identifier'>;
|
|
397
|
+
productBlockInstances: ProductBlockInstance[];
|
|
398
|
+
fixedInputs: FieldValue[];
|
|
399
|
+
tag: string;
|
|
400
|
+
status: SubscriptionStatus;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
export type SubscriptionDetail = {
|
|
404
|
+
subscriptionId: string;
|
|
405
|
+
description: string;
|
|
406
|
+
insync: boolean;
|
|
407
|
+
note: string;
|
|
408
|
+
fixedInputs: FieldValue[];
|
|
409
|
+
product: Pick<
|
|
410
|
+
ProductDefinition,
|
|
411
|
+
| 'createdAt'
|
|
412
|
+
| 'name'
|
|
413
|
+
| 'status'
|
|
414
|
+
| 'description'
|
|
415
|
+
| 'tag'
|
|
416
|
+
| 'productType'
|
|
417
|
+
| 'productId'
|
|
418
|
+
> & {
|
|
419
|
+
endDate: string;
|
|
420
|
+
};
|
|
421
|
+
endDate: string;
|
|
422
|
+
startDate: string;
|
|
423
|
+
status: SubscriptionStatus;
|
|
424
|
+
productBlockInstances: ProductBlockInstance[];
|
|
425
|
+
|
|
426
|
+
customerId?: string | null;
|
|
427
|
+
customer?: Customer;
|
|
428
|
+
externalServices?: ExternalService[];
|
|
429
|
+
|
|
430
|
+
processes: GraphQlSinglePage<SubscriptionDetailProcess>;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export type SubscriptionDetailProcess = Pick<
|
|
434
|
+
Process,
|
|
435
|
+
| 'processId'
|
|
436
|
+
| 'lastStatus'
|
|
437
|
+
| 'startedAt'
|
|
438
|
+
| 'createdBy'
|
|
439
|
+
| 'workflowTarget'
|
|
440
|
+
| 'workflowName'
|
|
441
|
+
>;
|
|
442
|
+
|
|
443
|
+
export type RelatedSubscription = Pick<
|
|
444
|
+
Subscription,
|
|
445
|
+
'subscriptionId' | 'description' | 'status' | 'startDate' | 'insync'
|
|
446
|
+
> & {
|
|
447
|
+
product: Pick<ProductDefinition, 'tag'>;
|
|
448
|
+
customer: Pick<Customer, 'fullname'>;
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
export type ExternalService = {
|
|
452
|
+
externalServiceKey: string;
|
|
453
|
+
externalServiceId: string;
|
|
454
|
+
externalServiceData: object;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export type WfoTreeNodeMap = { [key: number]: TreeBlock };
|
package/src/utils/date.spec.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
calculateTimeDifference,
|
|
3
|
+
getCurrentBrowserLocale,
|
|
4
|
+
parseDate,
|
|
5
|
+
parseDateOrTimeRelativeToToday,
|
|
6
|
+
parseDateRelativeToToday,
|
|
7
|
+
parseDateToLocaleDateTimeString,
|
|
8
|
+
parseIsoString,
|
|
9
|
+
} from './date';
|
|
10
|
+
|
|
11
|
+
const testDateIsoString = '2023-04-27T10:00:00.000Z';
|
|
12
|
+
const testDate = new Date(testDateIsoString);
|
|
13
|
+
const testDateEpoch = testDate.valueOf();
|
|
14
|
+
const testDateDateString = testDate.toLocaleDateString(
|
|
15
|
+
getCurrentBrowserLocale(),
|
|
16
|
+
);
|
|
17
|
+
const testDateTimeString = testDate.toLocaleTimeString(
|
|
18
|
+
getCurrentBrowserLocale(),
|
|
19
|
+
);
|
|
2
20
|
|
|
3
21
|
describe('date', () => {
|
|
4
22
|
describe('parseDate()', () => {
|
|
@@ -22,18 +40,152 @@ describe('date', () => {
|
|
|
22
40
|
expect(result).toBeInstanceOf(Date);
|
|
23
41
|
});
|
|
24
42
|
});
|
|
25
|
-
describe('
|
|
43
|
+
describe('parseDateTimeToLocaleString()', () => {
|
|
26
44
|
it('returns an empty string if the date is null', () => {
|
|
27
|
-
const result =
|
|
45
|
+
const result = parseDateToLocaleDateTimeString(null);
|
|
28
46
|
expect(result).toEqual('');
|
|
29
47
|
});
|
|
30
48
|
|
|
31
49
|
it('returns a date string if the date is a valid date string', () => {
|
|
32
50
|
const testDate = new Date('2022-01-02');
|
|
33
51
|
|
|
34
|
-
const result =
|
|
52
|
+
const result = parseDateToLocaleDateTimeString(testDate);
|
|
53
|
+
|
|
54
|
+
expect(result).toContain('1/2/2022');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('parseDateRelativeToToday()', () => {
|
|
59
|
+
it('returns an empty string if the date is null', () => {
|
|
60
|
+
const result = parseDateRelativeToToday(null);
|
|
61
|
+
expect(result).toEqual('');
|
|
62
|
+
});
|
|
63
|
+
it('returns only time when date is today', () => {
|
|
64
|
+
const now = new Date();
|
|
65
|
+
|
|
66
|
+
const result = parseDateRelativeToToday(now);
|
|
67
|
+
|
|
68
|
+
const expectedResult = now.toLocaleTimeString(
|
|
69
|
+
getCurrentBrowserLocale(),
|
|
70
|
+
);
|
|
71
|
+
expect(result).toEqual(expectedResult);
|
|
72
|
+
});
|
|
73
|
+
it('returns date and time when date is not today', () => {
|
|
74
|
+
const result = parseDateRelativeToToday(testDate);
|
|
75
|
+
|
|
76
|
+
const expectedDateTime = `${testDateDateString}, ${testDateTimeString}`;
|
|
77
|
+
expect(result).toEqual(expectedDateTime);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('parseDateOrTimeRelativeToToday()', () => {
|
|
82
|
+
it('returns time only when date is today', () => {
|
|
83
|
+
const now = new Date();
|
|
84
|
+
|
|
85
|
+
const result = parseDateOrTimeRelativeToToday(now);
|
|
86
|
+
|
|
87
|
+
const expectedResult = now.toLocaleTimeString(
|
|
88
|
+
getCurrentBrowserLocale(),
|
|
89
|
+
);
|
|
90
|
+
expect(result).toEqual(expectedResult);
|
|
91
|
+
});
|
|
92
|
+
it('returns only the date when that date is not today', () => {
|
|
93
|
+
const result = parseDateOrTimeRelativeToToday(testDate);
|
|
94
|
+
|
|
95
|
+
expect(result).toEqual(testDateDateString);
|
|
96
|
+
});
|
|
97
|
+
it('returns date only when date is not today and requesting "short notation"', () => {
|
|
98
|
+
const result = parseDateOrTimeRelativeToToday(testDate);
|
|
99
|
+
|
|
100
|
+
expect(result).toEqual(testDateDateString);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('calculateTimeDifference()', () => {
|
|
105
|
+
it('returns message with one of the dates missing', () => {
|
|
106
|
+
expect(calculateTimeDifference('', '')).toEqual('');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('returns appropriate string if the times are the same', () => {
|
|
110
|
+
expect(
|
|
111
|
+
calculateTimeDifference(testDateIsoString, testDateIsoString),
|
|
112
|
+
).toEqual('00:00:00');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('returns appropriate string if the timedifference is 1 second', () => {
|
|
116
|
+
const laterTestDateIsoString = new Date(
|
|
117
|
+
testDateEpoch + 1000,
|
|
118
|
+
).toISOString();
|
|
119
|
+
|
|
120
|
+
const result = calculateTimeDifference(
|
|
121
|
+
testDateIsoString,
|
|
122
|
+
laterTestDateIsoString,
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
expect(result).toEqual('00:00:01');
|
|
126
|
+
});
|
|
127
|
+
it('returns appropriate string if the timedifference is 1 minute', () => {
|
|
128
|
+
const laterTestDateIsoString = new Date(
|
|
129
|
+
testDateEpoch + 60000 + 1000,
|
|
130
|
+
).toISOString();
|
|
131
|
+
|
|
132
|
+
const result = calculateTimeDifference(
|
|
133
|
+
testDateIsoString,
|
|
134
|
+
laterTestDateIsoString,
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
expect(result).toEqual('00:01:01');
|
|
138
|
+
});
|
|
139
|
+
it('returns appropriate string if the timedifference is 1 hour', () => {
|
|
140
|
+
const laterTestDateIsoString = new Date(
|
|
141
|
+
testDateEpoch + 3600000 + 60000 + 1000,
|
|
142
|
+
).toISOString();
|
|
143
|
+
|
|
144
|
+
const result = calculateTimeDifference(
|
|
145
|
+
testDateIsoString,
|
|
146
|
+
laterTestDateIsoString,
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
expect(result).toEqual('01:01:01');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('returns appropriate string if the timedifference is 10 hour', () => {
|
|
153
|
+
const laterTestDateIsoString = new Date(
|
|
154
|
+
testDateEpoch + 36000000 + 60000 + 1000,
|
|
155
|
+
).toISOString();
|
|
156
|
+
|
|
157
|
+
const result = calculateTimeDifference(
|
|
158
|
+
testDateIsoString,
|
|
159
|
+
laterTestDateIsoString,
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
expect(result).toEqual('10:01:01');
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('returns empty string when time difference is invalid', () => {
|
|
166
|
+
const laterDateIsoString = new Date(
|
|
167
|
+
testDateEpoch + 3600000 + 60000 + 1000,
|
|
168
|
+
).toISOString();
|
|
169
|
+
|
|
170
|
+
const result = calculateTimeDifference(
|
|
171
|
+
laterDateIsoString,
|
|
172
|
+
testDateIsoString,
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
expect(result).toEqual('');
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
describe('parseIsoString()', () => {
|
|
180
|
+
it('returns the result of the function passed', () => {
|
|
181
|
+
const dateToStringTestFunction = (testDate: Date | null) =>
|
|
182
|
+
testDate?.toISOString().concat('-TEST') ?? 'empty-TEST';
|
|
183
|
+
|
|
184
|
+
const result = parseIsoString(dateToStringTestFunction)(
|
|
185
|
+
testDateIsoString,
|
|
186
|
+
);
|
|
35
187
|
|
|
36
|
-
expect(result).
|
|
188
|
+
expect(result).toEqual(`${testDateIsoString}-TEST`);
|
|
37
189
|
});
|
|
38
190
|
});
|
|
39
191
|
});
|