@orchestrator-ui/orchestrator-ui-components 8.8.1 → 8.8.2
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 +12 -12
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +22 -5
- package/dist/index.js +1247 -1135
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/components/WfoPydanticForm/fields/WfoMultiCheckboxField.tsx +2 -1
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +12 -8
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +23 -10
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +34 -3
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +4 -2
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +77 -46
- package/src/components/WfoTable/WfoTable/WfoTableSkeletonRows.tsx +52 -0
- package/src/components/WfoTable/WfoTable/index.ts +1 -0
- package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +21 -18
- package/src/components/WfoTable/WfoTableSettingsModal/styles.ts +17 -0
- package/src/components/WfoTable/utils/tableConfigPersistence.ts +1 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/useGetPydanticFormsConfig.tsx +5 -3
- package/src/hooks/useSearch.ts +2 -2
- package/src/hooks/useStoredTableConfig.ts +1 -0
- package/src/messages/en-GB.json +2 -0
- package/src/messages/nl-NL.json +2 -0
- package/src/pages/WfoSearchPocPage.tsx +28 -23
- package/src/pages/processes/WfoProductInformationWithLink.tsx +9 -4
- package/src/types/search.ts +8 -0
package/src/hooks/useSearch.ts
CHANGED
|
@@ -25,7 +25,7 @@ export const useSearch = (
|
|
|
25
25
|
) => {
|
|
26
26
|
const [results, setResults] = useState<PaginatedSearchResults>({ ...emptyResult });
|
|
27
27
|
|
|
28
|
-
const [triggerSearch, {
|
|
28
|
+
const [triggerSearch, { isFetching, isError }] = useLazySearchQuery();
|
|
29
29
|
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
const queryText = typeof query === 'string' ? query : query.text?.trim() || '';
|
|
@@ -75,7 +75,7 @@ export const useSearch = (
|
|
|
75
75
|
|
|
76
76
|
return {
|
|
77
77
|
results,
|
|
78
|
-
loading:
|
|
78
|
+
loading: isFetching,
|
|
79
79
|
error: isError ? 'Search failed' : null,
|
|
80
80
|
setResults,
|
|
81
81
|
};
|
|
@@ -24,6 +24,7 @@ export const useStoredTableConfig = <T>(localeStorageKey: string) => {
|
|
|
24
24
|
tableConfig.hiddenColumns = storedConfig.hiddenColumns;
|
|
25
25
|
tableConfig.selectedPageSize = storedConfig.selectedPageSize;
|
|
26
26
|
tableConfig.showMatchDetails = storedConfig.showMatchDetails;
|
|
27
|
+
tableConfig.advancedNestedSearch = storedConfig.advancedNestedSearch;
|
|
27
28
|
}
|
|
28
29
|
return tableConfig;
|
|
29
30
|
} catch {
|
package/src/messages/en-GB.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
|
+
"advancedNestedSearch": "Advanced nested search",
|
|
3
4
|
"applyFilter": "Apply filter",
|
|
4
5
|
"createFilter": "Create a filter",
|
|
5
6
|
"deselect": "Deselect",
|
|
6
7
|
"editColumns": "Edit columns",
|
|
7
8
|
"errorMessage": "An error occurred",
|
|
8
9
|
"export": "Export",
|
|
10
|
+
"exportRows": "Export {numberOfRows, plural, one {# row} other {# rows}}",
|
|
9
11
|
"insyncFalse": "out-of-sync",
|
|
10
12
|
"insyncTrue": "in-sync",
|
|
11
13
|
"loadMore": "Load more",
|
package/src/messages/nl-NL.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
|
+
"advancedNestedSearch": "Geavanceerd genest zoeken",
|
|
3
4
|
"applyFilter": "Pas filter toe",
|
|
4
5
|
"createFilter": "Filter",
|
|
5
6
|
"deselect": "Deselecteer",
|
|
6
7
|
"editColumns": "Wijzig kolommen",
|
|
7
8
|
"errorMessage": "Er is een fout opgetreden",
|
|
8
9
|
"export": "Exporteren",
|
|
10
|
+
"exportRows": "Exporteer {numberOfRows, plural, one {# rij} other {# rijen}}",
|
|
9
11
|
"insyncFalse": "out-of-sync",
|
|
10
12
|
"insyncTrue": "in-sync",
|
|
11
13
|
"loadMore": "Meer laden",
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
} from '@/components';
|
|
34
34
|
import { parseCelToRuleGroup } from '@/components/WfoTable/WfoStructuredSearchTable/utils';
|
|
35
35
|
import { ColumnType, WfoTableProps } from '@/components/WfoTable/WfoTable';
|
|
36
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
36
37
|
import { useStoredTableConfig } from '@/hooks';
|
|
37
38
|
import { SearchPayload, useLazySearchQuery, useSearchQuery } from '@/rtk';
|
|
38
39
|
import {
|
|
@@ -179,8 +180,7 @@ export const WfoSearchPocPage = () => {
|
|
|
179
180
|
);
|
|
180
181
|
const [isValidFilterString, setIsValidFilterString] = useState<boolean>(true);
|
|
181
182
|
const [tableDefaults, setTableDefaults] = useState<StoredTableConfig<SubscriptionListItem>>();
|
|
182
|
-
const [pageSize, setPageSize] = useState<number>(
|
|
183
|
-
const [limit, setLimit] = useState<number>(pageSize);
|
|
183
|
+
const [pageSize, setPageSize] = useState<number>(DEFAULT_PAGE_SIZE);
|
|
184
184
|
const [pageCursor, setPageCursor] = useState<{ cursor: string; searchKey: string } | undefined>(undefined);
|
|
185
185
|
const [dataSorting, setDataSorting] = useState<WfoDataSorting<SubscriptionListItem>>({
|
|
186
186
|
field: 'subscriptionId',
|
|
@@ -214,7 +214,7 @@ export const WfoSearchPocPage = () => {
|
|
|
214
214
|
};
|
|
215
215
|
return {
|
|
216
216
|
query: committedSearchQuery,
|
|
217
|
-
limit,
|
|
217
|
+
limit: pageSize,
|
|
218
218
|
entity_type: EntityKind.SUBSCRIPTION,
|
|
219
219
|
response_columns: Array.from(resultColumToPropertyMap.keys()),
|
|
220
220
|
order_by,
|
|
@@ -222,17 +222,19 @@ export const WfoSearchPocPage = () => {
|
|
|
222
222
|
...(filters && { filters }),
|
|
223
223
|
...(cursor && { cursor }),
|
|
224
224
|
};
|
|
225
|
-
}, [committedSearchQuery, committedRuleGroup, selectedTab, retrieverType,
|
|
225
|
+
}, [committedSearchQuery, committedRuleGroup, selectedTab, retrieverType, pageSize, dataSorting, cursor]);
|
|
226
226
|
|
|
227
227
|
const { data, isFetching } = useSearchQuery(searchPayload);
|
|
228
228
|
|
|
229
229
|
const [getSubscriptionListTrigger] = useLazySearchQuery();
|
|
230
|
-
const getSubscriptionListForExport = () =>
|
|
230
|
+
const getSubscriptionListForExport = (exportLimit: number) =>
|
|
231
|
+
getSubscriptionListTrigger({ ...searchPayload, limit: exportLimit, cursor: undefined }).unwrap();
|
|
231
232
|
|
|
232
233
|
useEffect(() => {
|
|
233
234
|
const storedConfig = getStoredTableConfig();
|
|
234
235
|
if (storedConfig) {
|
|
235
236
|
setTableDefaults(storedConfig);
|
|
237
|
+
setPageSize(storedConfig.selectedPageSize);
|
|
236
238
|
}
|
|
237
239
|
}, [getStoredTableConfig]);
|
|
238
240
|
|
|
@@ -249,8 +251,6 @@ export const WfoSearchPocPage = () => {
|
|
|
249
251
|
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
250
252
|
renderDetails: (value) => value,
|
|
251
253
|
renderTooltip: (value) => value,
|
|
252
|
-
isSortable: true,
|
|
253
|
-
isFilterable: true,
|
|
254
254
|
},
|
|
255
255
|
description: {
|
|
256
256
|
columnType: ColumnType.DATA,
|
|
@@ -258,44 +258,37 @@ export const WfoSearchPocPage = () => {
|
|
|
258
258
|
width: '500px',
|
|
259
259
|
renderData: (value, record) => <Link href={`/subscriptions/${record.subscriptionId}`}>{value}</Link>,
|
|
260
260
|
renderTooltip: (value) => value,
|
|
261
|
-
isFilterable: true,
|
|
262
261
|
},
|
|
263
262
|
status: {
|
|
264
263
|
columnType: ColumnType.DATA,
|
|
265
264
|
label: t('status'),
|
|
266
265
|
width: '120px',
|
|
267
266
|
renderData: (value) => <WfoSubscriptionStatusBadge status={value} />,
|
|
268
|
-
isFilterable: true,
|
|
269
267
|
},
|
|
270
268
|
insync: {
|
|
271
269
|
columnType: ColumnType.DATA,
|
|
272
270
|
label: t('insync'),
|
|
273
271
|
width: '75px',
|
|
274
272
|
renderData: (value) => <WfoInsyncIcon inSync={value} />,
|
|
275
|
-
isFilterable: true,
|
|
276
273
|
},
|
|
277
274
|
productName: {
|
|
278
275
|
columnType: ColumnType.DATA,
|
|
279
276
|
width: '260px',
|
|
280
277
|
label: t('product'),
|
|
281
|
-
isFilterable: true,
|
|
282
278
|
},
|
|
283
279
|
tag: {
|
|
284
280
|
columnType: ColumnType.DATA,
|
|
285
281
|
label: t('tag'),
|
|
286
282
|
width: '100px',
|
|
287
|
-
isFilterable: true,
|
|
288
283
|
},
|
|
289
284
|
customerFullname: {
|
|
290
285
|
columnType: ColumnType.DATA,
|
|
291
286
|
label: t('customerFullname'),
|
|
292
|
-
isFilterable: true,
|
|
293
287
|
},
|
|
294
288
|
customerShortcode: {
|
|
295
289
|
columnType: ColumnType.DATA,
|
|
296
290
|
label: t('customerShortcode'),
|
|
297
291
|
width: '150px',
|
|
298
|
-
isFilterable: true,
|
|
299
292
|
},
|
|
300
293
|
startDate: {
|
|
301
294
|
columnType: ColumnType.DATA,
|
|
@@ -305,7 +298,6 @@ export const WfoSearchPocPage = () => {
|
|
|
305
298
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
306
299
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
307
300
|
renderTooltip: (cellValue) => cellValue?.toString(),
|
|
308
|
-
isFilterable: true,
|
|
309
301
|
},
|
|
310
302
|
endDate: {
|
|
311
303
|
columnType: ColumnType.DATA,
|
|
@@ -315,7 +307,6 @@ export const WfoSearchPocPage = () => {
|
|
|
315
307
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
316
308
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
317
309
|
renderTooltip: (cellValue) => cellValue?.toString(),
|
|
318
|
-
isFilterable: true,
|
|
319
310
|
},
|
|
320
311
|
note: {
|
|
321
312
|
columnType: ColumnType.DATA,
|
|
@@ -332,7 +323,6 @@ export const WfoSearchPocPage = () => {
|
|
|
332
323
|
/>
|
|
333
324
|
);
|
|
334
325
|
},
|
|
335
|
-
isFilterable: true,
|
|
336
326
|
},
|
|
337
327
|
metadata: {
|
|
338
328
|
columnType: ColumnType.DATA,
|
|
@@ -341,10 +331,18 @@ export const WfoSearchPocPage = () => {
|
|
|
341
331
|
renderData: (value) => <WfoInlineJson data={value} />,
|
|
342
332
|
renderDetails: (value) => value && <WfoJsonCodeBlock data={value} isBasicStyle />,
|
|
343
333
|
renderTooltip: (value) => value && <WfoJsonCodeBlock data={value} isBasicStyle={false} />,
|
|
344
|
-
isFilterable: true,
|
|
345
334
|
},
|
|
346
335
|
};
|
|
347
336
|
|
|
337
|
+
const sortableAndFilterableFieldNames = Object.keys(tableColumnConfig).filter((fieldName) => fieldName !== 'actions');
|
|
338
|
+
const isSortingAllowed = queryText === '';
|
|
339
|
+
const tableColumnConfigWithSortingAndFiltering =
|
|
340
|
+
mapSortableAndFilterableValuesToTableColumnConfig<SubscriptionListItem>(
|
|
341
|
+
tableColumnConfig,
|
|
342
|
+
isSortingAllowed ? sortableAndFilterableFieldNames : [],
|
|
343
|
+
sortableAndFilterableFieldNames,
|
|
344
|
+
);
|
|
345
|
+
|
|
348
346
|
const handleApplyFilter = (searchParams?: SearchParams) => {
|
|
349
347
|
const ruleGroupParam = searchParams?.ruleGroup;
|
|
350
348
|
// Use an explicitly passed rule group when provided (e.g. a column-header search), a cleared filter
|
|
@@ -382,7 +380,6 @@ export const WfoSearchPocPage = () => {
|
|
|
382
380
|
|
|
383
381
|
const handleChangeTab = (updatedTab: WfoSubscriptionListTab) => {
|
|
384
382
|
setActiveTab(updatedTab);
|
|
385
|
-
setLimit(pageSize);
|
|
386
383
|
setPageCursor(undefined);
|
|
387
384
|
};
|
|
388
385
|
|
|
@@ -468,7 +465,7 @@ export const WfoSearchPocPage = () => {
|
|
|
468
465
|
const nextPageCursor = data?.page_info?.next_page_cursor ?? undefined;
|
|
469
466
|
|
|
470
467
|
const exportData = async () => {
|
|
471
|
-
const exportResult = await getSubscriptionListForExport();
|
|
468
|
+
const exportResult = await getSubscriptionListForExport(totalItems || pageSize);
|
|
472
469
|
const { items: exportItems } = getDataFromResponse<SubscriptionListItem>(
|
|
473
470
|
exportResult,
|
|
474
471
|
resultColumToPropertyMap,
|
|
@@ -489,7 +486,14 @@ export const WfoSearchPocPage = () => {
|
|
|
489
486
|
|
|
490
487
|
const onUpdateDataSorting = ({ field, sortOrder }: WfoDataSorting<SubscriptionListItem>) => {
|
|
491
488
|
setDataSorting({ field, sortOrder });
|
|
492
|
-
|
|
489
|
+
setPageCursor(undefined);
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
const onUpdatePageSize = (updatedPageSize: number) => {
|
|
493
|
+
if (updatedPageSize === pageSize) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
setPageSize(updatedPageSize);
|
|
493
497
|
setPageCursor(undefined);
|
|
494
498
|
};
|
|
495
499
|
|
|
@@ -508,6 +512,7 @@ export const WfoSearchPocPage = () => {
|
|
|
508
512
|
rowExpandingConfiguration={rowExpandingConfiguration}
|
|
509
513
|
defaultHiddenColumns={tableDefaults?.hiddenColumns}
|
|
510
514
|
defaultShowMatchDetails={tableDefaults?.showMatchDetails}
|
|
515
|
+
defaultAdvancedNestedSearch={tableDefaults?.advancedNestedSearch}
|
|
511
516
|
filterString={filterString}
|
|
512
517
|
handleSearch={handleApplyFilter}
|
|
513
518
|
isLoading={isFetching}
|
|
@@ -523,11 +528,11 @@ export const WfoSearchPocPage = () => {
|
|
|
523
528
|
queryBuilderRuleGroup={queryBuilderRuleGroup}
|
|
524
529
|
queryText={queryText}
|
|
525
530
|
retrieverType={retrieverType}
|
|
526
|
-
tableColumnConfig={
|
|
531
|
+
tableColumnConfig={tableColumnConfigWithSortingAndFiltering}
|
|
527
532
|
getColumnSearchFieldName={(field) => getKeyByValueFromMap(resultColumToPropertyMap, field)}
|
|
528
533
|
pageSize={pageSize}
|
|
529
534
|
onUpdateDataSorting={onUpdateDataSorting}
|
|
530
|
-
setPageSize={
|
|
535
|
+
setPageSize={onUpdatePageSize}
|
|
531
536
|
totalItems={totalItems}
|
|
532
537
|
hasNextPage={hasNextPage}
|
|
533
538
|
prefilledFieldOptions={prefilledFieldOptions}
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
|
-
import { EuiButtonIcon, EuiFlexGroup, EuiText, EuiToolTip } from '@elastic/eui';
|
|
5
|
+
import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiToolTip } from '@elastic/eui';
|
|
6
6
|
|
|
7
|
-
import { useGetOrchestratorConfig } from '@/hooks';
|
|
7
|
+
import { useGetOrchestratorConfig, useOrchestratorTheme } from '@/hooks';
|
|
8
8
|
|
|
9
9
|
interface WfoProductInformationWithLinkProps {
|
|
10
10
|
workflowName: string;
|
|
@@ -15,8 +15,10 @@ export const WfoProductInformationWithLink = ({ workflowName, productNames }: Wf
|
|
|
15
15
|
const { workflowInformationLinkUrl, showWorkflowInformationLink } = useGetOrchestratorConfig();
|
|
16
16
|
const t = useTranslations('processes.detail');
|
|
17
17
|
const docsUrl = workflowInformationLinkUrl + workflowName;
|
|
18
|
+
const { theme } = useOrchestratorTheme();
|
|
19
|
+
|
|
18
20
|
return (
|
|
19
|
-
<EuiFlexGroup gutterSize={'s'} alignItems={'center'}>
|
|
21
|
+
<EuiFlexGroup css={{ paddingBottom: theme.size.xs }} gutterSize={'s'} alignItems={'center'}>
|
|
20
22
|
{showWorkflowInformationLink && (
|
|
21
23
|
<EuiToolTip content={t('openWorkflowTaskInfo')}>
|
|
22
24
|
<a href={docsUrl} target="_blank">
|
|
@@ -24,7 +26,10 @@ export const WfoProductInformationWithLink = ({ workflowName, productNames }: Wf
|
|
|
24
26
|
</a>
|
|
25
27
|
</EuiToolTip>
|
|
26
28
|
)}
|
|
27
|
-
<
|
|
29
|
+
<EuiFlexItem>
|
|
30
|
+
<EuiSpacer size={'xs'} />
|
|
31
|
+
<EuiText size="m">{productNames}</EuiText>
|
|
32
|
+
</EuiFlexItem>
|
|
28
33
|
</EuiFlexGroup>
|
|
29
34
|
);
|
|
30
35
|
};
|
package/src/types/search.ts
CHANGED
|
@@ -214,3 +214,11 @@ export type ExportArtifact = {
|
|
|
214
214
|
|
|
215
215
|
export type ResultColumToPropertyMap<T> = Map<string, keyof T>;
|
|
216
216
|
export type FieldToOperatorMap = Map<string, string[]>;
|
|
217
|
+
|
|
218
|
+
export type WfoQueryBuilderContext = {
|
|
219
|
+
onFieldSelected: (field: string, operators: string[], pathInfo?: PathInfo) => void;
|
|
220
|
+
prefilledFieldOptions: FieldToOperatorMap;
|
|
221
|
+
fieldPathInfoMap: Map<string, PathInfo>;
|
|
222
|
+
onValueEditorEnter: () => void;
|
|
223
|
+
useAdvancedNestedSearch: boolean;
|
|
224
|
+
};
|