@orchestrator-ui/orchestrator-ui-components 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.js +1 -1
- package/.turbo/turbo-build.log +9 -7
- package/.turbo/turbo-lint.log +3 -6
- package/.turbo/turbo-test.log +17 -9
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1116 -359
- package/dist/index.js +23126 -6279
- package/jest.config.cjs +0 -1
- package/package.json +24 -8
- package/src/api/axios.ts +34 -0
- package/src/api/index.ts +170 -0
- package/src/components/WfoAuth/WfoAuth.tsx +22 -0
- package/src/components/WfoAuth/index.ts +1 -0
- package/src/components/{WFOBadges/WFOBadge/WFOBadge.stories.tsx → WfoBadges/WfoBadge/WfoBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOBadge/WFOBadge.tsx → WfoBadges/WfoBadge/WfoBadge.tsx} +4 -3
- package/src/components/WfoBadges/WfoBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.stories.tsx → WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.tsx → WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.tsx} +13 -7
- package/src/components/WfoBadges/WfoEngineStatusBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.stories.tsx → WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.tsx → WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.tsx} +8 -7
- package/src/components/WfoBadges/WfoEnvironmentBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.stories.tsx +13 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +95 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOHeaderBadge/WFOHeaderBadge.stories.tsx → WfoBadges/WfoHeaderBadge/WfoHeaderBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOHeaderBadge/WFOHeaderBadge.tsx → WfoBadges/WfoHeaderBadge/WfoHeaderBadge.tsx} +6 -4
- package/src/components/WfoBadges/WfoHeaderBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOProcessStatusBadge/WFOProcessStatusBadge.tsx → WfoBadges/WfoProcessStatusBadge/WfoProcessStatusBadge.tsx} +8 -6
- package/src/components/WfoBadges/WfoProcessStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.stories.tsx +16 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +70 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.stories.tsx +22 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +53 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOStatusBadge/WFOStatusBadge.stories.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOStatusBadge/WFOStatusBadge.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx} +14 -10
- package/src/components/WfoBadges/WfoSubscriptionStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/WfoWorkflowTargetBadge.tsx +65 -0
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/index.ts +1 -0
- package/src/components/WfoBadges/index.ts +9 -0
- package/src/components/WfoButtonComboBox/WfoButtonComboBox.tsx +76 -0
- package/src/components/WfoButtonComboBox/styles.ts +13 -0
- package/src/components/WfoDateTime/WfoDateTime.tsx +28 -0
- package/src/components/WfoDateTime/index.ts +1 -0
- package/src/components/WfoDropdownButton/WfoDropdownButton.tsx +67 -0
- package/src/components/WfoDropdownButton/index.ts +1 -0
- package/src/components/{WFOFilterTabs/WFOFilterTabs.tsx → WfoFilterTabs/WfoFilterTabs.tsx} +8 -6
- package/src/components/WfoFilterTabs/index.ts +1 -0
- package/src/components/WfoForms/AutoFieldLoader.tsx +110 -0
- package/src/components/WfoForms/AutoFields.tsx +49 -0
- package/src/components/WfoForms/CreateForm.tsx +71 -0
- package/src/components/WfoForms/UserInputForm.tsx +607 -0
- package/src/components/WfoForms/UserInputFormStyling.ts +80 -0
- package/src/components/WfoForms/UserInputFormWizard.tsx +120 -0
- package/src/components/WfoForms/formFields/AcceptField.tsx +239 -0
- package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +29 -0
- package/src/components/WfoForms/formFields/BoolField.tsx +71 -0
- package/src/components/WfoForms/formFields/BoolFieldStyling.ts +68 -0
- package/src/components/WfoForms/formFields/ContactPersonAutocomplete.tsx +97 -0
- package/src/components/WfoForms/formFields/ContactPersonAutocompleteStyles.ts +40 -0
- package/src/components/WfoForms/formFields/ContactPersonNameField.tsx +253 -0
- package/src/components/WfoForms/formFields/DateField.tsx +72 -0
- package/src/components/WfoForms/formFields/DividerField.tsx +29 -0
- package/src/components/WfoForms/formFields/ErrorField.tsx +40 -0
- package/src/components/WfoForms/formFields/ErrorsField.tsx +34 -0
- package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +110 -0
- package/src/components/WfoForms/formFields/IpNetworkField.tsx +128 -0
- package/src/components/WfoForms/formFields/IpPrefixTableField.tsx +454 -0
- package/src/components/WfoForms/formFields/IpPrefixTableFieldStyling.ts +117 -0
- package/src/components/WfoForms/formFields/LabelField.tsx +39 -0
- package/src/components/WfoForms/formFields/ListAddField.tsx +98 -0
- package/src/components/WfoForms/formFields/ListDelField.tsx +95 -0
- package/src/components/WfoForms/formFields/ListField.tsx +113 -0
- package/src/components/WfoForms/formFields/ListItemField.tsx +40 -0
- package/src/components/WfoForms/formFields/ListSelectField.tsx +92 -0
- package/src/components/WfoForms/formFields/LocationCodeField.tsx +66 -0
- package/src/components/WfoForms/formFields/LongTextField.tsx +68 -0
- package/src/components/WfoForms/formFields/NestField.tsx +107 -0
- package/src/components/WfoForms/formFields/NumField.tsx +75 -0
- package/src/components/WfoForms/formFields/OptGroupField.tsx +74 -0
- package/src/components/WfoForms/formFields/OrganisationField.tsx +57 -0
- package/src/components/WfoForms/formFields/ProductField.tsx +78 -0
- package/src/components/WfoForms/formFields/RadioField.tsx +87 -0
- package/src/components/WfoForms/formFields/SelectField.tsx +152 -0
- package/src/components/WfoForms/formFields/SplitPrefix.tsx +163 -0
- package/src/components/WfoForms/formFields/SplitPrefixStyling.ts +11 -0
- package/src/components/WfoForms/formFields/SubmitField.tsx +50 -0
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +351 -0
- package/src/components/WfoForms/formFields/SubscriptionFieldStyling.ts +33 -0
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +75 -0
- package/src/components/WfoForms/formFields/TextField.tsx +71 -0
- package/src/components/WfoForms/formFields/TimestampField.tsx +103 -0
- package/src/components/WfoForms/formFields/VlanField.tsx +297 -0
- package/src/components/WfoForms/formFields/index.ts +29 -0
- package/src/components/WfoForms/formFields/listFieldStyling.ts +86 -0
- package/src/components/WfoForms/formFields/reactSelectStyles.ts +45 -0
- package/src/components/WfoForms/formFields/surf/types.ts +53 -0
- package/src/components/WfoForms/formFields/surf/utils.ts +1 -0
- package/src/components/WfoForms/formFields/types.ts +50 -0
- package/src/components/WfoForms/formFields/utils.spec.ts +196 -0
- package/src/components/WfoForms/formFields/utils.ts +65 -0
- package/src/components/WfoForms/index.ts +5 -0
- package/src/components/WfoForms/useAxiosApiClient.ts +8 -0
- package/src/components/WfoInsyncIcon/WfoInsyncIcon.stories.tsx +21 -0
- package/src/components/WfoInsyncIcon/WfoInsyncIcon.tsx +26 -0
- package/src/components/WfoInsyncIcon/index.ts +1 -0
- package/src/components/WfoJsonCodeBlock/WfoJsonCodeBlock.tsx +27 -0
- package/src/components/WfoJsonCodeBlock/styles.ts +13 -0
- package/src/components/WfoKeyValueTable/WfoKeyCell.tsx +25 -0
- package/src/components/WfoKeyValueTable/WfoKeyValueTable.tsx +41 -0
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +53 -0
- package/src/components/WfoKeyValueTable/index.ts +3 -0
- package/src/components/WfoKeyValueTable/styles.ts +77 -0
- package/src/components/WfoLoading/WfoLoading.tsx +3 -0
- package/src/components/WfoLoading/index.ts +1 -0
- package/src/components/WfoNoResults/WfoNoResults.stories.tsx +19 -0
- package/src/components/WfoNoResults/WfoNoResults.tsx +22 -0
- package/src/components/WfoNoResults/index.ts +1 -0
- package/src/components/WfoNoResults/styles.ts +22 -0
- package/src/components/WfoPageHeader/WfoPageHeader.tsx +25 -0
- package/src/components/{WFOBreadcrumbs/WFOBreadcrumbs.tsx → WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx} +6 -3
- package/src/components/WfoPageTemplate/WfoBreadcrumbs/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOPageHeader/WFOPageHeader.stories.tsx → WfoPageTemplate/WfoPageHeader/WfoPageHeader.stories.tsx} +7 -5
- package/src/components/{WFOPageTemplate/WFOPageHeader/WFOPageHeader.tsx → WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx} +26 -11
- package/src/components/WfoPageTemplate/WfoPageHeader/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.stories.tsx → WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.stories.tsx} +8 -6
- package/src/components/{WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.tsx → WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx} +20 -8
- package/src/components/WfoPageTemplate/WfoPageTemplate/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOSidebar/WFOSidebar.stories.tsx → WfoPageTemplate/WfoSidebar/WfoSidebar.stories.tsx} +6 -4
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +161 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +58 -0
- package/src/components/WfoPageTemplate/WfoSidebar/index.ts +1 -0
- package/src/components/WfoPageTemplate/index.ts +4 -0
- package/src/components/WfoPageTemplate/paths.ts +11 -0
- package/src/components/WfoProcessesList/WfoProcessList.tsx +227 -0
- package/src/components/WfoProcessesList/processListObjectMappers.ts +79 -0
- package/src/components/{WFOSearchBar/WFOSearchField.tsx → WfoSearchBar/WfoSearchField.tsx} +4 -3
- package/src/components/WfoSearchBar/index.ts +1 -0
- package/src/components/WfoSettingsModal/WfoInformationModal.tsx +41 -0
- package/src/components/{WFOSettingsModal/WFOSettingsModal.tsx → WfoSettingsModal/WfoSettingsModal.tsx} +3 -2
- package/src/components/WfoSettingsModal/index.tsx +2 -0
- package/src/components/{WFOSettingsPage/WFOEngineStatusButton.tsx → WfoSettingsPage/WfoEngineStatusButton.tsx} +5 -3
- package/src/components/{WFOSettingsPage/WFOFlushSettings.tsx → WfoSettingsPage/WfoFlushSettings.tsx} +19 -30
- package/src/components/{WFOSettingsPage/WFOModifySettings.tsx → WfoSettingsPage/WfoModifySettings.tsx} +7 -5
- package/src/components/{WFOSettingsPage/WFOSettings.tsx → WfoSettingsPage/WfoSettings.tsx} +12 -8
- package/src/components/{WFOSettingsPage/WFOStatus.tsx → WfoSettingsPage/WfoStatus.tsx} +8 -6
- package/src/components/WfoSettingsPage/index.ts +1 -0
- package/src/components/{WFOStartPage/WFOFrequentlyUsed.stories.tsx → WfoStartPage/WfoFrequentlyUsed.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOFrequentlyUsed.tsx → WfoStartPage/WfoFrequentlyUsed.tsx} +4 -3
- package/src/components/{WFOStartPage/WFOListItemStartPage.stories.tsx → WfoStartPage/WfoListItemStartPage.stories.tsx} +6 -4
- package/src/components/{WFOStartPage/WFOListItemStartPage.tsx → WfoStartPage/WfoListItemStartPage.tsx} +9 -6
- package/src/components/{WFOStartPage/WFOListStartPage.stories.tsx → WfoStartPage/WfoListStartPage.stories.tsx} +6 -4
- package/src/components/{WFOStartPage/WFOListStartPage.tsx → WfoStartPage/WfoListStartPage.tsx} +7 -5
- package/src/components/{WFOStartPage/WFOMultiListSection.stories.tsx → WfoStartPage/WfoMultiListSection.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOMultiListSection.tsx → WfoStartPage/WfoMultiListSection.tsx} +7 -5
- package/src/components/WfoStartPage/WfoNewProcessPanel.stories.tsx +13 -0
- package/src/components/{WFOStartPage/WFONewProcessPanel.tsx → WfoStartPage/WfoNewProcessPanel.tsx} +5 -3
- package/src/components/WfoStartPage/WfoStatCards.stories.tsx +13 -0
- package/src/components/{WFOStartPage/WFOStatCards.tsx → WfoStartPage/WfoStatCards.tsx} +4 -2
- package/src/components/WfoStartPage/index.ts +6 -0
- package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +51 -0
- package/src/components/WfoStartTaskButtonComboBox/index.ts +1 -0
- package/src/components/WfoSubscription/SubscriptionKeyValueBlock.tsx +46 -0
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +158 -0
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +192 -0
- package/src/components/WfoSubscription/WfoSubscription.tsx +145 -0
- package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +236 -0
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +161 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +147 -0
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +207 -0
- package/src/components/WfoSubscription/index.ts +8 -0
- package/src/components/WfoSubscription/styles.ts +104 -0
- package/src/components/WfoSubscription/utils/index.ts +1 -0
- package/src/components/WfoSubscription/utils/utils.spec.ts +168 -0
- package/src/components/WfoSubscription/utils/utils.ts +76 -0
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +205 -0
- package/src/components/WfoSubscriptionsList/index.ts +3 -0
- package/src/components/WfoSubscriptionsList/mapGrapghQlSubscriptionsResultToSubscriptionListItems.ts +43 -0
- package/src/{pages/subscriptions → components/WfoSubscriptionsList}/subscriptionListTabs.ts +18 -18
- package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +178 -0
- package/src/components/{WFOTable/WFOSortDirectionIcon.tsx → WfoTable/WfoBasicTable/WfoSortDirectionIcon.tsx} +8 -8
- package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +21 -0
- package/src/components/WfoTable/WfoBasicTable/WfoTableHeaderCell.tsx +120 -0
- package/src/components/WfoTable/WfoBasicTable/index.ts +4 -0
- package/src/components/WfoTable/WfoBasicTable/styles.ts +73 -0
- package/src/components/{WFOTable/WFODataGridTable/WFODataGridTable.stories.tsx → WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx} +9 -7
- package/src/components/{WFOTable/WFODataGridTable/WFODataGridTable.tsx → WfoTable/WfoDataGridTable/WfoDataGridTable.tsx} +23 -21
- package/src/components/{WFOTable/WFODataGridTable/WFOdataGridColumns.spec.ts → WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts} +7 -7
- package/src/components/{WFOTable/WFODataGridTable/WFOdataGridColumns.ts → WfoTable/WfoDataGridTable/WfodataGridColumns.ts} +8 -7
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +11 -0
- package/src/components/WfoTable/WfoFirstPartUUID/index.ts +1 -0
- package/src/components/WfoTable/WfoSortButtons/WfoSortButton.tsx +31 -0
- package/src/components/WfoTable/WfoSortButtons/WfoSortButtons.tsx +33 -0
- package/src/components/WfoTable/WfoSortButtons/index.ts +2 -0
- package/src/components/WfoTable/WfoSortButtons/styles.ts +20 -0
- package/src/components/{WFOTable/WFOTableSettingsModal/WFOTableSettingsModal.tsx → WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx} +5 -3
- package/src/components/WfoTable/WfoTableSettingsModal/index.ts +1 -0
- package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +253 -0
- package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -0
- package/src/components/WfoTable/index.ts +15 -0
- package/src/components/{WFOTable → WfoTable}/utils/columns.ts +27 -16
- package/src/components/{WFOTable → WfoTable}/utils/constants.ts +5 -1
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +52 -0
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +21 -0
- package/src/components/{WFOTable → WfoTable}/utils/tableConfigPersistence.spec.ts +4 -4
- package/src/components/{WFOTable → WfoTable}/utils/tableConfigPersistence.ts +12 -16
- package/src/components/{WFOTable → WfoTable}/utils/tableUtils.spec.ts +1 -1
- package/src/components/{WFOTable → WfoTable}/utils/tableUtils.ts +6 -25
- package/src/components/WfoTimeline/WfoTimeline.tsx +69 -0
- package/src/components/WfoTimeline/WfoTimelineStep.tsx +57 -0
- package/src/components/WfoTimeline/index.ts +1 -0
- package/src/components/WfoTimeline/mapProcessStepStatusToEuiStepStatus.ts +23 -0
- package/src/components/WfoTimeline/styles.ts +165 -0
- package/src/components/WfoTimeline/timelineUtils.ts +14 -0
- package/src/components/WfoToastsList/WfoToastsList.tsx +22 -0
- package/src/components/WfoToastsList/index.ts +1 -0
- package/src/components/WfoTree/WfoTree.tsx +27 -0
- package/src/components/{WFOTree/WFOTreeBranch.tsx → WfoTree/WfoTreeBranch.tsx} +7 -6
- package/src/components/{WFOTree/WFOTreeNode.tsx → WfoTree/WfoTreeNode.tsx} +28 -13
- package/src/components/WfoTree/index.ts +4 -0
- package/src/components/WfoTree/styles.ts +18 -0
- package/src/components/WfoTree/treeUtils.spec.ts +100 -0
- package/src/components/WfoTree/treeUtils.ts +21 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.stories.tsx +13 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +167 -0
- package/src/components/WfoWorkflowSteps/WfoStep/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +107 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.stories.tsx +16 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +114 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +139 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.stories.tsx +56 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +121 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/index.ts +2 -0
- package/src/components/WfoWorkflowSteps/index.ts +4 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.spec.ts +26 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.ts +56 -0
- package/src/components/WfoWorkflowSteps/styles.ts +121 -0
- package/src/components/confirmationDialog/ConfirmationDialogStyling.ts +12 -0
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +112 -0
- package/src/components/confirmationDialog/index.ts +1 -0
- package/src/components/index.ts +19 -11
- package/src/contexts/ApiClientContext.tsx +30 -0
- package/src/contexts/ConfirmationDialogProvider.tsx +99 -0
- package/src/contexts/OrchestratorConfigContext.tsx +8 -3
- package/src/contexts/ToastContext.tsx +136 -0
- package/src/contexts/TreeContext.tsx +53 -32
- package/src/contexts/index.ts +3 -1
- package/src/graphqlQueries/customersQuery.ts +19 -0
- package/src/graphqlQueries/index.ts +6 -1
- package/src/graphqlQueries/processDetailQuery.ts +45 -0
- package/src/graphqlQueries/processListQuery.ts +19 -12
- package/src/graphqlQueries/productBlocksQuery.ts +13 -1
- package/src/graphqlQueries/productsQuery.ts +7 -4
- package/src/graphqlQueries/relatedSubscriptionsQuery.ts +65 -0
- package/src/graphqlQueries/resourceTypesQuery.ts +13 -2
- package/src/graphqlQueries/subscriptionDetailQuery.ts +62 -0
- package/src/graphqlQueries/subscriptionsDropdownOptionsQuery.ts +47 -0
- package/src/graphqlQueries/subscriptionsListQuery.ts +59 -0
- package/src/graphqlQueries/{workflowsQuery.ts → workflows/workflowsQuery.ts} +10 -5
- package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +41 -0
- package/src/hooks/DataFetchHooks.ts +72 -49
- package/src/hooks/ProcessesHooks/useDeleteProcess.ts +37 -0
- package/src/hooks/index.ts +4 -1
- package/src/hooks/surf/useGetSubscriptionDropdownOptions.ts +47 -0
- package/src/hooks/surf/useIsTaggedPort.ts +29 -0
- package/src/hooks/useDataDisplayParams.ts +1 -1
- package/src/hooks/useEngineStatusQuery.ts +20 -10
- package/src/hooks/useOrchestratorConfig.ts +6 -2
- package/src/hooks/useProcessStatusCountsQuery.ts +8 -23
- package/src/hooks/useQueryWithFetch.ts +33 -0
- package/src/hooks/useQueryWithGraphql.ts +18 -13
- package/src/hooks/useSessionWithToken.ts +14 -0
- package/src/hooks/useStoredTableConfig.ts +43 -0
- package/src/hooks/useSubscriptionActions.ts +3 -3
- package/src/hooks/useToastMessage.ts +5 -0
- package/src/hooks/useWithOrchestratorTheme.ts +10 -0
- package/src/icons/WfoArrowNarrowDown.stories.tsx +13 -0
- package/src/icons/{WFOArrowNarrowDown.tsx → WfoArrowNarrowDown.tsx} +4 -2
- package/src/icons/WfoArrowNarrowUp.stories.tsx +13 -0
- package/src/icons/{WFOArrowNarrowUp.tsx → WfoArrowNarrowUp.tsx} +4 -2
- package/src/icons/WfoArrowsExpand.stories.tsx +13 -0
- package/src/icons/WfoArrowsExpand.tsx +33 -0
- package/src/icons/WfoCheckmarkCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOCheckmarkCircleFill.tsx → WfoCheckmarkCircleFill.tsx} +3 -2
- package/src/icons/WfoChevronDown.stories.tsx +13 -0
- package/src/icons/{WFOChevronDown.tsx → WfoChevronDown.tsx} +3 -2
- package/src/icons/WfoChevronUp.stories.tsx +13 -0
- package/src/icons/WfoChevronUp.tsx +33 -0
- package/src/icons/WfoClipboardCopy.stories.tsx +13 -0
- package/src/icons/WfoClipboardCopy.tsx +33 -0
- package/src/icons/WfoCode.stories.tsx +13 -0
- package/src/icons/WfoCode.tsx +35 -0
- package/src/icons/WfoCogFill.stories.tsx +13 -0
- package/src/icons/WfoCogFill.tsx +35 -0
- package/src/icons/WfoEyeFill.stories.tsx +13 -0
- package/src/icons/WfoEyeFill.tsx +35 -0
- package/src/icons/{WFOIconProps.ts → WfoIconProps.ts} +1 -1
- package/src/icons/WfoLogoutIcon.stories.tsx +13 -0
- package/src/icons/{WFOLogoutIcon.tsx → WfoLogoutIcon.tsx} +3 -2
- package/src/icons/WfoMinusCircleFill.stories.tsx +13 -0
- package/src/icons/WfoMinusCircleFill.tsx +33 -0
- package/src/icons/WfoMinusCircleOutline.stories.tsx +13 -0
- package/src/icons/{WFOMinusCircleOutline.tsx → WfoMinusCircleOutline.tsx} +3 -2
- package/src/icons/WfoPencilAlt.stories.tsx +13 -0
- package/src/icons/WfoPencilAlt.tsx +33 -0
- package/src/icons/WfoPlayFill.stories.tsx +13 -0
- package/src/icons/WfoPlayFill.tsx +35 -0
- package/src/icons/WfoPlusCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOPlusCircleFill.tsx → WfoPlusCircleFill.tsx} +3 -2
- package/src/icons/WfoRefresh.stories.tsx +13 -0
- package/src/icons/WfoRefresh.tsx +35 -0
- package/src/icons/WfoSearchStrikethrough.stories.tsx +13 -0
- package/src/icons/WfoSearchStrikethrough.tsx +33 -0
- package/src/icons/WfoSortAsc.stories.tsx +13 -0
- package/src/icons/WfoSortAsc.tsx +33 -0
- package/src/icons/WfoSortDesc.stories.tsx +13 -0
- package/src/icons/WfoSortDesc.tsx +33 -0
- package/src/icons/WfoStatistic.tsx +41 -0
- package/src/icons/WfoStatusDotIcon.stories.tsx +13 -0
- package/src/icons/{WFOStatusDotIcon.tsx → WfoStatusDotIcon.tsx} +3 -2
- package/src/icons/WfoXCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOXCircleFill.tsx → WfoXCircleFill.tsx} +3 -2
- package/src/icons/index.ts +22 -10
- package/src/index.ts +2 -0
- package/src/messages/en-US.json +175 -21
- package/src/messages/getTranslationMessages.spec.ts +1 -1
- package/src/messages/getTranslationMessages.ts +1 -1
- package/src/messages/nl-NL.json +179 -23
- package/src/pages/index.ts +2 -0
- package/src/pages/metadata/{WFOMetadataPageLayout.tsx → WfoMetadataPageLayout.tsx} +5 -3
- package/src/pages/metadata/WfoProductBlocksPage.tsx +239 -0
- package/src/pages/metadata/{WFOProductsPage.tsx → WfoProductsPage.tsx} +96 -52
- package/src/pages/metadata/WfoResourceTypesPage.tsx +185 -0
- package/src/pages/metadata/WfoWorkflowsPage.tsx +194 -0
- package/src/pages/metadata/index.ts +4 -4
- package/src/pages/metadata/workflowListObjectMapper.ts +43 -0
- package/src/pages/processes/WfoProcessDetail.tsx +327 -0
- package/src/pages/processes/WfoProcessDetailPage.tsx +88 -0
- package/src/pages/processes/WfoProcessListPage.tsx +106 -0
- package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +72 -0
- package/src/pages/processes/getProcessListTabTypeFromString.ts +6 -6
- package/src/pages/processes/index.ts +3 -2
- package/src/pages/processes/tabConfig.ts +28 -10
- package/src/pages/processes/timelineUtils.spec.ts +202 -0
- package/src/pages/processes/timelineUtils.ts +113 -0
- package/src/pages/subscriptions/WfoSubscriptionDetailPage.tsx +19 -0
- package/src/pages/subscriptions/WfoSubscriptionsListPage.tsx +105 -0
- package/src/pages/subscriptions/index.ts +2 -2
- package/src/pages/tasks/WfoTaskListPage.tsx +120 -0
- package/src/pages/tasks/index.ts +1 -0
- package/src/pages/workflow/WfoStartWorkflowPage.tsx +176 -0
- package/src/pages/workflow/index.ts +1 -0
- package/src/stories/Button.jsx +45 -39
- package/src/stories/Configure.mdx +48 -43
- package/src/stories/Header.jsx +59 -45
- package/src/stories/Page.jsx +81 -60
- package/src/stories/Page.stories.js +2 -1
- package/src/stories/button.css +18 -18
- package/src/stories/colors.mdx +12 -0
- package/src/stories/colors.tsx +27 -0
- package/src/stories/header.css +18 -18
- package/src/stories/page.css +40 -40
- package/src/theme/defaultOrchestratorTheme.ts +16 -0
- package/src/types/forms.ts +40 -0
- package/src/types/index.ts +1 -0
- package/src/types/types.ts +457 -0
- package/src/utils/date.spec.ts +157 -5
- package/src/utils/date.ts +66 -5
- package/src/utils/environmentVariables.spec.ts +17 -0
- package/src/utils/environmentVariables.ts +12 -0
- package/src/utils/getDefaultTableConfig.ts +101 -0
- package/src/utils/getProductNamesFromProcess.spec.ts +133 -0
- package/src/utils/getProductNamesFromProcess.ts +16 -0
- package/src/utils/getTokenName.ts +2 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/string.spec.ts +24 -1
- package/src/utils/strings.ts +5 -0
- package/tsconfig.build.json +14 -0
- package/tsconfig.json +4 -2
- package/src/components/WFOBadges/WFOBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOEngineStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOEnvironmentBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.stories.tsx +0 -12
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.tsx +0 -63
- package/src/components/WFOBadges/WFOFailedTasksBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOHeaderBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOProcessStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOProductBlockBadge/WFOProductBlockBadge.stories.tsx +0 -15
- package/src/components/WFOBadges/WFOProductBlockBadge/WFOProductBlockBadge.tsx +0 -22
- package/src/components/WFOBadges/WFOProductBlockBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/index.ts +0 -8
- package/src/components/WFOBreadcrumbs/index.ts +0 -1
- package/src/components/WFOFilterTabs/index.ts +0 -1
- package/src/components/WFOLoading/WFOLoading.tsx +0 -2
- package/src/components/WFOLoading/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageHeader/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageTemplate/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOSidebar/WFOSidebar.tsx +0 -159
- package/src/components/WFOPageTemplate/WFOSidebar/index.ts +0 -1
- package/src/components/WFOPageTemplate/index.ts +0 -3
- package/src/components/WFOSearchBar/index.ts +0 -1
- package/src/components/WFOSettingsModal/index.tsx +0 -1
- package/src/components/WFOSettingsPage/index.ts +0 -1
- package/src/components/WFOStartPage/WFONewProcessPanel.stories.tsx +0 -12
- package/src/components/WFOStartPage/WFOStatCards.stories.tsx +0 -12
- package/src/components/WFOStartPage/index.ts +0 -6
- package/src/components/WFOSubscription/WFOFixedInputBlock.tsx +0 -58
- package/src/components/WFOSubscription/WFOProcessesTimeline.tsx +0 -105
- package/src/components/WFOSubscription/WFOProductBlock.tsx +0 -186
- package/src/components/WFOSubscription/WFOSubscriptionActions.tsx +0 -138
- package/src/components/WFOSubscription/WFOSubscriptionBlock.tsx +0 -108
- package/src/components/WFOSubscription/WFOSubscriptionDetailTree.tsx +0 -184
- package/src/components/WFOSubscription/WFOSubscriptionGeneral.tsx +0 -53
- package/src/components/WFOSubscription/index.ts +0 -7
- package/src/components/WFOSubscription/styles.ts +0 -18
- package/src/components/WFOTable/WFOTable.tsx +0 -85
- package/src/components/WFOTable/WFOTableHeaderCell.tsx +0 -30
- package/src/components/WFOTable/WFOTableSettingsModal/index.ts +0 -1
- package/src/components/WFOTable/WFOTableWithFilter/WFOTableWithFilter.tsx +0 -174
- package/src/components/WFOTable/WFOTableWithFilter/index.ts +0 -1
- package/src/components/WFOTable/index.ts +0 -14
- package/src/components/WFOTree/WFOTree.tsx +0 -16
- package/src/contexts/SubscriptionContext.tsx +0 -72
- package/src/hooks/useSubscriptionProcesses.ts +0 -45
- package/src/icons/WFOCheckmarkCircleFill.stories.tsx +0 -12
- package/src/icons/WFOLogoutIcon.stories.tsx +0 -12
- package/src/icons/WFOMinusCircleOutline.stories.tsx +0 -12
- package/src/icons/WFOPlusCircleFill.stories.tsx +0 -12
- package/src/icons/WFOStatusDotIcon.stories.tsx +0 -12
- package/src/icons/WFOXCircleFill.stories.tsx +0 -12
- package/src/pages/metadata/WFOProductBlocksPage.tsx +0 -164
- package/src/pages/metadata/WFOResourceTypesPage.tsx +0 -120
- package/src/pages/metadata/WFOWorkflowsPage.tsx +0 -251
- package/src/pages/processes/WFOProcessListPage.tsx +0 -209
- package/src/pages/processes/WFOProcessesListSubscriptionsCell.tsx +0 -28
- package/src/pages/processes/tableConfig.ts +0 -22
- package/src/pages/subscriptions/types.ts +0 -13
- package/src/types.ts +0 -250
- package/src/components/{WFOTable → WfoTable}/utils/columns.spec.ts +1 -1
|
@@ -0,0 +1,253 @@
|
|
|
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 React, { Ref, useEffect, useState } from 'react';
|
|
16
|
+
|
|
17
|
+
import { isFunction } from 'lodash';
|
|
18
|
+
import get from 'lodash/get';
|
|
19
|
+
import { useTranslations } from 'next-intl';
|
|
20
|
+
import {
|
|
21
|
+
connectField,
|
|
22
|
+
filterDOMProps,
|
|
23
|
+
joinName,
|
|
24
|
+
useField,
|
|
25
|
+
useForm,
|
|
26
|
+
} from 'uniforms';
|
|
27
|
+
|
|
28
|
+
import { EuiFieldText, EuiFormRow, EuiText } from '@elastic/eui';
|
|
29
|
+
|
|
30
|
+
import { useAxiosApiClient } from '../useAxiosApiClient';
|
|
31
|
+
import { ContactPersonAutocomplete } from './ContactPersonAutocomplete';
|
|
32
|
+
import { ContactPerson, FieldProps } from './types';
|
|
33
|
+
|
|
34
|
+
export function stop(e: React.SyntheticEvent) {
|
|
35
|
+
if (e !== undefined && e !== null) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type ContactPersonNameFieldProps = FieldProps<
|
|
42
|
+
string,
|
|
43
|
+
{ organisationId?: string; organisationKey?: string }
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
declare module 'uniforms' {
|
|
47
|
+
interface FilterDOMProps {
|
|
48
|
+
organisationId: never;
|
|
49
|
+
organisationKey: never;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
filterDOMProps.register('organisationId', 'organisationKey');
|
|
53
|
+
|
|
54
|
+
function ContactPersonName({
|
|
55
|
+
disabled,
|
|
56
|
+
id,
|
|
57
|
+
inputRef = React.createRef() as Ref<HTMLInputElement>,
|
|
58
|
+
label,
|
|
59
|
+
description,
|
|
60
|
+
name,
|
|
61
|
+
onChange,
|
|
62
|
+
placeholder,
|
|
63
|
+
readOnly,
|
|
64
|
+
value,
|
|
65
|
+
error,
|
|
66
|
+
showInlineError,
|
|
67
|
+
errorMessage,
|
|
68
|
+
organisationId,
|
|
69
|
+
organisationKey,
|
|
70
|
+
...props
|
|
71
|
+
}: ContactPersonNameFieldProps) {
|
|
72
|
+
const axiosApiClient = useAxiosApiClient();
|
|
73
|
+
const t = useTranslations('pydanticForms');
|
|
74
|
+
const { model, onChange: formOnChange, schema } = useForm();
|
|
75
|
+
|
|
76
|
+
const contactsPersonFieldNameArray = joinName(null, name).slice(0, -1);
|
|
77
|
+
const emailFieldName = joinName(contactsPersonFieldNameArray, 'email');
|
|
78
|
+
const contactsFieldName = joinName(
|
|
79
|
+
contactsPersonFieldNameArray.slice(0, -1),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const chosenPersons: ContactPerson[] = get(model, contactsFieldName, []);
|
|
83
|
+
// We cant call useField conditionally so if we don't have a parent we call it for ourself
|
|
84
|
+
const useFieldName = contactsPersonFieldNameArray.length
|
|
85
|
+
? contactsFieldName
|
|
86
|
+
: name;
|
|
87
|
+
const contactsField = useField(useFieldName, {}, { absoluteName: true })[0];
|
|
88
|
+
|
|
89
|
+
const organisationFieldName =
|
|
90
|
+
organisationKey ||
|
|
91
|
+
contactsField.field.organisationKey ||
|
|
92
|
+
'organisation';
|
|
93
|
+
|
|
94
|
+
// Get initial value for org field if it exists (we cant really test)
|
|
95
|
+
let organisationInitialValue;
|
|
96
|
+
try {
|
|
97
|
+
organisationInitialValue = schema.getInitialValue(
|
|
98
|
+
organisationFieldName,
|
|
99
|
+
{},
|
|
100
|
+
);
|
|
101
|
+
} catch {
|
|
102
|
+
organisationInitialValue = '';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const organisationIdValue =
|
|
106
|
+
organisationId ||
|
|
107
|
+
contactsField.field.organisationId ||
|
|
108
|
+
get(model, organisationFieldName, organisationInitialValue);
|
|
109
|
+
|
|
110
|
+
const [displayAutocomplete, setDisplayAutocomplete] = useState(false);
|
|
111
|
+
const [contactPersons, setContactPersons] = useState<ContactPerson[]>([]);
|
|
112
|
+
const [selectedIndex, setSelectedIndex] = useState(-1);
|
|
113
|
+
|
|
114
|
+
const suggestions = value
|
|
115
|
+
? contactPersons
|
|
116
|
+
.filter(
|
|
117
|
+
(item) =>
|
|
118
|
+
item.name.toLowerCase().indexOf(value.toLowerCase()) > -1,
|
|
119
|
+
)
|
|
120
|
+
.filter(
|
|
121
|
+
(item) =>
|
|
122
|
+
!chosenPersons.some(
|
|
123
|
+
(person) => person.email === item.email,
|
|
124
|
+
),
|
|
125
|
+
)
|
|
126
|
+
: [];
|
|
127
|
+
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
if (organisationIdValue) {
|
|
130
|
+
axiosApiClient
|
|
131
|
+
.axiosFetch<ContactPerson[]>(
|
|
132
|
+
`/surf/crm/contacts/${organisationIdValue}`,
|
|
133
|
+
{},
|
|
134
|
+
{},
|
|
135
|
+
false,
|
|
136
|
+
)
|
|
137
|
+
.then((result) => {
|
|
138
|
+
if (result) {
|
|
139
|
+
setContactPersons(result);
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
.catch(() => {
|
|
143
|
+
setContactPersons([]);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}, [organisationIdValue, axiosApiClient]);
|
|
147
|
+
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
// Set focus to the last name component to be created
|
|
150
|
+
if (!isFunction(inputRef)) {
|
|
151
|
+
inputRef!.current?.focus();
|
|
152
|
+
}
|
|
153
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
154
|
+
|
|
155
|
+
function onChangeInternal(e: React.FormEvent<HTMLInputElement>) {
|
|
156
|
+
stop(e);
|
|
157
|
+
const target = e.target as HTMLInputElement;
|
|
158
|
+
const value = target.value;
|
|
159
|
+
|
|
160
|
+
onChange(value);
|
|
161
|
+
setDisplayAutocomplete(true);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function itemSelected(item: ContactPerson) {
|
|
165
|
+
onChange(item.name || '');
|
|
166
|
+
formOnChange(emailFieldName, item.email || '');
|
|
167
|
+
setDisplayAutocomplete(false);
|
|
168
|
+
setSelectedIndex(-1);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function onAutocompleteKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
|
|
172
|
+
if (!suggestions) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (e.keyCode === 40 && selectedIndex < suggestions.length - 1) {
|
|
176
|
+
//keyDown
|
|
177
|
+
stop(e);
|
|
178
|
+
setSelectedIndex(selectedIndex + 1);
|
|
179
|
+
}
|
|
180
|
+
if (e.keyCode === 38 && selectedIndex >= 0) {
|
|
181
|
+
//keyUp
|
|
182
|
+
stop(e);
|
|
183
|
+
setSelectedIndex(selectedIndex - 1);
|
|
184
|
+
}
|
|
185
|
+
if (e.keyCode === 13) {
|
|
186
|
+
//enter
|
|
187
|
+
if (selectedIndex >= 0) {
|
|
188
|
+
stop(e);
|
|
189
|
+
itemSelected(suggestions[selectedIndex]);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (e.keyCode === 27) {
|
|
193
|
+
//escape
|
|
194
|
+
stop(e);
|
|
195
|
+
setDisplayAutocomplete(false);
|
|
196
|
+
setSelectedIndex(-1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function onBlurAutoComplete(e: React.FocusEvent<HTMLElement>) {
|
|
201
|
+
stop(e);
|
|
202
|
+
setTimeout(() => setDisplayAutocomplete(false), 350);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<section {...filterDOMProps(props)}>
|
|
207
|
+
<EuiFormRow
|
|
208
|
+
label={label}
|
|
209
|
+
labelAppend={<EuiText size="m">{description}</EuiText>}
|
|
210
|
+
error={showInlineError ? errorMessage : false}
|
|
211
|
+
isInvalid={error}
|
|
212
|
+
id={id}
|
|
213
|
+
fullWidth
|
|
214
|
+
css={{ marginBottom: 0 }}
|
|
215
|
+
>
|
|
216
|
+
<>
|
|
217
|
+
<EuiFieldText
|
|
218
|
+
disabled={disabled}
|
|
219
|
+
fullWidth
|
|
220
|
+
name={name}
|
|
221
|
+
isInvalid={error}
|
|
222
|
+
onChange={onChangeInternal}
|
|
223
|
+
placeholder={
|
|
224
|
+
placeholder ||
|
|
225
|
+
t('widgets.contactPersonName.placeholder')
|
|
226
|
+
}
|
|
227
|
+
readOnly={readOnly}
|
|
228
|
+
type="text"
|
|
229
|
+
value={value ?? ''}
|
|
230
|
+
onKeyDown={onAutocompleteKeyDown}
|
|
231
|
+
onBlur={onBlurAutoComplete}
|
|
232
|
+
autoComplete="off"
|
|
233
|
+
/>{' '}
|
|
234
|
+
<div className="autocomplete-container">
|
|
235
|
+
{!!(displayAutocomplete && suggestions.length) && (
|
|
236
|
+
<ContactPersonAutocomplete
|
|
237
|
+
query={value ?? ''}
|
|
238
|
+
itemSelected={itemSelected}
|
|
239
|
+
selectedItem={selectedIndex}
|
|
240
|
+
suggestions={suggestions}
|
|
241
|
+
personIndex={0}
|
|
242
|
+
/>
|
|
243
|
+
)}
|
|
244
|
+
</div>
|
|
245
|
+
</>
|
|
246
|
+
</EuiFormRow>
|
|
247
|
+
</section>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export const ContactPersonNameField = connectField(ContactPersonName, {
|
|
252
|
+
kind: 'leaf',
|
|
253
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
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 React from 'react';
|
|
16
|
+
|
|
17
|
+
import { connectField, filterDOMProps } from 'uniforms';
|
|
18
|
+
|
|
19
|
+
import { FieldProps } from './types';
|
|
20
|
+
|
|
21
|
+
const DateConstructor = (typeof global === 'object' ? global : window).Date;
|
|
22
|
+
const dateFormat = (value?: Date) => {
|
|
23
|
+
return value?.toISOString().slice(0, -8);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type DateFieldProps = FieldProps<Date, { max?: Date; min?: Date }>;
|
|
27
|
+
|
|
28
|
+
function Date({
|
|
29
|
+
disabled,
|
|
30
|
+
id,
|
|
31
|
+
inputRef,
|
|
32
|
+
label,
|
|
33
|
+
max,
|
|
34
|
+
min,
|
|
35
|
+
name,
|
|
36
|
+
onChange,
|
|
37
|
+
readOnly,
|
|
38
|
+
placeholder,
|
|
39
|
+
value,
|
|
40
|
+
...props
|
|
41
|
+
}: DateFieldProps) {
|
|
42
|
+
return (
|
|
43
|
+
<div {...filterDOMProps(props)}>
|
|
44
|
+
{label && <label htmlFor={id}>{label}</label>}
|
|
45
|
+
|
|
46
|
+
<input
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
id={id}
|
|
49
|
+
max={dateFormat(max)}
|
|
50
|
+
min={dateFormat(min)}
|
|
51
|
+
name={name}
|
|
52
|
+
onChange={(event) => {
|
|
53
|
+
const date = new DateConstructor(
|
|
54
|
+
event.target.valueAsNumber,
|
|
55
|
+
);
|
|
56
|
+
if (date.getFullYear() < 10000) {
|
|
57
|
+
onChange(date);
|
|
58
|
+
} else if (isNaN(event.target.valueAsNumber)) {
|
|
59
|
+
onChange(undefined);
|
|
60
|
+
}
|
|
61
|
+
}}
|
|
62
|
+
placeholder={placeholder}
|
|
63
|
+
readOnly={readOnly}
|
|
64
|
+
ref={inputRef}
|
|
65
|
+
type="datetime-local"
|
|
66
|
+
value={dateFormat(value) ?? ''}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const DateField = connectField(Date, { kind: 'leaf' });
|
|
@@ -0,0 +1,29 @@
|
|
|
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 React from 'react';
|
|
16
|
+
|
|
17
|
+
import { connectField } from 'uniforms';
|
|
18
|
+
|
|
19
|
+
import { EuiHorizontalRule } from '@elastic/eui';
|
|
20
|
+
|
|
21
|
+
import { FieldProps } from '../../../types/forms';
|
|
22
|
+
|
|
23
|
+
export type DividerFieldProps = FieldProps<null, object, null, HTMLDivElement>;
|
|
24
|
+
|
|
25
|
+
function Divider({ id }: DividerFieldProps) {
|
|
26
|
+
return <EuiHorizontalRule style={{ marginTop: '-30px' }} id={id} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const DividerField = connectField(Divider, { kind: 'leaf' });
|
|
@@ -0,0 +1,40 @@
|
|
|
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 React from 'react';
|
|
16
|
+
|
|
17
|
+
import { connectField, filterDOMProps } from 'uniforms';
|
|
18
|
+
|
|
19
|
+
import { FieldProps } from '../../../types/forms';
|
|
20
|
+
|
|
21
|
+
export type ErrorFieldProps = FieldProps<null>;
|
|
22
|
+
|
|
23
|
+
// onChange not used on purpose
|
|
24
|
+
function Error({
|
|
25
|
+
children,
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
+
onChange,
|
|
28
|
+
error,
|
|
29
|
+
errorMessage,
|
|
30
|
+
...props
|
|
31
|
+
}: ErrorFieldProps) {
|
|
32
|
+
return !error ? null : (
|
|
33
|
+
<div {...filterDOMProps(props)}>{children || errorMessage}</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ErrorField = connectField(Error, {
|
|
38
|
+
initialValue: false,
|
|
39
|
+
kind: 'leaf',
|
|
40
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
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 React, { HTMLProps } from 'react';
|
|
16
|
+
|
|
17
|
+
import { filterDOMProps, useForm } from 'uniforms';
|
|
18
|
+
|
|
19
|
+
export type ErrorsFieldProps = HTMLProps<HTMLDivElement>;
|
|
20
|
+
|
|
21
|
+
export const ErrorsField = (props: ErrorsFieldProps) => {
|
|
22
|
+
const { error, schema } = useForm();
|
|
23
|
+
return !error && !props.children ? null : (
|
|
24
|
+
<div {...filterDOMProps(props)}>
|
|
25
|
+
{props.children}
|
|
26
|
+
|
|
27
|
+
<ul>
|
|
28
|
+
{schema.getErrorMessages(error).map((message, index) => (
|
|
29
|
+
<li key={index}>{message}</li>
|
|
30
|
+
))}
|
|
31
|
+
</ul>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
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 React, { useEffect, useState } from 'react';
|
|
16
|
+
|
|
17
|
+
import { get } from 'lodash';
|
|
18
|
+
import { useTranslations } from 'next-intl';
|
|
19
|
+
import { connectField, filterDOMProps } from 'uniforms';
|
|
20
|
+
|
|
21
|
+
import { useAxiosApiClient } from '../useAxiosApiClient';
|
|
22
|
+
import { SelectField, SelectFieldProps } from './SelectField';
|
|
23
|
+
import { ImsNode } from './surf/types';
|
|
24
|
+
|
|
25
|
+
export type ImsNodeIdFieldProps = {
|
|
26
|
+
onChange: (value?: number | undefined) => void;
|
|
27
|
+
value?: number;
|
|
28
|
+
locationCode: string;
|
|
29
|
+
status?: string;
|
|
30
|
+
unsubscribedOnly?: boolean;
|
|
31
|
+
} & Omit<
|
|
32
|
+
SelectFieldProps,
|
|
33
|
+
| 'placeholder'
|
|
34
|
+
| 'transform'
|
|
35
|
+
| 'allowedValues'
|
|
36
|
+
| 'onChange'
|
|
37
|
+
| 'value'
|
|
38
|
+
| 'name'
|
|
39
|
+
>;
|
|
40
|
+
|
|
41
|
+
declare module 'uniforms' {
|
|
42
|
+
interface FilterDOMProps {
|
|
43
|
+
locationCode: never;
|
|
44
|
+
status: never;
|
|
45
|
+
unsubscribedOnly: never;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
filterDOMProps.register('locationCode', 'status', 'unsubscribedOnly');
|
|
49
|
+
|
|
50
|
+
function ImsNodeId({
|
|
51
|
+
value,
|
|
52
|
+
onChange,
|
|
53
|
+
locationCode,
|
|
54
|
+
status = 'PL',
|
|
55
|
+
unsubscribedOnly = true,
|
|
56
|
+
...props
|
|
57
|
+
}: ImsNodeIdFieldProps) {
|
|
58
|
+
const axiosApiClient = useAxiosApiClient();
|
|
59
|
+
const t = useTranslations('pydanticForms');
|
|
60
|
+
const [loading, setIsLoading] = useState(true);
|
|
61
|
+
const [nodes, setNodes] = useState<ImsNode[]>([]);
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (locationCode && status) {
|
|
65
|
+
const imsNodeEndPoint = `/surf/ims/nodes/${locationCode}/${status}?unsubscribed_only=${unsubscribedOnly}`;
|
|
66
|
+
axiosApiClient
|
|
67
|
+
.axiosFetch<ImsNode[]>(imsNodeEndPoint)
|
|
68
|
+
.then((result) => {
|
|
69
|
+
if (result) {
|
|
70
|
+
setNodes(result);
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
.catch((error) => {
|
|
74
|
+
console.error(error);
|
|
75
|
+
})
|
|
76
|
+
.finally(() => setIsLoading(false));
|
|
77
|
+
}
|
|
78
|
+
}, [locationCode, status, axiosApiClient, unsubscribedOnly]);
|
|
79
|
+
|
|
80
|
+
const placeholder =
|
|
81
|
+
loading && locationCode
|
|
82
|
+
? t('widgets.node_select.nodes_loading')
|
|
83
|
+
: nodes.length
|
|
84
|
+
? t('widgets.node_select.select_node')
|
|
85
|
+
: t('forms.widgets.node_select.no_nodes_placeholder');
|
|
86
|
+
|
|
87
|
+
const imsNodeIdLabelLookup =
|
|
88
|
+
nodes?.reduce<{ [index: string]: string }>(function (mapping, node) {
|
|
89
|
+
mapping[node.id.toString()] = node.name;
|
|
90
|
+
return mapping;
|
|
91
|
+
}, {}) ?? {};
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<SelectField
|
|
95
|
+
name=""
|
|
96
|
+
{...props}
|
|
97
|
+
allowedValues={Object.keys(imsNodeIdLabelLookup)}
|
|
98
|
+
value={value?.toString()}
|
|
99
|
+
transform={(id: string) => get(imsNodeIdLabelLookup, id, id)}
|
|
100
|
+
onChange={
|
|
101
|
+
((str: string) => onChange(parseInt(str, 10))) as unknown as (
|
|
102
|
+
v: string | string[] | undefined,
|
|
103
|
+
) => void
|
|
104
|
+
}
|
|
105
|
+
placeholder={placeholder}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const ImsNodeIdField = connectField(ImsNodeId, { kind: 'leaf' });
|
|
@@ -0,0 +1,128 @@
|
|
|
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 React, { useState } from 'react';
|
|
16
|
+
|
|
17
|
+
import { useTranslations } from 'next-intl';
|
|
18
|
+
import { connectField, filterDOMProps } from 'uniforms';
|
|
19
|
+
|
|
20
|
+
import { EuiCallOut, EuiFormRow, EuiText } from '@elastic/eui';
|
|
21
|
+
|
|
22
|
+
import IpPrefixTableField from './IpPrefixTableField';
|
|
23
|
+
import SplitPrefix from './SplitPrefix';
|
|
24
|
+
import { IpBlock } from './surf/types';
|
|
25
|
+
import { FieldProps } from './types';
|
|
26
|
+
|
|
27
|
+
export type IPvAnyNetworkFieldProps = FieldProps<
|
|
28
|
+
string,
|
|
29
|
+
{ prefixMin?: number }
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
function IpNetwork({
|
|
33
|
+
id,
|
|
34
|
+
label,
|
|
35
|
+
description,
|
|
36
|
+
name,
|
|
37
|
+
onChange,
|
|
38
|
+
readOnly,
|
|
39
|
+
value,
|
|
40
|
+
error,
|
|
41
|
+
showInlineError,
|
|
42
|
+
errorMessage,
|
|
43
|
+
prefixMin,
|
|
44
|
+
...props
|
|
45
|
+
}: IPvAnyNetworkFieldProps) {
|
|
46
|
+
const t = useTranslations('pydanticForms');
|
|
47
|
+
const [selectedPrefix, setSelectedPrefix] = useState<IpBlock | undefined>(
|
|
48
|
+
undefined,
|
|
49
|
+
);
|
|
50
|
+
const [manualOverride, setManualOverride] = useState(false);
|
|
51
|
+
|
|
52
|
+
const usePrefix = selectedPrefix?.prefix ?? value;
|
|
53
|
+
const [subnet, netmask] = usePrefix?.split('/') ?? ['', ''];
|
|
54
|
+
const usedPrefixMin =
|
|
55
|
+
prefixMin ??
|
|
56
|
+
parseInt(netmask, 10) + (selectedPrefix?.state === 0 ? 0 : 1);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<section {...filterDOMProps(props)}>
|
|
60
|
+
<EuiFormRow
|
|
61
|
+
label={label}
|
|
62
|
+
labelAppend={<EuiText size="m">{description}</EuiText>}
|
|
63
|
+
error={showInlineError ? errorMessage : false}
|
|
64
|
+
isInvalid={error}
|
|
65
|
+
id={id}
|
|
66
|
+
fullWidth
|
|
67
|
+
>
|
|
68
|
+
<section className="ipblock-selector">
|
|
69
|
+
<div id={id}>
|
|
70
|
+
{!prefixMin && (
|
|
71
|
+
<IpPrefixTableField
|
|
72
|
+
id={id}
|
|
73
|
+
name={name}
|
|
74
|
+
onChange={(prefix: IpBlock) => {
|
|
75
|
+
if (!readOnly) {
|
|
76
|
+
if (
|
|
77
|
+
prefix.state === 0 ||
|
|
78
|
+
prefix.state === 1
|
|
79
|
+
) {
|
|
80
|
+
setSelectedPrefix(prefix);
|
|
81
|
+
}
|
|
82
|
+
setManualOverride(false);
|
|
83
|
+
onChange(prefix.prefix);
|
|
84
|
+
}
|
|
85
|
+
}}
|
|
86
|
+
onManualOverride={(prefixString: string) => {
|
|
87
|
+
if (!readOnly) {
|
|
88
|
+
setManualOverride(true);
|
|
89
|
+
onChange(prefixString);
|
|
90
|
+
}
|
|
91
|
+
}}
|
|
92
|
+
selected_prefix_id={selectedPrefix?.id}
|
|
93
|
+
/>
|
|
94
|
+
)}
|
|
95
|
+
{usePrefix && !manualOverride && (
|
|
96
|
+
<SplitPrefix
|
|
97
|
+
id={id}
|
|
98
|
+
name={name}
|
|
99
|
+
subnet={subnet}
|
|
100
|
+
prefixlen={parseInt(netmask, 10)}
|
|
101
|
+
prefixMin={usedPrefixMin}
|
|
102
|
+
onChange={(prefix: string) => {
|
|
103
|
+
if (!readOnly) {
|
|
104
|
+
onChange(prefix);
|
|
105
|
+
}
|
|
106
|
+
}}
|
|
107
|
+
selectedSubnet={usePrefix}
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
110
|
+
{usePrefix && manualOverride && (
|
|
111
|
+
<EuiCallOut
|
|
112
|
+
title={t(
|
|
113
|
+
'widgets.ipvAnyNetworkField.manuallySelectedPrefix',
|
|
114
|
+
)}
|
|
115
|
+
color="primary"
|
|
116
|
+
iconType="check"
|
|
117
|
+
>
|
|
118
|
+
<p>{value}</p>
|
|
119
|
+
</EuiCallOut>
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
</section>
|
|
123
|
+
</EuiFormRow>
|
|
124
|
+
</section>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const IpNetworkField = connectField(IpNetwork, { kind: 'leaf' });
|