@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.
Files changed (121) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/.turbo/turbo-lint.log +0 -6
  3. package/.turbo/turbo-test.log +9 -8
  4. package/CHANGELOG.md +12 -0
  5. package/dist/index.d.ts +1005 -123
  6. package/dist/index.js +33996 -6348
  7. package/package.json +14 -12
  8. package/src/api/index.ts +55 -3
  9. package/src/components/WfoDiff/WfoDiff.tsx +119 -0
  10. package/src/components/WfoDiff/index.ts +1 -0
  11. package/src/components/WfoDiff/unidiff.d.ts +1 -0
  12. package/src/components/WfoForms/AutoFieldLoader.tsx +5 -1
  13. package/src/components/WfoForms/CreateForm.tsx +1 -1
  14. package/src/components/WfoForms/UserInputForm.tsx +75 -43
  15. package/src/components/WfoForms/UserInputFormWizard.tsx +11 -4
  16. package/src/components/WfoForms/formFields/AcceptField.tsx +8 -5
  17. package/src/components/WfoForms/formFields/BoolField.tsx +1 -1
  18. package/src/components/WfoForms/formFields/ImsNodeIdField.tsx +2 -2
  19. package/src/components/WfoForms/formFields/ImsPortIdField.tsx +238 -0
  20. package/src/components/WfoForms/formFields/ImsPortIdFieldStyling.ts +17 -0
  21. package/src/components/WfoForms/formFields/IpPrefixTableField.tsx +1 -1
  22. package/src/components/WfoForms/formFields/ListAddField.tsx +1 -1
  23. package/src/components/WfoForms/formFields/ListDelField.tsx +1 -1
  24. package/src/components/WfoForms/formFields/OptGroupField.tsx +1 -1
  25. package/src/components/WfoForms/formFields/SubscriptionField.tsx +2 -1
  26. package/src/components/WfoForms/formFields/SummaryField.tsx +103 -0
  27. package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +46 -0
  28. package/src/components/WfoForms/formFields/VlanField.tsx +10 -10
  29. package/src/components/WfoForms/formFields/index.ts +2 -0
  30. package/src/components/WfoForms/formFields/surf/types.ts +26 -0
  31. package/src/components/WfoForms/formFields/utils.spec.ts +1 -0
  32. package/src/components/WfoJsonCodeBlock/index.ts +1 -0
  33. package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +4 -3
  34. package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +14 -14
  35. package/src/components/WfoPageTemplate/WfoSidebar/WfoStartCreateWorkflowButtonComboBox.tsx +15 -9
  36. package/src/components/WfoPageTemplate/paths.ts +3 -2
  37. package/src/components/{WfoProcessesList → WfoProcessList}/WfoProcessList.tsx +18 -14
  38. package/src/components/WfoProcessList/index.ts +1 -0
  39. package/src/components/{WfoProcessesList → WfoProcessList}/processListObjectMappers.ts +4 -2
  40. package/src/components/WfoSearchBar/WfoSearchField.tsx +27 -37
  41. package/src/components/{WfoSettingsPage → WfoSettings}/WfoEngineStatusButton.tsx +7 -4
  42. package/src/components/{WfoSettingsPage → WfoSettings}/WfoFlushSettings.tsx +13 -12
  43. package/src/components/WfoSettings/WfoModifySettings.tsx +38 -0
  44. package/src/components/WfoSettings/WfoSettings.tsx +40 -0
  45. package/src/components/{WfoSettingsPage → WfoSettings}/WfoStatus.tsx +21 -14
  46. package/src/components/WfoStartPage/WfoListStartPage.tsx +3 -3
  47. package/src/components/WfoStartTaskButtonComboBox/WfoStartTaskButtonComboBox.tsx +14 -8
  48. package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +11 -18
  49. package/src/components/WfoSubscription/WfoSubscription.tsx +1 -1
  50. package/src/components/WfoSubscription/WfoSubscriptionActions.tsx +41 -33
  51. package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +32 -22
  52. package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +94 -90
  53. package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +26 -0
  54. package/src/components/WfoSubscription/utils/utils.spec.ts +24 -0
  55. package/src/components/WfoSubscription/utils/utils.ts +16 -0
  56. package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +17 -37
  57. package/src/components/WfoTable/WfoTableWithFilter/WfoTableWithFilter.tsx +20 -19
  58. package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts +95 -0
  59. package/src/components/WfoTable/WfoTableWithFilter/updateQueryString.ts +60 -0
  60. package/src/components/WfoTable/utils/tableUtils.ts +3 -3
  61. package/src/components/WfoTextAnchor/WfoTextAnchor.stories.tsx +18 -0
  62. package/src/components/WfoTextAnchor/WfoTextAnchor.tsx +22 -0
  63. package/src/components/WfoTextAnchor/index.ts +1 -0
  64. package/src/components/WfoTextAnchor/styles.ts +17 -0
  65. package/src/components/WfoTimeline/styles.ts +10 -4
  66. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +39 -24
  67. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +48 -0
  68. package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +14 -11
  69. package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +22 -23
  70. package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +97 -17
  71. package/src/components/WfoWorkflowSteps/stepListUtils.ts +1 -28
  72. package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +3 -3
  73. package/src/components/index.ts +6 -1
  74. package/src/contexts/ConfirmationDialogProvider.tsx +2 -2
  75. package/src/contexts/TreeContext.tsx +5 -0
  76. package/src/graphqlQueries/index.ts +1 -0
  77. package/src/graphqlQueries/processDetailQuery.ts +8 -0
  78. package/src/graphqlQueries/processListQuery.ts +7 -6
  79. package/src/graphqlQueries/processStepsQuery.ts +22 -0
  80. package/src/graphqlQueries/productBlocksQuery.ts +9 -5
  81. package/src/graphqlQueries/productsQuery.ts +7 -3
  82. package/src/graphqlQueries/relatedSubscriptionsQuery.ts +2 -2
  83. package/src/graphqlQueries/resourceTypesQuery.ts +8 -4
  84. package/src/graphqlQueries/subscriptionDetailQuery.ts +1 -0
  85. package/src/graphqlQueries/subscriptionsListQuery.ts +5 -3
  86. package/src/graphqlQueries/workflows/workflowsQuery.ts +8 -4
  87. package/src/graphqlQueries/workflows/workflowsQueryForDropdownList.ts +2 -2
  88. package/src/hooks/DataFetchHooks.ts +9 -4
  89. package/src/hooks/index.ts +3 -0
  90. package/src/hooks/useCheckEngineStatus.ts +30 -0
  91. package/src/hooks/useDataDisplayParams.ts +3 -3
  92. package/src/hooks/useEngineStatusQuery.ts +9 -7
  93. package/src/hooks/useMutateProcess.ts +96 -0
  94. package/src/messages/{en-US.json → en-GB.json} +85 -37
  95. package/src/messages/getTranslationMessages.spec.ts +25 -40
  96. package/src/messages/index.ts +1 -1
  97. package/src/messages/nl-NL.json +95 -48
  98. package/src/messages/useGetTranslationMessages.ts +51 -0
  99. package/src/pages/metadata/WfoProductBlocksPage.tsx +12 -10
  100. package/src/pages/metadata/WfoProductsPage.tsx +24 -25
  101. package/src/pages/metadata/WfoResourceTypesPage.tsx +12 -10
  102. package/src/pages/metadata/WfoWorkflowsPage.tsx +12 -10
  103. package/src/pages/processes/WfoProcessDetail.tsx +96 -79
  104. package/src/pages/processes/WfoProcessDetailPage.tsx +5 -3
  105. package/src/pages/{workflow/WfoStartWorkflowPage.tsx → processes/WfoStartProcessPage.tsx} +102 -51
  106. package/src/pages/processes/index.ts +1 -3
  107. package/src/pages/settings/WfoSettingsPage.tsx +30 -0
  108. package/src/pages/settings/index.ts +1 -0
  109. package/src/pages/tasks/WfoTaskListPage.tsx +35 -9
  110. package/src/pages/{processes/WfoProcessListPage.tsx → workflow/WfoWorkflowListPage.tsx} +22 -23
  111. package/src/pages/workflow/getWorkflowListTabTypeFromString.ts +19 -0
  112. package/src/pages/workflow/index.ts +1 -1
  113. package/src/pages/{processes → workflow}/tabConfig.ts +6 -6
  114. package/src/types/types.ts +33 -3
  115. package/src/utils/getDefaultTableConfig.ts +1 -1
  116. package/src/components/WfoSettingsPage/WfoModifySettings.tsx +0 -33
  117. package/src/components/WfoSettingsPage/WfoSettings.tsx +0 -40
  118. package/src/hooks/ProcessesHooks/useDeleteProcess.ts +0 -37
  119. package/src/messages/getTranslationMessages.ts +0 -26
  120. package/src/pages/processes/getProcessListTabTypeFromString.ts +0 -19
  121. /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 '../../../hooks';
4
- import { Step } from '../../../types';
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.log('Error scrolling to step with stepId ', stepId);
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
- step={stepListItem.step}
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('steps')}
75
+ {t(isTask ? 'taskSteps' : 'workflowSteps')}
69
76
  </EuiText>
70
77
  {!showRaw && (
71
- <EuiText
72
- css={stepListContentAnchorStyle}
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
- <EuiButton
88
- onClick={(
89
- e: React.MouseEvent<
90
- HTMLButtonElement | HTMLElement,
91
- MouseEvent
92
- >,
93
- ) => {
94
- e.preventDefault();
95
- alert('TODO: Implement Show delta');
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 { useRawProcessDetails } from '../../../hooks';
6
- import { Step } from '../../../types';
7
- import { WfoJsonCodeBlock } from '../../WfoJsonCodeBlock/WfoJsonCodeBlock';
8
- import { WfoLoading } from '../../WfoLoading';
9
- import { StepListItem, WfoStepList, WfoStepListRef } from '../WfoStepList';
10
- import { updateStepListItems } from '../stepListUtils';
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
- { steps = [], startedAt, processId }: WfoWorkflowStepListProps,
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
- useEffect(
43
- () =>
44
- setStepListItems((previousStepListItems) =>
45
- updateStepListItems(previousStepListItems, steps),
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
- [steps],
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
- <WfoProcessRawData processId={processId} />
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 { Step, StepState } from '../../types';
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>
@@ -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 './WfoSettingsPage';
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}
@@ -6,3 +6,4 @@ export * from './subscriptionDetailQuery';
6
6
  export * from './processDetailQuery';
7
7
  export * from './customersQuery';
8
8
  export * from './subscriptionsDropdownOptionsQuery';
9
+ export * from './processStepsQuery';
@@ -20,6 +20,14 @@ export const GET_PROCESS_DETAIL_GRAPHQL_QUERY: TypedDocumentNode<
20
20
  lastStep
21
21
  workflowName
22
22
  isTask
23
+ form {
24
+ additionalProperties
25
+ definitions
26
+ properties
27
+ required
28
+ title
29
+ type
30
+ }
23
31
  steps {
24
32
  name
25
33
  status
@@ -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, ProcessesResult } from '../types';
6
+ import { GraphqlQueryVariables, Process, ProcessListResult } from '@/types';
7
7
 
8
8
  export const GET_PROCESS_LIST_GRAPHQL_QUERY: TypedDocumentNode<
9
- ProcessesResult,
9
+ ProcessListResult,
10
10
  GraphqlQueryVariables<Process>
11
11
  > = parse(gql`
12
12
  query ProcessList(
13
- $first: IntType!
14
- $after: IntType!
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 '../types';
7
- import { GraphqlQueryVariables, ProductBlockDefinitionsResult } from '../types';
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: IntType!
15
- $after: IntType!
14
+ $first: Int!
15
+ $after: Int!
16
16
  $sortBy: [GraphqlSort!]
17
17
  ) {
18
- productBlocks(first: $first, after: $after, sortBy: $sortBy) {
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: IntType!
18
- $after: IntType!
17
+ $first: Int!
18
+ $after: Int!
19
19
  $sortBy: [GraphqlSort!]
20
20
  ) {
21
- products(first: $first, after: $after, sortBy: $sortBy) {
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: IntType!
24
- $after: IntType!
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 '../types';
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: IntType!
18
- $after: IntType!
17
+ $first: Int!
18
+ $after: Int!
19
19
  $sortBy: [GraphqlSort!]
20
20
  ) {
21
- resourceTypes(first: $first, after: $after, sortBy: $sortBy) {
21
+ resourceTypes(
22
+ first: $first
23
+ after: $after
24
+ sortBy: $sortBy # query: $query
25
+ ) {
22
26
  page {
23
27
  resourceTypeId
24
28
  resourceType
@@ -54,6 +54,7 @@ export const GET_SUBSCRIPTION_DETAIL_GRAPHQL_QUERY: TypedDocumentNode<
54
54
  createdBy
55
55
  workflowTarget
56
56
  workflowName
57
+ isTask
57
58
  }
58
59
  }
59
60
  }
@@ -7,20 +7,22 @@ import {
7
7
  GraphqlQueryVariables,
8
8
  Subscription,
9
9
  SubscriptionsResult,
10
- } from '../types';
10
+ } from '@/types';
11
11
 
12
12
  export const GET_SUBSCRIPTIONS_LIST_GRAPHQL_QUERY = parse(gql`
13
13
  query SubscriptionsList(
14
- $first: IntType!
15
- $after: IntType!
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