@orchestrator-ui/orchestrator-ui-components 8.4.5 → 8.6.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 +10 -14
- package/.turbo/turbo-lint.log +2 -4
- package/.turbo/turbo-test.log +7 -9
- package/CHANGELOG.md +17 -0
- package/dist/index.d.ts +1968 -630
- package/dist/index.js +4389 -2362
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/WfoAutoExpandableTextArea/WfoAutoExpandableTextArea.tsx +54 -0
- package/src/components/WfoAutoExpandableTextArea/index.ts +1 -0
- package/src/components/WfoAutoExpandableTextArea/styles.ts +18 -0
- package/src/components/WfoPageTemplate/paths.ts +1 -0
- package/src/components/WfoPydanticForm/WfoPydanticForm.tsx +23 -1
- package/src/components/WfoSearchBar/WfoSearchField.tsx +0 -1
- package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +5 -5
- package/src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx +12 -5
- package/src/components/WfoSearchPage/constants.ts +0 -4
- package/src/components/WfoSearchPage/utils.ts +75 -20
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx +36 -18
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem.tsx +38 -2
- package/src/components/WfoSubscription/utils/index.ts +3 -0
- package/src/components/WfoSubscription/utils/utils.spec.ts +39 -4
- package/src/components/WfoSubscription/utils/utils.ts +10 -4
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoAddGroupAction.tsx +19 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoAddRuleAction.tsx +23 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoCombinatorSelector.tsx +33 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoExpandingSearchRow.tsx +38 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +138 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +198 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoInlineCombinator.tsx +17 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoOperatorSelector.tsx +33 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoRangeEditor.tsx +64 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoRemoveGroupAction.tsx +21 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoRemoveRuleAction.tsx +20 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoRule.tsx +16 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoRuleGroup.tsx +76 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoSearchFieldWithActions.tsx +56 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +326 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +159 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/index.ts +2 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/styles.ts +182 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/utils.ts +45 -0
- package/src/components/WfoTable/WfoTable/WfoDragHandler.tsx +4 -2
- package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +9 -0
- package/src/components/WfoTable/index.ts +2 -6
- package/src/components/WfoTitleWithWebsocketBadge/WfoTitleWithWebsocketBadge.tsx +14 -6
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +1 -0
- package/src/components/WfoWorkflowSteps/WfoStepList/WfoStepList.tsx +3 -0
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +32 -12
- package/src/components/WfoWorkflowUserGuide/WfoPageWithUserGuide.tsx +38 -0
- package/src/components/WfoWorkflowUserGuide/WfoWorkflowGuideExpandablePanel.tsx +151 -0
- package/src/components/WfoWorkflowUserGuide/index.ts +2 -0
- package/src/components/WfoWorkflowUserGuide/styles.ts +87 -0
- package/src/components/index.ts +2 -0
- package/src/configuration/version.ts +1 -1
- package/src/contexts/OrchestratorConfigContext.tsx +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/usePathAutoComplete.ts +3 -4
- package/src/hooks/useSearch.ts +20 -15
- package/src/hooks/useSearchPagination.ts +11 -8
- package/src/hooks/useUrlParams.ts +3 -5
- package/src/icons/WfoTrashFilled.tsx +13 -0
- package/src/icons/WfoXMarkSmall.tsx +2 -2
- package/src/icons/index.ts +1 -0
- package/src/messages/en-GB.json +95 -8
- package/src/messages/nl-NL.json +24 -5
- package/src/pages/WfoSearchPocPage.tsx +528 -0
- package/src/pages/index.ts +1 -0
- package/src/pages/processes/WfoProcessDetail.tsx +10 -10
- package/src/pages/processes/WfoProcessDetailPage.tsx +1 -0
- package/src/pages/processes/WfoStartProcessPage.tsx +15 -19
- package/src/rtk/api.ts +1 -0
- package/src/rtk/endpoints/index.ts +1 -0
- package/src/rtk/endpoints/search.ts +45 -10
- package/src/rtk/endpoints/workflowGuides.ts +25 -0
- package/src/types/search.ts +24 -5
- package/src/types/types.ts +10 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
|
+
|
|
5
|
+
export const getWfoStructuredSearchTableStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
|
+
const queryBuilderContainerStyles = css({
|
|
7
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
8
|
+
padding: theme.base / 2,
|
|
9
|
+
marginBottom: theme.base,
|
|
10
|
+
border: `thin solid ${theme.colors.borderBasePlain}`,
|
|
11
|
+
borderRadius: theme.border.radius.small,
|
|
12
|
+
});
|
|
13
|
+
const toggleButtonStyles = css({
|
|
14
|
+
backgroundColor: 'primary',
|
|
15
|
+
padding: theme.base * 0.75,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const buttonGroupStyles = css({
|
|
19
|
+
alignSelf: 'center',
|
|
20
|
+
backgroundColor: 'transparent',
|
|
21
|
+
height: theme.base * 2,
|
|
22
|
+
'.euiButtonGroup__buttons': {
|
|
23
|
+
backgroundColor: 'transparent',
|
|
24
|
+
height: theme.base * 2,
|
|
25
|
+
minHeight: theme.base * 2,
|
|
26
|
+
},
|
|
27
|
+
'button.euiButtonGroupButton': {
|
|
28
|
+
height: theme.base * 2,
|
|
29
|
+
minHeight: theme.base * 2,
|
|
30
|
+
blockSize: theme.base * 2,
|
|
31
|
+
borderRadius: 0,
|
|
32
|
+
transition: 'none',
|
|
33
|
+
},
|
|
34
|
+
'button.euiButtonGroupButton:not(.euiButtonGroupButton-isSelected)': {
|
|
35
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
36
|
+
},
|
|
37
|
+
'button.euiButtonGroupButton:first-of-type': {
|
|
38
|
+
borderTopLeftRadius: theme.base,
|
|
39
|
+
borderBottomLeftRadius: theme.base,
|
|
40
|
+
},
|
|
41
|
+
'button.euiButtonGroupButton:last-of-type': {
|
|
42
|
+
borderTopRightRadius: theme.base,
|
|
43
|
+
borderBottomRightRadius: theme.base,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const ruleContainerStyles = css({
|
|
48
|
+
'& > .rule': {
|
|
49
|
+
display: 'flex',
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
gap: theme.base / 2,
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
marginBottom: theme.base / 4,
|
|
54
|
+
marginTop: theme.base / 4,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const ruleGroupContainerBase = {
|
|
59
|
+
padding: theme.base / 2,
|
|
60
|
+
border: `1px solid ${theme.colors.borderBaseSubdued}`,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const ruleGroupContainerBlueStyles = css({
|
|
64
|
+
...ruleGroupContainerBase,
|
|
65
|
+
borderRadius: theme.border.radius.small,
|
|
66
|
+
backgroundColor: '#E9F1F9',
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const ruleGroupContainerWhiteStyles = css({
|
|
70
|
+
...ruleGroupContainerBase,
|
|
71
|
+
borderRadius: theme.border.radius.small,
|
|
72
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const innerGroupContainerWhiteStyles = css({
|
|
76
|
+
...ruleGroupContainerBase,
|
|
77
|
+
borderBottomLeftRadius: theme.border.radius.small,
|
|
78
|
+
borderTopLeftRadius: theme.border.radius.small,
|
|
79
|
+
backgroundColor: theme.colors.backgroundBasePlain,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const innerGroupContainerBlueStyles = css({
|
|
83
|
+
...ruleGroupContainerBase,
|
|
84
|
+
borderBottomLeftRadius: theme.border.radius.small,
|
|
85
|
+
borderTopLeftRadius: theme.border.radius.small,
|
|
86
|
+
backgroundColor: '#E9F1F9',
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const removeGroupActionStyles = css({
|
|
90
|
+
backgroundColor: theme.colors.backgroundLightPrimary,
|
|
91
|
+
width: '40px',
|
|
92
|
+
height: 'stretch',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
justifyContent: 'center',
|
|
95
|
+
borderBottomRightRadius: theme.border.radius.small,
|
|
96
|
+
borderTopRightRadius: theme.border.radius.small,
|
|
97
|
+
border: `thin solid ${theme.colors.borderBasePlain}`,
|
|
98
|
+
cursor: 'pointer',
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const expandingSearchRowStyles = css({
|
|
102
|
+
padding: theme.base / 2,
|
|
103
|
+
height: theme.base * 2,
|
|
104
|
+
borderRadius: theme.border.radius.medium,
|
|
105
|
+
border: 'thin solid FEF7E0',
|
|
106
|
+
backgroundColor: '#FEF7E0',
|
|
107
|
+
});
|
|
108
|
+
const expandingRowBodyStyles = css({
|
|
109
|
+
display: 'flex',
|
|
110
|
+
gap: theme.base,
|
|
111
|
+
fontWeight: theme.font.weight.bold,
|
|
112
|
+
span: {
|
|
113
|
+
fontWeight: 'bold',
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const addRulePlusStyles = css({
|
|
118
|
+
fontSize: theme.size.l,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const addRuleContainerStyles = css({
|
|
122
|
+
color: theme.colors.primary,
|
|
123
|
+
size: theme.size.m,
|
|
124
|
+
display: 'flex',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
flexDirection: 'row',
|
|
127
|
+
gap: theme.base / 2,
|
|
128
|
+
alignSelf: 'end',
|
|
129
|
+
cursor: 'pointer',
|
|
130
|
+
marginRight: theme.base / 2,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const addGroupStyles = css({
|
|
134
|
+
border: `thin dashed ${theme.colors.backgroundFilledPrimary}`,
|
|
135
|
+
borderRadius: theme.border.radius.medium,
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
paddingBlock: theme.base / 3,
|
|
138
|
+
paddingInline: theme.base,
|
|
139
|
+
color: theme.colors.primary,
|
|
140
|
+
justifyContent: 'center',
|
|
141
|
+
flexDirection: 'row',
|
|
142
|
+
cursor: 'pointer',
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
const inlineCombinatorStyles = css({
|
|
146
|
+
alignSelf: 'start',
|
|
147
|
+
transform: `translateY(calc(-50% - ${theme.base / 8}px))`,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const ruleGroupBodyGridStyles = css({
|
|
151
|
+
display: 'grid',
|
|
152
|
+
gridTemplateColumns: 'auto 1fr',
|
|
153
|
+
columnGap: theme.base / 2,
|
|
154
|
+
rowGap: theme.base / 4,
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
'& > :first-child': {
|
|
157
|
+
gridColumn: '1 / -1',
|
|
158
|
+
},
|
|
159
|
+
'& > :first-child:not(:only-child)': {
|
|
160
|
+
gridColumn: '2 / -1',
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
toggleButtonStyles,
|
|
166
|
+
queryBuilderContainerStyles,
|
|
167
|
+
buttonGroupStyles,
|
|
168
|
+
ruleContainerStyles,
|
|
169
|
+
ruleGroupContainerBlueStyles,
|
|
170
|
+
ruleGroupContainerWhiteStyles,
|
|
171
|
+
innerGroupContainerWhiteStyles,
|
|
172
|
+
innerGroupContainerBlueStyles,
|
|
173
|
+
removeGroupActionStyles,
|
|
174
|
+
expandingSearchRowStyles,
|
|
175
|
+
expandingRowBodyStyles,
|
|
176
|
+
addRulePlusStyles,
|
|
177
|
+
addRuleContainerStyles,
|
|
178
|
+
addGroupStyles,
|
|
179
|
+
inlineCombinatorStyles,
|
|
180
|
+
ruleGroupBodyGridStyles,
|
|
181
|
+
};
|
|
182
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RuleGroupType } from 'react-querybuilder';
|
|
2
|
+
import { parseCEL } from 'react-querybuilder/parseCEL';
|
|
3
|
+
|
|
4
|
+
export const parseCelToRuleGroup = (celString: string): RuleGroupType | undefined => {
|
|
5
|
+
if (!celString) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
try {
|
|
9
|
+
const ruleGroup = parseCEL(celString);
|
|
10
|
+
return ruleGroup?.rules?.length > 0 ? ruleGroup : undefined;
|
|
11
|
+
} catch {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Builds a CEL filter that appends a single column condition (`field == "value"`) to the current
|
|
18
|
+
* filter and returns it together with its parsed rule group. The column name is resolved via
|
|
19
|
+
* getColumnSearchFieldName, falling back to the field key. Returns undefined when the input can't
|
|
20
|
+
* produce a valid filter (empty/quoted search text, or a filter that doesn't parse back to rules).
|
|
21
|
+
*/
|
|
22
|
+
export const buildColumnFilter = <T>(
|
|
23
|
+
field: keyof T,
|
|
24
|
+
searchText: string,
|
|
25
|
+
currentFilter?: string,
|
|
26
|
+
getColumnSearchFieldName?: (field: keyof T) => string,
|
|
27
|
+
): { filterString: string; ruleGroup: RuleGroupType } | undefined => {
|
|
28
|
+
// A double quote in the value would break the `== "..."` CEL literal and parseCEL has no escaping.
|
|
29
|
+
if (!searchText || searchText.includes('"')) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const searchFieldName = getColumnSearchFieldName?.(field) ?? String(field);
|
|
34
|
+
const columnFilterCondition = `${searchFieldName} == "${searchText}"`;
|
|
35
|
+
const trimmedCurrentFilter = currentFilter?.trim();
|
|
36
|
+
const filterString =
|
|
37
|
+
trimmedCurrentFilter ? `(${trimmedCurrentFilter}) && ${columnFilterCondition}` : columnFilterCondition;
|
|
38
|
+
|
|
39
|
+
const ruleGroup = parseCelToRuleGroup(filterString);
|
|
40
|
+
if (!ruleGroup) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return { filterString, ruleGroup };
|
|
45
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import Draggable from 'react-draggable';
|
|
4
4
|
import type { DraggableEventHandler } from 'react-draggable';
|
|
@@ -17,6 +17,7 @@ interface WfoDragHandlerProps {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const WfoDragHandler: FC<WfoDragHandlerProps> = ({ headerRowRef, fieldName, onUpdateColumWidth }) => {
|
|
20
|
+
const nodeRef = useRef(null);
|
|
20
21
|
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
21
22
|
const [isDragging, setIsDragging] = useState(false);
|
|
22
23
|
const { dragAndDropStyle } = useWithOrchestratorTheme(getWfoTableStyles);
|
|
@@ -66,8 +67,9 @@ export const WfoDragHandler: FC<WfoDragHandlerProps> = ({ headerRowRef, fieldNam
|
|
|
66
67
|
onDrag={onDrag}
|
|
67
68
|
bounds={bounds}
|
|
68
69
|
onStop={onStop}
|
|
70
|
+
nodeRef={nodeRef}
|
|
69
71
|
>
|
|
70
|
-
<div css={dragAndDropStyle} />
|
|
72
|
+
<div css={dragAndDropStyle} ref={nodeRef} />
|
|
71
73
|
</Draggable>
|
|
72
74
|
</div>
|
|
73
75
|
);
|
|
@@ -25,6 +25,7 @@ export type TableSettingsModalProps<T> = {
|
|
|
25
25
|
onClose: () => void;
|
|
26
26
|
onUpdateTableConfig: (updatedTableConfig: TableSettingsConfig<T>) => void;
|
|
27
27
|
onResetToDefaults: () => void;
|
|
28
|
+
extraSettings?: React.ReactNode;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export const TableSettingsModal = <T,>({
|
|
@@ -33,6 +34,7 @@ export const TableSettingsModal = <T,>({
|
|
|
33
34
|
onUpdateTableConfig,
|
|
34
35
|
onResetToDefaults,
|
|
35
36
|
onClose,
|
|
37
|
+
extraSettings,
|
|
36
38
|
}: TableSettingsModalProps<T>) => {
|
|
37
39
|
const t = useTranslations('main');
|
|
38
40
|
const { formRowStyle, selectFieldStyle } = useWithOrchestratorTheme(getWfoTableSettingsModalStyles);
|
|
@@ -97,6 +99,13 @@ export const TableSettingsModal = <T,>({
|
|
|
97
99
|
options={options}
|
|
98
100
|
/>
|
|
99
101
|
</EuiFormRow>
|
|
102
|
+
|
|
103
|
+
{extraSettings && (
|
|
104
|
+
<>
|
|
105
|
+
<EuiSpacer size="xs" />
|
|
106
|
+
{extraSettings}
|
|
107
|
+
</>
|
|
108
|
+
)}
|
|
100
109
|
</EuiForm>
|
|
101
110
|
</WfoSettingsModal>
|
|
102
111
|
);
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
export * from './WfoTableSettingsModal';
|
|
2
|
-
|
|
3
1
|
export * from './utils/columns';
|
|
4
2
|
export * from './utils/constants';
|
|
5
|
-
|
|
6
3
|
export * from './utils/tableConfigPersistence';
|
|
7
4
|
export * from './utils/tableUtils';
|
|
8
|
-
|
|
5
|
+
export * from './WfoTableSettingsModal';
|
|
9
6
|
export * from './WfoStatusColorField';
|
|
10
7
|
export * from './WfoTableWithFilter';
|
|
11
|
-
|
|
12
8
|
export * from './WfoSortButtons';
|
|
13
9
|
export * from './WfoFirstPartUUID';
|
|
14
10
|
export * from './WfoInlineJson';
|
|
15
11
|
export * from './WfoRowContextMenu';
|
|
16
|
-
|
|
17
12
|
export * from './WfoAdvancedTable';
|
|
18
13
|
export * from './WfoTable';
|
|
14
|
+
export * from './WfoStructuredSearchTable';
|
|
@@ -8,18 +8,26 @@ import { useGetOrchestratorConfig } from '@/hooks';
|
|
|
8
8
|
interface WfoTitleWithWebsocketBadgeProps {
|
|
9
9
|
title: string | ReactNode;
|
|
10
10
|
wsUrl?: string;
|
|
11
|
+
extraElement?: ReactNode;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export const WfoTitleWithWebsocketBadge = ({
|
|
14
|
+
export const WfoTitleWithWebsocketBadge = ({
|
|
15
|
+
title,
|
|
16
|
+
wsUrl = undefined,
|
|
17
|
+
extraElement,
|
|
18
|
+
}: WfoTitleWithWebsocketBadgeProps) => {
|
|
14
19
|
const { useWebSockets } = useGetOrchestratorConfig();
|
|
15
20
|
|
|
16
21
|
const pageTitle =
|
|
17
|
-
useWebSockets ?
|
|
18
|
-
<EuiFlexGroup alignItems="center" gutterSize="s">
|
|
22
|
+
useWebSockets || extraElement ?
|
|
23
|
+
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
|
|
19
24
|
<EuiFlexItem grow={false}>{title}</EuiFlexItem>
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
25
|
+
{useWebSockets && (
|
|
26
|
+
<EuiFlexItem grow={false}>
|
|
27
|
+
<WfoWebsocketStatusBadge wsUrl={wsUrl} />
|
|
28
|
+
</EuiFlexItem>
|
|
29
|
+
)}
|
|
30
|
+
{extraElement && <EuiFlexItem grow={false}>{extraElement}</EuiFlexItem>}
|
|
23
31
|
</EuiFlexGroup>
|
|
24
32
|
: title;
|
|
25
33
|
|
|
@@ -20,6 +20,7 @@ export type WfoStepListProps = {
|
|
|
20
20
|
onTriggerExpandStepListItem: (stepListItem: StepListItem) => void;
|
|
21
21
|
isTask: boolean;
|
|
22
22
|
processId: string;
|
|
23
|
+
workflowName?: string;
|
|
23
24
|
userPermissions: FormUserPermissions;
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -32,6 +33,7 @@ export const WfoStepList = React.forwardRef(
|
|
|
32
33
|
onTriggerExpandStepListItem,
|
|
33
34
|
isTask,
|
|
34
35
|
processId,
|
|
36
|
+
workflowName,
|
|
35
37
|
userPermissions,
|
|
36
38
|
}: WfoStepListProps,
|
|
37
39
|
reference: Ref<WfoStepListRef>,
|
|
@@ -97,6 +99,7 @@ export const WfoStepList = React.forwardRef(
|
|
|
97
99
|
isStartStep={index === 0}
|
|
98
100
|
isTask={isTask}
|
|
99
101
|
processId={processId}
|
|
102
|
+
workflowName={workflowName}
|
|
100
103
|
userPermissions={userPermissions}
|
|
101
104
|
/>
|
|
102
105
|
</div>
|
|
@@ -2,7 +2,14 @@ import React, { Ref, useEffect, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
WfoJsonCodeBlock,
|
|
7
|
+
WfoLoading,
|
|
8
|
+
WfoPageWithUserGuide,
|
|
9
|
+
WfoStepList,
|
|
10
|
+
WfoStepListHeader,
|
|
11
|
+
WfoStepListRef,
|
|
12
|
+
} from '@/components';
|
|
6
13
|
import WfoDiff, { getSubscriptionDiffTexts } from '@/components/WfoDiff/WfoDiff';
|
|
7
14
|
import { WfoTraceback } from '@/components/WfoWorkflowSteps/WfoTraceback/WfoTraceback';
|
|
8
15
|
import { useGetRawProcessDetailQuery } from '@/rtk/endpoints/processDetail';
|
|
@@ -21,6 +28,7 @@ export interface WfoWorkflowStepListProps {
|
|
|
21
28
|
traceBack: string | null;
|
|
22
29
|
startedAt: string;
|
|
23
30
|
processId: string;
|
|
31
|
+
workflowName?: string;
|
|
24
32
|
isTask: boolean;
|
|
25
33
|
userInputForm?: InputForm;
|
|
26
34
|
userPermissions: FormUserPermissions;
|
|
@@ -40,7 +48,16 @@ export const WfoProcessSubscriptionDelta = ({ processId }: { processId: string }
|
|
|
40
48
|
|
|
41
49
|
export const WfoWorkflowStepList = React.forwardRef(
|
|
42
50
|
(
|
|
43
|
-
{
|
|
51
|
+
{
|
|
52
|
+
steps = [],
|
|
53
|
+
lastStatus,
|
|
54
|
+
traceBack,
|
|
55
|
+
processId,
|
|
56
|
+
workflowName,
|
|
57
|
+
isTask,
|
|
58
|
+
userInputForm,
|
|
59
|
+
userPermissions,
|
|
60
|
+
}: WfoWorkflowStepListProps,
|
|
44
61
|
reference: Ref<WfoStepListRef>,
|
|
45
62
|
) => {
|
|
46
63
|
const [showHiddenKeys, setShowHiddenKeys] = useState(false);
|
|
@@ -143,16 +160,19 @@ export const WfoWorkflowStepList = React.forwardRef(
|
|
|
143
160
|
{showRaw && <WfoProcessRawData processId={processId} />}
|
|
144
161
|
{showDelta && <WfoProcessSubscriptionDelta processId={processId} />}
|
|
145
162
|
{!showRaw && !showDelta && (
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
<WfoPageWithUserGuide workflowName={workflowName}>
|
|
164
|
+
<WfoStepList
|
|
165
|
+
ref={reference}
|
|
166
|
+
stepListItems={stepListItems}
|
|
167
|
+
showHiddenKeys={showHiddenKeys}
|
|
168
|
+
isTask={isTask}
|
|
169
|
+
onToggleExpandStepListItem={toggleExpandedStateStepListItem}
|
|
170
|
+
processId={processId}
|
|
171
|
+
workflowName={workflowName}
|
|
172
|
+
onTriggerExpandStepListItem={handleExpandStepListItem}
|
|
173
|
+
userPermissions={userPermissions}
|
|
174
|
+
/>
|
|
175
|
+
</WfoPageWithUserGuide>
|
|
156
176
|
)}
|
|
157
177
|
</>
|
|
158
178
|
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { ReactNode, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiFlexGroup, EuiFlexItem, useIsWithinBreakpoints } from '@elastic/eui';
|
|
4
|
+
|
|
5
|
+
import { useGetOrchestratorConfig } from '@/hooks';
|
|
6
|
+
|
|
7
|
+
import { WfoWorkflowGuideExpandablePanel } from './WfoWorkflowGuideExpandablePanel';
|
|
8
|
+
|
|
9
|
+
interface WfoFormWithUserGuideProps {
|
|
10
|
+
workflowName?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const WfoPageWithUserGuide = ({ workflowName, children }: WfoFormWithUserGuideProps) => {
|
|
15
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
16
|
+
const isBigScreen = useIsWithinBreakpoints(['xl', 'xxl']);
|
|
17
|
+
const { showWorkflowUserGuide } = useGetOrchestratorConfig();
|
|
18
|
+
|
|
19
|
+
if (!workflowName || !showWorkflowUserGuide) {
|
|
20
|
+
return <>{children}</>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const workflowGuideExpandablePanel = (
|
|
24
|
+
<WfoWorkflowGuideExpandablePanel
|
|
25
|
+
workflowName={workflowName}
|
|
26
|
+
isExpanded={isExpanded}
|
|
27
|
+
onToggle={() => setIsExpanded((expanded) => !expanded)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<EuiFlexGroup gutterSize="s" direction={isBigScreen ? 'row' : 'column'}>
|
|
33
|
+
{!isBigScreen && workflowGuideExpandablePanel}
|
|
34
|
+
<EuiFlexItem grow={true}>{children}</EuiFlexItem>
|
|
35
|
+
{isBigScreen && workflowGuideExpandablePanel}
|
|
36
|
+
</EuiFlexGroup>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
EuiFlexGroup,
|
|
7
|
+
EuiFlexItem,
|
|
8
|
+
EuiIcon,
|
|
9
|
+
EuiLoadingSpinner,
|
|
10
|
+
EuiMarkdownFormat,
|
|
11
|
+
EuiPanel,
|
|
12
|
+
EuiText,
|
|
13
|
+
useIsWithinBreakpoints,
|
|
14
|
+
} from '@elastic/eui';
|
|
15
|
+
|
|
16
|
+
import { useWithOrchestratorTheme } from '@/hooks';
|
|
17
|
+
import { useGetWorkflowGuideQuery } from '@/rtk';
|
|
18
|
+
|
|
19
|
+
import { getStyles } from './styles';
|
|
20
|
+
|
|
21
|
+
interface WfoWorkflowUserGuideProps {
|
|
22
|
+
workflowName: string;
|
|
23
|
+
isExpanded: boolean;
|
|
24
|
+
onToggle: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface WfoUserGuideToggleStripProps {
|
|
28
|
+
onToggle: () => void;
|
|
29
|
+
ariaLabel: string;
|
|
30
|
+
isBigScreen: boolean;
|
|
31
|
+
noLeadingBorder?: boolean;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const WfoWorkflowGuideToggleStrip = ({
|
|
36
|
+
onToggle,
|
|
37
|
+
ariaLabel,
|
|
38
|
+
isBigScreen,
|
|
39
|
+
noLeadingBorder,
|
|
40
|
+
children,
|
|
41
|
+
}: WfoUserGuideToggleStripProps) => {
|
|
42
|
+
const {
|
|
43
|
+
fullHeightStyle,
|
|
44
|
+
toggleStripContainerStyle,
|
|
45
|
+
toggleStripContainerHorizontalStyle,
|
|
46
|
+
toggleStripPanelStyle,
|
|
47
|
+
noLeftBorderStyle,
|
|
48
|
+
noBottomBorderStyle,
|
|
49
|
+
} = useWithOrchestratorTheme(getStyles);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<EuiFlexItem
|
|
53
|
+
grow={false}
|
|
54
|
+
onClick={onToggle}
|
|
55
|
+
aria-label={ariaLabel}
|
|
56
|
+
css={isBigScreen ? toggleStripContainerStyle : toggleStripContainerHorizontalStyle}
|
|
57
|
+
>
|
|
58
|
+
<EuiPanel
|
|
59
|
+
hasShadow={false}
|
|
60
|
+
css={[toggleStripPanelStyle, noLeadingBorder && (isBigScreen ? noLeftBorderStyle : noBottomBorderStyle)]}
|
|
61
|
+
>
|
|
62
|
+
<EuiFlexGroup
|
|
63
|
+
direction={isBigScreen ? 'column' : 'row'}
|
|
64
|
+
alignItems="center"
|
|
65
|
+
gutterSize="s"
|
|
66
|
+
justifyContent="center"
|
|
67
|
+
css={fullHeightStyle}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</EuiFlexGroup>
|
|
71
|
+
</EuiPanel>
|
|
72
|
+
</EuiFlexItem>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const WfoWorkflowGuideMarkdown = ({ workflowName, isBigScreen }: { workflowName: string; isBigScreen: boolean }) => {
|
|
77
|
+
const t = useTranslations('workflowGuide');
|
|
78
|
+
const { guideBodyStyle, guidePanelStyle, guideStackedBodyStyle, guideStackedPanelStyle } =
|
|
79
|
+
useWithOrchestratorTheme(getStyles);
|
|
80
|
+
const { data, isLoading, isError } = useGetWorkflowGuideQuery({ workflowName });
|
|
81
|
+
const content = data?.content ?? '';
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div css={isBigScreen ? guideBodyStyle : guideStackedBodyStyle}>
|
|
85
|
+
{(isLoading && <EuiLoadingSpinner size="m" />)
|
|
86
|
+
|| ((isError || !content) && <EuiText color="subdued">{t('noGuideAvailable')}</EuiText>) || (
|
|
87
|
+
<EuiPanel paddingSize="m" hasShadow css={isBigScreen ? guidePanelStyle : guideStackedPanelStyle}>
|
|
88
|
+
<EuiMarkdownFormat>{content}</EuiMarkdownFormat>
|
|
89
|
+
</EuiPanel>
|
|
90
|
+
)}
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const WfoWorkflowGuideExpandablePanel = ({ workflowName, isExpanded, onToggle }: WfoWorkflowUserGuideProps) => {
|
|
96
|
+
const t = useTranslations('workflowGuide');
|
|
97
|
+
const { fullHeightStyle, guideExpandedItemStyle, guideExpandedFillStyle } = useWithOrchestratorTheme(getStyles);
|
|
98
|
+
const isBigScreen = useIsWithinBreakpoints(['xl', 'xxl']);
|
|
99
|
+
|
|
100
|
+
const OpenGuideButton = () => (
|
|
101
|
+
<EuiFlexItem grow={false}>
|
|
102
|
+
<EuiFlexGroup gutterSize="xs" alignItems="center" direction={isBigScreen ? 'column' : 'row'}>
|
|
103
|
+
<EuiIcon type={isBigScreen ? 'arrowLeft' : 'arrowDown'} size="xxl" color="primary" />
|
|
104
|
+
<EuiIcon type={'info'} size="xxl" color="primary" />
|
|
105
|
+
</EuiFlexGroup>
|
|
106
|
+
</EuiFlexItem>
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const CloseGuideButton = () => (
|
|
110
|
+
<EuiFlexItem grow={false}>
|
|
111
|
+
<EuiIcon type={isBigScreen ? 'arrowRight' : 'arrowUp'} size="xl" color="primary" />
|
|
112
|
+
</EuiFlexItem>
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
if (!isExpanded) {
|
|
116
|
+
return (
|
|
117
|
+
<WfoWorkflowGuideToggleStrip onToggle={onToggle} ariaLabel={t('show')} isBigScreen={isBigScreen}>
|
|
118
|
+
<OpenGuideButton />
|
|
119
|
+
</WfoWorkflowGuideToggleStrip>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (isBigScreen) {
|
|
124
|
+
return (
|
|
125
|
+
<EuiFlexItem grow={1} css={guideExpandedItemStyle}>
|
|
126
|
+
<EuiFlexGroup gutterSize="none" css={[fullHeightStyle, guideExpandedFillStyle]}>
|
|
127
|
+
<WfoWorkflowGuideMarkdown workflowName={workflowName} isBigScreen />
|
|
128
|
+
<WfoWorkflowGuideToggleStrip onToggle={onToggle} ariaLabel={t('hide')} isBigScreen noLeadingBorder>
|
|
129
|
+
<CloseGuideButton />
|
|
130
|
+
</WfoWorkflowGuideToggleStrip>
|
|
131
|
+
</EuiFlexGroup>
|
|
132
|
+
</EuiFlexItem>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<EuiFlexItem grow={false}>
|
|
138
|
+
<EuiFlexGroup direction="column" gutterSize="none">
|
|
139
|
+
<WfoWorkflowGuideToggleStrip
|
|
140
|
+
onToggle={onToggle}
|
|
141
|
+
ariaLabel={t('hide')}
|
|
142
|
+
isBigScreen={isBigScreen}
|
|
143
|
+
noLeadingBorder
|
|
144
|
+
>
|
|
145
|
+
<CloseGuideButton />
|
|
146
|
+
</WfoWorkflowGuideToggleStrip>
|
|
147
|
+
<WfoWorkflowGuideMarkdown workflowName={workflowName} isBigScreen />
|
|
148
|
+
</EuiFlexGroup>
|
|
149
|
+
</EuiFlexItem>
|
|
150
|
+
);
|
|
151
|
+
};
|