@orchestrator-ui/orchestrator-ui-components 0.2.6 → 0.3.0
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/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +9 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1005 -123
- package/dist/index.js +33996 -6348
- package/package.json +14 -12
- package/src/api/index.ts +55 -3
- package/src/components/WfoDiff/WfoDiff.tsx +119 -0
- package/src/components/WfoDiff/index.ts +1 -0
- package/src/components/WfoDiff/unidiff.d.ts +1 -0
- package/src/components/WfoForms/AutoFieldLoader.tsx +5 -1
- package/src/components/WfoForms/CreateForm.tsx +1 -1
- package/src/components/WfoForms/UserInputForm.tsx +75 -43
- package/src/components/WfoForms/UserInputFormWizard.tsx +11 -4
- package/src/components/WfoForms/formFields/AcceptField.tsx +8 -5
- package/src/components/WfoForms/formFields/BoolField.tsx +1 -1
- package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +2 -2
- package/src/components/WfoForms/formFields/ImsPortIdField.tsx +238 -0
- package/src/components/WfoForms/formFields/ImsPortIdFieldStyling.ts +17 -0
- package/src/components/WfoForms/formFields/IpPrefixTableField.tsx +1 -1
- package/src/components/WfoForms/formFields/ListAddField.tsx +1 -1
- package/src/components/WfoForms/formFields/ListDelField.tsx +1 -1
- package/src/components/WfoForms/formFields/OptGroupField.tsx +1 -1
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +2 -1
- package/src/components/WfoForms/formFields/SummaryField.tsx +103 -0
- package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +46 -0
- package/src/components/WfoForms/formFields/VlanField.tsx +10 -10
- package/src/components/WfoForms/formFields/index.ts +2 -0
- package/src/components/WfoForms/formFields/surf/types.ts +26 -0
- package/src/components/WfoForms/formFields/utils.spec.ts +1 -0
- package/src/components/WfoJsonCodeBlock/index.ts +1 -0
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +4 -3
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +14 -14
- package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +15 -9
- package/src/components/WfoPageTemplate/paths.ts +3 -2
- package/src/components/{WfoProcessesList → WfoProcessList}/WfoProcessList.tsx +18 -14
- package/src/components/WfoProcessList/index.ts +1 -0
- package/src/components/{WfoProcessesList → WfoProcessList}/processListObjectMappers.ts +4 -2
- package/src/components/WfoSearchBar/WfoSearchField.tsx +27 -37
- package/src/components/{WfoSettingsPage → WfoSettings}/WfoEngineStatusButton.tsx +7 -4
- package/src/components/{WfoSettingsPage → WfoSettings}/WfoFlushSettings.tsx +13 -12
- package/src/components/WfoSettings/WfoModifySettings.tsx +38 -0
- package/src/components/WfoSettings/WfoSettings.tsx +40 -0
- package/src/components/{WfoSettingsPage → WfoSettings}/WfoStatus.tsx +21 -14
- package/src/components/WfoStartPage/WfoListStartPage.tsx +3 -3
- package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +14 -8
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +11 -18
- package/src/components/WfoSubscription/WfoSubscription.tsx +1 -1
- package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +41 -33
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +32 -22
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +94 -90
- package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +26 -0
- package/src/components/WfoSubscription/utils/utils.spec.ts +24 -0
- package/src/components/WfoSubscription/utils/utils.ts +16 -0
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +17 -37
- package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +20 -19
- package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts +95 -0
- package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.ts +60 -0
- package/src/components/WfoTable/utils/tableUtils.ts +3 -3
- package/src/components/WfoTextAnchor/WfoTextAnchor.stories.tsx +18 -0
- package/src/components/WfoTextAnchor/WfoTextAnchor.tsx +22 -0
- package/src/components/WfoTextAnchor/index.ts +1 -0
- package/src/components/WfoTextAnchor/styles.ts +17 -0
- package/src/components/WfoTimeline/styles.ts +10 -4
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +39 -24
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +48 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +14 -11
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +22 -23
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +97 -17
- package/src/components/WfoWorkflowSteps/stepListUtils.ts +1 -28
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +3 -3
- package/src/components/index.ts +6 -1
- package/src/contexts/ConfirmationDialogProvider.tsx +2 -2
- package/src/contexts/TreeContext.tsx +5 -0
- package/src/graphqlQueries/index.ts +1 -0
- package/src/graphqlQueries/processDetailQuery.ts +8 -0
- package/src/graphqlQueries/processListQuery.ts +7 -6
- package/src/graphqlQueries/processStepsQuery.ts +22 -0
- package/src/graphqlQueries/productBlocksQuery.ts +9 -5
- package/src/graphqlQueries/productsQuery.ts +7 -3
- package/src/graphqlQueries/relatedSubscriptionsQuery.ts +2 -2
- package/src/graphqlQueries/resourceTypesQuery.ts +8 -4
- package/src/graphqlQueries/subscriptionDetailQuery.ts +1 -0
- package/src/graphqlQueries/subscriptionsListQuery.ts +5 -3
- package/src/graphqlQueries/workflows/workflowsQuery.ts +8 -4
- package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +2 -2
- package/src/hooks/DataFetchHooks.ts +9 -4
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useCheckEngineStatus.ts +30 -0
- package/src/hooks/useDataDisplayParams.ts +3 -3
- package/src/hooks/useEngineStatusQuery.ts +9 -7
- package/src/hooks/useMutateProcess.ts +96 -0
- package/src/messages/{en-US.json → en-GB.json} +85 -37
- package/src/messages/getTranslationMessages.spec.ts +25 -40
- package/src/messages/index.ts +1 -1
- package/src/messages/nl-NL.json +95 -48
- package/src/messages/useGetTranslationMessages.ts +51 -0
- package/src/pages/metadata/WfoProductBlocksPage.tsx +12 -10
- package/src/pages/metadata/WfoProductsPage.tsx +24 -25
- package/src/pages/metadata/WfoResourceTypesPage.tsx +12 -10
- package/src/pages/metadata/WfoWorkflowsPage.tsx +12 -10
- package/src/pages/processes/WfoProcessDetail.tsx +96 -79
- package/src/pages/processes/WfoProcessDetailPage.tsx +5 -3
- package/src/pages/{workflow/WfoStartWorkflowPage.tsx → processes/WfoStartProcessPage.tsx} +102 -51
- package/src/pages/processes/index.ts +1 -3
- package/src/pages/settings/WfoSettingsPage.tsx +30 -0
- package/src/pages/settings/index.ts +1 -0
- package/src/pages/tasks/WfoTaskListPage.tsx +35 -9
- package/src/pages/{processes/WfoProcessListPage.tsx → workflow/WfoWorkflowListPage.tsx} +22 -23
- package/src/pages/workflow/getWorkflowListTabTypeFromString.ts +19 -0
- package/src/pages/workflow/index.ts +1 -1
- package/src/pages/{processes → workflow}/tabConfig.ts +6 -6
- package/src/types/types.ts +33 -3
- package/src/utils/getDefaultTableConfig.ts +1 -1
- package/src/components/WfoSettingsPage/WfoModifySettings.tsx +0 -33
- package/src/components/WfoSettingsPage/WfoSettings.tsx +0 -40
- package/src/hooks/ProcessesHooks/useDeleteProcess.ts +0 -37
- package/src/messages/getTranslationMessages.ts +0 -26
- package/src/pages/processes/getProcessListTabTypeFromString.ts +0 -19
- /package/src/components/{WfoSettingsPage → WfoSettings}/index.ts +0 -0
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import React, { Ref, useImperativeHandle, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useOrchestratorTheme } from '
|
|
4
|
-
|
|
3
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
4
|
+
|
|
5
5
|
import { WfoStep } from '../WfoStep';
|
|
6
6
|
import { getStyles } from '../styles';
|
|
7
|
-
|
|
8
|
-
export type StepListItem = {
|
|
9
|
-
step: Step;
|
|
10
|
-
isExpanded: boolean;
|
|
11
|
-
};
|
|
7
|
+
import { StepListItem } from './../WfoWorkflowStepList';
|
|
12
8
|
|
|
13
9
|
export type WfoStepListRef = {
|
|
14
10
|
scrollToStep: (stepId: string) => void;
|
|
@@ -20,6 +16,8 @@ export type WfoStepListProps = {
|
|
|
20
16
|
startedAt: string;
|
|
21
17
|
onToggleExpandStepListItem: (stepListItem: StepListItem) => void;
|
|
22
18
|
onTriggerExpandStepListItem: (stepListItem: StepListItem) => void;
|
|
19
|
+
isTask: boolean;
|
|
20
|
+
processId: string;
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
export const WfoStepList = React.forwardRef(
|
|
@@ -30,6 +28,8 @@ export const WfoStepList = React.forwardRef(
|
|
|
30
28
|
startedAt,
|
|
31
29
|
onToggleExpandStepListItem,
|
|
32
30
|
onTriggerExpandStepListItem,
|
|
31
|
+
isTask,
|
|
32
|
+
processId,
|
|
33
33
|
}: WfoStepListProps,
|
|
34
34
|
reference: Ref<WfoStepListRef>,
|
|
35
35
|
) => {
|
|
@@ -61,7 +61,10 @@ export const WfoStepList = React.forwardRef(
|
|
|
61
61
|
behavior: 'smooth',
|
|
62
62
|
});
|
|
63
63
|
} catch {
|
|
64
|
-
console.
|
|
64
|
+
console.error(
|
|
65
|
+
'Error scrolling to step with stepId ',
|
|
66
|
+
stepId,
|
|
67
|
+
);
|
|
65
68
|
}
|
|
66
69
|
},
|
|
67
70
|
}));
|
|
@@ -82,15 +85,15 @@ export const WfoStepList = React.forwardRef(
|
|
|
82
85
|
ref={getReferenceCallbackForStepId(
|
|
83
86
|
stepListItem.step.stepId,
|
|
84
87
|
)}
|
|
85
|
-
stepDetailIsOpen={stepListItem.isExpanded}
|
|
86
88
|
onToggleStepDetail={() =>
|
|
87
89
|
onToggleExpandStepListItem(stepListItem)
|
|
88
90
|
}
|
|
89
|
-
|
|
90
|
-
stepDelta={stepListItem.step.stateDelta || {}}
|
|
91
|
+
stepListItem={stepListItem}
|
|
91
92
|
startedAt={stepStartTime}
|
|
92
93
|
showHiddenKeys={showHiddenKeys}
|
|
93
94
|
isStartStep={index === 0}
|
|
95
|
+
isTask={isTask}
|
|
96
|
+
processId={processId}
|
|
94
97
|
/>
|
|
95
98
|
</div>
|
|
96
99
|
);
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
EuiText,
|
|
13
13
|
} from '@elastic/eui';
|
|
14
14
|
|
|
15
|
+
import { WfoTextAnchor } from '@/components/WfoTextAnchor/WfoTextAnchor';
|
|
16
|
+
|
|
15
17
|
import { useOrchestratorTheme } from '../../../hooks';
|
|
16
18
|
import { WfoCode, WfoEyeFill } from '../../../icons';
|
|
17
19
|
import { getStyles } from '../styles';
|
|
@@ -19,19 +21,25 @@ import { getStyles } from '../styles';
|
|
|
19
21
|
export type WfoStepListHeaderProps = {
|
|
20
22
|
showHiddenKeys: boolean;
|
|
21
23
|
showRaw: boolean;
|
|
24
|
+
showDelta: boolean;
|
|
22
25
|
allDetailToggleText: string;
|
|
23
26
|
onChangeShowRaw: (showRaw: boolean) => void;
|
|
27
|
+
onChangeShowDelta: (showRaw: boolean) => void;
|
|
24
28
|
onChangeShowHiddenKeys: (showHiddenKeys: boolean) => void;
|
|
25
29
|
onToggleAllDetailsIsOpen: () => void;
|
|
30
|
+
isTask: boolean;
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
export const WfoStepListHeader: FC<WfoStepListHeaderProps> = ({
|
|
29
34
|
showHiddenKeys,
|
|
30
35
|
showRaw,
|
|
36
|
+
showDelta,
|
|
31
37
|
onChangeShowHiddenKeys,
|
|
32
38
|
onChangeShowRaw,
|
|
39
|
+
onChangeShowDelta,
|
|
33
40
|
allDetailToggleText,
|
|
34
41
|
onToggleAllDetailsIsOpen,
|
|
42
|
+
isTask,
|
|
35
43
|
}) => {
|
|
36
44
|
const t = useTranslations('processes.steps');
|
|
37
45
|
const { theme } = useOrchestratorTheme();
|
|
@@ -39,7 +47,6 @@ export const WfoStepListHeader: FC<WfoStepListHeaderProps> = ({
|
|
|
39
47
|
stepListHeaderStyle,
|
|
40
48
|
stepListContentStyle,
|
|
41
49
|
stepListContentBoldTextStyle,
|
|
42
|
-
stepListContentAnchorStyle,
|
|
43
50
|
stepListOptionsContainerStyle,
|
|
44
51
|
} = getStyles(theme);
|
|
45
52
|
|
|
@@ -65,15 +72,13 @@ export const WfoStepListHeader: FC<WfoStepListHeaderProps> = ({
|
|
|
65
72
|
{/* Left side: header and expand/collapse button */}
|
|
66
73
|
<EuiFlexGroup css={stepListContentStyle}>
|
|
67
74
|
<EuiText css={stepListContentBoldTextStyle}>
|
|
68
|
-
{t('
|
|
75
|
+
{t(isTask ? 'taskSteps' : 'workflowSteps')}
|
|
69
76
|
</EuiText>
|
|
70
77
|
{!showRaw && (
|
|
71
|
-
<
|
|
72
|
-
|
|
78
|
+
<WfoTextAnchor
|
|
79
|
+
text={allDetailToggleText}
|
|
73
80
|
onClick={onToggleAllDetailsIsOpen}
|
|
74
|
-
|
|
75
|
-
{allDetailToggleText}
|
|
76
|
-
</EuiText>
|
|
81
|
+
/>
|
|
77
82
|
)}
|
|
78
83
|
</EuiFlexGroup>
|
|
79
84
|
|
|
@@ -84,22 +89,16 @@ export const WfoStepListHeader: FC<WfoStepListHeaderProps> = ({
|
|
|
84
89
|
css={stepListOptionsContainerStyle}
|
|
85
90
|
gutterSize="s"
|
|
86
91
|
>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
iconSide="right"
|
|
98
|
-
size="s"
|
|
99
|
-
iconType={() => <WfoCode color={theme.colors.link} />}
|
|
100
|
-
>
|
|
101
|
-
{t('showDelta')}
|
|
102
|
-
</EuiButton>
|
|
92
|
+
{!showRaw && (
|
|
93
|
+
<EuiButton
|
|
94
|
+
onClick={() => onChangeShowDelta(!showDelta)}
|
|
95
|
+
iconSide="right"
|
|
96
|
+
size="s"
|
|
97
|
+
iconType={() => <WfoCode color={theme.colors.link} />}
|
|
98
|
+
>
|
|
99
|
+
{showDelta ? t('hideDelta') : t('showDelta')}
|
|
100
|
+
</EuiButton>
|
|
101
|
+
)}
|
|
103
102
|
<EuiPopover
|
|
104
103
|
button={viewOptionButton}
|
|
105
104
|
isOpen={isViewOptionOpen}
|
|
@@ -2,18 +2,27 @@ import React, { Ref, useEffect, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import { WfoJsonCodeBlock, WfoLoading } from '@/components';
|
|
6
|
+
import WfoDiff from '@/components/WfoDiff/WfoDiff';
|
|
7
|
+
import { useRawProcessDetails } from '@/hooks';
|
|
8
|
+
import { Step, StepStatus } from '@/types';
|
|
9
|
+
import { InputForm } from '@/types/forms';
|
|
10
|
+
|
|
11
|
+
import { WfoStepList, WfoStepListRef } from '../WfoStepList';
|
|
11
12
|
import { WfoStepListHeader } from './WfoStepListHeader';
|
|
12
13
|
|
|
14
|
+
export type StepListItem = {
|
|
15
|
+
step: Step;
|
|
16
|
+
isExpanded: boolean;
|
|
17
|
+
userInputForm?: InputForm;
|
|
18
|
+
};
|
|
19
|
+
|
|
13
20
|
export interface WfoWorkflowStepListProps {
|
|
14
21
|
steps: Step[];
|
|
15
22
|
startedAt: string;
|
|
16
23
|
processId: string;
|
|
24
|
+
isTask: boolean;
|
|
25
|
+
userInputForm?: InputForm;
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
export const WfoProcessRawData = ({ processId }: { processId: string }) => {
|
|
@@ -21,31 +30,95 @@ export const WfoProcessRawData = ({ processId }: { processId: string }) => {
|
|
|
21
30
|
return isFetching ? <WfoLoading /> : <WfoJsonCodeBlock data={data || {}} />;
|
|
22
31
|
};
|
|
23
32
|
|
|
33
|
+
export const WfoProcessSubscriptionDelta = ({
|
|
34
|
+
processId,
|
|
35
|
+
}: {
|
|
36
|
+
processId: string;
|
|
37
|
+
}) => {
|
|
38
|
+
const { data, isFetching } = useRawProcessDetails(processId);
|
|
39
|
+
|
|
40
|
+
const subscriptionKey =
|
|
41
|
+
data?.current_state?.subscription?.subscription_id ?? '';
|
|
42
|
+
const newText = data?.current_state?.subscription ?? null;
|
|
43
|
+
const oldText =
|
|
44
|
+
data?.current_state?.__old_subscriptions__ &&
|
|
45
|
+
subscriptionKey in data?.current_state?.__old_subscriptions__
|
|
46
|
+
? data?.current_state?.__old_subscriptions__[subscriptionKey]
|
|
47
|
+
: null;
|
|
48
|
+
|
|
49
|
+
return isFetching ? (
|
|
50
|
+
<WfoLoading />
|
|
51
|
+
) : (
|
|
52
|
+
<WfoDiff
|
|
53
|
+
oldText={oldText ? JSON.stringify(oldText, null, 2) : ''}
|
|
54
|
+
newText={newText ? JSON.stringify(newText, null, 2) : ''}
|
|
55
|
+
syntax="javascript"
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
24
60
|
export const WfoWorkflowStepList = React.forwardRef(
|
|
25
61
|
(
|
|
26
|
-
{
|
|
62
|
+
{
|
|
63
|
+
steps = [],
|
|
64
|
+
startedAt,
|
|
65
|
+
processId,
|
|
66
|
+
isTask,
|
|
67
|
+
userInputForm,
|
|
68
|
+
}: WfoWorkflowStepListProps,
|
|
27
69
|
reference: Ref<WfoStepListRef>,
|
|
28
70
|
) => {
|
|
29
71
|
const [showHiddenKeys, setShowHiddenKeys] = useState(false);
|
|
30
72
|
const [showRaw, setShowRaw] = useState(false);
|
|
73
|
+
const [showDelta, setShowDelta] = useState(false);
|
|
31
74
|
|
|
32
75
|
const t = useTranslations('processes.steps');
|
|
33
76
|
|
|
34
77
|
const initialStepListItems: StepListItem[] = steps.map((step) => ({
|
|
35
78
|
step,
|
|
36
79
|
isExpanded: false,
|
|
37
|
-
}));
|
|
80
|
+
})); // If the step is in the suspend state, we show the user input form
|
|
38
81
|
|
|
39
82
|
const [stepListItems, setStepListItems] =
|
|
40
83
|
useState(initialStepListItems);
|
|
41
84
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
85
|
+
const persistStepListItemState = (
|
|
86
|
+
previousStepListItems: StepListItem[],
|
|
87
|
+
updatedSteps: Step[],
|
|
88
|
+
userInputForm?: InputForm,
|
|
89
|
+
): StepListItem[] => {
|
|
90
|
+
const reversedSteps = [...updatedSteps].reverse();
|
|
91
|
+
const lastStepWithSuspendStatusStepId = reversedSteps.find(
|
|
92
|
+
(step) => step.status === StepStatus.SUSPEND,
|
|
93
|
+
)?.stepId;
|
|
94
|
+
|
|
95
|
+
return updatedSteps.map((step) => {
|
|
96
|
+
const previousStepListItem = previousStepListItems.find(
|
|
97
|
+
(previousStepListItem) =>
|
|
98
|
+
previousStepListItem.step.stepId === step.stepId,
|
|
99
|
+
);
|
|
100
|
+
return {
|
|
101
|
+
step,
|
|
102
|
+
isExpanded: previousStepListItem?.isExpanded || false,
|
|
103
|
+
userInputForm:
|
|
104
|
+
lastStepWithSuspendStatusStepId === step.stepId &&
|
|
105
|
+
userInputForm
|
|
106
|
+
? userInputForm
|
|
107
|
+
: undefined,
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
// We want to preserve the state of stepListItems between renders
|
|
114
|
+
setStepListItems((previousStepListItems) =>
|
|
115
|
+
persistStepListItemState(
|
|
116
|
+
previousStepListItems,
|
|
117
|
+
steps,
|
|
118
|
+
userInputForm,
|
|
46
119
|
),
|
|
47
|
-
|
|
48
|
-
);
|
|
120
|
+
);
|
|
121
|
+
}, [steps, userInputForm]);
|
|
49
122
|
|
|
50
123
|
const updateStepListItem = (
|
|
51
124
|
stepListItemToUpdate: StepListItem,
|
|
@@ -89,27 +162,34 @@ export const WfoWorkflowStepList = React.forwardRef(
|
|
|
89
162
|
<WfoStepListHeader
|
|
90
163
|
showHiddenKeys={showHiddenKeys}
|
|
91
164
|
showRaw={showRaw}
|
|
165
|
+
showDelta={showDelta}
|
|
92
166
|
allDetailToggleText={
|
|
93
167
|
allStepsAreExpanded ? t('collapseAll') : t('expandAll')
|
|
94
168
|
}
|
|
95
169
|
onChangeShowHiddenKeys={setShowHiddenKeys}
|
|
96
170
|
onChangeShowRaw={setShowRaw}
|
|
171
|
+
onChangeShowDelta={setShowDelta}
|
|
97
172
|
onToggleAllDetailsIsOpen={() =>
|
|
98
173
|
setExpandedStateStepListItems(!allStepsAreExpanded)
|
|
99
174
|
}
|
|
175
|
+
isTask={isTask}
|
|
100
176
|
/>
|
|
101
177
|
|
|
102
|
-
{showRaw
|
|
103
|
-
|
|
104
|
-
|
|
178
|
+
{showRaw && <WfoProcessRawData processId={processId} />}
|
|
179
|
+
{showDelta && (
|
|
180
|
+
<WfoProcessSubscriptionDelta processId={processId} />
|
|
181
|
+
)}
|
|
182
|
+
{!showRaw && !showDelta && (
|
|
105
183
|
<WfoStepList
|
|
106
184
|
ref={reference}
|
|
107
185
|
stepListItems={stepListItems}
|
|
108
186
|
startedAt={startedAt}
|
|
109
187
|
showHiddenKeys={showHiddenKeys}
|
|
188
|
+
isTask={isTask}
|
|
110
189
|
onToggleExpandStepListItem={
|
|
111
190
|
toggleExpandedStateStepListItem
|
|
112
191
|
}
|
|
192
|
+
processId={processId}
|
|
113
193
|
onTriggerExpandStepListItem={handleExpandStepListItem}
|
|
114
194
|
/>
|
|
115
195
|
)}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { StepListItem } from './WfoStepList';
|
|
1
|
+
import { StepState } from '@/types';
|
|
3
2
|
|
|
4
3
|
export const STEP_STATE_HIDDEN_KEYS = [
|
|
5
4
|
'label_',
|
|
@@ -28,29 +27,3 @@ export const getStepContent = (
|
|
|
28
27
|
{},
|
|
29
28
|
);
|
|
30
29
|
};
|
|
31
|
-
|
|
32
|
-
export const updateStepListItems = (
|
|
33
|
-
previousStepListItems: StepListItem[],
|
|
34
|
-
updatedSteps: Step[],
|
|
35
|
-
) => {
|
|
36
|
-
const currentExpandedStateByStepId = previousStepListItems.reduce<
|
|
37
|
-
Map<string, boolean>
|
|
38
|
-
>(
|
|
39
|
-
(previousValue, currentValue) =>
|
|
40
|
-
previousValue.set(
|
|
41
|
-
currentValue.step.stepId,
|
|
42
|
-
currentValue.isExpanded,
|
|
43
|
-
),
|
|
44
|
-
new Map(),
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return updatedSteps.map((step) => {
|
|
48
|
-
const isCurrentlyExpanded = currentExpandedStateByStepId.get(
|
|
49
|
-
step.stepId,
|
|
50
|
-
);
|
|
51
|
-
return {
|
|
52
|
-
step,
|
|
53
|
-
isExpanded: isCurrentlyExpanded ?? false,
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
};
|
|
@@ -62,8 +62,8 @@ export default function WfoConfirmationDialog({
|
|
|
62
62
|
<section
|
|
63
63
|
className={`dialog-content ${isError ? ' error' : ''}`}
|
|
64
64
|
>
|
|
65
|
-
<h2>{t('leavePage')}</h2>
|
|
66
|
-
<p>{t('leavePageSub')}</p>
|
|
65
|
+
<h2>{question || t('leavePage')}</h2>
|
|
66
|
+
{!question && <p>{t('leavePageSub')}</p>}
|
|
67
67
|
</section>
|
|
68
68
|
) : (
|
|
69
69
|
<section className="dialog-content">
|
|
@@ -81,7 +81,7 @@ export default function WfoConfirmationDialog({
|
|
|
81
81
|
<EuiModal
|
|
82
82
|
css={confirmationDialogStyling}
|
|
83
83
|
className="confirm-modal"
|
|
84
|
-
onClose={cancel}
|
|
84
|
+
onClose={leavePage ? confirm : cancel}
|
|
85
85
|
initialFocus="[name=popfirst]"
|
|
86
86
|
>
|
|
87
87
|
<EuiModalHeader>
|
package/src/components/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './WfoKeyValueTable';
|
|
|
5
5
|
export * from './WfoPageTemplate';
|
|
6
6
|
export * from './WfoSearchBar';
|
|
7
7
|
export * from './WfoSettingsModal';
|
|
8
|
-
export * from '
|
|
8
|
+
export * from '../pages/settings/WfoSettingsPage';
|
|
9
9
|
export * from './WfoStartPage';
|
|
10
10
|
export * from './WfoSubscription';
|
|
11
11
|
export * from './WfoTable';
|
|
@@ -17,3 +17,8 @@ export * from './WfoStartTaskButtonComboBox';
|
|
|
17
17
|
export * from './WfoDateTime';
|
|
18
18
|
export * from './WfoAuth';
|
|
19
19
|
export * from './WfoDropdownButton';
|
|
20
|
+
export * from './WfoProcessList';
|
|
21
|
+
export * from './WfoTextAnchor';
|
|
22
|
+
export * from './WfoJsonCodeBlock';
|
|
23
|
+
export * from './WfoDiff';
|
|
24
|
+
export * from './WfoSettings';
|
|
@@ -9,6 +9,7 @@ export interface ConfirmDialogActions {
|
|
|
9
9
|
e:
|
|
10
10
|
| React.KeyboardEvent<HTMLDivElement>
|
|
11
11
|
| React.MouseEvent<HTMLButtonElement, MouseEvent>
|
|
12
|
+
| React.MouseEvent<HTMLDivElement, MouseEvent>
|
|
12
13
|
| undefined,
|
|
13
14
|
confirm?: boolean,
|
|
14
15
|
) => void;
|
|
@@ -30,13 +31,12 @@ export type ShowConfirmDialogType = ({
|
|
|
30
31
|
isError,
|
|
31
32
|
}: ShowConfirmDialog) => void;
|
|
32
33
|
|
|
33
|
-
const ConfirmationDialogContext = createContext<ConfirmDialogActions>({
|
|
34
|
+
export const ConfirmationDialogContext = createContext<ConfirmDialogActions>({
|
|
34
35
|
showConfirmDialog: () => {},
|
|
35
36
|
closeConfirmDialog: () => {},
|
|
36
37
|
});
|
|
37
38
|
|
|
38
39
|
export const ConfirmationDialogProvider = ConfirmationDialogContext.Provider;
|
|
39
|
-
export default ConfirmationDialogContext;
|
|
40
40
|
|
|
41
41
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
42
|
export function ConfirmationDialogContextWrapper({ children }: any) {
|
|
@@ -12,6 +12,7 @@ export type TreeContextType = {
|
|
|
12
12
|
expandAll: () => void;
|
|
13
13
|
collapseAll: () => void;
|
|
14
14
|
resetSelection: () => void;
|
|
15
|
+
selectAll: () => void;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export const TreeContext = React.createContext<TreeContextType | null>(null);
|
|
@@ -38,6 +39,9 @@ export const TreeProvider: React.FC<TreeProviderProps> = ({ children }) => {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
42
|
+
const selectAll = () => {
|
|
43
|
+
setSelectedIds(Array.from(Array(depths.length).keys()));
|
|
44
|
+
};
|
|
41
45
|
|
|
42
46
|
const toggleExpandedId = (id: number) => {
|
|
43
47
|
if (expandedIds.includes(id)) {
|
|
@@ -106,6 +110,7 @@ export const TreeProvider: React.FC<TreeProviderProps> = ({ children }) => {
|
|
|
106
110
|
expandAll,
|
|
107
111
|
collapseAll,
|
|
108
112
|
resetSelection,
|
|
113
|
+
selectAll,
|
|
109
114
|
}}
|
|
110
115
|
>
|
|
111
116
|
{children}
|
|
@@ -3,23 +3,23 @@ import { gql } from 'graphql-request';
|
|
|
3
3
|
|
|
4
4
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
5
|
|
|
6
|
-
import { GraphqlQueryVariables, Process,
|
|
6
|
+
import { GraphqlQueryVariables, Process, ProcessListResult } from '@/types';
|
|
7
7
|
|
|
8
8
|
export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
|
|
9
|
-
|
|
9
|
+
ProcessListResult,
|
|
10
10
|
GraphqlQueryVariables<Process>
|
|
11
11
|
> = parse(gql`
|
|
12
12
|
query ProcessList(
|
|
13
|
-
$first:
|
|
14
|
-
$after:
|
|
13
|
+
$first: Int!
|
|
14
|
+
$after: Int!
|
|
15
15
|
$sortBy: [GraphqlSort!]
|
|
16
|
-
$filterBy: [GraphqlFilter!]
|
|
16
|
+
$filterBy: [GraphqlFilter!] # $query: String
|
|
17
17
|
) {
|
|
18
18
|
processes(
|
|
19
19
|
first: $first
|
|
20
20
|
after: $after
|
|
21
21
|
sortBy: $sortBy
|
|
22
|
-
filterBy: $filterBy
|
|
22
|
+
filterBy: $filterBy # query: $query
|
|
23
23
|
) {
|
|
24
24
|
page {
|
|
25
25
|
workflowName
|
|
@@ -39,6 +39,7 @@ export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
39
39
|
processId
|
|
40
40
|
startedAt
|
|
41
41
|
lastModifiedAt
|
|
42
|
+
isTask
|
|
42
43
|
subscriptions {
|
|
43
44
|
page {
|
|
44
45
|
subscriptionId
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { parse } from 'graphql';
|
|
2
|
+
import { gql } from 'graphql-request';
|
|
3
|
+
|
|
4
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
+
|
|
6
|
+
import { ProcessStepsResult } from '@/types';
|
|
7
|
+
|
|
8
|
+
export const GET_PROCESS_STEPS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
9
|
+
ProcessStepsResult,
|
|
10
|
+
{ processName: string }
|
|
11
|
+
> = parse(gql`
|
|
12
|
+
query ProcessSteps($processName: String!) {
|
|
13
|
+
workflows(filterBy: { field: "name", value: $processName }) {
|
|
14
|
+
page {
|
|
15
|
+
steps {
|
|
16
|
+
name
|
|
17
|
+
assignee
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`);
|
|
@@ -3,19 +3,23 @@ import { gql } from 'graphql-request';
|
|
|
3
3
|
|
|
4
4
|
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
5
|
|
|
6
|
-
import type { ProductBlockDefinition } from '
|
|
7
|
-
import { GraphqlQueryVariables, ProductBlockDefinitionsResult } from '
|
|
6
|
+
import type { ProductBlockDefinition } from '@/types';
|
|
7
|
+
import { GraphqlQueryVariables, ProductBlockDefinitionsResult } from '@/types';
|
|
8
8
|
|
|
9
9
|
export const GET_PRODUCTS_BLOCKS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
10
10
|
ProductBlockDefinitionsResult,
|
|
11
11
|
GraphqlQueryVariables<ProductBlockDefinition>
|
|
12
12
|
> = parse(gql`
|
|
13
13
|
query MetadataProductBlocks(
|
|
14
|
-
$first:
|
|
15
|
-
$after:
|
|
14
|
+
$first: Int!
|
|
15
|
+
$after: Int!
|
|
16
16
|
$sortBy: [GraphqlSort!]
|
|
17
17
|
) {
|
|
18
|
-
productBlocks(
|
|
18
|
+
productBlocks(
|
|
19
|
+
first: $first
|
|
20
|
+
after: $after
|
|
21
|
+
sortBy: $sortBy # query: $query
|
|
22
|
+
) {
|
|
19
23
|
page {
|
|
20
24
|
productBlockId
|
|
21
25
|
name
|
|
@@ -14,11 +14,15 @@ export const GET_PRODUCTS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
14
14
|
GraphqlQueryVariables<ProductDefinition>
|
|
15
15
|
> = parse(gql`
|
|
16
16
|
query MetadataProducts(
|
|
17
|
-
$first:
|
|
18
|
-
$after:
|
|
17
|
+
$first: Int!
|
|
18
|
+
$after: Int!
|
|
19
19
|
$sortBy: [GraphqlSort!]
|
|
20
20
|
) {
|
|
21
|
-
products(
|
|
21
|
+
products(
|
|
22
|
+
first: $first
|
|
23
|
+
after: $after
|
|
24
|
+
sortBy: $sortBy # query: $query
|
|
25
|
+
) {
|
|
22
26
|
page {
|
|
23
27
|
productId
|
|
24
28
|
name
|
|
@@ -20,8 +20,8 @@ export const GET_RELATED_SUBSCRIPTIONS_GRAPHQL_QUERY: TypedDocumentNode<
|
|
|
20
20
|
> = parse(gql`
|
|
21
21
|
query RelatedSubscriptions(
|
|
22
22
|
$subscriptionId: String!
|
|
23
|
-
$first:
|
|
24
|
-
$after:
|
|
23
|
+
$first: Int!
|
|
24
|
+
$after: Int!
|
|
25
25
|
$sortBy: [GraphqlSort!]
|
|
26
26
|
$terminatedSubscriptionFilter: [GraphqlFilter!]
|
|
27
27
|
) {
|
|
@@ -7,18 +7,22 @@ import type {
|
|
|
7
7
|
GraphqlQueryVariables,
|
|
8
8
|
ResourceTypeDefinition,
|
|
9
9
|
ResourceTypeDefinitionsResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '@/types';
|
|
11
11
|
|
|
12
12
|
export const GET_RESOURCE_TYPES_GRAPHQL_QUERY: TypedDocumentNode<
|
|
13
13
|
ResourceTypeDefinitionsResult,
|
|
14
14
|
GraphqlQueryVariables<ResourceTypeDefinition>
|
|
15
15
|
> = parse(gql`
|
|
16
16
|
query MetadataResourceTypes(
|
|
17
|
-
$first:
|
|
18
|
-
$after:
|
|
17
|
+
$first: Int!
|
|
18
|
+
$after: Int!
|
|
19
19
|
$sortBy: [GraphqlSort!]
|
|
20
20
|
) {
|
|
21
|
-
resourceTypes(
|
|
21
|
+
resourceTypes(
|
|
22
|
+
first: $first
|
|
23
|
+
after: $after
|
|
24
|
+
sortBy: $sortBy # query: $query
|
|
25
|
+
) {
|
|
22
26
|
page {
|
|
23
27
|
resourceTypeId
|
|
24
28
|
resourceType
|
|
@@ -7,20 +7,22 @@ import {
|
|
|
7
7
|
GraphqlQueryVariables,
|
|
8
8
|
Subscription,
|
|
9
9
|
SubscriptionsResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '@/types';
|
|
11
11
|
|
|
12
12
|
export const GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY = parse(gql`
|
|
13
13
|
query SubscriptionsList(
|
|
14
|
-
$first:
|
|
15
|
-
$after:
|
|
14
|
+
$first: Int!
|
|
15
|
+
$after: Int!
|
|
16
16
|
$sortBy: [GraphqlSort!]
|
|
17
17
|
$filterBy: [GraphqlFilter!]
|
|
18
|
+
$query: String
|
|
18
19
|
) {
|
|
19
20
|
subscriptions(
|
|
20
21
|
first: $first
|
|
21
22
|
after: $after
|
|
22
23
|
sortBy: $sortBy
|
|
23
24
|
filterBy: $filterBy
|
|
25
|
+
query: $query
|
|
24
26
|
) {
|
|
25
27
|
page {
|
|
26
28
|
note
|