@orchestrator-ui/orchestrator-ui-components 5.2.0 → 5.2.3
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 +7 -7
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +7 -7
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +80 -86
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/WfoInlineNoteEdit/WfoSubscriptionNoteEdit.tsx +9 -18
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +52 -55
- package/src/components/WfoSubscriptionsList/subscriptionResultMappers.ts +5 -3
- package/src/components/WfoSummary/WfoMyWorkflowsSummaryCard.tsx +1 -1
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx +4 -1
- package/src/configuration/version.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchestrator-ui/orchestrator-ui-components",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Library of UI Components used to display the workflow orchestrator frontend",
|
|
6
6
|
"author": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"next-query-params": "^5.0.0",
|
|
49
49
|
"object-hash": "^3.0.0",
|
|
50
50
|
"prism-themes": "^1.9.0",
|
|
51
|
-
"pydantic-forms": "^0.3.
|
|
51
|
+
"pydantic-forms": "^0.3.3",
|
|
52
52
|
"react-diff-view": "^3.2.0",
|
|
53
53
|
"react-draggable": "^4.4.6",
|
|
54
54
|
"react-redux": "^9.1.2",
|
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { ApiResult, SubscriptionListResponse, UseQuery } from '@/rtk';
|
|
5
4
|
import { useStartProcessMutation } from '@/rtk/endpoints/forms';
|
|
6
5
|
import { useUpdateSubscriptionNoteOptimisticMutation } from '@/rtk/endpoints/subscriptionListMutation';
|
|
7
|
-
import { Subscription } from '@/types';
|
|
8
6
|
import { INVISIBLE_CHARACTER } from '@/utils';
|
|
9
7
|
|
|
10
8
|
import { WfoInlineEdit } from '../WfoInlineEdit';
|
|
9
|
+
import { SubscriptionListItem } from '../WfoSubscriptionsList';
|
|
11
10
|
|
|
12
11
|
interface WfoSubscriptionNoteEditProps {
|
|
13
|
-
subscriptionId: Subscription['subscriptionId'];
|
|
14
12
|
onlyShowOnHover?: boolean;
|
|
15
13
|
queryVariables: Record<string, unknown>;
|
|
16
|
-
|
|
14
|
+
endpointName: string | undefined;
|
|
15
|
+
subscription: SubscriptionListItem;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export const WfoSubscriptionNoteEdit: FC<WfoSubscriptionNoteEditProps> = ({
|
|
20
|
-
subscriptionId,
|
|
21
19
|
onlyShowOnHover = false,
|
|
22
20
|
queryVariables,
|
|
23
|
-
|
|
21
|
+
endpointName,
|
|
22
|
+
subscription,
|
|
24
23
|
}) => {
|
|
25
|
-
const { selectedItem } = useQuery(queryVariables, {
|
|
26
|
-
selectFromResult: (result: ApiResult<SubscriptionListResponse>) => ({
|
|
27
|
-
selectedItem: result?.data?.subscriptions?.find(
|
|
28
|
-
(sub) => sub.subscriptionId === subscriptionId,
|
|
29
|
-
),
|
|
30
|
-
}),
|
|
31
|
-
});
|
|
32
|
-
const endpointName = useQuery().endpointName;
|
|
33
24
|
const [startProcess] = useStartProcessMutation();
|
|
34
25
|
const [updateSub] = useUpdateSubscriptionNoteOptimisticMutation();
|
|
35
26
|
|
|
36
27
|
const triggerNoteModifyWorkflow = (note: string) => {
|
|
37
28
|
const noteModifyPayload = [
|
|
38
|
-
{ subscription_id: subscriptionId },
|
|
29
|
+
{ subscription_id: subscription.subscriptionId },
|
|
39
30
|
{ note: note === INVISIBLE_CHARACTER ? '' : note },
|
|
40
31
|
];
|
|
41
32
|
startProcess({
|
|
@@ -45,7 +36,7 @@ export const WfoSubscriptionNoteEdit: FC<WfoSubscriptionNoteEditProps> = ({
|
|
|
45
36
|
|
|
46
37
|
updateSub({
|
|
47
38
|
queryName: endpointName ?? '',
|
|
48
|
-
subscriptionId: subscriptionId,
|
|
39
|
+
subscriptionId: subscription.subscriptionId,
|
|
49
40
|
graphQlQueryVariables: queryVariables,
|
|
50
41
|
note: note,
|
|
51
42
|
});
|
|
@@ -54,8 +45,8 @@ export const WfoSubscriptionNoteEdit: FC<WfoSubscriptionNoteEditProps> = ({
|
|
|
54
45
|
return (
|
|
55
46
|
<WfoInlineEdit
|
|
56
47
|
value={
|
|
57
|
-
|
|
58
|
-
?
|
|
48
|
+
subscription?.note?.trim()
|
|
49
|
+
? subscription.note
|
|
59
50
|
: INVISIBLE_CHARACTER
|
|
60
51
|
}
|
|
61
52
|
onlyShowOnHover={onlyShowOnHover}
|
|
@@ -22,14 +22,12 @@ import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedT
|
|
|
22
22
|
import { ColumnType } from '@/components/WfoTable/WfoTable';
|
|
23
23
|
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
24
24
|
import { DataDisplayParams, useShowToastMessage } from '@/hooks';
|
|
25
|
-
import { UseQuery } from '@/rtk';
|
|
26
25
|
import {
|
|
27
|
-
SubscriptionListResponse,
|
|
28
26
|
useGetSubscriptionListQuery,
|
|
29
27
|
useLazyGetSubscriptionListQuery,
|
|
30
28
|
} from '@/rtk/endpoints/subscriptionList';
|
|
31
29
|
import { mapRtkErrorToWfoError } from '@/rtk/utils';
|
|
32
|
-
import { GraphqlQueryVariables, SortOrder
|
|
30
|
+
import { GraphqlQueryVariables, SortOrder } from '@/types';
|
|
33
31
|
import {
|
|
34
32
|
getQueryVariablesForExport,
|
|
35
33
|
getTypedFieldFromObject,
|
|
@@ -78,6 +76,22 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
78
76
|
const tError = useTranslations('errors');
|
|
79
77
|
const { showToastMessage } = useShowToastMessage();
|
|
80
78
|
|
|
79
|
+
const { sortBy, queryString, pageIndex, pageSize } = dataDisplayParams;
|
|
80
|
+
|
|
81
|
+
const graphqlQueryVariables: GraphqlQueryVariables<SubscriptionListItem> = {
|
|
82
|
+
first: pageSize,
|
|
83
|
+
after: pageIndex * pageSize,
|
|
84
|
+
sortBy,
|
|
85
|
+
filterBy: alwaysOnFilters,
|
|
86
|
+
query: queryString || undefined,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const { data, isFetching, error, endpointName } =
|
|
90
|
+
useGetSubscriptionListQuery(graphqlQueryVariables);
|
|
91
|
+
|
|
92
|
+
const subscriptionList =
|
|
93
|
+
mapGraphQlSubscriptionsResultToSubscriptionListItems(data);
|
|
94
|
+
|
|
81
95
|
const tableColumnConfig: WfoAdvancedTableColumnConfig<SubscriptionListItem> =
|
|
82
96
|
{
|
|
83
97
|
subscriptionId: {
|
|
@@ -155,15 +169,10 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
155
169
|
renderData: (cellValue, row) => {
|
|
156
170
|
return (
|
|
157
171
|
<WfoSubscriptionNoteEdit
|
|
158
|
-
queryVariables={graphqlQueryVariables}
|
|
159
|
-
subscriptionId={row.subscriptionId}
|
|
160
172
|
onlyShowOnHover={true}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Subscription
|
|
165
|
-
>
|
|
166
|
-
}
|
|
173
|
+
endpointName={endpointName}
|
|
174
|
+
queryVariables={graphqlQueryVariables}
|
|
175
|
+
subscription={row}
|
|
167
176
|
/>
|
|
168
177
|
);
|
|
169
178
|
},
|
|
@@ -182,19 +191,6 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
182
191
|
},
|
|
183
192
|
};
|
|
184
193
|
|
|
185
|
-
const { sortBy, queryString, pageIndex, pageSize } = dataDisplayParams;
|
|
186
|
-
|
|
187
|
-
const graphqlQueryVariables: GraphqlQueryVariables<SubscriptionListItem> = {
|
|
188
|
-
first: pageSize,
|
|
189
|
-
after: pageIndex * pageSize,
|
|
190
|
-
sortBy,
|
|
191
|
-
filterBy: alwaysOnFilters,
|
|
192
|
-
query: queryString || undefined,
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
const { data, isFetching, error } = useGetSubscriptionListQuery(
|
|
196
|
-
graphqlQueryVariables,
|
|
197
|
-
);
|
|
198
194
|
const [getSubscriptionListTrigger, { isFetching: isFetchingCsv }] =
|
|
199
195
|
useLazyGetSubscriptionListQuery();
|
|
200
196
|
const getSubscriptionListForExport = () =>
|
|
@@ -217,35 +213,46 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
217
213
|
};
|
|
218
214
|
const { totalItems, sortFields, filterFields } = data?.pageInfo ?? {};
|
|
219
215
|
|
|
216
|
+
const pageChange =
|
|
217
|
+
getPageIndexChangeHandler<SubscriptionListItem>(setDataDisplayParam);
|
|
218
|
+
const pageSizeChange =
|
|
219
|
+
getPageSizeChangeHandler<SubscriptionListItem>(setDataDisplayParam);
|
|
220
|
+
const updateQuery =
|
|
221
|
+
getQueryStringHandler<SubscriptionListItem>(setDataDisplayParam);
|
|
222
|
+
const updateSorting =
|
|
223
|
+
getDataSortHandler<SubscriptionListItem>(setDataDisplayParam);
|
|
224
|
+
|
|
220
225
|
const pagination: Pagination = {
|
|
221
226
|
pageIndex: dataDisplayParams.pageIndex,
|
|
222
227
|
pageSize: dataDisplayParams.pageSize,
|
|
223
228
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
224
229
|
totalItemCount: totalItems ?? 0,
|
|
225
|
-
onChangePage:
|
|
226
|
-
|
|
227
|
-
setDataDisplayParam,
|
|
228
|
-
),
|
|
229
|
-
onChangeItemsPerPage:
|
|
230
|
-
getPageSizeChangeHandler<SubscriptionListItem>(setDataDisplayParam),
|
|
230
|
+
onChangePage: pageChange,
|
|
231
|
+
onChangeItemsPerPage: pageSizeChange,
|
|
231
232
|
};
|
|
232
233
|
|
|
234
|
+
const exportData = csvDownloadHandler(
|
|
235
|
+
getSubscriptionListForExport,
|
|
236
|
+
mapGraphQlSubscriptionsResultToSubscriptionListItems,
|
|
237
|
+
mapGraphQlSubscriptionsResultToPageInfo,
|
|
238
|
+
Object.keys(tableColumnConfig),
|
|
239
|
+
getCsvFileNameWithDate('Subscriptions'),
|
|
240
|
+
showToastMessage,
|
|
241
|
+
tError,
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
const tableConfig = mapSortableAndFilterableValuesToTableColumnConfig(
|
|
245
|
+
tableColumnConfig,
|
|
246
|
+
sortFields,
|
|
247
|
+
filterFields,
|
|
248
|
+
);
|
|
249
|
+
|
|
233
250
|
return (
|
|
234
251
|
<WfoAdvancedTable
|
|
235
252
|
queryString={dataDisplayParams.queryString}
|
|
236
|
-
onUpdateQueryString={
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
data={
|
|
240
|
-
data
|
|
241
|
-
? mapGraphQlSubscriptionsResultToSubscriptionListItems(data)
|
|
242
|
-
: []
|
|
243
|
-
}
|
|
244
|
-
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
245
|
-
tableColumnConfig,
|
|
246
|
-
sortFields,
|
|
247
|
-
filterFields,
|
|
248
|
-
)}
|
|
253
|
+
onUpdateQueryString={updateQuery}
|
|
254
|
+
data={subscriptionList}
|
|
255
|
+
tableColumnConfig={tableConfig}
|
|
249
256
|
defaultHiddenColumns={hiddenColumns}
|
|
250
257
|
dataSorting={[dataSorting]}
|
|
251
258
|
isLoading={isFetching}
|
|
@@ -253,18 +260,8 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
253
260
|
detailModalTitle={'Details - Subscription'}
|
|
254
261
|
pagination={pagination}
|
|
255
262
|
error={mapRtkErrorToWfoError(error)}
|
|
256
|
-
onUpdateDataSorting={
|
|
257
|
-
|
|
258
|
-
)}
|
|
259
|
-
onExportData={csvDownloadHandler(
|
|
260
|
-
getSubscriptionListForExport,
|
|
261
|
-
mapGraphQlSubscriptionsResultToSubscriptionListItems,
|
|
262
|
-
mapGraphQlSubscriptionsResultToPageInfo,
|
|
263
|
-
Object.keys(tableColumnConfig),
|
|
264
|
-
getCsvFileNameWithDate('Subscriptions'),
|
|
265
|
-
showToastMessage,
|
|
266
|
-
tError,
|
|
267
|
-
)}
|
|
263
|
+
onUpdateDataSorting={updateSorting}
|
|
264
|
+
onExportData={exportData}
|
|
268
265
|
exportDataIsLoading={isFetchingCsv}
|
|
269
266
|
/>
|
|
270
267
|
);
|
|
@@ -20,9 +20,10 @@ export const mapGraphQlSubscriptionsResultToPageInfo = (
|
|
|
20
20
|
) => graphqlResponse.pageInfo;
|
|
21
21
|
|
|
22
22
|
export const mapGraphQlSubscriptionsResultToSubscriptionListItems = (
|
|
23
|
-
graphqlResponse: SubscriptionListResponse,
|
|
24
|
-
): SubscriptionListItem[] =>
|
|
25
|
-
graphqlResponse
|
|
23
|
+
graphqlResponse: SubscriptionListResponse | undefined,
|
|
24
|
+
): SubscriptionListItem[] => {
|
|
25
|
+
if (!graphqlResponse) return [];
|
|
26
|
+
return graphqlResponse.subscriptions.map((subscription) => {
|
|
26
27
|
const {
|
|
27
28
|
description,
|
|
28
29
|
insync,
|
|
@@ -55,3 +56,4 @@ export const mapGraphQlSubscriptionsResultToSubscriptionListItems = (
|
|
|
55
56
|
metadata: Object.keys(metadata).length > 0 ? metadata : null,
|
|
56
57
|
};
|
|
57
58
|
});
|
|
59
|
+
};
|
|
@@ -37,7 +37,7 @@ export const WfoMyWorkflowsSummaryCard: FC<WfoMyWorkflowsSummaryCardProps> = ({
|
|
|
37
37
|
const queryParams = {
|
|
38
38
|
[WfoQueryParams.ACTIVE_TAB]: WfoWorkflowsListTabType.COMPLETED,
|
|
39
39
|
[WfoQueryParams.SORT_BY]: 'field-lastModifiedAt_order-DESC',
|
|
40
|
-
[WfoQueryParams.QUERY_STRING]: `createdBy
|
|
40
|
+
[WfoQueryParams.QUERY_STRING]: `createdBy:"${username}"`,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
return (
|
|
@@ -47,7 +47,10 @@ export const WfoProcessSubscriptionDelta = ({
|
|
|
47
47
|
data?.current_state?.subscription?.subscription_id ?? '';
|
|
48
48
|
const newText = data?.current_state?.subscription ?? null;
|
|
49
49
|
const oldSubscriptions = data?.current_state?.__old_subscriptions__ || {};
|
|
50
|
-
const oldSubscription =
|
|
50
|
+
const oldSubscription =
|
|
51
|
+
subscriptionId in oldSubscriptions
|
|
52
|
+
? oldSubscriptions[subscriptionId]
|
|
53
|
+
: null;
|
|
51
54
|
const oldText = oldSubscription || null;
|
|
52
55
|
|
|
53
56
|
return isFetching ? (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '5.2.
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '5.2.3';
|