@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.
Files changed (93) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/.turbo/turbo-lint.log +5 -2
  3. package/.turbo/turbo-test.log +12 -12
  4. package/CHANGELOG.md +18 -0
  5. package/dist/index.d.ts +246 -170
  6. package/dist/index.js +4350 -3504
  7. package/package.json +1 -1
  8. package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +6 -5
  9. package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +3 -1
  10. package/src/components/WfoPageTemplate/WfoSidebar/WfoCopyright.tsx +1 -1
  11. package/src/components/WfoProcessList/WfoProcessesList.tsx +52 -51
  12. package/src/components/WfoRadioDropdown/WfoRadioDropdown.tsx +88 -0
  13. package/src/components/WfoRadioDropdown/index.ts +1 -0
  14. package/src/components/WfoSubscription/WfoInSyncField.tsx +13 -9
  15. package/src/components/WfoSubscription/WfoInUseByRelations.tsx +4 -2
  16. package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +76 -29
  17. package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +50 -56
  18. package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +17 -9
  19. package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +18 -156
  20. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionDetailSection.tsx +113 -0
  21. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionFixedInputSection.tsx +28 -0
  22. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionMetadataSection.tsx +29 -0
  23. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionProductInfoSection.tsx +55 -0
  24. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/index.ts +4 -0
  25. package/src/components/WfoSubscription/index.ts +3 -0
  26. package/src/components/WfoSubscription/overrides/index.ts +1 -0
  27. package/src/components/WfoSubscription/styles.ts +4 -1
  28. package/src/components/WfoSubscription/utils/utils.spec.ts +0 -13
  29. package/src/components/WfoSubscription/utils/utils.ts +18 -5
  30. package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +105 -100
  31. package/src/components/WfoTable/{WfoTableWithFilter/WfoTableWithFilter.tsx → WfoAdvancedTable/WfoAdvancedTable.tsx} +65 -123
  32. package/src/components/WfoTable/WfoAdvancedTable/getRowDetailData.tsx +55 -0
  33. package/src/components/WfoTable/WfoAdvancedTable/index.ts +4 -0
  34. package/src/components/WfoTable/WfoAdvancedTable/toSortedTableColumnConfig.ts +12 -0
  35. package/src/components/WfoTable/WfoAdvancedTable/types.ts +23 -0
  36. package/src/components/WfoTable/WfoStatusColorField/WfoStatusColorField.tsx +16 -0
  37. package/src/components/WfoTable/WfoStatusColorField/index.ts +1 -0
  38. package/src/components/WfoTable/WfoStatusColorField/styles.ts +20 -0
  39. package/src/components/WfoTable/WfoTable/WfoExpandedRow.tsx +33 -0
  40. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandableRow.tsx +48 -0
  41. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandedGroupRow.tsx +71 -0
  42. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTable.tsx +100 -0
  43. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTableGroups.tsx +74 -0
  44. package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +39 -0
  45. package/src/components/WfoTable/WfoTable/WfoGroupedTable/useGroupedTableConfig.tsx +184 -0
  46. package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts +133 -0
  47. package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.ts +41 -0
  48. package/src/components/WfoTable/WfoTable/WfoMultilineCell.tsx +13 -0
  49. package/src/components/WfoTable/WfoTable/WfoTable.tsx +201 -0
  50. package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +112 -0
  51. package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoSortDirectionIcon.tsx +3 -3
  52. package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoTableHeaderCell.tsx +4 -3
  53. package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/index.ts +2 -0
  54. package/src/components/WfoTable/WfoTable/WfoTableHeaderRow.tsx +114 -0
  55. package/src/components/WfoTable/WfoTable/WfoTruncateCell.tsx +23 -0
  56. package/src/components/WfoTable/WfoTable/constants.ts +1 -0
  57. package/src/components/WfoTable/WfoTable/index.ts +14 -0
  58. package/src/components/WfoTable/WfoTable/styles.ts +117 -0
  59. package/src/components/WfoTable/WfoTable/utils.spec.ts +79 -0
  60. package/src/components/WfoTable/WfoTable/utils.ts +78 -0
  61. package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +13 -12
  62. package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -1
  63. package/src/components/WfoTable/index.ts +4 -5
  64. package/src/components/WfoTable/utils/columns.ts +1 -48
  65. package/src/components/WfoTable/utils/tableUtils.ts +13 -10
  66. package/src/components/WfoTree/WfoTreeBranch.tsx +10 -1
  67. package/src/components/WfoTree/WfoTreeNode.tsx +8 -57
  68. package/src/components/WfoTree/WfoTreeNodeListItem.tsx +65 -0
  69. package/src/components/WfoTree/styles.ts +28 -4
  70. package/src/components/index.ts +1 -0
  71. package/src/configuration/policy-resources.ts +1 -0
  72. package/src/configuration/version.ts +1 -1
  73. package/src/icons/WfoXMarkSmall.tsx +29 -0
  74. package/src/messages/en-GB.json +4 -0
  75. package/src/messages/nl-NL.json +4 -0
  76. package/src/pages/metadata/WfoProductBlocksPage.tsx +42 -59
  77. package/src/pages/metadata/WfoProductsPage.tsx +41 -47
  78. package/src/pages/metadata/WfoResourceTypesPage.tsx +26 -35
  79. package/src/pages/metadata/WfoTasksPage.tsx +35 -33
  80. package/src/pages/metadata/WfoWorkflowsPage.tsx +33 -29
  81. package/src/pages/tasks/WfoTasksListPage.tsx +25 -19
  82. package/src/utils/getObjectKeys.ts +3 -0
  83. package/src/utils/index.ts +5 -3
  84. package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +0 -194
  85. package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +0 -21
  86. package/src/components/WfoTable/WfoBasicTable/index.ts +0 -5
  87. package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx +0 -136
  88. package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.tsx +0 -146
  89. package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts +0 -113
  90. package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.ts +0 -81
  91. package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +0 -52
  92. package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +0 -23
  93. /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 type { Pagination } from '@elastic/eui/src/components';
6
-
7
- import type { WfoDataSorting, WfoTableColumns } from '@/components';
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 { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig';
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: WfoTableColumns<ProductDefinition> = {
91
+ const tableColumns: WfoAdvancedTableColumnConfig<ProductDefinition> = {
97
92
  productId: {
98
- field: PRODUCT_FIELD_PRODUCT_ID,
99
- name: t('id'),
93
+ columnType: ColumnType.DATA,
94
+ label: t('id'),
100
95
  width: '90',
101
- render: (value) => <WfoFirstPartUUID UUID={value} />,
96
+ renderData: (value) => <WfoFirstPartUUID UUID={value} />,
102
97
  renderDetails: (value) => value,
103
98
  },
104
99
  name: {
105
- field: PRODUCT_FIELD_NAME,
106
- name: t('name'),
100
+ columnType: ColumnType.DATA,
101
+ label: t('name'),
107
102
  width: '200',
108
- render: (name) => (
103
+ renderData: (name) => (
109
104
  <WfoProductBlockBadge badgeType={BadgeType.PRODUCT}>
110
105
  {name}
111
106
  </WfoProductBlockBadge>
112
107
  ),
113
108
  },
114
109
  tag: {
115
- field: PRODUCT_FIELD_TAG,
116
- name: t('tag'),
110
+ columnType: ColumnType.DATA,
111
+ label: t('tag'),
117
112
  width: '120',
118
- render: (value) => (
113
+ renderData: (value) => (
119
114
  <WfoProductBlockBadge badgeType={BadgeType.PRODUCT_TAG}>
120
115
  {value}
121
116
  </WfoProductBlockBadge>
122
117
  ),
123
118
  },
124
119
  description: {
125
- field: PRODUCT_FIELD_DESCRIPTION,
126
- name: t('description'),
120
+ columnType: ColumnType.DATA,
121
+ label: t('description'),
127
122
  width: '400',
128
123
  },
129
124
  productType: {
130
- field: PRODUCT_FIELD_PRODUCT_TYPE,
131
- name: t('productType'),
125
+ columnType: ColumnType.DATA,
126
+ label: t('productType'),
132
127
  },
133
128
  status: {
134
- field: PRODUCT_FIELD_STATUS,
135
- name: t('status'),
129
+ columnType: ColumnType.DATA,
130
+ label: t('status'),
136
131
  width: '90',
137
- render: (value) => <WfoProductStatusBadge status={value} />,
132
+ renderData: (value) => <WfoProductStatusBadge status={value} />,
138
133
  },
139
134
  fixedInputs: {
140
- field: PRODUCT_FIELD_FIXED_INPUTS,
141
- name: t('fixedInputs'),
142
- render: (fixedInputs) => (
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
- field: PRODUCT_FIELD_PRODUCT_BLOCKS,
157
- name: t('productBlocks'),
158
- render: (productBlocks) => (
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
- field: PRODUCT_FIELD_CREATED_AT,
173
- name: t('createdAt'),
174
- render: (date) => <WfoDateTime dateOrIsoString={date} />,
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
- <WfoTableWithFilter<ProductDefinition>
240
+ <WfoAdvancedTable
244
241
  data={data?.products ?? []}
245
- tableColumns={mapSortableAndFilterableValuesToTableColumnConfig(
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
- onUpdateDataSort={getDataSortHandler<ProductDefinition>(
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
- getPageChangeHandler,
13
+ getPageIndexChangeHandler,
14
+ getPageSizeChangeHandler,
16
15
  getQueryStringHandler,
17
16
  } from '@/components';
18
- import type {
19
- StoredTableConfig,
20
- WfoDataSorting,
21
- WfoTableColumns,
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: WfoTableColumns<ResourceTypeDefinition> = {
87
+ const tableColumns: WfoAdvancedTableColumnConfig<ResourceTypeDefinition> = {
96
88
  resourceTypeId: {
97
- field: RESOURCE_TYPE_FIELD_ID,
98
- name: t('resourceId'),
89
+ columnType: ColumnType.DATA,
90
+ label: t('resourceId'),
99
91
  width: '90',
100
- render: (value) => <WfoFirstPartUUID UUID={value} />,
92
+ renderData: (value) => <WfoFirstPartUUID UUID={value} />,
101
93
  renderDetails: (value) => value,
102
94
  },
103
95
  resourceType: {
104
- field: RESOURCE_TYPE_FIELD_TYPE,
105
- name: t('type'),
96
+ columnType: ColumnType.DATA,
97
+ label: t('type'),
106
98
  width: '200',
107
- render: (value) => (
99
+ renderData: (value) => (
108
100
  <WfoProductBlockBadge badgeType={BadgeType.RESOURCE_TYPE}>
109
101
  {value}
110
102
  </WfoProductBlockBadge>
111
103
  ),
112
104
  },
113
105
  description: {
114
- field: RESOURCE_TYPE_FIELD_DESCRIPTION,
115
- name: t('description'),
106
+ columnType: ColumnType.DATA,
107
+ label: t('description'),
116
108
  },
117
109
  productBlocks: {
118
- field: RESOURCE_TYPE_FIELD_PRODUCT_BLOCKS,
119
- name: t('usedInProductBlocks'),
120
- render: (productBlocks) => (
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
- <WfoTableWithFilter<ResourceTypeDefinition>
188
+ <WfoAdvancedTable
195
189
  data={data ? data.resourceTypes : []}
196
- tableColumns={mapSortableAndFilterableValuesToTableColumnConfig(
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
- onUpdateDataSort={getDataSortHandler<ResourceTypeDefinition>(
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 { WfoTableWithFilter, WfoWorkflowTargetBadge } from '@/components';
9
- import type { WfoDataSorting, WfoTableColumns } from '@/components';
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 { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig';
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: WfoTableColumns<TaskListItem> = {
99
+ const tableColumns: WfoAdvancedTableColumnConfig<TaskListItem> = {
95
100
  name: {
96
- field: 'name',
97
- name: t('name'),
98
- width: '20%',
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
- field: 'description',
107
- name: t('description'),
110
+ columnType: ColumnType.DATA,
111
+ label: t('description'),
108
112
  width: '40%',
109
113
  },
110
114
  target: {
111
- field: 'target',
112
- name: t('target'),
113
- width: '15%',
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
- field: 'productTags',
118
- name: t('productTags'),
120
+ columnType: ColumnType.DATA,
121
+ label: t('productTags'),
119
122
  width: '20%',
120
- render: (productTags) => (
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
- field: 'createdAt',
151
- name: t('createdAt'),
153
+ columnType: ColumnType.DATA,
154
+ label: t('createdAt'),
152
155
  width: '15%',
153
- render: (date) => <WfoDateTime dateOrIsoString={date} />,
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
- <WfoTableWithFilter<TaskListItem>
220
+ <WfoAdvancedTable
216
221
  data={data ? mapTaskDefinitionToTaskListItem(data.tasks) : []}
217
- tableColumns={mapSortableAndFilterableValuesToTableColumnConfig(
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
- onUpdateDataSort={getDataSortHandler<TaskListItem>(
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 type { WfoDataSorting, WfoTableColumns } from '@/components';
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: WfoTableColumns<WorkflowListItem> = {
105
+ const tableColumns: WfoAdvancedTableColumnConfig<WorkflowListItem> = {
99
106
  name: {
100
- field: 'name',
101
- name: t('name'),
102
- width: '20%',
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
- field: 'description',
111
- name: t('description'),
116
+ columnType: ColumnType.DATA,
117
+ label: t('description'),
112
118
  width: '40%',
113
119
  },
114
120
  target: {
115
- field: 'target',
116
- name: t('target'),
117
- width: '15%',
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
- field: 'productTags',
122
- name: t('productTags'),
126
+ columnType: ColumnType.DATA,
127
+ label: t('productTags'),
123
128
  width: '20%',
124
- render: (productTags) => (
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
- field: 'createdAt',
155
- name: t('createdAt'),
159
+ columnType: ColumnType.DATA,
160
+ label: t('createdAt'),
156
161
  width: '15%',
157
- render: (date) => <WfoDateTime dateOrIsoString={date} />,
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
- <WfoTableWithFilter<WorkflowListItem>
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
- tableColumns={mapSortableAndFilterableValuesToTableColumnConfig(
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
- onUpdateDataSort={getDataSortHandler<WorkflowListItem>(
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: WfoTableColumns<ProcessListItem>,
115
- ) => WfoTableColumns<ProcessListItem> = (defaultTableColumns) => ({
116
+ defaultTableColumns: WfoAdvancedTableColumnConfig<ProcessListItem>,
117
+ ) => WfoAdvancedTableColumnConfig<ProcessListItem> = (
118
+ defaultTableColumns,
119
+ ) => ({
116
120
  workflowName: {
117
- field: 'workflowName',
118
- name: t('taskName'),
119
- render: (value, { processId }) => (
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
- lastStep: defaultTableColumns.lastStep,
124
- lastStatus: defaultTableColumns.lastStatus,
125
- workflowTarget: defaultTableColumns.workflowTarget,
126
- productTag: defaultTableColumns.tag,
127
- productName: defaultTableColumns.productName,
128
- customer: defaultTableColumns.customer,
129
- customerAbbreviation: defaultTableColumns.customerAbbreviation,
130
- subscriptions: defaultTableColumns.subscriptions,
131
- createdBy: defaultTableColumns.createdBy,
132
- assignee: defaultTableColumns.assignee,
133
- processId: defaultTableColumns.processId,
134
- startedAt: defaultTableColumns.startedAt,
135
- lastModifiedAt: defaultTableColumns.lastModifiedAt,
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 (
@@ -0,0 +1,3 @@
1
+ export const getObjectKeys = <T extends object>(
2
+ inputObject: T,
3
+ ): Array<keyof T> => Object.keys(inputObject) as Array<keyof T>;