@orchestrator-ui/orchestrator-ui-components 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.js +1 -1
- package/.turbo/turbo-build.log +9 -7
- package/.turbo/turbo-lint.log +3 -6
- package/.turbo/turbo-test.log +17 -9
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1092 -358
- package/dist/index.js +22934 -6399
- package/jest.config.cjs +0 -1
- package/package.json +24 -8
- package/src/api/axios.ts +34 -0
- package/src/api/index.ts +170 -0
- package/src/components/WfoAuth/WfoAuth.tsx +22 -0
- package/src/components/WfoAuth/index.ts +1 -0
- package/src/components/{WFOBadges/WFOBadge/WFOBadge.stories.tsx → WfoBadges/WfoBadge/WfoBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOBadge/WFOBadge.tsx → WfoBadges/WfoBadge/WfoBadge.tsx} +4 -3
- package/src/components/WfoBadges/WfoBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.stories.tsx → WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOEngineStatusBadge/WFOEngineStatusBadge.tsx → WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.tsx} +13 -7
- package/src/components/WfoBadges/WfoEngineStatusBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.stories.tsx → WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOEnvironmentBadge/WFOEnvironmentBadge.tsx → WfoBadges/WfoEnvironmentBadge/WfoEnvironmentBadge.tsx} +8 -7
- package/src/components/WfoBadges/WfoEnvironmentBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.stories.tsx +13 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +95 -0
- package/src/components/WfoBadges/WfoFailedTasksBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOHeaderBadge/WFOHeaderBadge.stories.tsx → WfoBadges/WfoHeaderBadge/WfoHeaderBadge.stories.tsx} +6 -4
- package/src/components/{WFOBadges/WFOHeaderBadge/WFOHeaderBadge.tsx → WfoBadges/WfoHeaderBadge/WfoHeaderBadge.tsx} +6 -4
- package/src/components/WfoBadges/WfoHeaderBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOProcessStatusBadge/WFOProcessStatusBadge.tsx → WfoBadges/WfoProcessStatusBadge/WfoProcessStatusBadge.tsx} +8 -6
- package/src/components/WfoBadges/WfoProcessStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.stories.tsx +16 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +70 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.stories.tsx +22 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +53 -0
- package/src/components/WfoBadges/WfoProductStatusBadge/index.ts +1 -0
- package/src/components/{WFOBadges/WFOSubscriptionStatusBadge/WFOSubscriptionStatusBadge.stories.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.stories.tsx} +5 -4
- package/src/components/{WFOBadges/WFOSubscriptionStatusBadge/WFOSubscriptionStatusBadge.tsx → WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx} +12 -10
- package/src/components/WfoBadges/WfoSubscriptionStatusBadge/index.ts +1 -0
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/WfoWorkflowTargetBadge.tsx +65 -0
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/index.ts +1 -0
- package/src/components/WfoBadges/index.ts +9 -0
- package/src/components/WfoButtonComboBox/WfoButtonComboBox.tsx +76 -0
- package/src/components/WfoButtonComboBox/styles.ts +13 -0
- package/src/components/WfoDateTime/WfoDateTime.tsx +28 -0
- package/src/components/WfoDateTime/index.ts +1 -0
- package/src/components/WfoDropdownButton/WfoDropdownButton.tsx +67 -0
- package/src/components/WfoDropdownButton/index.ts +1 -0
- package/src/components/{WFOFilterTabs/WFOFilterTabs.tsx → WfoFilterTabs/WfoFilterTabs.tsx} +8 -6
- package/src/components/WfoFilterTabs/index.ts +1 -0
- package/src/components/WfoForms/AutoFieldLoader.tsx +110 -0
- package/src/components/WfoForms/AutoFields.tsx +49 -0
- package/src/components/WfoForms/CreateForm.tsx +71 -0
- package/src/components/WfoForms/UserInputForm.tsx +607 -0
- package/src/components/WfoForms/UserInputFormStyling.ts +80 -0
- package/src/components/WfoForms/UserInputFormWizard.tsx +120 -0
- package/src/components/WfoForms/formFields/AcceptField.tsx +239 -0
- package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +29 -0
- package/src/components/WfoForms/formFields/BoolField.tsx +71 -0
- package/src/components/WfoForms/formFields/BoolFieldStyling.ts +68 -0
- package/src/components/WfoForms/formFields/ContactPersonAutocomplete.tsx +97 -0
- package/src/components/WfoForms/formFields/ContactPersonAutocompleteStyles.ts +40 -0
- package/src/components/WfoForms/formFields/ContactPersonNameField.tsx +253 -0
- package/src/components/WfoForms/formFields/DateField.tsx +72 -0
- package/src/components/WfoForms/formFields/DividerField.tsx +29 -0
- package/src/components/WfoForms/formFields/ErrorField.tsx +40 -0
- package/src/components/WfoForms/formFields/ErrorsField.tsx +34 -0
- package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +110 -0
- package/src/components/WfoForms/formFields/IpNetworkField.tsx +128 -0
- package/src/components/WfoForms/formFields/IpPrefixTableField.tsx +454 -0
- package/src/components/WfoForms/formFields/IpPrefixTableFieldStyling.ts +117 -0
- package/src/components/WfoForms/formFields/LabelField.tsx +39 -0
- package/src/components/WfoForms/formFields/ListAddField.tsx +98 -0
- package/src/components/WfoForms/formFields/ListDelField.tsx +95 -0
- package/src/components/WfoForms/formFields/ListField.tsx +113 -0
- package/src/components/WfoForms/formFields/ListItemField.tsx +40 -0
- package/src/components/WfoForms/formFields/ListSelectField.tsx +92 -0
- package/src/components/WfoForms/formFields/LocationCodeField.tsx +66 -0
- package/src/components/WfoForms/formFields/LongTextField.tsx +68 -0
- package/src/components/WfoForms/formFields/NestField.tsx +107 -0
- package/src/components/WfoForms/formFields/NumField.tsx +75 -0
- package/src/components/WfoForms/formFields/OptGroupField.tsx +74 -0
- package/src/components/WfoForms/formFields/OrganisationField.tsx +57 -0
- package/src/components/WfoForms/formFields/ProductField.tsx +78 -0
- package/src/components/WfoForms/formFields/RadioField.tsx +87 -0
- package/src/components/WfoForms/formFields/SelectField.tsx +152 -0
- package/src/components/WfoForms/formFields/SplitPrefix.tsx +163 -0
- package/src/components/WfoForms/formFields/SplitPrefixStyling.ts +11 -0
- package/src/components/WfoForms/formFields/SubmitField.tsx +50 -0
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +351 -0
- package/src/components/WfoForms/formFields/SubscriptionFieldStyling.ts +33 -0
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +75 -0
- package/src/components/WfoForms/formFields/TextField.tsx +71 -0
- package/src/components/WfoForms/formFields/TimestampField.tsx +103 -0
- package/src/components/WfoForms/formFields/VlanField.tsx +297 -0
- package/src/components/WfoForms/formFields/index.ts +29 -0
- package/src/components/WfoForms/formFields/listFieldStyling.ts +86 -0
- package/src/components/WfoForms/formFields/reactSelectStyles.ts +45 -0
- package/src/components/WfoForms/formFields/surf/types.ts +53 -0
- package/src/components/WfoForms/formFields/surf/utils.ts +1 -0
- package/src/components/WfoForms/formFields/types.ts +50 -0
- package/src/components/WfoForms/formFields/utils.spec.ts +196 -0
- package/src/components/WfoForms/formFields/utils.ts +65 -0
- package/src/components/WfoForms/index.ts +5 -0
- package/src/components/WfoForms/useAxiosApiClient.ts +8 -0
- package/src/components/WfoInsyncIcon/WfoInsyncIcon.stories.tsx +21 -0
- package/src/components/WfoInsyncIcon/WfoInsyncIcon.tsx +26 -0
- package/src/components/WfoInsyncIcon/index.ts +1 -0
- package/src/components/WfoJsonCodeBlock/WfoJsonCodeBlock.tsx +27 -0
- package/src/components/WfoJsonCodeBlock/styles.ts +13 -0
- package/src/components/WfoKeyValueTable/WfoKeyCell.tsx +25 -0
- package/src/components/WfoKeyValueTable/WfoKeyValueTable.tsx +41 -0
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +53 -0
- package/src/components/WfoKeyValueTable/index.ts +3 -0
- package/src/components/WfoKeyValueTable/styles.ts +77 -0
- package/src/components/WfoLoading/WfoLoading.tsx +3 -0
- package/src/components/WfoLoading/index.ts +1 -0
- package/src/components/WfoNoResults/WfoNoResults.stories.tsx +19 -0
- package/src/components/WfoNoResults/WfoNoResults.tsx +22 -0
- package/src/components/WfoNoResults/index.ts +1 -0
- package/src/components/WfoNoResults/styles.ts +22 -0
- package/src/components/WfoPageHeader/WfoPageHeader.tsx +25 -0
- package/src/components/{WFOPageTemplate/WFOBreadcrumbs/WFOBreadcrumbs.tsx → WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx} +5 -2
- package/src/components/WfoPageTemplate/WfoBreadcrumbs/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOPageHeader/WFOPageHeader.stories.tsx → WfoPageTemplate/WfoPageHeader/WfoPageHeader.stories.tsx} +7 -5
- package/src/components/{WFOPageTemplate/WFOPageHeader/WFOPageHeader.tsx → WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx} +26 -11
- package/src/components/WfoPageTemplate/WfoPageHeader/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.stories.tsx → WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.stories.tsx} +8 -6
- package/src/components/{WFOPageTemplate/WFOPageTemplate/WFOPageTemplate.tsx → WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx} +20 -10
- package/src/components/WfoPageTemplate/WfoPageTemplate/index.ts +1 -0
- package/src/components/{WFOPageTemplate/WFOSidebar/WFOSidebar.stories.tsx → WfoPageTemplate/WfoSidebar/WfoSidebar.stories.tsx} +6 -4
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +161 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +58 -0
- package/src/components/WfoPageTemplate/WfoSidebar/index.ts +1 -0
- package/src/components/WfoPageTemplate/index.ts +4 -0
- package/src/components/{WFOPageTemplate → WfoPageTemplate}/paths.ts +1 -1
- package/src/components/WfoProcessesList/WfoProcessList.tsx +227 -0
- package/src/components/WfoProcessesList/processListObjectMappers.ts +79 -0
- package/src/components/{WFOSearchBar/WFOSearchField.tsx → WfoSearchBar/WfoSearchField.tsx} +4 -3
- package/src/components/WfoSearchBar/index.ts +1 -0
- package/src/components/WfoSettingsModal/WfoInformationModal.tsx +41 -0
- package/src/components/{WFOSettingsModal/WFOSettingsModal.tsx → WfoSettingsModal/WfoSettingsModal.tsx} +3 -2
- package/src/components/WfoSettingsModal/index.tsx +2 -0
- package/src/components/{WFOSettingsPage/WFOEngineStatusButton.tsx → WfoSettingsPage/WfoEngineStatusButton.tsx} +5 -3
- package/src/components/{WFOSettingsPage/WFOFlushSettings.tsx → WfoSettingsPage/WfoFlushSettings.tsx} +19 -30
- package/src/components/{WFOSettingsPage/WFOModifySettings.tsx → WfoSettingsPage/WfoModifySettings.tsx} +7 -5
- package/src/components/{WFOSettingsPage/WFOSettings.tsx → WfoSettingsPage/WfoSettings.tsx} +12 -8
- package/src/components/{WFOSettingsPage/WFOStatus.tsx → WfoSettingsPage/WfoStatus.tsx} +8 -6
- package/src/components/WfoSettingsPage/index.ts +1 -0
- package/src/components/{WFOStartPage/WFOFrequentlyUsed.stories.tsx → WfoStartPage/WfoFrequentlyUsed.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOFrequentlyUsed.tsx → WfoStartPage/WfoFrequentlyUsed.tsx} +4 -3
- package/src/components/{WFOStartPage/WFOListItemStartPage.stories.tsx → WfoStartPage/WfoListItemStartPage.stories.tsx} +6 -4
- package/src/components/{WFOStartPage/WFOListItemStartPage.tsx → WfoStartPage/WfoListItemStartPage.tsx} +9 -6
- package/src/components/{WFOStartPage/WFOListStartPage.stories.tsx → WfoStartPage/WfoListStartPage.stories.tsx} +6 -4
- package/src/components/{WFOStartPage/WFOListStartPage.tsx → WfoStartPage/WfoListStartPage.tsx} +9 -6
- package/src/components/{WFOStartPage/WFOMultiListSection.stories.tsx → WfoStartPage/WfoMultiListSection.stories.tsx} +5 -4
- package/src/components/{WFOStartPage/WFOMultiListSection.tsx → WfoStartPage/WfoMultiListSection.tsx} +9 -6
- package/src/components/WfoStartPage/WfoNewProcessPanel.stories.tsx +13 -0
- package/src/components/{WFOStartPage/WFONewProcessPanel.tsx → WfoStartPage/WfoNewProcessPanel.tsx} +5 -3
- package/src/components/WfoStartPage/WfoStatCards.stories.tsx +13 -0
- package/src/components/{WFOStartPage/WFOStatCards.tsx → WfoStartPage/WfoStatCards.tsx} +6 -4
- package/src/components/WfoStartPage/index.ts +6 -0
- package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +51 -0
- package/src/components/WfoStartTaskButtonComboBox/index.ts +1 -0
- package/src/components/WfoSubscription/SubscriptionKeyValueBlock.tsx +46 -0
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +158 -0
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +192 -0
- package/src/components/WfoSubscription/WfoSubscription.tsx +145 -0
- package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +236 -0
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +161 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +147 -0
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +207 -0
- package/src/components/WfoSubscription/index.ts +8 -0
- package/src/components/WfoSubscription/styles.ts +104 -0
- package/src/components/WfoSubscription/utils/index.ts +1 -0
- package/src/components/WfoSubscription/utils/utils.spec.ts +168 -0
- package/src/components/WfoSubscription/utils/utils.ts +76 -0
- package/src/components/{WFOSubscriptionsList/WFOSubscriptionsList.tsx → WfoSubscriptionsList/WfoSubscriptionsList.tsx} +63 -57
- package/src/components/{WFOSubscriptionsList → WfoSubscriptionsList}/index.ts +1 -2
- package/src/components/{WFOSubscriptionsList → WfoSubscriptionsList}/mapGrapghQlSubscriptionsResultToSubscriptionListItems.ts +16 -7
- package/src/components/{WFOSubscriptionsList → WfoSubscriptionsList}/subscriptionListTabs.ts +18 -18
- package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +178 -0
- package/src/components/{WFOTable/WFOSortDirectionIcon.tsx → WfoTable/WfoBasicTable/WfoSortDirectionIcon.tsx} +8 -8
- package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +21 -0
- package/src/components/WfoTable/WfoBasicTable/WfoTableHeaderCell.tsx +120 -0
- package/src/components/WfoTable/WfoBasicTable/index.ts +4 -0
- package/src/components/WfoTable/WfoBasicTable/styles.ts +73 -0
- package/src/components/{WFOTable/WFODataGridTable/WFODataGridTable.stories.tsx → WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx} +9 -7
- package/src/components/{WFOTable/WFODataGridTable/WFODataGridTable.tsx → WfoTable/WfoDataGridTable/WfoDataGridTable.tsx} +23 -21
- package/src/components/{WFOTable/WFODataGridTable/WFOdataGridColumns.spec.ts → WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts} +7 -7
- package/src/components/{WFOTable/WFODataGridTable/WFOdataGridColumns.ts → WfoTable/WfoDataGridTable/WfodataGridColumns.ts} +8 -7
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +11 -0
- package/src/components/WfoTable/WfoFirstPartUUID/index.ts +1 -0
- package/src/components/WfoTable/WfoSortButtons/WfoSortButton.tsx +31 -0
- package/src/components/WfoTable/WfoSortButtons/WfoSortButtons.tsx +33 -0
- package/src/components/WfoTable/WfoSortButtons/index.ts +2 -0
- package/src/components/WfoTable/WfoSortButtons/styles.ts +20 -0
- package/src/components/{WFOTable/WFOTableSettingsModal/WFOTableSettingsModal.tsx → WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx} +5 -3
- package/src/components/WfoTable/WfoTableSettingsModal/index.ts +1 -0
- package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +253 -0
- package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -0
- package/src/components/WfoTable/index.ts +15 -0
- package/src/components/{WFOTable → WfoTable}/utils/columns.ts +27 -16
- package/src/components/{WFOTable → WfoTable}/utils/constants.ts +3 -1
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +52 -0
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +21 -0
- package/src/components/{WFOTable → WfoTable}/utils/tableConfigPersistence.spec.ts +4 -4
- package/src/components/{WFOTable → WfoTable}/utils/tableConfigPersistence.ts +12 -16
- package/src/components/{WFOTable → WfoTable}/utils/tableUtils.spec.ts +1 -1
- package/src/components/{WFOTable → WfoTable}/utils/tableUtils.ts +6 -25
- package/src/components/WfoTimeline/WfoTimeline.tsx +69 -0
- package/src/components/WfoTimeline/WfoTimelineStep.tsx +57 -0
- package/src/components/WfoTimeline/index.ts +1 -0
- package/src/components/WfoTimeline/mapProcessStepStatusToEuiStepStatus.ts +23 -0
- package/src/components/WfoTimeline/styles.ts +165 -0
- package/src/components/WfoTimeline/timelineUtils.ts +14 -0
- package/src/components/WfoToastsList/WfoToastsList.tsx +22 -0
- package/src/components/WfoToastsList/index.ts +1 -0
- package/src/components/WfoTree/WfoTree.tsx +27 -0
- package/src/components/{WFOTree/WFOTreeBranch.tsx → WfoTree/WfoTreeBranch.tsx} +7 -6
- package/src/components/{WFOTree/WFOTreeNode.tsx → WfoTree/WfoTreeNode.tsx} +28 -13
- package/src/components/WfoTree/index.ts +4 -0
- package/src/components/WfoTree/styles.ts +18 -0
- package/src/components/WfoTree/treeUtils.spec.ts +100 -0
- package/src/components/WfoTree/treeUtils.ts +21 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.stories.tsx +13 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +167 -0
- package/src/components/WfoWorkflowSteps/WfoStep/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +107 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.stories.tsx +16 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +114 -0
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/index.ts +1 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +139 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.stories.tsx +56 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +121 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/index.ts +2 -0
- package/src/components/WfoWorkflowSteps/index.ts +4 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.spec.ts +26 -0
- package/src/components/WfoWorkflowSteps/stepListUtils.ts +56 -0
- package/src/components/WfoWorkflowSteps/styles.ts +121 -0
- package/src/components/confirmationDialog/ConfirmationDialogStyling.ts +12 -0
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +112 -0
- package/src/components/confirmationDialog/index.ts +1 -0
- package/src/components/index.ts +19 -11
- package/src/contexts/ApiClientContext.tsx +30 -0
- package/src/contexts/ConfirmationDialogProvider.tsx +99 -0
- package/src/contexts/OrchestratorConfigContext.tsx +8 -3
- package/src/contexts/ToastContext.tsx +136 -0
- package/src/contexts/TreeContext.tsx +53 -32
- package/src/contexts/index.ts +3 -1
- package/src/graphqlQueries/customersQuery.ts +19 -0
- package/src/graphqlQueries/index.ts +4 -0
- package/src/graphqlQueries/processDetailQuery.ts +45 -0
- package/src/graphqlQueries/processListQuery.ts +17 -7
- package/src/graphqlQueries/productBlocksQuery.ts +13 -1
- package/src/graphqlQueries/productsQuery.ts +5 -1
- package/src/graphqlQueries/relatedSubscriptionsQuery.ts +65 -0
- package/src/graphqlQueries/resourceTypesQuery.ts +13 -2
- package/src/graphqlQueries/subscriptionDetailQuery.ts +62 -0
- package/src/graphqlQueries/subscriptionsDropdownOptionsQuery.ts +47 -0
- package/src/graphqlQueries/subscriptionsListQuery.ts +4 -0
- package/src/graphqlQueries/{workflowsQuery.ts → workflows/workflowsQuery.ts} +9 -3
- package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +41 -0
- package/src/hooks/DataFetchHooks.ts +72 -49
- package/src/hooks/ProcessesHooks/useDeleteProcess.ts +37 -0
- package/src/hooks/index.ts +4 -1
- package/src/hooks/surf/useGetSubscriptionDropdownOptions.ts +47 -0
- package/src/hooks/surf/useIsTaggedPort.ts +29 -0
- package/src/hooks/useDataDisplayParams.ts +1 -1
- package/src/hooks/useEngineStatusQuery.ts +20 -10
- package/src/hooks/useOrchestratorConfig.ts +6 -2
- package/src/hooks/useProcessStatusCountsQuery.ts +8 -23
- package/src/hooks/useQueryWithFetch.ts +33 -0
- package/src/hooks/useQueryWithGraphql.ts +18 -13
- package/src/hooks/useSessionWithToken.ts +14 -0
- package/src/hooks/useStoredTableConfig.ts +43 -0
- package/src/hooks/useSubscriptionActions.ts +3 -3
- package/src/hooks/useToastMessage.ts +5 -0
- package/src/hooks/useWithOrchestratorTheme.ts +10 -0
- package/src/icons/WfoArrowNarrowDown.stories.tsx +13 -0
- package/src/icons/{WFOArrowNarrowDown.tsx → WfoArrowNarrowDown.tsx} +4 -2
- package/src/icons/WfoArrowNarrowUp.stories.tsx +13 -0
- package/src/icons/{WFOArrowNarrowUp.tsx → WfoArrowNarrowUp.tsx} +4 -2
- package/src/icons/WfoArrowsExpand.stories.tsx +13 -0
- package/src/icons/WfoArrowsExpand.tsx +33 -0
- package/src/icons/WfoCheckmarkCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOCheckmarkCircleFill.tsx → WfoCheckmarkCircleFill.tsx} +3 -2
- package/src/icons/WfoChevronDown.stories.tsx +13 -0
- package/src/icons/{WFOChevronDown.tsx → WfoChevronDown.tsx} +3 -2
- package/src/icons/WfoChevronUp.stories.tsx +13 -0
- package/src/icons/WfoChevronUp.tsx +33 -0
- package/src/icons/WfoClipboardCopy.stories.tsx +13 -0
- package/src/icons/WfoClipboardCopy.tsx +33 -0
- package/src/icons/WfoCode.stories.tsx +13 -0
- package/src/icons/WfoCode.tsx +35 -0
- package/src/icons/WfoCogFill.stories.tsx +13 -0
- package/src/icons/WfoCogFill.tsx +35 -0
- package/src/icons/WfoEyeFill.stories.tsx +13 -0
- package/src/icons/WfoEyeFill.tsx +35 -0
- package/src/icons/{WFOIconProps.ts → WfoIconProps.ts} +1 -1
- package/src/icons/WfoLogoutIcon.stories.tsx +13 -0
- package/src/icons/{WFOLogoutIcon.tsx → WfoLogoutIcon.tsx} +3 -2
- package/src/icons/WfoMinusCircleFill.stories.tsx +13 -0
- package/src/icons/WfoMinusCircleFill.tsx +33 -0
- package/src/icons/WfoMinusCircleOutline.stories.tsx +13 -0
- package/src/icons/{WFOMinusCircleOutline.tsx → WfoMinusCircleOutline.tsx} +3 -2
- package/src/icons/WfoPencilAlt.stories.tsx +13 -0
- package/src/icons/WfoPencilAlt.tsx +33 -0
- package/src/icons/WfoPlayFill.stories.tsx +13 -0
- package/src/icons/WfoPlayFill.tsx +35 -0
- package/src/icons/WfoPlusCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOPlusCircleFill.tsx → WfoPlusCircleFill.tsx} +3 -2
- package/src/icons/WfoRefresh.stories.tsx +13 -0
- package/src/icons/WfoRefresh.tsx +35 -0
- package/src/icons/WfoSearchStrikethrough.stories.tsx +13 -0
- package/src/icons/WfoSearchStrikethrough.tsx +33 -0
- package/src/icons/WfoSortAsc.stories.tsx +13 -0
- package/src/icons/WfoSortAsc.tsx +33 -0
- package/src/icons/WfoSortDesc.stories.tsx +13 -0
- package/src/icons/WfoSortDesc.tsx +33 -0
- package/src/icons/WfoStatistic.tsx +41 -0
- package/src/icons/WfoStatusDotIcon.stories.tsx +13 -0
- package/src/icons/{WFOStatusDotIcon.tsx → WfoStatusDotIcon.tsx} +3 -2
- package/src/icons/WfoXCircleFill.stories.tsx +13 -0
- package/src/icons/{WFOXCircleFill.tsx → WfoXCircleFill.tsx} +3 -2
- package/src/icons/index.ts +22 -10
- package/src/index.ts +1 -0
- package/src/messages/en-US.json +173 -20
- package/src/messages/getTranslationMessages.spec.ts +1 -1
- package/src/messages/getTranslationMessages.ts +1 -1
- package/src/messages/nl-NL.json +177 -22
- package/src/pages/index.ts +2 -0
- package/src/pages/metadata/{WFOMetadataPageLayout.tsx → WfoMetadataPageLayout.tsx} +5 -3
- package/src/pages/metadata/WfoProductBlocksPage.tsx +239 -0
- package/src/pages/metadata/{WFOProductsPage.tsx → WfoProductsPage.tsx} +96 -54
- package/src/pages/metadata/WfoResourceTypesPage.tsx +185 -0
- package/src/pages/metadata/WfoWorkflowsPage.tsx +194 -0
- package/src/pages/metadata/index.ts +4 -4
- package/src/pages/metadata/workflowListObjectMapper.ts +43 -0
- package/src/pages/processes/WfoProcessDetail.tsx +327 -0
- package/src/pages/processes/WfoProcessDetailPage.tsx +88 -0
- package/src/pages/processes/WfoProcessListPage.tsx +106 -0
- package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +72 -0
- package/src/pages/processes/getProcessListTabTypeFromString.ts +6 -6
- package/src/pages/processes/index.ts +3 -2
- package/src/pages/processes/tabConfig.ts +28 -10
- package/src/pages/processes/timelineUtils.spec.ts +202 -0
- package/src/pages/processes/timelineUtils.ts +113 -0
- package/src/pages/subscriptions/WfoSubscriptionDetailPage.tsx +19 -0
- package/src/pages/subscriptions/{WFOSubscriptionsListPage.tsx → WfoSubscriptionsListPage.tsx} +40 -20
- package/src/pages/subscriptions/index.ts +2 -1
- package/src/pages/tasks/WfoTaskListPage.tsx +120 -0
- package/src/pages/tasks/index.ts +1 -0
- package/src/pages/workflow/WfoStartWorkflowPage.tsx +176 -0
- package/src/pages/workflow/index.ts +1 -0
- package/src/stories/Button.jsx +45 -39
- package/src/stories/Configure.mdx +48 -43
- package/src/stories/Header.jsx +59 -45
- package/src/stories/Page.jsx +81 -60
- package/src/stories/Page.stories.js +2 -1
- package/src/stories/button.css +18 -18
- package/src/stories/colors.mdx +12 -0
- package/src/stories/colors.tsx +27 -0
- package/src/stories/header.css +18 -18
- package/src/stories/page.css +40 -40
- package/src/theme/defaultOrchestratorTheme.ts +16 -0
- package/src/types/forms.ts +40 -0
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +283 -73
- package/src/utils/date.spec.ts +157 -5
- package/src/utils/date.ts +66 -5
- package/src/utils/environmentVariables.spec.ts +17 -0
- package/src/utils/environmentVariables.ts +12 -0
- package/src/utils/getDefaultTableConfig.ts +101 -0
- package/src/utils/getProductNamesFromProcess.spec.ts +133 -0
- package/src/utils/getProductNamesFromProcess.ts +16 -0
- package/src/utils/getTokenName.ts +2 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/string.spec.ts +24 -1
- package/src/utils/strings.ts +5 -0
- package/tsconfig.build.json +18 -0
- package/tsconfig.json +8 -2
- package/src/components/WFOBadges/WFOBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOEngineStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOEnvironmentBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.stories.tsx +0 -12
- package/src/components/WFOBadges/WFOFailedTasksBadge/WFOFailedTasksBadge.tsx +0 -63
- package/src/components/WFOBadges/WFOFailedTasksBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOHeaderBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOProcessStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOProductBlockBadge/WFOProductBlockBadge.stories.tsx +0 -15
- package/src/components/WFOBadges/WFOProductBlockBadge/WFOProductBlockBadge.tsx +0 -22
- package/src/components/WFOBadges/WFOProductBlockBadge/index.ts +0 -1
- package/src/components/WFOBadges/WFOSubscriptionStatusBadge/index.ts +0 -1
- package/src/components/WFOBadges/index.ts +0 -8
- package/src/components/WFOFilterTabs/index.ts +0 -1
- package/src/components/WFOLoading/WFOLoading.tsx +0 -2
- package/src/components/WFOLoading/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOBreadcrumbs/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageHeader/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOPageTemplate/index.ts +0 -1
- package/src/components/WFOPageTemplate/WFOSidebar/WFOSidebar.tsx +0 -161
- package/src/components/WFOPageTemplate/WFOSidebar/index.ts +0 -1
- package/src/components/WFOPageTemplate/index.ts +0 -4
- package/src/components/WFOSearchBar/index.ts +0 -1
- package/src/components/WFOSettingsModal/index.tsx +0 -1
- package/src/components/WFOSettingsPage/index.ts +0 -1
- package/src/components/WFOStartPage/WFONewProcessPanel.stories.tsx +0 -12
- package/src/components/WFOStartPage/WFOStatCards.stories.tsx +0 -12
- package/src/components/WFOStartPage/index.ts +0 -6
- package/src/components/WFOSubscription/WFOFixedInputBlock.tsx +0 -58
- package/src/components/WFOSubscription/WFOProcessesTimeline.tsx +0 -105
- package/src/components/WFOSubscription/WFOProductBlock.tsx +0 -186
- package/src/components/WFOSubscription/WFOSubscriptionActions.tsx +0 -138
- package/src/components/WFOSubscription/WFOSubscriptionBlock.tsx +0 -109
- package/src/components/WFOSubscription/WFOSubscriptionDetailTree.tsx +0 -184
- package/src/components/WFOSubscription/WFOSubscriptionGeneral.tsx +0 -53
- package/src/components/WFOSubscription/index.ts +0 -7
- package/src/components/WFOSubscription/styles.ts +0 -18
- package/src/components/WFOSubscriptionsList/types.ts +0 -11
- package/src/components/WFOTable/WFOTable.tsx +0 -85
- package/src/components/WFOTable/WFOTableHeaderCell.tsx +0 -30
- package/src/components/WFOTable/WFOTableSettingsModal/index.ts +0 -1
- package/src/components/WFOTable/WFOTableWithFilter/WFOTableWithFilter.tsx +0 -174
- package/src/components/WFOTable/WFOTableWithFilter/index.ts +0 -1
- package/src/components/WFOTable/index.ts +0 -14
- package/src/components/WFOTree/WFOTree.tsx +0 -16
- package/src/contexts/SubscriptionContext.tsx +0 -72
- package/src/hooks/useSubscriptionProcesses.ts +0 -45
- package/src/icons/WFOCheckmarkCircleFill.stories.tsx +0 -12
- package/src/icons/WFOLogoutIcon.stories.tsx +0 -12
- package/src/icons/WFOMinusCircleOutline.stories.tsx +0 -12
- package/src/icons/WFOPlusCircleFill.stories.tsx +0 -12
- package/src/icons/WFOStatusDotIcon.stories.tsx +0 -12
- package/src/icons/WFOXCircleFill.stories.tsx +0 -12
- package/src/pages/metadata/WFOProductBlocksPage.tsx +0 -166
- package/src/pages/metadata/WFOResourceTypesPage.tsx +0 -120
- package/src/pages/metadata/WFOWorkflowsPage.tsx +0 -251
- package/src/pages/processes/WFOProcessListPage.tsx +0 -213
- package/src/pages/processes/WFOProcessesListSubscriptionsCell.tsx +0 -28
- package/src/pages/processes/tableConfig.ts +0 -22
- package/src/types/subscription.ts +0 -21
- package/src/components/{WFOTable → WfoTable}/utils/columns.spec.ts +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
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 { useRouter } from 'next/router';
|
|
18
|
+
import hash from 'object-hash';
|
|
19
|
+
|
|
20
|
+
import { ConfirmDialogActions } from '../../contexts/ConfirmationDialogProvider';
|
|
21
|
+
import { FormNotCompleteResponse, InputForm } from '../../types/forms';
|
|
22
|
+
import UserInputForm from './UserInputForm';
|
|
23
|
+
import { useAxiosApiClient } from './useAxiosApiClient';
|
|
24
|
+
|
|
25
|
+
interface Form {
|
|
26
|
+
form: InputForm;
|
|
27
|
+
hasNext?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface UserInputFormWizardProps {
|
|
31
|
+
stepUserInput: InputForm;
|
|
32
|
+
validSubmit: (processInput: object[]) => Promise<unknown>;
|
|
33
|
+
cancel: () => void;
|
|
34
|
+
hasNext?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function stop(e: React.SyntheticEvent) {
|
|
38
|
+
if (e !== undefined && e !== null) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function UserInputFormWizard({
|
|
45
|
+
hasNext = false,
|
|
46
|
+
stepUserInput,
|
|
47
|
+
validSubmit,
|
|
48
|
+
cancel,
|
|
49
|
+
}: UserInputFormWizardProps) {
|
|
50
|
+
const router = useRouter();
|
|
51
|
+
const apiClient = useAxiosApiClient();
|
|
52
|
+
const [forms, setForms] = useState<Form[]>([
|
|
53
|
+
{ form: stepUserInput, hasNext: hasNext },
|
|
54
|
+
]);
|
|
55
|
+
const [userInputs, setUserInputs] = useState<object[]>([]);
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
setForms([{ form: stepUserInput, hasNext: hasNext }]);
|
|
59
|
+
}, [hasNext, stepUserInput]);
|
|
60
|
+
|
|
61
|
+
const previous: ConfirmDialogActions['closeConfirmDialog'] = (e) => {
|
|
62
|
+
if (e) {
|
|
63
|
+
stop(e);
|
|
64
|
+
}
|
|
65
|
+
const current = forms.pop();
|
|
66
|
+
setForms(forms.filter((item) => item !== current));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const submit = (currentFormData: object) => {
|
|
70
|
+
const newUserInputs = userInputs.slice(0, forms.length - 1);
|
|
71
|
+
newUserInputs.push(currentFormData);
|
|
72
|
+
|
|
73
|
+
const result = validSubmit(newUserInputs);
|
|
74
|
+
return apiClient.catchErrorStatus<FormNotCompleteResponse>(
|
|
75
|
+
result,
|
|
76
|
+
510,
|
|
77
|
+
(json) => {
|
|
78
|
+
// Scroll to top when navigating to next screen of wizard
|
|
79
|
+
window.scrollTo(0, 0);
|
|
80
|
+
// setFlash(intl.formatMessage({ id: "process.flash.wizard_next_step" }));
|
|
81
|
+
setForms([
|
|
82
|
+
...forms,
|
|
83
|
+
{ form: json.form, hasNext: json.hasNext },
|
|
84
|
+
]);
|
|
85
|
+
setUserInputs(newUserInputs);
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const currentForm = forms[forms.length - 1];
|
|
91
|
+
const currentUserInput = userInputs[forms.length - 1];
|
|
92
|
+
if (!currentForm || !currentForm.form.properties) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Generate a key based on input widget names that results in a new
|
|
97
|
+
* clean instance + rerender of UserInputForm if the form changes. Without this, state of previous,
|
|
98
|
+
* wizard step can cause wrong/weird default values for forms inputs.
|
|
99
|
+
*
|
|
100
|
+
* Note: to ensure a new form for multiple form wizard steps with exactly the same fields and labels on
|
|
101
|
+
* the form the hash is calculated on the form object itself + length, which generates a unique hash as it
|
|
102
|
+
* has a changing ".length" attribute.
|
|
103
|
+
* */
|
|
104
|
+
const key = hash.sha1({ form: currentForm.form, length: forms.length });
|
|
105
|
+
return (
|
|
106
|
+
<UserInputForm
|
|
107
|
+
key={key}
|
|
108
|
+
router={router}
|
|
109
|
+
stepUserInput={currentForm.form}
|
|
110
|
+
validSubmit={submit}
|
|
111
|
+
previous={previous}
|
|
112
|
+
hasNext={currentForm.hasNext}
|
|
113
|
+
hasPrev={forms.length > 1}
|
|
114
|
+
cancel={cancel}
|
|
115
|
+
userInput={currentUserInput}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default UserInputFormWizard;
|
|
@@ -0,0 +1,239 @@
|
|
|
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, { useReducer } from 'react';
|
|
16
|
+
|
|
17
|
+
import { useTranslations } from 'next-intl';
|
|
18
|
+
import { connectField, filterDOMProps } from 'uniforms';
|
|
19
|
+
|
|
20
|
+
import { EuiCheckbox, EuiFlexItem, EuiText } from '@elastic/eui';
|
|
21
|
+
|
|
22
|
+
import { useWithOrchestratorTheme } from '../../../hooks';
|
|
23
|
+
import { getStyles } from './AcceptFieldStyling';
|
|
24
|
+
import { FieldProps } from './types';
|
|
25
|
+
|
|
26
|
+
type AcceptItemType =
|
|
27
|
+
| 'info'
|
|
28
|
+
| 'label'
|
|
29
|
+
| 'warning'
|
|
30
|
+
| 'url'
|
|
31
|
+
| 'checkbox'
|
|
32
|
+
| '>checkbox'
|
|
33
|
+
| 'checkbox?'
|
|
34
|
+
| '>checkbox?'
|
|
35
|
+
| 'skip'
|
|
36
|
+
| 'margin'
|
|
37
|
+
| 'value';
|
|
38
|
+
type AcceptItem = [string, AcceptItemType, Record<string, string>?];
|
|
39
|
+
type AcceptValue = 'SKIPPED' | 'ACCEPTED' | 'INCOMPLETE';
|
|
40
|
+
|
|
41
|
+
export type AcceptFieldProps = FieldProps<AcceptValue, { data?: AcceptItem[] }>;
|
|
42
|
+
|
|
43
|
+
declare module 'uniforms' {
|
|
44
|
+
interface FilterDOMProps {
|
|
45
|
+
data: never;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
filterDOMProps.register('data');
|
|
50
|
+
|
|
51
|
+
interface AcceptState {
|
|
52
|
+
checks: { [index: number]: boolean };
|
|
53
|
+
skip: boolean;
|
|
54
|
+
allChecked: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface Action {
|
|
58
|
+
field: number;
|
|
59
|
+
type: string;
|
|
60
|
+
value: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function Accept({
|
|
64
|
+
disabled,
|
|
65
|
+
className = '',
|
|
66
|
+
name,
|
|
67
|
+
onChange,
|
|
68
|
+
error,
|
|
69
|
+
showInlineError,
|
|
70
|
+
errorMessage,
|
|
71
|
+
data,
|
|
72
|
+
...props
|
|
73
|
+
}: AcceptFieldProps) {
|
|
74
|
+
const t = useTranslations('pydanticForms.widgets');
|
|
75
|
+
const { acceptFieldStyle } = useWithOrchestratorTheme(getStyles);
|
|
76
|
+
|
|
77
|
+
const legacy = !data;
|
|
78
|
+
const i18nBaseKey = data ? `forms.fields.${name}_accept` : 'forms.fields';
|
|
79
|
+
|
|
80
|
+
data = data ?? [
|
|
81
|
+
[name, 'label', {}],
|
|
82
|
+
[`${name}_info`, 'info', {}],
|
|
83
|
+
[name, 'checkbox', {}],
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
const [state, dispatch] = useReducer(
|
|
87
|
+
(state: AcceptState, action: Action) => {
|
|
88
|
+
if (action.type === 'skip') {
|
|
89
|
+
state.skip = action.value;
|
|
90
|
+
state.checks = {};
|
|
91
|
+
} else {
|
|
92
|
+
state.checks[action.field] = action.value;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// We intentionally skip optional checkboxes here
|
|
96
|
+
state.allChecked = data!
|
|
97
|
+
.map(
|
|
98
|
+
(entry: AcceptItem, index: number) =>
|
|
99
|
+
[entry, state.checks[index] || false] as [
|
|
100
|
+
AcceptItem,
|
|
101
|
+
boolean,
|
|
102
|
+
],
|
|
103
|
+
)
|
|
104
|
+
.filter((entry: [AcceptItem, boolean]) =>
|
|
105
|
+
entry[0][1].endsWith('checkbox'),
|
|
106
|
+
)
|
|
107
|
+
.map((entry: [AcceptItem, boolean]) => entry[1])
|
|
108
|
+
.every((check: boolean) => check);
|
|
109
|
+
|
|
110
|
+
onChange(
|
|
111
|
+
state.skip
|
|
112
|
+
? 'SKIPPED'
|
|
113
|
+
: state.allChecked
|
|
114
|
+
? 'ACCEPTED'
|
|
115
|
+
: 'INCOMPLETE',
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
return { ...state };
|
|
119
|
+
},
|
|
120
|
+
{ checks: {}, skip: false, allChecked: false },
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<EuiFlexItem css={acceptFieldStyle}>
|
|
125
|
+
<section
|
|
126
|
+
{...filterDOMProps(props)}
|
|
127
|
+
className={`${className} acceptField`}
|
|
128
|
+
>
|
|
129
|
+
{data.map((entry, index) => {
|
|
130
|
+
const label = t(`${i18nBaseKey}.${entry[0]}`, entry[2]);
|
|
131
|
+
switch (entry[1]) {
|
|
132
|
+
case 'label':
|
|
133
|
+
return (
|
|
134
|
+
<label
|
|
135
|
+
key={index}
|
|
136
|
+
className="euiFormLabel euiFormRow__label"
|
|
137
|
+
>
|
|
138
|
+
{label}
|
|
139
|
+
</label>
|
|
140
|
+
);
|
|
141
|
+
case 'info':
|
|
142
|
+
return (
|
|
143
|
+
<EuiText key={index} size="m">
|
|
144
|
+
{label}
|
|
145
|
+
</EuiText>
|
|
146
|
+
);
|
|
147
|
+
case 'url':
|
|
148
|
+
return (
|
|
149
|
+
<div key={index}>
|
|
150
|
+
<a
|
|
151
|
+
href={entry[0]}
|
|
152
|
+
target="_blank"
|
|
153
|
+
rel="noopener noreferrer"
|
|
154
|
+
>
|
|
155
|
+
{entry[0]}
|
|
156
|
+
</a>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
case 'value':
|
|
160
|
+
return (
|
|
161
|
+
<div key={index}>
|
|
162
|
+
<input value={entry[0]} disabled={true} />
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
case 'margin':
|
|
166
|
+
return <br key={index} />;
|
|
167
|
+
case 'warning':
|
|
168
|
+
return (
|
|
169
|
+
<label
|
|
170
|
+
key={index}
|
|
171
|
+
className="euiFormLabel euiFormRow__label warning"
|
|
172
|
+
>
|
|
173
|
+
{label}
|
|
174
|
+
</label>
|
|
175
|
+
);
|
|
176
|
+
case 'skip':
|
|
177
|
+
return (
|
|
178
|
+
<EuiCheckbox
|
|
179
|
+
id={entry[0]}
|
|
180
|
+
key={index}
|
|
181
|
+
name={entry[0]}
|
|
182
|
+
onChange={(
|
|
183
|
+
e: React.FormEvent<HTMLInputElement>,
|
|
184
|
+
) => {
|
|
185
|
+
const target =
|
|
186
|
+
e.target as HTMLInputElement;
|
|
187
|
+
dispatch({
|
|
188
|
+
field: index,
|
|
189
|
+
type: 'skip',
|
|
190
|
+
value: target.checked,
|
|
191
|
+
});
|
|
192
|
+
}}
|
|
193
|
+
checked={state.skip}
|
|
194
|
+
label={label}
|
|
195
|
+
className={'skip'}
|
|
196
|
+
/>
|
|
197
|
+
);
|
|
198
|
+
default:
|
|
199
|
+
return (
|
|
200
|
+
<EuiCheckbox
|
|
201
|
+
id={entry[0] + (legacy ? '' : index)}
|
|
202
|
+
key={index}
|
|
203
|
+
name={entry[0] + (legacy ? '' : index)} // Index needed to allow checkboxes with same name (we can skip this in legacy mode)
|
|
204
|
+
className={
|
|
205
|
+
entry[1].startsWith('>')
|
|
206
|
+
? 'level_2'
|
|
207
|
+
: undefined
|
|
208
|
+
}
|
|
209
|
+
onChange={(
|
|
210
|
+
e: React.FormEvent<HTMLInputElement>,
|
|
211
|
+
) => {
|
|
212
|
+
const target =
|
|
213
|
+
e.target as HTMLInputElement;
|
|
214
|
+
|
|
215
|
+
dispatch({
|
|
216
|
+
field: index,
|
|
217
|
+
type: 'check',
|
|
218
|
+
value: target.checked,
|
|
219
|
+
});
|
|
220
|
+
}}
|
|
221
|
+
checked={state.checks[index]}
|
|
222
|
+
label={label}
|
|
223
|
+
readOnly={state.skip || disabled}
|
|
224
|
+
/>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
})}
|
|
228
|
+
|
|
229
|
+
{error && showInlineError && (
|
|
230
|
+
<em className="error">
|
|
231
|
+
<div className="backend-validation">{errorMessage}</div>
|
|
232
|
+
</em>
|
|
233
|
+
)}
|
|
234
|
+
</section>
|
|
235
|
+
</EuiFlexItem>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export const AcceptField = connectField(Accept);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
export const getStyles = (theme: EuiThemeComputed) => {
|
|
5
|
+
const acceptFieldStyle = css({
|
|
6
|
+
'.acceptField': {
|
|
7
|
+
'label.warning': {
|
|
8
|
+
color: theme.colors.danger,
|
|
9
|
+
},
|
|
10
|
+
'.skip': {
|
|
11
|
+
color: theme.colors.success,
|
|
12
|
+
fontStyle: 'italic',
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
// Don't touch the margin + padding: they also control if the user can click on the checkbox instead of label
|
|
16
|
+
'.level_2': {
|
|
17
|
+
marginLeft: '24px',
|
|
18
|
+
padding: 0,
|
|
19
|
+
label: {
|
|
20
|
+
marginTop: 0,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
acceptFieldStyle: acceptFieldStyle,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
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 { EuiCheckbox, EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
|
|
20
|
+
|
|
21
|
+
import { FieldProps } from '../../../types/forms';
|
|
22
|
+
import { boolFieldStyling } from './BoolFieldStyling';
|
|
23
|
+
|
|
24
|
+
export type BoolFieldProps = FieldProps<boolean>;
|
|
25
|
+
|
|
26
|
+
function Bool({
|
|
27
|
+
disabled,
|
|
28
|
+
id,
|
|
29
|
+
className = '',
|
|
30
|
+
label,
|
|
31
|
+
description,
|
|
32
|
+
name,
|
|
33
|
+
onChange,
|
|
34
|
+
readOnly,
|
|
35
|
+
value,
|
|
36
|
+
error,
|
|
37
|
+
showInlineError,
|
|
38
|
+
errorMessage,
|
|
39
|
+
...props
|
|
40
|
+
}: BoolFieldProps) {
|
|
41
|
+
return (
|
|
42
|
+
<EuiFlexItem css={boolFieldStyling}>
|
|
43
|
+
<section
|
|
44
|
+
{...filterDOMProps(props)}
|
|
45
|
+
className={`${className} bool-field`}
|
|
46
|
+
>
|
|
47
|
+
<EuiFormRow
|
|
48
|
+
label={label}
|
|
49
|
+
labelAppend={<EuiText size="m">{description}</EuiText>}
|
|
50
|
+
error={showInlineError ? errorMessage : false}
|
|
51
|
+
isInvalid={error}
|
|
52
|
+
id={id}
|
|
53
|
+
fullWidth
|
|
54
|
+
>
|
|
55
|
+
<EuiCheckbox
|
|
56
|
+
checked={value || false}
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
id={id}
|
|
59
|
+
name={name}
|
|
60
|
+
label={name}
|
|
61
|
+
onChange={() =>
|
|
62
|
+
!disabled && !readOnly && onChange(!value)
|
|
63
|
+
}
|
|
64
|
+
/>
|
|
65
|
+
</EuiFormRow>
|
|
66
|
+
</section>
|
|
67
|
+
</EuiFlexItem>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const BoolField = connectField(Bool, { kind: 'leaf' });
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
// Todo: theme with decent colors from theme (style was copied from v1)
|
|
4
|
+
const PRIMARY_COLOR = '#0077cc';
|
|
5
|
+
const LIGHT_GREY_COLOR = '#eff2f3';
|
|
6
|
+
const MEDIUM_GREY_COLOR = '#a6b6be';
|
|
7
|
+
|
|
8
|
+
export const boolFieldStyling = css`
|
|
9
|
+
|
|
10
|
+
.bool-field {
|
|
11
|
+
.euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label {
|
|
12
|
+
z-index: unset;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
input[type="checkbox"] {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
label {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
margin: 3px 0;
|
|
22
|
+
&.info {
|
|
23
|
+
margin-left: 10px;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
input[type="checkbox"] + label span {
|
|
29
|
+
font-size: 11px;
|
|
30
|
+
background-color: white;
|
|
31
|
+
border: 1px solid ${PRIMARY_COLOR};
|
|
32
|
+
border-radius: 3px;
|
|
33
|
+
padding: 1px 2px;
|
|
34
|
+
margin: 2px 0;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
i {
|
|
37
|
+
color: transparent;
|
|
38
|
+
padding: 0 1px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
input[type="checkbox"]:disabled + label span {
|
|
43
|
+
border: 1px solid ${MEDIUM_GREY_COLOR}
|
|
44
|
+
background-color: ${LIGHT_GREY_COLOR};
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
input[type="checkbox"]:checked + label span {
|
|
49
|
+
border: 2px solid ${PRIMARY_COLOR};
|
|
50
|
+
border-radius: 2px;
|
|
51
|
+
box-shadow: none;
|
|
52
|
+
padding: 0;
|
|
53
|
+
i {
|
|
54
|
+
background-color: ${PRIMARY_COLOR};
|
|
55
|
+
color: white;
|
|
56
|
+
padding: 3px 2px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
input[type="checkbox"]:checked:disabled + label span {
|
|
61
|
+
border: 3px solid ${MEDIUM_GREY_COLOR};
|
|
62
|
+
cursor: default;
|
|
63
|
+
i {
|
|
64
|
+
background-color: ${MEDIUM_GREY_COLOR};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
@@ -0,0 +1,97 @@
|
|
|
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, useRef } from 'react';
|
|
16
|
+
|
|
17
|
+
import scrollIntoView from 'scroll-into-view';
|
|
18
|
+
|
|
19
|
+
import { EuiFlexItem } from '@elastic/eui';
|
|
20
|
+
|
|
21
|
+
import { useWithOrchestratorTheme } from '../../../hooks';
|
|
22
|
+
import { getStyles } from './ContactPersonAutocompleteStyles';
|
|
23
|
+
import { ContactPerson } from './types';
|
|
24
|
+
import { isEmpty } from './utils';
|
|
25
|
+
|
|
26
|
+
interface ContactPersonAutocompleteProps {
|
|
27
|
+
query: string;
|
|
28
|
+
selectedItem: number;
|
|
29
|
+
personIndex: number;
|
|
30
|
+
itemSelected: (value: ContactPerson, index: number) => void;
|
|
31
|
+
suggestions: ContactPerson[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const ContactPersonAutocomplete = ({
|
|
35
|
+
query,
|
|
36
|
+
selectedItem,
|
|
37
|
+
personIndex,
|
|
38
|
+
itemSelected,
|
|
39
|
+
suggestions,
|
|
40
|
+
}: ContactPersonAutocompleteProps) => {
|
|
41
|
+
const { contactPersonAutocompleteStyling } =
|
|
42
|
+
useWithOrchestratorTheme(getStyles);
|
|
43
|
+
|
|
44
|
+
// Intentionally not done with state since we don't need a rerender
|
|
45
|
+
// This is only to store a ref for the scroll into view part
|
|
46
|
+
const selectedRowRef = useRef(null);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!isEmpty(suggestions) && selectedRowRef.current) {
|
|
50
|
+
scrollIntoView(selectedRowRef.current);
|
|
51
|
+
}
|
|
52
|
+
}, [selectedItem, suggestions]);
|
|
53
|
+
|
|
54
|
+
const itemName = (item: ContactPerson, query: string) => {
|
|
55
|
+
const name = item.name;
|
|
56
|
+
const nameToLower = name.toLowerCase();
|
|
57
|
+
const indexOf = nameToLower.indexOf(query.toLowerCase());
|
|
58
|
+
const first = name.substring(0, indexOf);
|
|
59
|
+
const middle = name.substring(indexOf, indexOf + query.length);
|
|
60
|
+
const last = name.substring(indexOf + query.length);
|
|
61
|
+
return (
|
|
62
|
+
<span>
|
|
63
|
+
{first}
|
|
64
|
+
<span className="matched">{middle}</span>
|
|
65
|
+
{last}
|
|
66
|
+
</span>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return isEmpty(suggestions) ? null : (
|
|
71
|
+
<EuiFlexItem css={contactPersonAutocompleteStyling}>
|
|
72
|
+
<section className={`autocomplete`}>
|
|
73
|
+
<table className="result">
|
|
74
|
+
<tbody>
|
|
75
|
+
{suggestions.map((item, index) => (
|
|
76
|
+
<tr
|
|
77
|
+
key={index}
|
|
78
|
+
className={
|
|
79
|
+
selectedItem === index ? 'active' : ''
|
|
80
|
+
}
|
|
81
|
+
onClick={() => itemSelected(item, personIndex)}
|
|
82
|
+
ref={
|
|
83
|
+
selectedItem === index
|
|
84
|
+
? selectedRowRef
|
|
85
|
+
: null
|
|
86
|
+
}
|
|
87
|
+
>
|
|
88
|
+
<td>{itemName(item, query)}</td>
|
|
89
|
+
<td>{item.email || ''}</td>
|
|
90
|
+
</tr>
|
|
91
|
+
))}
|
|
92
|
+
</tbody>
|
|
93
|
+
</table>
|
|
94
|
+
</section>
|
|
95
|
+
</EuiFlexItem>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
export const getStyles = (theme: EuiThemeComputed) => {
|
|
5
|
+
const contactPersonAutocompleteStyling = css`
|
|
6
|
+
.autocomplete-container {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
section.autocomplete {
|
|
11
|
+
position: relative;
|
|
12
|
+
z-index: 2000;
|
|
13
|
+
width: 100%;
|
|
14
|
+
border-radius: ${theme.border.radius.medium};
|
|
15
|
+
background-color: ${theme.colors.lightShade};
|
|
16
|
+
margin-bottom: 20px;
|
|
17
|
+
|
|
18
|
+
table.result {
|
|
19
|
+
z-index: 2000;
|
|
20
|
+
|
|
21
|
+
tbody tr {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
|
|
24
|
+
td {
|
|
25
|
+
padding: 10px;
|
|
26
|
+
width: 50%;
|
|
27
|
+
vertical-align: middle;
|
|
28
|
+
span.matched {
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
text-decoration: underline;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
return {
|
|
38
|
+
contactPersonAutocompleteStyling,
|
|
39
|
+
};
|
|
40
|
+
};
|