@orchestrator-ui/orchestrator-ui-components 6.5.0 → 6.7.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 +8 -8
- package/.turbo/turbo-lint.log +3 -6
- package/.turbo/turbo-test.log +6 -6
- package/CHANGELOG.md +28 -0
- package/dist/index.d.ts +837 -255
- package/dist/index.js +2738 -2371
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/WfoAgent/WfoAgent/WfoAgent.tsx +48 -39
- package/src/components/WfoAvailabilityCheck/WfoAvailabilityCheck.tsx +27 -0
- package/src/components/WfoAvailabilityCheck/index.ts +1 -0
- package/src/components/WfoBackendUnavailable/WfoBackendUnavailable.tsx +109 -0
- package/src/components/WfoBackendUnavailable/index.ts +1 -0
- package/src/components/WfoInlineEdit/WfoInlineEdit.tsx +5 -1
- package/src/components/WfoInlineNoteEdit/WfoSubscriptionDetailNoteEdit.tsx +1 -1
- package/src/components/WfoLogoSpinner/WfoLogoSpinner.tsx +2 -2
- package/src/components/WfoMetadata/WfoMetadataDescriptionField.tsx +3 -1
- package/src/components/WfoPydanticForm/WfoPydanticForm.tsx +7 -1
- package/src/components/WfoPydanticForm/fields/WfoArrayField/WfoArrayField.tsx +15 -6
- package/src/components/WfoPydanticForm/fields/WfoReactSelect/styles.ts +5 -1
- package/src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx +9 -2
- package/src/components/WfoSubscription/WfoCustomerDescriptionsField.tsx +1 -1
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +138 -46
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem.tsx +27 -33
- package/src/components/WfoSubscription/WfoSubscriptionActions/styles.ts +3 -1
- package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +37 -6
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +1 -0
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +1 -0
- package/src/components/index.ts +2 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useBackendAvailability.ts +72 -0
- package/src/messages/en-GB.json +39 -0
- package/src/messages/nl-NL.json +2 -0
- package/src/rtk/api.ts +5 -3
- package/src/rtk/endpoints/availability.ts +41 -0
- package/src/rtk/endpoints/index.ts +1 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { FC, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { useRouter } from 'next/router';
|
|
4
6
|
|
|
5
7
|
import {
|
|
6
8
|
EuiButton,
|
|
@@ -12,14 +14,23 @@ import {
|
|
|
12
14
|
EuiTitle,
|
|
13
15
|
} from '@elastic/eui';
|
|
14
16
|
|
|
15
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
PATH_START_NEW_TASK,
|
|
19
|
+
PATH_START_NEW_WORKFLOW,
|
|
20
|
+
PATH_TASKS,
|
|
21
|
+
PATH_WORKFLOWS,
|
|
22
|
+
WfoInSyncField,
|
|
23
|
+
} from '@/components';
|
|
16
24
|
import { WfoSubscriptionActionsMenuItem } from '@/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem';
|
|
17
25
|
import { PolicyResource } from '@/configuration/policy-resources';
|
|
18
|
-
import { usePolicy } from '@/hooks';
|
|
26
|
+
import { usePolicy, useShowToastMessage } from '@/hooks';
|
|
19
27
|
import { WfoDotsHorizontal } from '@/icons/WfoDotsHorizontal';
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
import {
|
|
29
|
+
useGetSubscriptionActionsQuery,
|
|
30
|
+
useGetSubscriptionDetailQuery,
|
|
31
|
+
useStartProcessMutation,
|
|
32
|
+
} from '@/rtk';
|
|
33
|
+
import { ToastTypes, WorkflowTarget } from '@/types';
|
|
23
34
|
|
|
24
35
|
type MenuBlockProps = {
|
|
25
36
|
title: string;
|
|
@@ -43,6 +54,7 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
|
|
|
43
54
|
}) => {
|
|
44
55
|
const t = useTranslations('subscriptions.detail.actions');
|
|
45
56
|
const [isPopoverOpen, setPopover] = useState(false);
|
|
57
|
+
const router = useRouter();
|
|
46
58
|
const disableQuery = isLoading || (!isPopoverOpen && compactMode);
|
|
47
59
|
const {
|
|
48
60
|
data: subscriptionActions,
|
|
@@ -51,6 +63,8 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
|
|
|
51
63
|
{ subscriptionId },
|
|
52
64
|
{ skip: disableQuery },
|
|
53
65
|
);
|
|
66
|
+
const { showToastMessage } = useShowToastMessage();
|
|
67
|
+
const [startProcess] = useStartProcessMutation();
|
|
54
68
|
|
|
55
69
|
const { data: subscriptionDetail } = useGetSubscriptionDetailQuery(
|
|
56
70
|
{
|
|
@@ -89,23 +103,88 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
|
|
|
89
103
|
SUBSCRIPTION_TERMINATE,
|
|
90
104
|
SET_IN_SYNC,
|
|
91
105
|
} = PolicyResource;
|
|
106
|
+
|
|
107
|
+
const redirectToUrl = (actionName: string, isTask: boolean = false) => {
|
|
108
|
+
const path = isTask ? PATH_START_NEW_TASK : PATH_START_NEW_WORKFLOW;
|
|
109
|
+
|
|
110
|
+
const url = {
|
|
111
|
+
pathname: `${path}/${actionName}`,
|
|
112
|
+
query: {
|
|
113
|
+
subscriptionId,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
router.push(url);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const silentlyStartAction = (
|
|
120
|
+
actionName: string,
|
|
121
|
+
isTask: boolean = false,
|
|
122
|
+
) => {
|
|
123
|
+
startProcess({
|
|
124
|
+
workflowName: actionName,
|
|
125
|
+
userInputs: [
|
|
126
|
+
{
|
|
127
|
+
subscription_id: subscriptionId,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
})
|
|
131
|
+
.unwrap()
|
|
132
|
+
.then((result) => {
|
|
133
|
+
const processUrl = `${isTask ? PATH_TASKS : PATH_WORKFLOWS}/${result.id}`;
|
|
134
|
+
showToastMessage(
|
|
135
|
+
ToastTypes.SUCCESS,
|
|
136
|
+
<Link href={processUrl}>{processUrl}</Link>,
|
|
137
|
+
t('actionStarted'),
|
|
138
|
+
);
|
|
139
|
+
})
|
|
140
|
+
.catch((error) => {
|
|
141
|
+
showToastMessage(
|
|
142
|
+
ToastTypes.ERROR,
|
|
143
|
+
t('actionStartFailed'),
|
|
144
|
+
t('actionStartFailed'),
|
|
145
|
+
);
|
|
146
|
+
console.error(`Failed to start action:`, error);
|
|
147
|
+
})
|
|
148
|
+
.finally(() => {
|
|
149
|
+
closePopover();
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const handleActionClick = (
|
|
154
|
+
actionName: string,
|
|
155
|
+
compactMode: boolean,
|
|
156
|
+
isTask: boolean = false,
|
|
157
|
+
) => {
|
|
158
|
+
if (compactMode) {
|
|
159
|
+
silentlyStartAction(actionName, isTask);
|
|
160
|
+
} else {
|
|
161
|
+
redirectToUrl(actionName, isTask);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
92
165
|
const compactItems = (
|
|
93
166
|
<>
|
|
94
167
|
{isAllowed(SUBSCRIPTION_VALIDATE + subscriptionId) &&
|
|
95
168
|
subscriptionActions?.validate && (
|
|
96
169
|
<>
|
|
97
170
|
{!compactMode && <MenuBlock title={t('tasks')} />}
|
|
98
|
-
{subscriptionActions.validate.map(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
171
|
+
{subscriptionActions.validate.map(
|
|
172
|
+
(subscriptionAction, index) => (
|
|
173
|
+
<WfoSubscriptionActionsMenuItem
|
|
174
|
+
key={`s_${index}`}
|
|
175
|
+
subscriptionAction={subscriptionAction}
|
|
176
|
+
target={WorkflowTarget.VALIDATE}
|
|
177
|
+
setPopover={setPopover}
|
|
178
|
+
onClick={() =>
|
|
179
|
+
handleActionClick(
|
|
180
|
+
subscriptionAction.name,
|
|
181
|
+
compactMode,
|
|
182
|
+
true,
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
/>
|
|
186
|
+
),
|
|
187
|
+
)}
|
|
109
188
|
</>
|
|
110
189
|
)}
|
|
111
190
|
|
|
@@ -113,16 +192,23 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
|
|
|
113
192
|
(subscriptionActions?.reconcile?.length ?? 0) > 0 && (
|
|
114
193
|
<>
|
|
115
194
|
{!compactMode && <MenuBlock title={t('reconcile')} />}
|
|
116
|
-
{subscriptionActions?.reconcile.map(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
195
|
+
{subscriptionActions?.reconcile.map(
|
|
196
|
+
(subscriptionAction, index) => (
|
|
197
|
+
<WfoSubscriptionActionsMenuItem
|
|
198
|
+
key={`r_${index}`}
|
|
199
|
+
subscriptionAction={subscriptionAction}
|
|
200
|
+
target={WorkflowTarget.RECONCILE}
|
|
201
|
+
setPopover={setPopover}
|
|
202
|
+
onClick={() =>
|
|
203
|
+
handleActionClick(
|
|
204
|
+
subscriptionAction.name,
|
|
205
|
+
compactMode,
|
|
206
|
+
false,
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
/>
|
|
210
|
+
),
|
|
211
|
+
)}
|
|
126
212
|
</>
|
|
127
213
|
)}
|
|
128
214
|
|
|
@@ -144,16 +230,19 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
|
|
|
144
230
|
subscriptionActions?.modify && (
|
|
145
231
|
<>
|
|
146
232
|
<MenuBlock title={t('modify')} />
|
|
147
|
-
{subscriptionActions.modify.map(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
233
|
+
{subscriptionActions.modify.map(
|
|
234
|
+
(subscriptionAction, index) => (
|
|
235
|
+
<WfoSubscriptionActionsMenuItem
|
|
236
|
+
key={`m_${index}`}
|
|
237
|
+
subscriptionAction={subscriptionAction}
|
|
238
|
+
target={WorkflowTarget.MODIFY}
|
|
239
|
+
setPopover={setPopover}
|
|
240
|
+
onClick={() => {
|
|
241
|
+
redirectToUrl(subscriptionAction.name);
|
|
242
|
+
}}
|
|
243
|
+
/>
|
|
244
|
+
),
|
|
245
|
+
)}
|
|
157
246
|
</>
|
|
158
247
|
)}
|
|
159
248
|
{compactItems}
|
|
@@ -161,16 +250,19 @@ export const WfoSubscriptionActions: FC<WfoSubscriptionActionsProps> = ({
|
|
|
161
250
|
subscriptionActions?.terminate && (
|
|
162
251
|
<>
|
|
163
252
|
<MenuBlock title={t('terminate')} />
|
|
164
|
-
{subscriptionActions.terminate.map(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
253
|
+
{subscriptionActions.terminate.map(
|
|
254
|
+
(subscriptionAction, index) => (
|
|
255
|
+
<WfoSubscriptionActionsMenuItem
|
|
256
|
+
key={`t_${index}`}
|
|
257
|
+
subscriptionAction={subscriptionAction}
|
|
258
|
+
target={WorkflowTarget.TERMINATE}
|
|
259
|
+
setPopover={setPopover}
|
|
260
|
+
onClick={() => {
|
|
261
|
+
redirectToUrl(subscriptionAction.name);
|
|
262
|
+
}}
|
|
263
|
+
/>
|
|
264
|
+
),
|
|
265
|
+
)}
|
|
174
266
|
</>
|
|
175
267
|
)}
|
|
176
268
|
</>
|
package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem.tsx
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
|
-
import Link from 'next/link';
|
|
5
|
-
import { useRouter } from 'next/router';
|
|
6
4
|
|
|
7
5
|
import { EuiContextMenuItem, EuiToolTip } from '@elastic/eui';
|
|
8
6
|
|
|
9
7
|
import { flattenArrayProps } from '@/components';
|
|
10
|
-
import {
|
|
11
|
-
PATH_START_NEW_TASK,
|
|
12
|
-
PATH_START_NEW_WORKFLOW,
|
|
13
|
-
} from '@/components/WfoPageTemplate';
|
|
14
8
|
import { WfoSubscriptionActionExpandableMenuItem } from '@/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem';
|
|
15
9
|
import { getSubscriptionActionStyles } from '@/components/WfoSubscription/WfoSubscriptionActions/styles';
|
|
16
10
|
import {
|
|
@@ -24,21 +18,16 @@ import { SubscriptionAction, WorkflowTarget } from '@/types';
|
|
|
24
18
|
import { WfoTargetTypeIcon } from '../WfoTargetTypeIcon';
|
|
25
19
|
|
|
26
20
|
interface MenuItemProps {
|
|
27
|
-
|
|
28
|
-
action: SubscriptionAction;
|
|
29
|
-
index: number;
|
|
21
|
+
subscriptionAction: SubscriptionAction;
|
|
30
22
|
target: WorkflowTarget;
|
|
31
|
-
isTask?: boolean;
|
|
32
|
-
isDisabled?: boolean;
|
|
33
|
-
subscriptionId: string;
|
|
34
23
|
setPopover: (isOpen: boolean) => void;
|
|
24
|
+
onClick: () => void;
|
|
35
25
|
}
|
|
36
26
|
|
|
37
27
|
export const WfoSubscriptionActionsMenuItem: FC<MenuItemProps> = ({
|
|
38
|
-
|
|
28
|
+
subscriptionAction,
|
|
29
|
+
onClick,
|
|
39
30
|
target,
|
|
40
|
-
isTask = false,
|
|
41
|
-
subscriptionId,
|
|
42
31
|
setPopover,
|
|
43
32
|
}) => {
|
|
44
33
|
const {
|
|
@@ -50,41 +39,38 @@ export const WfoSubscriptionActionsMenuItem: FC<MenuItemProps> = ({
|
|
|
50
39
|
} = useWithOrchestratorTheme(getSubscriptionActionStyles);
|
|
51
40
|
|
|
52
41
|
const { isEngineRunningNow } = useCheckEngineStatus();
|
|
53
|
-
const router = useRouter();
|
|
54
42
|
const t = useTranslations('subscriptions.detail.actions');
|
|
55
43
|
const { theme } = useOrchestratorTheme();
|
|
56
44
|
|
|
57
45
|
const linkIt = (actionItem: React.ReactNode) => {
|
|
58
|
-
const path = isTask ? PATH_START_NEW_TASK : PATH_START_NEW_WORKFLOW;
|
|
59
|
-
const url = {
|
|
60
|
-
pathname: `${path}/${action.name}`,
|
|
61
|
-
query: { subscriptionId },
|
|
62
|
-
};
|
|
63
|
-
|
|
64
46
|
const handleLinkClick = async (e: React.MouseEvent) => {
|
|
65
47
|
e.preventDefault();
|
|
66
48
|
setPopover(false);
|
|
49
|
+
|
|
67
50
|
if (await isEngineRunningNow()) {
|
|
68
|
-
|
|
51
|
+
onClick();
|
|
69
52
|
}
|
|
70
53
|
};
|
|
71
54
|
|
|
72
55
|
return (
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
</
|
|
56
|
+
<div css={linkMenuItemStyle} onClick={handleLinkClick}>
|
|
57
|
+
{actionItem}
|
|
58
|
+
</div>
|
|
76
59
|
);
|
|
77
60
|
};
|
|
78
61
|
|
|
79
62
|
const tooltipIt = (actionItem: React.ReactNode) => {
|
|
80
|
-
if (!
|
|
81
|
-
const tooltipContent = t(
|
|
63
|
+
if (!subscriptionAction.reason) return actionItem;
|
|
64
|
+
const tooltipContent = t(
|
|
65
|
+
subscriptionAction.reason,
|
|
66
|
+
flattenArrayProps(subscriptionAction),
|
|
67
|
+
);
|
|
82
68
|
|
|
83
69
|
return (
|
|
84
70
|
<div css={tooltipMenuItemStyle}>
|
|
85
71
|
<EuiToolTip position="top" content={tooltipContent}>
|
|
86
72
|
<WfoSubscriptionActionExpandableMenuItem
|
|
87
|
-
subscriptionAction={
|
|
73
|
+
subscriptionAction={subscriptionAction}
|
|
88
74
|
onClickLockedRelation={() => setPopover(false)}
|
|
89
75
|
>
|
|
90
76
|
{actionItem}
|
|
@@ -95,7 +81,7 @@ export const WfoSubscriptionActionsMenuItem: FC<MenuItemProps> = ({
|
|
|
95
81
|
};
|
|
96
82
|
|
|
97
83
|
const getIcon = () =>
|
|
98
|
-
|
|
84
|
+
subscriptionAction.reason ? (
|
|
99
85
|
<div css={disabledIconStyle}>
|
|
100
86
|
<WfoTargetTypeIcon target={target} disabled />
|
|
101
87
|
<div css={secondaryIconStyle}>
|
|
@@ -113,10 +99,18 @@ export const WfoSubscriptionActionsMenuItem: FC<MenuItemProps> = ({
|
|
|
113
99
|
);
|
|
114
100
|
|
|
115
101
|
const ActionItem = () => (
|
|
116
|
-
<EuiContextMenuItem
|
|
117
|
-
{
|
|
102
|
+
<EuiContextMenuItem
|
|
103
|
+
icon={getIcon()}
|
|
104
|
+
disabled={!!subscriptionAction.reason}
|
|
105
|
+
css={{
|
|
106
|
+
whiteSpace: 'nowrap',
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
{subscriptionAction.description}
|
|
118
110
|
</EuiContextMenuItem>
|
|
119
111
|
);
|
|
120
112
|
|
|
121
|
-
return
|
|
113
|
+
return subscriptionAction?.reason
|
|
114
|
+
? tooltipIt(<ActionItem />)
|
|
115
|
+
: linkIt(<ActionItem />);
|
|
122
116
|
};
|
|
@@ -35,6 +35,7 @@ export const getSubscriptionActionStyles = ({ theme }: WfoTheme) => {
|
|
|
35
35
|
'&>:hover': {
|
|
36
36
|
backgroundColor: theme.colors.lightestShade,
|
|
37
37
|
borderRadius: theme.border.radius.medium,
|
|
38
|
+
cursor: 'pointer',
|
|
38
39
|
},
|
|
39
40
|
'.euiToolTipAnchor': {
|
|
40
41
|
width: '100%',
|
|
@@ -60,7 +61,8 @@ export const getSubscriptionActionStyles = ({ theme }: WfoTheme) => {
|
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
const secondaryIconStyle = css({
|
|
63
|
-
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
transform: 'translate(13px, -8px);',
|
|
64
66
|
});
|
|
65
67
|
|
|
66
68
|
const spinnerSecondaryIconStyle = css({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { css } from '@emotion/css';
|
|
4
4
|
|
|
5
5
|
import { useOrchestratorTheme } from '@/hooks';
|
|
6
6
|
import { WorkflowTarget } from '@/types';
|
|
@@ -17,17 +17,48 @@ interface WfoInSyncCompactIconProps {
|
|
|
17
17
|
isLoading?: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
interface IconProps {
|
|
21
|
+
targetLetter: string;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
}
|
|
24
|
+
const Icon = ({ targetLetter, backgroundColor }: IconProps) => {
|
|
25
|
+
const { theme } = useOrchestratorTheme();
|
|
26
|
+
const size = theme.size.l;
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
aria-label={targetLetter}
|
|
30
|
+
role="img"
|
|
31
|
+
title={targetLetter}
|
|
32
|
+
className={css({
|
|
33
|
+
backgroundColor: backgroundColor,
|
|
34
|
+
borderRadius: '50%',
|
|
35
|
+
color: theme.colors.ghost,
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
fontWeight: 500,
|
|
39
|
+
fontSize: theme.size.m,
|
|
40
|
+
display: 'flex',
|
|
41
|
+
height: size,
|
|
42
|
+
width: size,
|
|
43
|
+
})}
|
|
44
|
+
>
|
|
45
|
+
{targetLetter}
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
20
50
|
export const WfoTargetTypeIcon: FC<WfoTargetTypeIconProps> = ({
|
|
21
51
|
target,
|
|
22
52
|
disabled = false,
|
|
23
53
|
}) => {
|
|
24
54
|
const { theme } = useOrchestratorTheme();
|
|
25
|
-
|
|
26
|
-
const color = disabled
|
|
55
|
+
const backGroundColor = disabled
|
|
27
56
|
? theme.colors.lightShade
|
|
28
57
|
: getWorkflowTargetColor(target, theme);
|
|
29
|
-
const
|
|
30
|
-
return
|
|
58
|
+
const targetLetter = getWorkflowTargetIconContent(target);
|
|
59
|
+
return (
|
|
60
|
+
<Icon targetLetter={targetLetter} backgroundColor={backGroundColor} />
|
|
61
|
+
);
|
|
31
62
|
};
|
|
32
63
|
|
|
33
64
|
export const WfoInSyncCompactIcon: FC<WfoInSyncCompactIconProps> = ({
|
|
@@ -37,5 +68,5 @@ export const WfoInSyncCompactIcon: FC<WfoInSyncCompactIconProps> = ({
|
|
|
37
68
|
|
|
38
69
|
const color = disabled ? theme.colors.lightShade : theme.colors.danger;
|
|
39
70
|
const name = 'S';
|
|
40
|
-
return <
|
|
71
|
+
return <Icon targetLetter={name} backgroundColor={color} />;
|
|
41
72
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '6.
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '6.7.0';
|
package/src/hooks/index.ts
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
2
|
+
|
|
3
|
+
import { SerializedError } from '@reduxjs/toolkit';
|
|
4
|
+
import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
useCheckAgentAvailabilityQuery,
|
|
8
|
+
useCheckSearchAvailabilityQuery,
|
|
9
|
+
} from '@/rtk/endpoints/availability';
|
|
10
|
+
|
|
11
|
+
export interface BackendFeatureStatus {
|
|
12
|
+
isAvailable: boolean;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type RTKQueryError = FetchBaseQueryError | SerializedError | GraphQLError[];
|
|
17
|
+
|
|
18
|
+
const isNotFoundError = (error: RTKQueryError | undefined): boolean => {
|
|
19
|
+
if (error && 'status' in error) {
|
|
20
|
+
return error.status === 404;
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useSearchAvailability = (): BackendFeatureStatus => {
|
|
26
|
+
const { isLoading, error } = useCheckSearchAvailabilityQuery();
|
|
27
|
+
|
|
28
|
+
if (isLoading) {
|
|
29
|
+
return {
|
|
30
|
+
isAvailable: false,
|
|
31
|
+
isLoading: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (error) {
|
|
36
|
+
const isNotFound = isNotFoundError(error);
|
|
37
|
+
return {
|
|
38
|
+
isAvailable: !isNotFound,
|
|
39
|
+
isLoading: false,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
isAvailable: true,
|
|
45
|
+
isLoading: false,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const useAgentAvailability = (): BackendFeatureStatus => {
|
|
50
|
+
const { isLoading: agentLoading, error: agentError } =
|
|
51
|
+
useCheckAgentAvailabilityQuery();
|
|
52
|
+
|
|
53
|
+
const { isLoading: searchLoading, error: searchError } =
|
|
54
|
+
useCheckSearchAvailabilityQuery();
|
|
55
|
+
|
|
56
|
+
if (agentLoading || searchLoading) {
|
|
57
|
+
return {
|
|
58
|
+
isAvailable: false,
|
|
59
|
+
isLoading: true,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const agentNotFound = agentError ? isNotFoundError(agentError) : false;
|
|
64
|
+
const searchNotFound = searchError ? isNotFoundError(searchError) : false;
|
|
65
|
+
|
|
66
|
+
const isAvailable = !agentNotFound && !searchNotFound;
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
isAvailable,
|
|
70
|
+
isLoading: false,
|
|
71
|
+
};
|
|
72
|
+
};
|
package/src/messages/en-GB.json
CHANGED
|
@@ -312,6 +312,8 @@
|
|
|
312
312
|
"tasks": "Tasks",
|
|
313
313
|
"terminate": "Terminate workflow",
|
|
314
314
|
"reconcile": "Reconcile workflow",
|
|
315
|
+
"actionStarted": "Action started",
|
|
316
|
+
"actionStartFailed": "Action failed",
|
|
315
317
|
"actions": "Actions",
|
|
316
318
|
"lockedBySubscriptions": "This action is locked by the following subscriptions:",
|
|
317
319
|
"notAvailable": "Not available",
|
|
@@ -473,6 +475,27 @@
|
|
|
473
475
|
},
|
|
474
476
|
"agent": {
|
|
475
477
|
"title": "Search results",
|
|
478
|
+
"availability": {
|
|
479
|
+
"unavailable": {
|
|
480
|
+
"title": "Agent Service Not Available",
|
|
481
|
+
"instructions": {
|
|
482
|
+
"setAgentEnvironment": {
|
|
483
|
+
"before": "Set ",
|
|
484
|
+
"after": " in your service environment variables"
|
|
485
|
+
},
|
|
486
|
+
"setSearchEnvironment": {
|
|
487
|
+
"before": "Set ",
|
|
488
|
+
"after": " (agent functionality requires search)"
|
|
489
|
+
},
|
|
490
|
+
"checkVersion": "Ensure your orchestrator-core version supports agent functionality",
|
|
491
|
+
"configureOpenAI": "Configure your OpenAI API key if using OpenAI models",
|
|
492
|
+
"restartService": "Restart your service",
|
|
493
|
+
"checkDockerConfig": "If using Docker, make sure the environment variables are set in docker-compose.yml"
|
|
494
|
+
},
|
|
495
|
+
"documentation": "Please refer to the orchestrator documentation for detailed setup instructions.",
|
|
496
|
+
"retryButton": "Retry Connection"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
476
499
|
"page": {
|
|
477
500
|
"filledParameters": "Filled parameters",
|
|
478
501
|
"emptyGroup": "Empty group",
|
|
@@ -488,6 +511,22 @@
|
|
|
488
511
|
}
|
|
489
512
|
},
|
|
490
513
|
"search": {
|
|
514
|
+
"availability": {
|
|
515
|
+
"unavailable": {
|
|
516
|
+
"title": "Search Service Not Available",
|
|
517
|
+
"instructions": {
|
|
518
|
+
"setEnvironmentVariable": {
|
|
519
|
+
"before": "Set ",
|
|
520
|
+
"after": " in your service environment variables"
|
|
521
|
+
},
|
|
522
|
+
"checkVersion": "Ensure your orchestrator-core version supports search functionality",
|
|
523
|
+
"restartService": "Restart your service",
|
|
524
|
+
"checkDockerConfig": "If using Docker, make sure the environment variable is set in docker-compose.yml"
|
|
525
|
+
},
|
|
526
|
+
"documentation": "Please refer to the orchestrator documentation for detailed setup instructions.",
|
|
527
|
+
"retryButton": "Retry Connection"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
491
530
|
"page": {
|
|
492
531
|
"selectFieldFirst": "Select a field first",
|
|
493
532
|
"maxNestingDepth": "Maximum nesting depth reached",
|
package/src/messages/nl-NL.json
CHANGED
|
@@ -314,6 +314,8 @@
|
|
|
314
314
|
"reconcileSubscription": "Reconcile subscription",
|
|
315
315
|
"validateSubscription": "Validate subscription",
|
|
316
316
|
"actions": "Acties",
|
|
317
|
+
"actionStarted": "Actie gestart",
|
|
318
|
+
"actionStartFailed": "Actie mislukt",
|
|
317
319
|
"lockedBySubscriptions": "Deze actie is geblokkeerd door de volgende subscriptions:",
|
|
318
320
|
"subscription": {
|
|
319
321
|
"no_modify_deleted_related_objects": "Deze subscription kan niet worden gewijzigd omdat het verwijzingen bevat naar andere systemen die zijn verwijderd.",
|
package/src/rtk/api.ts
CHANGED
|
@@ -145,10 +145,12 @@ export const orchestratorApi = createApi({
|
|
|
145
145
|
|
|
146
146
|
switch (baseQueryType) {
|
|
147
147
|
case BaseQueryTypes.fetch: {
|
|
148
|
+
const baseUrl = customApi
|
|
149
|
+
? customApi.apiBaseUrl
|
|
150
|
+
: orchestratorApiBaseUrl;
|
|
151
|
+
|
|
148
152
|
const fetchFn = fetchBaseQuery({
|
|
149
|
-
baseUrl
|
|
150
|
-
? customApi.apiBaseUrl
|
|
151
|
-
: orchestratorApiBaseUrl,
|
|
153
|
+
baseUrl,
|
|
152
154
|
prepareHeaders,
|
|
153
155
|
paramsSerializer,
|
|
154
156
|
responseHandler: (response) =>
|