@orchestrator-ui/orchestrator-ui-components 1.38.2 → 2.0.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 +7 -7
- package/.turbo/turbo-lint.log +5 -2
- package/.turbo/turbo-test.log +12 -12
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +246 -170
- package/dist/index.js +4350 -3504
- package/package.json +1 -1
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +6 -5
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +3 -1
- package/src/components/WfoPageTemplate/WfoSidebar/WfoCopyright.tsx +1 -1
- package/src/components/WfoProcessList/WfoProcessesList.tsx +52 -51
- package/src/components/WfoRadioDropdown/WfoRadioDropdown.tsx +88 -0
- package/src/components/WfoRadioDropdown/index.ts +1 -0
- package/src/components/WfoSubscription/WfoInSyncField.tsx +13 -9
- package/src/components/WfoSubscription/WfoInUseByRelations.tsx +4 -2
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +76 -29
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +50 -56
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +17 -9
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +18 -156
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionDetailSection.tsx +113 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionFixedInputSection.tsx +28 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionMetadataSection.tsx +29 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionProductInfoSection.tsx +55 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/index.ts +4 -0
- package/src/components/WfoSubscription/index.ts +3 -0
- package/src/components/WfoSubscription/overrides/index.ts +1 -0
- package/src/components/WfoSubscription/styles.ts +4 -1
- package/src/components/WfoSubscription/utils/utils.spec.ts +0 -13
- package/src/components/WfoSubscription/utils/utils.ts +18 -5
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +105 -100
- package/src/components/WfoTable/{WfoTableWithFilter/WfoTableWithFilter.tsx → WfoAdvancedTable/WfoAdvancedTable.tsx} +65 -123
- package/src/components/WfoTable/WfoAdvancedTable/getRowDetailData.tsx +55 -0
- package/src/components/WfoTable/WfoAdvancedTable/index.ts +4 -0
- package/src/components/WfoTable/WfoAdvancedTable/toSortedTableColumnConfig.ts +12 -0
- package/src/components/WfoTable/WfoAdvancedTable/types.ts +23 -0
- package/src/components/WfoTable/WfoStatusColorField/WfoStatusColorField.tsx +16 -0
- package/src/components/WfoTable/WfoStatusColorField/index.ts +1 -0
- package/src/components/WfoTable/WfoStatusColorField/styles.ts +20 -0
- package/src/components/WfoTable/WfoTable/WfoExpandedRow.tsx +33 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandableRow.tsx +48 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandedGroupRow.tsx +71 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTable.tsx +100 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTableGroups.tsx +74 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +39 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/useGroupedTableConfig.tsx +184 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts +133 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.ts +41 -0
- package/src/components/WfoTable/WfoTable/WfoMultilineCell.tsx +13 -0
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +201 -0
- package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +112 -0
- package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoSortDirectionIcon.tsx +3 -3
- package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoTableHeaderCell.tsx +4 -3
- package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/index.ts +2 -0
- package/src/components/WfoTable/WfoTable/WfoTableHeaderRow.tsx +114 -0
- package/src/components/WfoTable/WfoTable/WfoTruncateCell.tsx +23 -0
- package/src/components/WfoTable/WfoTable/constants.ts +1 -0
- package/src/components/WfoTable/WfoTable/index.ts +14 -0
- package/src/components/WfoTable/WfoTable/styles.ts +117 -0
- package/src/components/WfoTable/WfoTable/utils.spec.ts +79 -0
- package/src/components/WfoTable/WfoTable/utils.ts +78 -0
- package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +13 -12
- package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -1
- package/src/components/WfoTable/index.ts +4 -5
- package/src/components/WfoTable/utils/columns.ts +1 -48
- package/src/components/WfoTable/utils/tableUtils.ts +13 -10
- package/src/components/WfoTree/WfoTreeBranch.tsx +10 -1
- package/src/components/WfoTree/WfoTreeNode.tsx +8 -57
- package/src/components/WfoTree/WfoTreeNodeListItem.tsx +65 -0
- package/src/components/WfoTree/styles.ts +28 -4
- package/src/components/index.ts +1 -0
- package/src/configuration/policy-resources.ts +1 -0
- package/src/configuration/version.ts +1 -1
- package/src/icons/WfoXMarkSmall.tsx +29 -0
- package/src/messages/en-GB.json +4 -0
- package/src/messages/nl-NL.json +4 -0
- package/src/pages/metadata/WfoProductBlocksPage.tsx +42 -59
- package/src/pages/metadata/WfoProductsPage.tsx +41 -47
- package/src/pages/metadata/WfoResourceTypesPage.tsx +26 -35
- package/src/pages/metadata/WfoTasksPage.tsx +35 -33
- package/src/pages/metadata/WfoWorkflowsPage.tsx +33 -29
- package/src/pages/tasks/WfoTasksListPage.tsx +25 -19
- package/src/utils/getObjectKeys.ts +3 -0
- package/src/utils/index.ts +5 -3
- package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +0 -194
- package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +0 -21
- package/src/components/WfoTable/WfoBasicTable/index.ts +0 -5
- package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx +0 -136
- package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.tsx +0 -146
- package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts +0 -113
- package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.ts +0 -81
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +0 -52
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +0 -23
- /package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/styles.ts +0 -0
|
@@ -2,9 +2,11 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import {
|
|
6
|
+
WfoDataSorting,
|
|
7
|
+
getPageIndexChangeHandler,
|
|
8
|
+
getPageSizeChangeHandler,
|
|
9
|
+
} from '@/components';
|
|
8
10
|
import {
|
|
9
11
|
DEFAULT_PAGE_SIZE,
|
|
10
12
|
DEFAULT_PAGE_SIZES,
|
|
@@ -13,13 +15,14 @@ import {
|
|
|
13
15
|
WfoDateTime,
|
|
14
16
|
WfoProductBlockBadge,
|
|
15
17
|
WfoProductStatusBadge,
|
|
16
|
-
WfoTableWithFilter,
|
|
17
18
|
getDataSortHandler,
|
|
18
|
-
getPageChangeHandler,
|
|
19
19
|
getQueryStringHandler,
|
|
20
20
|
} from '@/components';
|
|
21
|
+
import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable';
|
|
22
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
21
23
|
import { WfoFirstPartUUID } from '@/components/WfoTable/WfoFirstPartUUID';
|
|
22
|
-
import {
|
|
24
|
+
import { ColumnType, Pagination } from '@/components/WfoTable/WfoTable';
|
|
25
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
23
26
|
import {
|
|
24
27
|
useDataDisplayParams,
|
|
25
28
|
useShowToastMessage,
|
|
@@ -43,15 +46,7 @@ import {
|
|
|
43
46
|
|
|
44
47
|
import { WfoMetadataPageLayout } from './WfoMetadataPageLayout';
|
|
45
48
|
|
|
46
|
-
const PRODUCT_FIELD_PRODUCT_ID: keyof ProductDefinition = 'productId';
|
|
47
49
|
const PRODUCT_FIELD_NAME: keyof ProductDefinition = 'name';
|
|
48
|
-
const PRODUCT_FIELD_DESCRIPTION: keyof ProductDefinition = 'description';
|
|
49
|
-
const PRODUCT_FIELD_TAG: keyof ProductDefinition = 'tag';
|
|
50
|
-
const PRODUCT_FIELD_PRODUCT_TYPE: keyof ProductDefinition = 'productType';
|
|
51
|
-
const PRODUCT_FIELD_STATUS: keyof ProductDefinition = 'status';
|
|
52
|
-
const PRODUCT_FIELD_PRODUCT_BLOCKS: keyof ProductDefinition = 'productBlocks';
|
|
53
|
-
const PRODUCT_FIELD_FIXED_INPUTS: keyof ProductDefinition = 'fixedInputs';
|
|
54
|
-
const PRODUCT_FIELD_CREATED_AT: keyof ProductDefinition = 'createdAt';
|
|
55
50
|
|
|
56
51
|
type ProductDefinitionExportItem = Omit<
|
|
57
52
|
ProductDefinition,
|
|
@@ -93,53 +88,53 @@ export const WfoProductsPage = () => {
|
|
|
93
88
|
},
|
|
94
89
|
});
|
|
95
90
|
|
|
96
|
-
const tableColumns:
|
|
91
|
+
const tableColumns: WfoAdvancedTableColumnConfig<ProductDefinition> = {
|
|
97
92
|
productId: {
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
columnType: ColumnType.DATA,
|
|
94
|
+
label: t('id'),
|
|
100
95
|
width: '90',
|
|
101
|
-
|
|
96
|
+
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
102
97
|
renderDetails: (value) => value,
|
|
103
98
|
},
|
|
104
99
|
name: {
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
columnType: ColumnType.DATA,
|
|
101
|
+
label: t('name'),
|
|
107
102
|
width: '200',
|
|
108
|
-
|
|
103
|
+
renderData: (name) => (
|
|
109
104
|
<WfoProductBlockBadge badgeType={BadgeType.PRODUCT}>
|
|
110
105
|
{name}
|
|
111
106
|
</WfoProductBlockBadge>
|
|
112
107
|
),
|
|
113
108
|
},
|
|
114
109
|
tag: {
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
columnType: ColumnType.DATA,
|
|
111
|
+
label: t('tag'),
|
|
117
112
|
width: '120',
|
|
118
|
-
|
|
113
|
+
renderData: (value) => (
|
|
119
114
|
<WfoProductBlockBadge badgeType={BadgeType.PRODUCT_TAG}>
|
|
120
115
|
{value}
|
|
121
116
|
</WfoProductBlockBadge>
|
|
122
117
|
),
|
|
123
118
|
},
|
|
124
119
|
description: {
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
columnType: ColumnType.DATA,
|
|
121
|
+
label: t('description'),
|
|
127
122
|
width: '400',
|
|
128
123
|
},
|
|
129
124
|
productType: {
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
columnType: ColumnType.DATA,
|
|
126
|
+
label: t('productType'),
|
|
132
127
|
},
|
|
133
128
|
status: {
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
columnType: ColumnType.DATA,
|
|
130
|
+
label: t('status'),
|
|
136
131
|
width: '90',
|
|
137
|
-
|
|
132
|
+
renderData: (value) => <WfoProductStatusBadge status={value} />,
|
|
138
133
|
},
|
|
139
134
|
fixedInputs: {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
columnType: ColumnType.DATA,
|
|
136
|
+
label: t('fixedInputs'),
|
|
137
|
+
renderData: (fixedInputs) => (
|
|
143
138
|
<>
|
|
144
139
|
{fixedInputs.map((fixedInput, index) => (
|
|
145
140
|
<WfoProductBlockBadge
|
|
@@ -153,9 +148,9 @@ export const WfoProductsPage = () => {
|
|
|
153
148
|
),
|
|
154
149
|
},
|
|
155
150
|
productBlocks: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
columnType: ColumnType.DATA,
|
|
152
|
+
label: t('productBlocks'),
|
|
153
|
+
renderData: (productBlocks) => (
|
|
159
154
|
<>
|
|
160
155
|
{productBlocks.map((block, index) => (
|
|
161
156
|
<WfoProductBlockBadge
|
|
@@ -169,9 +164,9 @@ export const WfoProductsPage = () => {
|
|
|
169
164
|
),
|
|
170
165
|
},
|
|
171
166
|
createdAt: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
columnType: ColumnType.DATA,
|
|
168
|
+
label: t('createdAt'),
|
|
169
|
+
renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
|
|
175
170
|
renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
|
|
176
171
|
clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
|
|
177
172
|
},
|
|
@@ -201,6 +196,8 @@ export const WfoProductsPage = () => {
|
|
|
201
196
|
pageIndex: pageIndex,
|
|
202
197
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
203
198
|
totalItemCount: totalItems ? totalItems : 0,
|
|
199
|
+
onChangePage: getPageIndexChangeHandler(setDataDisplayParam),
|
|
200
|
+
onChangeItemsPerPage: getPageSizeChangeHandler(setDataDisplayParam),
|
|
204
201
|
};
|
|
205
202
|
|
|
206
203
|
const dataSorting: WfoDataSorting<ProductDefinition> = {
|
|
@@ -240,19 +237,16 @@ export const WfoProductsPage = () => {
|
|
|
240
237
|
|
|
241
238
|
return (
|
|
242
239
|
<WfoMetadataPageLayout>
|
|
243
|
-
<
|
|
240
|
+
<WfoAdvancedTable
|
|
244
241
|
data={data?.products ?? []}
|
|
245
|
-
|
|
242
|
+
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
246
243
|
tableColumns,
|
|
247
244
|
sortFields,
|
|
248
245
|
filterFields,
|
|
249
246
|
)}
|
|
250
|
-
dataSorting={dataSorting}
|
|
247
|
+
dataSorting={[dataSorting]}
|
|
251
248
|
defaultHiddenColumns={tableDefaults?.hiddenColumns}
|
|
252
|
-
|
|
253
|
-
setDataDisplayParam,
|
|
254
|
-
)}
|
|
255
|
-
onUpdatePage={getPageChangeHandler<ProductDefinition>(
|
|
249
|
+
onUpdateDataSorting={getDataSortHandler<ProductDefinition>(
|
|
256
250
|
setDataDisplayParam,
|
|
257
251
|
)}
|
|
258
252
|
onUpdateQueryString={getQueryStringHandler<ProductDefinition>(
|
|
@@ -3,23 +3,23 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
5
|
import { EuiBadgeGroup } from '@elastic/eui';
|
|
6
|
-
import type { Pagination } from '@elastic/eui/src/components';
|
|
7
6
|
|
|
8
7
|
import {
|
|
9
8
|
DEFAULT_PAGE_SIZE,
|
|
10
9
|
DEFAULT_PAGE_SIZES,
|
|
11
10
|
METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY,
|
|
12
11
|
WfoProductBlockBadge,
|
|
13
|
-
WfoTableWithFilter,
|
|
14
12
|
getDataSortHandler,
|
|
15
|
-
|
|
13
|
+
getPageIndexChangeHandler,
|
|
14
|
+
getPageSizeChangeHandler,
|
|
16
15
|
getQueryStringHandler,
|
|
17
16
|
} from '@/components';
|
|
18
|
-
import type {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from '@/components';
|
|
17
|
+
import type { StoredTableConfig, WfoDataSorting } from '@/components';
|
|
18
|
+
import { WfoFirstPartUUID } from '@/components';
|
|
19
|
+
import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable';
|
|
20
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
21
|
+
import { ColumnType, Pagination } from '@/components/WfoTable/WfoTable';
|
|
22
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
23
23
|
import {
|
|
24
24
|
useDataDisplayParams,
|
|
25
25
|
useShowToastMessage,
|
|
@@ -43,18 +43,10 @@ import {
|
|
|
43
43
|
getCsvFileNameWithDate,
|
|
44
44
|
} from '@/utils/csvDownload';
|
|
45
45
|
|
|
46
|
-
import { WfoFirstPartUUID } from '../../components/WfoTable/WfoFirstPartUUID';
|
|
47
|
-
import { mapSortableAndFilterableValuesToTableColumnConfig } from '../../components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig';
|
|
48
46
|
import { WfoMetadataPageLayout } from './WfoMetadataPageLayout';
|
|
49
47
|
|
|
50
|
-
export const RESOURCE_TYPE_FIELD_ID: keyof ResourceTypeDefinition =
|
|
51
|
-
'resourceTypeId';
|
|
52
48
|
export const RESOURCE_TYPE_FIELD_TYPE: keyof ResourceTypeDefinition =
|
|
53
49
|
'resourceType';
|
|
54
|
-
export const RESOURCE_TYPE_FIELD_DESCRIPTION: keyof ResourceTypeDefinition =
|
|
55
|
-
'description';
|
|
56
|
-
export const RESOURCE_TYPE_FIELD_PRODUCT_BLOCKS: keyof ResourceTypeDefinition =
|
|
57
|
-
'productBlocks';
|
|
58
50
|
|
|
59
51
|
type ResourceTypeExportItem = Omit<ResourceTypeDefinition, 'productBlocks'> & {
|
|
60
52
|
productBlocks: string;
|
|
@@ -92,32 +84,32 @@ export const WfoResourceTypesPage = () => {
|
|
|
92
84
|
},
|
|
93
85
|
});
|
|
94
86
|
|
|
95
|
-
const tableColumns:
|
|
87
|
+
const tableColumns: WfoAdvancedTableColumnConfig<ResourceTypeDefinition> = {
|
|
96
88
|
resourceTypeId: {
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
columnType: ColumnType.DATA,
|
|
90
|
+
label: t('resourceId'),
|
|
99
91
|
width: '90',
|
|
100
|
-
|
|
92
|
+
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
101
93
|
renderDetails: (value) => value,
|
|
102
94
|
},
|
|
103
95
|
resourceType: {
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
columnType: ColumnType.DATA,
|
|
97
|
+
label: t('type'),
|
|
106
98
|
width: '200',
|
|
107
|
-
|
|
99
|
+
renderData: (value) => (
|
|
108
100
|
<WfoProductBlockBadge badgeType={BadgeType.RESOURCE_TYPE}>
|
|
109
101
|
{value}
|
|
110
102
|
</WfoProductBlockBadge>
|
|
111
103
|
),
|
|
112
104
|
},
|
|
113
105
|
description: {
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
columnType: ColumnType.DATA,
|
|
107
|
+
label: t('description'),
|
|
116
108
|
},
|
|
117
109
|
productBlocks: {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
columnType: ColumnType.DATA,
|
|
111
|
+
label: t('usedInProductBlocks'),
|
|
112
|
+
renderData: (productBlocks) => (
|
|
121
113
|
<>
|
|
122
114
|
{productBlocks.map((productBlock, index) => (
|
|
123
115
|
<WfoProductBlockBadge
|
|
@@ -176,6 +168,8 @@ export const WfoResourceTypesPage = () => {
|
|
|
176
168
|
pageIndex: pageIndex,
|
|
177
169
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
178
170
|
totalItemCount: totalItems ? totalItems : 0,
|
|
171
|
+
onChangePage: getPageIndexChangeHandler(setDataDisplayParam),
|
|
172
|
+
onChangeItemsPerPage: getPageSizeChangeHandler(setDataDisplayParam),
|
|
179
173
|
};
|
|
180
174
|
const mapToExportItems = (
|
|
181
175
|
resourceTypesResponse: ResourceTypesResponse,
|
|
@@ -191,19 +185,16 @@ export const WfoResourceTypesPage = () => {
|
|
|
191
185
|
};
|
|
192
186
|
return (
|
|
193
187
|
<WfoMetadataPageLayout>
|
|
194
|
-
<
|
|
188
|
+
<WfoAdvancedTable
|
|
195
189
|
data={data ? data.resourceTypes : []}
|
|
196
|
-
|
|
190
|
+
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
197
191
|
tableColumns,
|
|
198
192
|
sortFields,
|
|
199
193
|
filterFields,
|
|
200
194
|
)}
|
|
201
|
-
dataSorting={dataSorting}
|
|
195
|
+
dataSorting={[dataSorting]}
|
|
202
196
|
defaultHiddenColumns={tableDefaults?.hiddenColumns}
|
|
203
|
-
|
|
204
|
-
setDataDisplayParam,
|
|
205
|
-
)}
|
|
206
|
-
onUpdatePage={getPageChangeHandler<ResourceTypeDefinition>(
|
|
197
|
+
onUpdateDataSorting={getDataSortHandler<ResourceTypeDefinition>(
|
|
207
198
|
setDataDisplayParam,
|
|
208
199
|
)}
|
|
209
200
|
onUpdateQueryString={getQueryStringHandler<ResourceTypeDefinition>(
|
|
@@ -3,10 +3,13 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
5
|
import { EuiBadgeGroup } from '@elastic/eui';
|
|
6
|
-
import type { Pagination } from '@elastic/eui/src/components';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import {
|
|
8
|
+
WfoWorkflowTargetBadge,
|
|
9
|
+
getPageIndexChangeHandler,
|
|
10
|
+
getPageSizeChangeHandler,
|
|
11
|
+
} from '@/components';
|
|
12
|
+
import type { WfoDataSorting } from '@/components';
|
|
10
13
|
import { StoredTableConfig } from '@/components';
|
|
11
14
|
import {
|
|
12
15
|
DEFAULT_PAGE_SIZE,
|
|
@@ -14,13 +17,15 @@ import {
|
|
|
14
17
|
METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY,
|
|
15
18
|
WfoProductBlockBadge,
|
|
16
19
|
} from '@/components';
|
|
17
|
-
import {
|
|
18
|
-
getDataSortHandler,
|
|
19
|
-
getPageChangeHandler,
|
|
20
|
-
getQueryStringHandler,
|
|
21
|
-
} from '@/components';
|
|
20
|
+
import { getDataSortHandler, getQueryStringHandler } from '@/components';
|
|
22
21
|
import { WfoDateTime } from '@/components/WfoDateTime/WfoDateTime';
|
|
23
|
-
import {
|
|
22
|
+
import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable';
|
|
23
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
24
|
+
import {
|
|
25
|
+
ColumnType,
|
|
26
|
+
Pagination,
|
|
27
|
+
} from '@/components/WfoTable/WfoTable/WfoTable';
|
|
28
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
24
29
|
import {
|
|
25
30
|
useDataDisplayParams,
|
|
26
31
|
useShowToastMessage,
|
|
@@ -91,33 +96,31 @@ export const WfoTasksPage = () => {
|
|
|
91
96
|
},
|
|
92
97
|
});
|
|
93
98
|
|
|
94
|
-
const tableColumns:
|
|
99
|
+
const tableColumns: WfoAdvancedTableColumnConfig<TaskListItem> = {
|
|
95
100
|
name: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
render: (name) => (
|
|
101
|
+
columnType: ColumnType.DATA,
|
|
102
|
+
label: t('name'),
|
|
103
|
+
renderData: (name) => (
|
|
100
104
|
<WfoProductBlockBadge badgeType={BadgeType.TASK}>
|
|
101
105
|
{name}
|
|
102
106
|
</WfoProductBlockBadge>
|
|
103
107
|
),
|
|
104
108
|
},
|
|
105
109
|
description: {
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
columnType: ColumnType.DATA,
|
|
111
|
+
label: t('description'),
|
|
108
112
|
width: '40%',
|
|
109
113
|
},
|
|
110
114
|
target: {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
render: (target) => <WfoWorkflowTargetBadge target={target} />,
|
|
115
|
+
columnType: ColumnType.DATA,
|
|
116
|
+
label: t('target'),
|
|
117
|
+
renderData: (target) => <WfoWorkflowTargetBadge target={target} />,
|
|
115
118
|
},
|
|
116
119
|
productTags: {
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
columnType: ColumnType.DATA,
|
|
121
|
+
label: t('productTags'),
|
|
119
122
|
width: '20%',
|
|
120
|
-
|
|
123
|
+
renderData: (productTags) => (
|
|
121
124
|
<>
|
|
122
125
|
{productTags
|
|
123
126
|
?.filter(onlyUnique)
|
|
@@ -147,10 +150,10 @@ export const WfoTasksPage = () => {
|
|
|
147
150
|
),
|
|
148
151
|
},
|
|
149
152
|
createdAt: {
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
columnType: ColumnType.DATA,
|
|
154
|
+
label: t('createdAt'),
|
|
152
155
|
width: '15%',
|
|
153
|
-
|
|
156
|
+
renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
|
|
154
157
|
renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
|
|
155
158
|
clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
|
|
156
159
|
},
|
|
@@ -188,6 +191,8 @@ export const WfoTasksPage = () => {
|
|
|
188
191
|
pageIndex: pageIndex,
|
|
189
192
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
190
193
|
totalItemCount: totalItems ? totalItems : 0,
|
|
194
|
+
onChangePage: getPageIndexChangeHandler(setDataDisplayParam),
|
|
195
|
+
onChangeItemsPerPage: getPageSizeChangeHandler(setDataDisplayParam),
|
|
191
196
|
};
|
|
192
197
|
|
|
193
198
|
const mapToExportItems = (
|
|
@@ -212,19 +217,16 @@ export const WfoTasksPage = () => {
|
|
|
212
217
|
|
|
213
218
|
return (
|
|
214
219
|
<WfoMetadataPageLayout>
|
|
215
|
-
<
|
|
220
|
+
<WfoAdvancedTable
|
|
216
221
|
data={data ? mapTaskDefinitionToTaskListItem(data.tasks) : []}
|
|
217
|
-
|
|
222
|
+
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
218
223
|
tableColumns,
|
|
219
224
|
sortFields,
|
|
220
225
|
filterFields,
|
|
221
226
|
)}
|
|
222
|
-
dataSorting={dataSorting}
|
|
227
|
+
dataSorting={[dataSorting]}
|
|
223
228
|
defaultHiddenColumns={tableDefaults?.hiddenColumns}
|
|
224
|
-
|
|
225
|
-
setDataDisplayParam,
|
|
226
|
-
)}
|
|
227
|
-
onUpdatePage={getPageChangeHandler<TaskListItem>(
|
|
229
|
+
onUpdateDataSorting={getDataSortHandler<TaskListItem>(
|
|
228
230
|
setDataDisplayParam,
|
|
229
231
|
)}
|
|
230
232
|
onUpdateQueryString={getQueryStringHandler<TaskListItem>(
|
|
@@ -3,9 +3,12 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
5
|
import { EuiBadgeGroup } from '@elastic/eui';
|
|
6
|
-
import type { Pagination } from '@elastic/eui/src/components';
|
|
7
6
|
|
|
8
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
WfoDataSorting,
|
|
9
|
+
getPageIndexChangeHandler,
|
|
10
|
+
getPageSizeChangeHandler,
|
|
11
|
+
} from '@/components';
|
|
9
12
|
import {
|
|
10
13
|
DEFAULT_PAGE_SIZE,
|
|
11
14
|
DEFAULT_PAGE_SIZES,
|
|
@@ -13,12 +16,17 @@ import {
|
|
|
13
16
|
StoredTableConfig,
|
|
14
17
|
WfoDateTime,
|
|
15
18
|
WfoProductBlockBadge,
|
|
16
|
-
WfoTableWithFilter,
|
|
17
19
|
WfoWorkflowTargetBadge,
|
|
18
20
|
getDataSortHandler,
|
|
19
|
-
getPageChangeHandler,
|
|
20
21
|
getQueryStringHandler,
|
|
21
22
|
} from '@/components';
|
|
23
|
+
import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable';
|
|
24
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
25
|
+
import {
|
|
26
|
+
ColumnType,
|
|
27
|
+
Pagination,
|
|
28
|
+
} from '@/components/WfoTable/WfoTable/WfoTable';
|
|
29
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
22
30
|
import {
|
|
23
31
|
useDataDisplayParams,
|
|
24
32
|
useShowToastMessage,
|
|
@@ -44,7 +52,6 @@ import {
|
|
|
44
52
|
getCsvFileNameWithDate,
|
|
45
53
|
} from '@/utils/csvDownload';
|
|
46
54
|
|
|
47
|
-
import { mapSortableAndFilterableValuesToTableColumnConfig } from '../../components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig';
|
|
48
55
|
import { WfoMetadataPageLayout } from './WfoMetadataPageLayout';
|
|
49
56
|
import {
|
|
50
57
|
graphQlWorkflowListMapper,
|
|
@@ -95,33 +102,31 @@ export const WfoWorkflowsPage = () => {
|
|
|
95
102
|
},
|
|
96
103
|
});
|
|
97
104
|
|
|
98
|
-
const tableColumns:
|
|
105
|
+
const tableColumns: WfoAdvancedTableColumnConfig<WorkflowListItem> = {
|
|
99
106
|
name: {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
render: (name) => (
|
|
107
|
+
columnType: ColumnType.DATA,
|
|
108
|
+
label: t('name'),
|
|
109
|
+
renderData: (name) => (
|
|
104
110
|
<WfoProductBlockBadge badgeType={BadgeType.WORKFLOW}>
|
|
105
111
|
{name}
|
|
106
112
|
</WfoProductBlockBadge>
|
|
107
113
|
),
|
|
108
114
|
},
|
|
109
115
|
description: {
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
columnType: ColumnType.DATA,
|
|
117
|
+
label: t('description'),
|
|
112
118
|
width: '40%',
|
|
113
119
|
},
|
|
114
120
|
target: {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
render: (target) => <WfoWorkflowTargetBadge target={target} />,
|
|
121
|
+
columnType: ColumnType.DATA,
|
|
122
|
+
label: t('target'),
|
|
123
|
+
renderData: (target) => <WfoWorkflowTargetBadge target={target} />,
|
|
119
124
|
},
|
|
120
125
|
productTags: {
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
columnType: ColumnType.DATA,
|
|
127
|
+
label: t('productTags'),
|
|
123
128
|
width: '20%',
|
|
124
|
-
|
|
129
|
+
renderData: (productTags) => (
|
|
125
130
|
<>
|
|
126
131
|
{productTags
|
|
127
132
|
?.filter(onlyUnique)
|
|
@@ -151,10 +156,10 @@ export const WfoWorkflowsPage = () => {
|
|
|
151
156
|
),
|
|
152
157
|
},
|
|
153
158
|
createdAt: {
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
columnType: ColumnType.DATA,
|
|
160
|
+
label: t('createdAt'),
|
|
156
161
|
width: '15%',
|
|
157
|
-
|
|
162
|
+
renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
|
|
158
163
|
renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
|
|
159
164
|
clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
|
|
160
165
|
},
|
|
@@ -193,6 +198,8 @@ export const WfoWorkflowsPage = () => {
|
|
|
193
198
|
pageIndex: pageIndex,
|
|
194
199
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
195
200
|
totalItemCount: totalItems ? totalItems : 0,
|
|
201
|
+
onChangePage: getPageIndexChangeHandler(setDataDisplayParam),
|
|
202
|
+
onChangeItemsPerPage: getPageSizeChangeHandler(setDataDisplayParam),
|
|
196
203
|
};
|
|
197
204
|
|
|
198
205
|
const mapToExportItems = (
|
|
@@ -212,7 +219,7 @@ export const WfoWorkflowsPage = () => {
|
|
|
212
219
|
|
|
213
220
|
return (
|
|
214
221
|
<WfoMetadataPageLayout>
|
|
215
|
-
<
|
|
222
|
+
<WfoAdvancedTable
|
|
216
223
|
data={
|
|
217
224
|
data
|
|
218
225
|
? mapWorkflowDefinitionToWorkflowListItem(
|
|
@@ -220,17 +227,14 @@ export const WfoWorkflowsPage = () => {
|
|
|
220
227
|
)
|
|
221
228
|
: []
|
|
222
229
|
}
|
|
223
|
-
|
|
230
|
+
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
224
231
|
tableColumns,
|
|
225
232
|
sortFields,
|
|
226
233
|
filterFields,
|
|
227
234
|
)}
|
|
228
|
-
dataSorting={dataSorting}
|
|
235
|
+
dataSorting={[dataSorting]}
|
|
229
236
|
defaultHiddenColumns={tableDefaults?.hiddenColumns}
|
|
230
|
-
|
|
231
|
-
setDataDisplayParam,
|
|
232
|
-
)}
|
|
233
|
-
onUpdatePage={getPageChangeHandler<WorkflowListItem>(
|
|
237
|
+
onUpdateDataSorting={getDataSortHandler<WorkflowListItem>(
|
|
234
238
|
setDataDisplayParam,
|
|
235
239
|
)}
|
|
236
240
|
onUpdateQueryString={getQueryStringHandler<WorkflowListItem>(
|
|
@@ -10,12 +10,12 @@ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
|
|
|
10
10
|
import {
|
|
11
11
|
ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY,
|
|
12
12
|
COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY,
|
|
13
|
+
ColumnType,
|
|
13
14
|
DEFAULT_PAGE_SIZE,
|
|
14
15
|
StoredTableConfig,
|
|
15
16
|
WfoFilterTabs,
|
|
16
17
|
WfoIsAllowedToRender,
|
|
17
18
|
WfoStartTaskButtonComboBox,
|
|
18
|
-
WfoTableColumns,
|
|
19
19
|
} from '@/components';
|
|
20
20
|
import { PATH_TASKS } from '@/components';
|
|
21
21
|
import {
|
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
WfoProcessesList,
|
|
24
24
|
WfoTitleWithWebsocketBadge,
|
|
25
25
|
} from '@/components';
|
|
26
|
+
import { toSortedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/';
|
|
27
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
26
28
|
import { PolicyResource } from '@/configuration/policy-resources';
|
|
27
29
|
import { ConfirmationDialogContext } from '@/contexts';
|
|
28
30
|
import {
|
|
@@ -111,28 +113,32 @@ export const WfoTasksListPage = () => {
|
|
|
111
113
|
|
|
112
114
|
// Changing the order of the keys, resulting in an updated column order in the table
|
|
113
115
|
const handleOverrideTableColumns: (
|
|
114
|
-
defaultTableColumns:
|
|
115
|
-
) =>
|
|
116
|
+
defaultTableColumns: WfoAdvancedTableColumnConfig<ProcessListItem>,
|
|
117
|
+
) => WfoAdvancedTableColumnConfig<ProcessListItem> = (
|
|
118
|
+
defaultTableColumns,
|
|
119
|
+
) => ({
|
|
116
120
|
workflowName: {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
columnType: ColumnType.DATA,
|
|
122
|
+
label: t('taskName'),
|
|
123
|
+
renderData: (value, { processId }) => (
|
|
120
124
|
<Link href={`${PATH_TASKS}/${processId}`}>{value}</Link>
|
|
121
125
|
),
|
|
122
126
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
...toSortedTableColumnConfig(defaultTableColumns, [
|
|
128
|
+
'lastStep',
|
|
129
|
+
'lastStatus',
|
|
130
|
+
'workflowTarget',
|
|
131
|
+
'tag',
|
|
132
|
+
'productName',
|
|
133
|
+
'customer',
|
|
134
|
+
'customerAbbreviation',
|
|
135
|
+
'subscriptions',
|
|
136
|
+
'createdBy',
|
|
137
|
+
'assignee',
|
|
138
|
+
'processId',
|
|
139
|
+
'startedAt',
|
|
140
|
+
'lastModifiedAt',
|
|
141
|
+
]),
|
|
136
142
|
});
|
|
137
143
|
|
|
138
144
|
return (
|