@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/jest.config.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchestrator-ui/orchestrator-ui-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
7
|
-
"build": "tsup src/index.ts --format esm --dts",
|
|
7
|
+
"build": "tsup src/index.ts --format esm --dts --tsconfig tsconfig.build.json",
|
|
8
8
|
"tsc": "tsc --noEmit",
|
|
9
9
|
"lint": "eslint \"src/**/*.ts*\"",
|
|
10
10
|
"dev": "yarn build -- --watch",
|
|
11
11
|
"storybook": "storybook dev -p 6006",
|
|
12
|
-
"build-storybook": "storybook build"
|
|
12
|
+
"build-storybook": "storybook build",
|
|
13
|
+
"reset": "rm -rf node_modules"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
16
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
17
|
+
"axios": "^0.24.0",
|
|
18
|
+
"invariant": "^2.2.4",
|
|
16
19
|
"moment": "2.29.4",
|
|
20
|
+
"moment-timezone": "^0.5.43",
|
|
21
|
+
"object-hash": "^2.1.1",
|
|
22
|
+
"react-select": "^5.8.0",
|
|
23
|
+
"scroll-into-view": "^1.16.2",
|
|
24
|
+
"uniforms": "^3.8.1",
|
|
25
|
+
"uniforms-bridge-json-schema": "^3.8.1",
|
|
26
|
+
"uniforms-unstyled": "^3.8.1",
|
|
17
27
|
"use-query-params": "2.2.1"
|
|
18
28
|
},
|
|
19
29
|
"peerDependencies": {
|
|
20
|
-
"@elastic/eui": "
|
|
30
|
+
"@elastic/eui": "^88.1.0",
|
|
21
31
|
"@emotion/css": "^11.11.2",
|
|
22
32
|
"@emotion/react": "^11.11.1",
|
|
23
33
|
"graphql-request": "5.2.0",
|
|
24
34
|
"next": "^13.4.1",
|
|
35
|
+
"next-auth": "^4.23.1",
|
|
25
36
|
"next-intl": "2.19.0",
|
|
26
37
|
"next-query-params": "4.2.2",
|
|
27
38
|
"react": "^18.2.0",
|
|
@@ -42,15 +53,20 @@
|
|
|
42
53
|
"@testing-library/react": "^14.0.0",
|
|
43
54
|
"@testing-library/react-hooks": "^8.0.1",
|
|
44
55
|
"@testing-library/user-event": "^14.4.3",
|
|
45
|
-
"@types/
|
|
56
|
+
"@types/invariant": "^2.2.33",
|
|
57
|
+
"@types/jest": "^29.5.8",
|
|
58
|
+
"@types/object-hash": "^2.1.0",
|
|
59
|
+
"@types/scroll-into-view": "^1.16.3",
|
|
46
60
|
"esbuild": "^0.14.10",
|
|
47
61
|
"esbuild-jest": "^0.5.0",
|
|
48
|
-
"jest": "^
|
|
49
|
-
"jest-watch-typeahead": "^
|
|
62
|
+
"jest": "^29.7.0",
|
|
63
|
+
"jest-watch-typeahead": "^2.2.2",
|
|
64
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
50
65
|
"react": "^18.2.0",
|
|
51
66
|
"react-dom": "^18.2.0",
|
|
52
67
|
"storybook": "^7.2.1",
|
|
53
|
-
"tsup": "^7.
|
|
68
|
+
"tsup": "^7.2.0",
|
|
69
|
+
"uniforms-bridge-simple-schema-2": "^3.8.1"
|
|
54
70
|
},
|
|
55
71
|
"type": "module",
|
|
56
72
|
"main": "./dist/index.js",
|
package/src/api/axios.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2020-2021 SURF.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
*
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
* See the License for the specific language governing permissions and
|
|
12
|
+
* limitations under the License.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
import axios, { AxiosRequestConfig } from 'axios';
|
|
16
|
+
|
|
17
|
+
// basic configuration for axios.
|
|
18
|
+
// the 'Authorization' header is set in
|
|
19
|
+
// index.ts:setUser
|
|
20
|
+
export const getAxiosInstance = (apiPath: string) => {
|
|
21
|
+
const axiosRequestConfig: AxiosRequestConfig = {
|
|
22
|
+
baseURL: apiPath,
|
|
23
|
+
headers: {
|
|
24
|
+
Accept: 'application/json',
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
return axios.create(axiosRequestConfig);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// export function setUser(_user: User | null) {
|
|
32
|
+
// // @ts-ignore
|
|
33
|
+
// axiosInstance.defaults.headers.common["Authorization"] = `${_user?.token_type} ${_user?.access_token}`;
|
|
34
|
+
// }
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2019-2023 SURF.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License.
|
|
5
|
+
* You may obtain a copy of the License at
|
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
*
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
* See the License for the specific language governing permissions and
|
|
12
|
+
* limitations under the License.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
import { AxiosInstance } from 'axios';
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
IpBlock,
|
|
19
|
+
IpPrefix,
|
|
20
|
+
} from '../components/WfoForms/formFields/surf/types';
|
|
21
|
+
import { ProductDefinition } from '../types';
|
|
22
|
+
import { getAxiosInstance } from './axios';
|
|
23
|
+
|
|
24
|
+
const FORMS_ENDPOINT = 'surf/forms/';
|
|
25
|
+
const PROCESS_ENDPOINT = 'processes/';
|
|
26
|
+
const PRODUCTS_ENDPOINT = 'products/';
|
|
27
|
+
|
|
28
|
+
export class BaseApiClient {
|
|
29
|
+
private _axiosInstance: AxiosInstance;
|
|
30
|
+
|
|
31
|
+
constructor(apiPath: string) {
|
|
32
|
+
this._axiosInstance = getAxiosInstance(apiPath);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
axiosFetch = <R = object>(
|
|
36
|
+
path: string,
|
|
37
|
+
options = {},
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
|
+
headers = {},
|
|
40
|
+
showErrorDialog = true,
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
+
result = true,
|
|
43
|
+
): Promise<R> => {
|
|
44
|
+
// preset the config with the relative URL and a GET type.
|
|
45
|
+
// presets can be overridden with `options`.
|
|
46
|
+
return this._axiosInstance({ url: path, method: 'GET', ...options })
|
|
47
|
+
.then((res) => res.data)
|
|
48
|
+
.catch((err) => {
|
|
49
|
+
if (showErrorDialog) {
|
|
50
|
+
console.debug(
|
|
51
|
+
`Show error dialog for GET ${path} returning ${err?.response?.status}`,
|
|
52
|
+
);
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
throw err;
|
|
55
|
+
}, 250);
|
|
56
|
+
}
|
|
57
|
+
throw err;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
catchErrorStatus = <T>(
|
|
62
|
+
promise: Promise<unknown>,
|
|
63
|
+
status: number,
|
|
64
|
+
callback: (json: T) => void,
|
|
65
|
+
) => {
|
|
66
|
+
return promise.catch((err) => {
|
|
67
|
+
if (err.response && err.response.status === status) {
|
|
68
|
+
callback(err.response.data);
|
|
69
|
+
} else {
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
fetchJson = <R = object>(
|
|
76
|
+
path: string,
|
|
77
|
+
options = {},
|
|
78
|
+
headers = {},
|
|
79
|
+
showErrorDialog = true,
|
|
80
|
+
result = true,
|
|
81
|
+
): Promise<R> => {
|
|
82
|
+
return this.axiosFetch(path, options, headers, showErrorDialog, result);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
fetchJsonWithCustomErrorHandling = <R = object>(
|
|
86
|
+
path: string,
|
|
87
|
+
): Promise<R> => {
|
|
88
|
+
return this.fetchJson(path, {}, {}, false, true);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
postPutJson = <R = object>(
|
|
92
|
+
path: string,
|
|
93
|
+
processInput: object,
|
|
94
|
+
method: string,
|
|
95
|
+
showErrorDialog = true,
|
|
96
|
+
result = true,
|
|
97
|
+
): Promise<R> => {
|
|
98
|
+
return this.axiosFetch(
|
|
99
|
+
path,
|
|
100
|
+
{ method: method, data: processInput },
|
|
101
|
+
{},
|
|
102
|
+
showErrorDialog,
|
|
103
|
+
result,
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
abstract class ApiClientInterface extends BaseApiClient {
|
|
109
|
+
abstract cimStartForm: (
|
|
110
|
+
formKey: string,
|
|
111
|
+
userInputs: object[],
|
|
112
|
+
) => Promise<object>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export class ApiClient extends ApiClientInterface {
|
|
116
|
+
startProcess = (
|
|
117
|
+
workflowName: string,
|
|
118
|
+
processInput: object,
|
|
119
|
+
): Promise<unknown> => {
|
|
120
|
+
return this.postPutJson<unknown>(
|
|
121
|
+
`${PROCESS_ENDPOINT}${workflowName}`,
|
|
122
|
+
processInput,
|
|
123
|
+
'post',
|
|
124
|
+
false,
|
|
125
|
+
true,
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
products = (): Promise<ProductDefinition[]> => {
|
|
129
|
+
return this.fetchJson<ProductDefinition[]>(PRODUCTS_ENDPOINT);
|
|
130
|
+
};
|
|
131
|
+
productById = (productId: string): Promise<ProductDefinition> => {
|
|
132
|
+
return this.fetchJson(`${PRODUCTS_ENDPOINT}${productId}`);
|
|
133
|
+
};
|
|
134
|
+
cimStartForm = (
|
|
135
|
+
formKey: string,
|
|
136
|
+
userInputs: object[],
|
|
137
|
+
): Promise<{ id: string }> => {
|
|
138
|
+
return this.postPutJson(
|
|
139
|
+
`${FORMS_ENDPOINT}${formKey}`,
|
|
140
|
+
userInputs,
|
|
141
|
+
'post',
|
|
142
|
+
false,
|
|
143
|
+
true,
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
prefix_filters = (): Promise<IpPrefix[]> => {
|
|
147
|
+
return this.fetchJson('surf/ipam/prefix_filters');
|
|
148
|
+
};
|
|
149
|
+
ip_blocks = (parentPrefix: number): Promise<IpBlock[]> => {
|
|
150
|
+
return this.fetchJson('surf/ipam/ip_blocks/' + parentPrefix);
|
|
151
|
+
};
|
|
152
|
+
free_subnets = (
|
|
153
|
+
subnet: string,
|
|
154
|
+
netmask: number,
|
|
155
|
+
prefixlen: number,
|
|
156
|
+
): Promise<string[]> => {
|
|
157
|
+
return this.fetchJson(
|
|
158
|
+
'surf/ipam/free_subnets/' +
|
|
159
|
+
subnet +
|
|
160
|
+
'/' +
|
|
161
|
+
netmask +
|
|
162
|
+
'/' +
|
|
163
|
+
prefixlen,
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function getApiClient(apiEndPoint: string) {
|
|
169
|
+
return new ApiClient(apiEndPoint);
|
|
170
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { JSX, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useSession } from 'next-auth/react';
|
|
4
|
+
|
|
5
|
+
import { OrchestratorConfigContext } from '../../contexts';
|
|
6
|
+
import { WfoLoading } from '../WfoLoading';
|
|
7
|
+
|
|
8
|
+
interface AuthProps {
|
|
9
|
+
children: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const WfoAuth = ({ children }: AuthProps): JSX.Element => {
|
|
13
|
+
const { authActive } = useContext(OrchestratorConfigContext);
|
|
14
|
+
const { status } = useSession({
|
|
15
|
+
required: authActive,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (status === 'loading') {
|
|
19
|
+
return <WfoLoading />;
|
|
20
|
+
}
|
|
21
|
+
return children;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoAuth';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Meta } from '@storybook/react';
|
|
2
|
-
import { WFOBadge } from './WFOBadge';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { WfoBadge } from './WfoBadge';
|
|
4
|
+
|
|
5
|
+
const Story: Meta<typeof WfoBadge> = {
|
|
6
|
+
component: WfoBadge,
|
|
7
|
+
title: 'Badges/WfoBadge',
|
|
7
8
|
};
|
|
8
9
|
export default Story;
|
|
9
10
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { EuiBadge, EuiBadgeProps, EuiText } from '@elastic/eui';
|
|
3
2
|
import { FC, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { EuiBadge, EuiBadgeProps, EuiText } from '@elastic/eui';
|
|
4
5
|
import { TextColor } from '@elastic/eui/src/components/text/text_color';
|
|
5
6
|
|
|
6
|
-
export type
|
|
7
|
+
export type WfoBadgeProps = EuiBadgeProps & {
|
|
7
8
|
textColor: TextColor | string;
|
|
8
9
|
children: ReactNode;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
+
export const WfoBadge: FC<WfoBadgeProps> = ({
|
|
12
13
|
textColor,
|
|
13
14
|
children,
|
|
14
15
|
...restProps
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoBadge';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import type { Meta } from '@storybook/react';
|
|
3
|
-
import { WFOEngineStatusBadge } from './WFOEngineStatusBadge';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { WfoEngineStatusBadge } from './WfoEngineStatusBadge';
|
|
6
|
+
|
|
7
|
+
const Story: Meta<typeof WfoEngineStatusBadge> = {
|
|
6
8
|
component: (args) => (
|
|
7
9
|
<div style={{ display: 'flex' }}>
|
|
8
|
-
<
|
|
10
|
+
<WfoEngineStatusBadge {...args} />
|
|
9
11
|
</div>
|
|
10
12
|
),
|
|
11
|
-
title: 'Badges/
|
|
13
|
+
title: 'Badges/WfoEngineStatusBadge',
|
|
12
14
|
parameters: {
|
|
13
15
|
mockData: [
|
|
14
16
|
{
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { WFOHeaderBadge } from '../WFOHeaderBadge';
|
|
2
|
+
|
|
4
3
|
import { useEngineStatusQuery } from '../../../hooks/useEngineStatusQuery';
|
|
5
|
-
import {
|
|
4
|
+
import { useOrchestratorTheme } from '../../../hooks/useOrchestratorTheme';
|
|
5
|
+
import { WfoStatusDotIcon } from '../../../icons/WfoStatusDotIcon';
|
|
6
|
+
import { WfoHeaderBadge } from '../WfoHeaderBadge';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
+
export const WfoEngineStatusBadge = () => {
|
|
8
9
|
const { theme } = useOrchestratorTheme();
|
|
9
10
|
const { data: engineStatus } = useEngineStatusQuery();
|
|
10
11
|
|
|
@@ -12,13 +13,18 @@ export const WFOEngineStatusBadge = () => {
|
|
|
12
13
|
? `Engine is ${engineStatus.global_status}`
|
|
13
14
|
: 'Engine status is unavailable';
|
|
14
15
|
|
|
16
|
+
const engineColor =
|
|
17
|
+
engineStatus?.global_status === 'RUNNING'
|
|
18
|
+
? theme.colors.success
|
|
19
|
+
: theme.colors.warning;
|
|
20
|
+
|
|
15
21
|
return (
|
|
16
|
-
<
|
|
22
|
+
<WfoHeaderBadge
|
|
17
23
|
color={theme.colors.emptyShade}
|
|
18
24
|
textColor={theme.colors.shadow}
|
|
19
|
-
iconType={() => <
|
|
25
|
+
iconType={() => <WfoStatusDotIcon color={engineColor} />}
|
|
20
26
|
>
|
|
21
27
|
{engineStatusText}
|
|
22
|
-
</
|
|
28
|
+
</WfoHeaderBadge>
|
|
23
29
|
);
|
|
24
30
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoEngineStatusBadge';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import type { Meta } from '@storybook/react';
|
|
3
|
-
import { WFOEnvironmentBadge } from './WFOEnvironmentBadge';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { WfoEnvironmentBadge } from './WfoEnvironmentBadge';
|
|
6
|
+
|
|
7
|
+
const Story: Meta<typeof WfoEnvironmentBadge> = {
|
|
6
8
|
component: (args) => (
|
|
7
9
|
<div style={{ display: 'flex' }}>
|
|
8
|
-
<
|
|
10
|
+
<WfoEnvironmentBadge {...args} />
|
|
9
11
|
</div>
|
|
10
12
|
),
|
|
11
|
-
title: 'Badges/
|
|
13
|
+
title: 'Badges/WfoEnvironmentBadge',
|
|
12
14
|
};
|
|
13
15
|
export default Story;
|
|
14
16
|
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
import { WFOHeaderBadge } from '../WFOHeaderBadge/WFOHeaderBadge';
|
|
2
|
+
|
|
4
3
|
import { OrchestratorConfigContext } from '../../../contexts/OrchestratorConfigContext';
|
|
5
4
|
import { Environment } from '../../../hooks/useOrchestratorConfig';
|
|
5
|
+
import { useOrchestratorTheme } from '../../../hooks/useOrchestratorTheme';
|
|
6
|
+
import { WfoHeaderBadge } from '../WfoHeaderBadge/WfoHeaderBadge';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
+
export const WfoEnvironmentBadge = () => {
|
|
8
9
|
const { environmentName } = useContext(OrchestratorConfigContext);
|
|
9
10
|
const { theme, toSecondaryColor } = useOrchestratorTheme();
|
|
10
11
|
|
|
11
12
|
if (environmentName !== Environment.PRODUCTION) {
|
|
12
13
|
return (
|
|
13
|
-
<
|
|
14
|
+
<WfoHeaderBadge color="warning" textColor={theme.colors.shadow}>
|
|
14
15
|
{environmentName}
|
|
15
|
-
</
|
|
16
|
+
</WfoHeaderBadge>
|
|
16
17
|
);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
|
-
<
|
|
21
|
+
<WfoHeaderBadge
|
|
21
22
|
color={toSecondaryColor(theme.colors.primary)}
|
|
22
23
|
textColor={theme.colors.primary}
|
|
23
24
|
>
|
|
24
25
|
{environmentName}
|
|
25
|
-
</
|
|
26
|
+
</WfoHeaderBadge>
|
|
26
27
|
);
|
|
27
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoEnvironmentBadge';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { WfoFailedTasksBadge } from './WfoFailedTasksBadge';
|
|
4
|
+
|
|
5
|
+
const Story: Meta<typeof WfoFailedTasksBadge> = {
|
|
6
|
+
component: WfoFailedTasksBadge,
|
|
7
|
+
title: 'Badges/WfoFailedTasksBadge',
|
|
8
|
+
};
|
|
9
|
+
export default Story;
|
|
10
|
+
|
|
11
|
+
export const Primary = {
|
|
12
|
+
args: {},
|
|
13
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import { EuiToolTip } from '@elastic/eui';
|
|
6
|
+
|
|
7
|
+
import { useOrchestratorTheme } from '../../../hooks/useOrchestratorTheme';
|
|
8
|
+
import {
|
|
9
|
+
ProcessStatusCounts,
|
|
10
|
+
useProcessStatusCountsQuery,
|
|
11
|
+
} from '../../../hooks/useProcessStatusCountsQuery';
|
|
12
|
+
import { WfoCheckmarkCircleFill } from '../../../icons';
|
|
13
|
+
import { WfoXCircleFill } from '../../../icons/WfoXCircleFill';
|
|
14
|
+
import { WfoHeaderBadge } from '../WfoHeaderBadge';
|
|
15
|
+
|
|
16
|
+
type TaskCountsSummary = {
|
|
17
|
+
failed: number;
|
|
18
|
+
inconsistentData: number;
|
|
19
|
+
apiUnavailable: number;
|
|
20
|
+
total: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getTaskCountsSummary = (
|
|
24
|
+
processStatusCounts?: ProcessStatusCounts,
|
|
25
|
+
): TaskCountsSummary => {
|
|
26
|
+
const failed = processStatusCounts?.task_counts.failed || 0;
|
|
27
|
+
const inconsistentData =
|
|
28
|
+
processStatusCounts?.task_counts.inconsistent_data || 0;
|
|
29
|
+
const apiUnavailable =
|
|
30
|
+
processStatusCounts?.task_counts.api_unavailable || 0;
|
|
31
|
+
return {
|
|
32
|
+
failed,
|
|
33
|
+
inconsistentData,
|
|
34
|
+
apiUnavailable,
|
|
35
|
+
total: failed + inconsistentData + apiUnavailable,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const WfoFailedTasksBadge = () => {
|
|
40
|
+
const t = useTranslations('common');
|
|
41
|
+
const { theme } = useOrchestratorTheme();
|
|
42
|
+
const { data: processStatusCounts } = useProcessStatusCountsQuery();
|
|
43
|
+
const taskCountsSummary = getTaskCountsSummary(processStatusCounts);
|
|
44
|
+
|
|
45
|
+
if (taskCountsSummary.total != 0) {
|
|
46
|
+
return (
|
|
47
|
+
<EuiToolTip
|
|
48
|
+
position="bottom"
|
|
49
|
+
content={
|
|
50
|
+
<>
|
|
51
|
+
<div>Failed: {taskCountsSummary.failed}</div>
|
|
52
|
+
<div>
|
|
53
|
+
Inconsistent data:{' '}
|
|
54
|
+
{taskCountsSummary.inconsistentData}
|
|
55
|
+
</div>
|
|
56
|
+
<div>
|
|
57
|
+
API unavailable: {taskCountsSummary.apiUnavailable}
|
|
58
|
+
</div>
|
|
59
|
+
</>
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
<WfoHeaderBadge
|
|
63
|
+
color={theme.colors.emptyShade}
|
|
64
|
+
textColor={theme.colors.shadow}
|
|
65
|
+
iconType={() => (
|
|
66
|
+
<WfoXCircleFill color={theme.colors.danger} />
|
|
67
|
+
)}
|
|
68
|
+
>
|
|
69
|
+
{taskCountsSummary.total}
|
|
70
|
+
</WfoHeaderBadge>
|
|
71
|
+
</EuiToolTip>
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
return (
|
|
75
|
+
<EuiToolTip
|
|
76
|
+
position="bottom"
|
|
77
|
+
content={
|
|
78
|
+
<>
|
|
79
|
+
<div>{t('noFailedTasks')}</div>
|
|
80
|
+
</>
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
<WfoHeaderBadge
|
|
84
|
+
color={theme.colors.emptyShade}
|
|
85
|
+
textColor={theme.colors.shadow}
|
|
86
|
+
iconType={() => (
|
|
87
|
+
<WfoCheckmarkCircleFill color={theme.colors.success} />
|
|
88
|
+
)}
|
|
89
|
+
>
|
|
90
|
+
{taskCountsSummary.total}
|
|
91
|
+
</WfoHeaderBadge>
|
|
92
|
+
</EuiToolTip>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoFailedTasksBadge';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import type { Meta } from '@storybook/react';
|
|
3
|
-
import { WFOHeaderBadge } from './WFOHeaderBadge';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { WfoHeaderBadge } from './WfoHeaderBadge';
|
|
6
|
+
|
|
7
|
+
const Story: Meta<typeof WfoHeaderBadge> = {
|
|
6
8
|
component: (args) => (
|
|
7
9
|
<div style={{ display: 'flex' }}>
|
|
8
|
-
<
|
|
10
|
+
<WfoHeaderBadge {...args} />
|
|
9
11
|
</div>
|
|
10
12
|
),
|
|
11
|
-
title: 'Badges/
|
|
13
|
+
title: 'Badges/WfoHeaderBadge',
|
|
12
14
|
};
|
|
13
15
|
export default Story;
|
|
14
16
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
2
3
|
import { EuiBadgeProps } from '@elastic/eui';
|
|
3
|
-
import { WFOBadge } from '../WFOBadge/WFOBadge';
|
|
4
4
|
import { TextColor } from '@elastic/eui/src/components/text/text_color';
|
|
5
5
|
|
|
6
|
+
import { WfoBadge } from '../WfoBadge/WfoBadge';
|
|
7
|
+
|
|
6
8
|
export type HeaderBadgeProps = EuiBadgeProps & {
|
|
7
9
|
textColor: TextColor | string;
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
export const
|
|
13
|
+
export const WfoHeaderBadge: FC<HeaderBadgeProps> = ({
|
|
12
14
|
children,
|
|
13
15
|
...restProps
|
|
14
16
|
}) => {
|
|
@@ -24,8 +26,8 @@ export const WFOHeaderBadge: FC<HeaderBadgeProps> = ({
|
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
return (
|
|
27
|
-
<
|
|
29
|
+
<WfoBadge {...restProps} css={css}>
|
|
28
30
|
{children}
|
|
29
|
-
</
|
|
31
|
+
</WfoBadge>
|
|
30
32
|
);
|
|
31
33
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoHeaderBadge';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
-
import { ProcessStatus, useOrchestratorTheme } from '../../../hooks';
|
|
3
|
-
import { WFOBadge } from '../WFOBadge';
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
import { useOrchestratorTheme } from '../../../hooks';
|
|
4
|
+
import { ProcessStatus } from '../../../types';
|
|
5
|
+
import { WfoBadge } from '../WfoBadge';
|
|
6
|
+
|
|
7
|
+
export type WfoProcessStatusBadgeProps = {
|
|
6
8
|
processStatus: ProcessStatus;
|
|
7
9
|
};
|
|
8
10
|
|
|
9
|
-
export const
|
|
11
|
+
export const WfoProcessStatusBadge: FC<WfoProcessStatusBadgeProps> = ({
|
|
10
12
|
processStatus,
|
|
11
13
|
}) => {
|
|
12
14
|
const { theme, toSecondaryColor } = useOrchestratorTheme();
|
|
@@ -64,8 +66,8 @@ export const WFOProcessStatusBadge: FC<WFOProcessStatusBadgeProps> = ({
|
|
|
64
66
|
getBadgeColorFromProcessStatus(processStatus);
|
|
65
67
|
|
|
66
68
|
return (
|
|
67
|
-
<
|
|
69
|
+
<WfoBadge textColor={textColor} color={badgeColor}>
|
|
68
70
|
{processStatus.toLowerCase()}
|
|
69
|
-
</
|
|
71
|
+
</WfoBadge>
|
|
70
72
|
);
|
|
71
73
|
};
|