@orchestrator-ui/orchestrator-ui-components 1.38.2 → 2.1.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 (113) hide show
  1. package/.turbo/turbo-build.log +11 -9
  2. package/.turbo/turbo-lint.log +5 -2
  3. package/.turbo/turbo-test.log +14 -14
  4. package/CHANGELOG.md +30 -0
  5. package/dist/index.d.ts +329 -172
  6. package/dist/index.js +6152 -5545
  7. package/dist/index.js.map +1 -0
  8. package/package.json +2 -2
  9. package/src/components/WfoContentHeader/WfoContentHeader.tsx +55 -0
  10. package/src/components/WfoContentHeader/index.ts +1 -0
  11. package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +6 -5
  12. package/src/components/WfoInlineNoteEdit/WfoInlineNoteEdit.tsx +105 -0
  13. package/src/components/WfoInlineNoteEdit/index.ts +1 -0
  14. package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +3 -1
  15. package/src/components/WfoPageTemplate/WfoSidebar/WfoCopyright.tsx +1 -1
  16. package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +6 -6
  17. package/src/components/WfoProcessList/WfoProcessesList.tsx +52 -51
  18. package/src/components/WfoRadioDropdown/WfoRadioDropdown.tsx +88 -0
  19. package/src/components/WfoRadioDropdown/index.ts +1 -0
  20. package/src/components/WfoRenderElementOrString/WfoRenderElementOrString.tsx +16 -0
  21. package/src/components/WfoRenderElementOrString/index.ts +1 -0
  22. package/src/components/WfoSubscription/WfoInSyncField.tsx +13 -9
  23. package/src/components/WfoSubscription/WfoInUseByRelations.tsx +4 -2
  24. package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +76 -29
  25. package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +92 -84
  26. package/src/components/WfoSubscription/WfoSubscription.tsx +19 -37
  27. package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +17 -9
  28. package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +18 -156
  29. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionDetailSection.tsx +119 -0
  30. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionFixedInputSection.tsx +28 -0
  31. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionMetadataSection.tsx +29 -0
  32. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionProductInfoSection.tsx +55 -0
  33. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/index.ts +4 -0
  34. package/src/components/WfoSubscription/index.ts +3 -0
  35. package/src/components/WfoSubscription/overrides/index.ts +1 -0
  36. package/src/components/WfoSubscription/styles.ts +4 -1
  37. package/src/components/WfoSubscription/utils/relatedSubscriptionsListItemsObjectMappers.ts +62 -0
  38. package/src/components/WfoSubscription/utils/utils.spec.ts +0 -13
  39. package/src/components/WfoSubscription/utils/utils.ts +18 -5
  40. package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +105 -100
  41. package/src/components/WfoTable/{WfoTableWithFilter/WfoTableWithFilter.tsx → WfoAdvancedTable/WfoAdvancedTable.tsx} +65 -123
  42. package/src/components/WfoTable/WfoAdvancedTable/getRowDetailData.tsx +55 -0
  43. package/src/components/WfoTable/WfoAdvancedTable/index.ts +4 -0
  44. package/src/components/WfoTable/WfoAdvancedTable/toSortedTableColumnConfig.ts +12 -0
  45. package/src/components/WfoTable/WfoAdvancedTable/types.ts +23 -0
  46. package/src/components/WfoTable/WfoStatusColorField/WfoStatusColorField.tsx +16 -0
  47. package/src/components/WfoTable/WfoStatusColorField/index.ts +1 -0
  48. package/src/components/WfoTable/WfoStatusColorField/styles.ts +20 -0
  49. package/src/components/WfoTable/WfoTable/WfoExpandedRow.tsx +33 -0
  50. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandableRow.tsx +48 -0
  51. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandedGroupRow.tsx +71 -0
  52. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTable.tsx +100 -0
  53. package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTableGroups.tsx +74 -0
  54. package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +39 -0
  55. package/src/components/WfoTable/WfoTable/WfoGroupedTable/useGroupedTableConfig.tsx +184 -0
  56. package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts +133 -0
  57. package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.ts +41 -0
  58. package/src/components/WfoTable/WfoTable/WfoMultilineCell.tsx +13 -0
  59. package/src/components/WfoTable/WfoTable/WfoTable.tsx +201 -0
  60. package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +112 -0
  61. package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoSortDirectionIcon.tsx +3 -3
  62. package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoTableHeaderCell.tsx +4 -3
  63. package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/index.ts +2 -0
  64. package/src/components/WfoTable/WfoTable/WfoTableHeaderRow.tsx +114 -0
  65. package/src/components/WfoTable/WfoTable/WfoTruncateCell.tsx +23 -0
  66. package/src/components/WfoTable/WfoTable/constants.ts +1 -0
  67. package/src/components/WfoTable/WfoTable/index.ts +14 -0
  68. package/src/components/WfoTable/WfoTable/styles.ts +117 -0
  69. package/src/components/WfoTable/WfoTable/utils.spec.ts +79 -0
  70. package/src/components/WfoTable/WfoTable/utils.ts +78 -0
  71. package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +13 -12
  72. package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -1
  73. package/src/components/WfoTable/index.ts +4 -5
  74. package/src/components/WfoTable/utils/columns.ts +1 -48
  75. package/src/components/WfoTable/utils/tableUtils.ts +13 -10
  76. package/src/components/WfoTree/WfoTreeBranch.tsx +10 -1
  77. package/src/components/WfoTree/WfoTreeNode.tsx +8 -57
  78. package/src/components/WfoTree/WfoTreeNodeListItem.tsx +65 -0
  79. package/src/components/WfoTree/styles.ts +28 -4
  80. package/src/components/index.ts +4 -0
  81. package/src/configuration/policy-resources.ts +1 -0
  82. package/src/configuration/version.ts +1 -1
  83. package/src/icons/WfoXMarkSmall.tsx +29 -0
  84. package/src/messages/en-GB.json +4 -0
  85. package/src/messages/nl-NL.json +4 -0
  86. package/src/pages/metadata/WfoMetadataPageLayout.tsx +4 -4
  87. package/src/pages/metadata/WfoProductBlocksPage.tsx +42 -59
  88. package/src/pages/metadata/WfoProductsPage.tsx +41 -47
  89. package/src/pages/metadata/WfoResourceTypesPage.tsx +26 -35
  90. package/src/pages/metadata/WfoTasksPage.tsx +35 -33
  91. package/src/pages/metadata/WfoWorkflowsPage.tsx +33 -29
  92. package/src/pages/processes/WfoProcessDetail.tsx +47 -55
  93. package/src/pages/settings/WfoSettingsPage.tsx +9 -4
  94. package/src/pages/startPage/WfoStartPage.tsx +17 -1
  95. package/src/pages/subscriptions/WfoSubscriptionsListPage.tsx +4 -5
  96. package/src/pages/tasks/WfoTasksListPage.tsx +44 -52
  97. package/src/pages/workflows/WfoWorkflowsListPage.tsx +4 -5
  98. package/src/rtk/endpoints/index.ts +1 -0
  99. package/src/rtk/endpoints/relatedSubscriptions.ts +5 -4
  100. package/src/rtk/endpoints/subscriptionActions.ts +11 -1
  101. package/src/utils/getObjectKeys.ts +3 -0
  102. package/src/utils/index.ts +5 -3
  103. package/tsup.config.ts +10 -0
  104. package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +0 -194
  105. package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +0 -21
  106. package/src/components/WfoTable/WfoBasicTable/index.ts +0 -5
  107. package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx +0 -136
  108. package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.tsx +0 -146
  109. package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts +0 -113
  110. package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.ts +0 -81
  111. package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +0 -52
  112. package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +0 -23
  113. /package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/styles.ts +0 -0
@@ -12,14 +12,38 @@ export const getStyles = (wfoTheme: WfoTheme) => {
12
12
  marginRight: `-${theme.size.s}`,
13
13
  };
14
14
 
15
- const treeItemOtherSubscriptionStyle = {
16
- backgroundColor: toSecondaryColor(theme.colors.lightestShade),
17
- border: `thin dashed ${theme.colors.lightShade}`,
15
+ const treeItemStyle = (isOutsideCurrentSubscription: boolean) => {
16
+ return {
17
+ cursor: 'pointer',
18
+ paddingBlock: theme.size.xs,
19
+ paddingInline: theme.size.s,
20
+ borderRadius: theme.base - 10,
21
+ textDecoration: 'none',
22
+ backgroundColor: 'transparent',
23
+ transition: 'background-color 0.2s ease, text-decoration 0.3s ease', // Smooth transition for background
24
+ '&:hover': {
25
+ textDecoration: 'underline',
26
+ },
27
+ border: isOutsideCurrentSubscription
28
+ ? `1px dashed ${theme.colors.lightShade}`
29
+ : 'none',
30
+ };
31
+ };
32
+
33
+ const selectedTreeItemStyle = (isOutsideCurrentSubscription: boolean) => {
34
+ return {
35
+ ...treeItemStyle(isOutsideCurrentSubscription),
36
+ backgroundColor: isOutsideCurrentSubscription
37
+ ? theme.colors.lightShade
38
+ : toSecondaryColor(theme.colors.primary),
39
+ color: theme.colors.primaryText,
40
+ };
18
41
  };
19
42
 
20
43
  return {
21
44
  expandIconContainerStyle: expandIconContainerStyle,
22
45
  treeContainerStyle: treeContainerStyle,
23
- treeItemOtherSubscriptionStyle,
46
+ selectedTreeItemStyle,
47
+ treeItemStyle,
24
48
  };
25
49
  };
@@ -1,4 +1,5 @@
1
1
  export * from './WfoBadges';
2
+ export * from './WfoContentHeader';
2
3
  export * from './WfoExpandableField';
3
4
  export * from './WfoPageTemplate/WfoBreadcrumbs';
4
5
  export * from './WfoFilterTabs';
@@ -25,7 +26,10 @@ export * from './WfoError';
25
26
  export * from './WfoErrorBoundary';
26
27
  export * from './WfoWorkflowSteps';
27
28
  export * from './WfoNoResults';
29
+ export * from './WfoRenderElementOrString';
28
30
  export * from './WfoStartButton';
29
31
  export * from './WfoSubscriptionsList';
30
32
  export * from './WfoSummary';
31
33
  export * from './WfoTitleWithWebsocketBadge';
34
+ export * from './WfoRadioDropdown';
35
+ export * from './WfoInlineNoteEdit';
@@ -17,4 +17,5 @@ export enum PolicyResource {
17
17
  TASKS_CREATE = '/orchestrator/processes/create/task',
18
18
  TASKS_RETRY_ALL = '/orchestrator/processes/all-tasks/retry',
19
19
  SETTINGS_FLUSH_CACHE = '/orchestrator/settings/flush-cache',
20
+ SET_IN_SYNC = '/orchestrator/subscriptions/set-in-sync',
20
21
  }
@@ -1 +1 @@
1
- export const ORCHESTRATOR_UI_LIBRARY_VERSION = '1.38.2';
1
+ export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.1.0';
@@ -0,0 +1,29 @@
1
+ import React, { FC } from 'react';
2
+
3
+ import { WfoIconProps } from './WfoIconProps';
4
+
5
+ export const WfoXMarkSmall: FC<WfoIconProps> = ({
6
+ width = 20,
7
+ height = 20,
8
+ }) => (
9
+ <svg
10
+ width={width}
11
+ height={height}
12
+ viewBox="0 -2 16 16"
13
+ version="1.1"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ >
16
+ <title>icon/x-mark</title>
17
+ <g
18
+ id="Symbols"
19
+ stroke="none"
20
+ strokeWidth="1"
21
+ fill="none"
22
+ fillRule="evenodd"
23
+ >
24
+ <g xmlns="http://www.w3.org/2000/svg" fill="currentColor">
25
+ <path d="M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z" />
26
+ </g>
27
+ </g>
28
+ </svg>
29
+ );
@@ -357,6 +357,10 @@
357
357
  "setInSyncSuccess": {
358
358
  "title": "Subscription set in sync",
359
359
  "text": "The subscription was successfully set in sync."
360
+ },
361
+ "workflowsTab": {
362
+ "startWithOldestLabel": "Start with oldest first",
363
+ "startWithNewestLabel": "Start with newest first"
360
364
  }
361
365
  }
362
366
  },
@@ -356,6 +356,10 @@
356
356
  "setInSyncSuccess": {
357
357
  "title": "Subscription inSync",
358
358
  "text": "De subscription is in sync gezet."
359
+ },
360
+ "workflowsTab": {
361
+ "startWithOldestLabel": "Start met oudste eerst",
362
+ "startWithNewestLabel": "Start met nieuwste eerst"
359
363
  }
360
364
  }
361
365
  },
@@ -4,7 +4,9 @@ import type { ReactNode } from 'react';
4
4
  import { useTranslations } from 'next-intl';
5
5
  import { useRouter } from 'next/router';
6
6
 
7
- import { EuiPageHeader, EuiSpacer, EuiTab, EuiTabs } from '@elastic/eui';
7
+ import { EuiSpacer, EuiTab, EuiTabs } from '@elastic/eui';
8
+
9
+ import { WfoContentHeader } from '@/components/WfoContentHeader/WfoContentHeader';
8
10
 
9
11
  interface MetadataLayoutProps {
10
12
  children: ReactNode;
@@ -55,10 +57,8 @@ export const WfoMetadataPageLayout = ({
55
57
 
56
58
  return (
57
59
  <>
58
- <EuiSpacer />
60
+ <WfoContentHeader title={t('title')} />
59
61
 
60
- <EuiPageHeader pageTitle={t('title')} />
61
- <EuiSpacer size="m" />
62
62
  <EuiTabs>
63
63
  {tabs.map(({ id, translationKey: name, path }) => (
64
64
  <EuiTab
@@ -3,7 +3,6 @@ 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,
@@ -15,13 +14,15 @@ import {
15
14
  WfoFirstPartUUID,
16
15
  WfoProductBlockBadge,
17
16
  WfoProductStatusBadge,
18
- WfoTableColumns,
19
- WfoTableWithFilter,
20
17
  getDataSortHandler,
21
- getPageChangeHandler,
18
+ getPageIndexChangeHandler,
19
+ getPageSizeChangeHandler,
22
20
  getQueryStringHandler,
23
- mapSortableAndFilterableValuesToTableColumnConfig,
24
21
  } from '@/components';
22
+ import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable';
23
+ import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
24
+ import { ColumnType, Pagination } from '@/components/WfoTable/WfoTable';
25
+ import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
25
26
  import {
26
27
  useDataDisplayParams,
27
28
  useShowToastMessage,
@@ -47,21 +48,8 @@ import {
47
48
 
48
49
  import { WfoMetadataPageLayout } from './WfoMetadataPageLayout';
49
50
 
50
- const PRODUCT_BLOCK_FIELD_ID: keyof ProductBlockDefinition = 'productBlockId';
51
51
  const PRODUCT_BLOCK_FIELD_NAME: keyof ProductBlockDefinition = 'name';
52
52
 
53
- const PRODUCT_BLOCK_FIELD_TAG: keyof ProductBlockDefinition = 'tag';
54
- const PRODUCT_BLOCK_FIELD_DESCRIPTION: keyof ProductBlockDefinition =
55
- 'description';
56
- const PRODUCT_BLOCK_FIELD_STATUS: keyof ProductBlockDefinition = 'status';
57
- const PRODUCT_BLOCK_FIELD_CREATED_AT: keyof ProductBlockDefinition =
58
- 'createdAt';
59
- const PRODUCT_BLOCK_FIELD_END_DATE: keyof ProductBlockDefinition = 'endDate';
60
- const PRODUCT_BLOCK_FIELD_RESOURCE_TYPES: keyof ProductBlockDefinition =
61
- 'resourceTypes';
62
- const PRODUCT_BLOCK_FIELD_PRODUCT_BLOCKS: keyof ProductBlockDefinition =
63
- 'dependsOn';
64
-
65
53
  type ProductBlockDefinitionExportItem = Omit<
66
54
  ProductBlockDefinition,
67
55
  'resourceTypes' | 'dependsOn'
@@ -103,44 +91,42 @@ export const WfoProductBlocksPage = () => {
103
91
  },
104
92
  });
105
93
 
106
- const tableColumns: WfoTableColumns<ProductBlockDefinition> = {
94
+ const tableColumns: WfoAdvancedTableColumnConfig<ProductBlockDefinition> = {
107
95
  productBlockId: {
108
- field: PRODUCT_BLOCK_FIELD_ID,
109
- name: t('id'),
96
+ columnType: ColumnType.DATA,
97
+ label: t('id'),
110
98
  width: '90',
111
- render: (value) => <WfoFirstPartUUID UUID={value} />,
99
+ renderData: (value) => <WfoFirstPartUUID UUID={value} />,
112
100
  renderDetails: (value) => value,
113
101
  },
114
102
  name: {
115
- field: PRODUCT_BLOCK_FIELD_NAME,
116
- name: t('name'),
117
- width: '200',
118
- render: (name) => (
103
+ columnType: ColumnType.DATA,
104
+ label: t('name'),
105
+ renderData: (name) => (
119
106
  <WfoProductBlockBadge badgeType={BadgeType.PRODUCT_BLOCK}>
120
107
  {name}
121
108
  </WfoProductBlockBadge>
122
109
  ),
123
110
  },
124
111
  tag: {
125
- field: PRODUCT_BLOCK_FIELD_TAG,
126
- name: t('tag'),
127
- width: '140',
112
+ columnType: ColumnType.DATA,
113
+ label: t('tag'),
128
114
  },
129
115
  description: {
130
- field: PRODUCT_BLOCK_FIELD_DESCRIPTION,
131
- name: t('description'),
132
- width: '400',
116
+ columnType: ColumnType.DATA,
117
+ label: t('description'),
118
+ width: '400px',
133
119
  },
134
120
  status: {
135
- field: PRODUCT_BLOCK_FIELD_STATUS,
136
- name: t('status'),
137
- width: '90',
138
- render: (value) => <WfoProductStatusBadge status={value} />,
121
+ columnType: ColumnType.DATA,
122
+ label: t('status'),
123
+ width: '90px',
124
+ renderData: (value) => <WfoProductStatusBadge status={value} />,
139
125
  },
140
126
  dependsOn: {
141
- field: PRODUCT_BLOCK_FIELD_PRODUCT_BLOCKS,
142
- name: t('dependingProductBlocks'),
143
- render: (dependsOn) => (
127
+ columnType: ColumnType.DATA,
128
+ label: t('dependingProductBlocks'),
129
+ renderData: (dependsOn) => (
144
130
  <>
145
131
  {dependsOn.map((productBlock, index) => (
146
132
  <WfoProductBlockBadge
@@ -154,9 +140,9 @@ export const WfoProductBlocksPage = () => {
154
140
  ),
155
141
  },
156
142
  resourceTypes: {
157
- field: PRODUCT_BLOCK_FIELD_RESOURCE_TYPES,
158
- name: t('resourceTypes'),
159
- render: (resourceTypes) => (
143
+ columnType: ColumnType.DATA,
144
+ label: t('resourceTypes'),
145
+ renderData: (resourceTypes) => (
160
146
  <>
161
147
  {resourceTypes.map((resourceType, index) => (
162
148
  <WfoProductBlockBadge
@@ -182,16 +168,16 @@ export const WfoProductBlocksPage = () => {
182
168
  ),
183
169
  },
184
170
  createdAt: {
185
- field: PRODUCT_BLOCK_FIELD_CREATED_AT,
186
- name: t('createdAt'),
187
- render: (date) => <WfoDateTime dateOrIsoString={date} />,
171
+ columnType: ColumnType.DATA,
172
+ label: t('createdAt'),
173
+ renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
188
174
  renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
189
175
  clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
190
176
  },
191
177
  endDate: {
192
- field: PRODUCT_BLOCK_FIELD_END_DATE,
193
- name: t('endDate'),
194
- render: (date) => <WfoDateTime dateOrIsoString={date} />,
178
+ columnType: ColumnType.DATA,
179
+ label: t('endDate'),
180
+ renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
195
181
  renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
196
182
  clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
197
183
  },
@@ -223,10 +209,12 @@ export const WfoProductBlocksPage = () => {
223
209
  const { totalItems, sortFields, filterFields } = data?.pageInfo ?? {};
224
210
 
225
211
  const pagination: Pagination = {
226
- pageSize: pageSize,
227
- pageIndex: pageIndex,
212
+ pageIndex,
213
+ pageSize,
228
214
  pageSizeOptions: DEFAULT_PAGE_SIZES,
229
215
  totalItemCount: totalItems ? totalItems : 0,
216
+ onChangePage: getPageIndexChangeHandler(setDataDisplayParam),
217
+ onChangeItemsPerPage: getPageSizeChangeHandler(setDataDisplayParam),
230
218
  };
231
219
 
232
220
  const mapToExportItems = (
@@ -245,21 +233,16 @@ export const WfoProductBlocksPage = () => {
245
233
 
246
234
  return (
247
235
  <WfoMetadataPageLayout>
248
- <WfoTableWithFilter<ProductBlockDefinition>
236
+ <WfoAdvancedTable
249
237
  data={data?.productBlocks || []}
250
- tableColumns={mapSortableAndFilterableValuesToTableColumnConfig(
238
+ tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
251
239
  tableColumns,
252
240
  sortFields,
253
241
  filterFields,
254
242
  )}
255
- dataSorting={dataSorting}
243
+ dataSorting={[dataSorting]}
256
244
  defaultHiddenColumns={tableDefaults?.hiddenColumns}
257
- onUpdateDataSort={getDataSortHandler<ProductBlockDefinition>(
258
- setDataDisplayParam,
259
- )}
260
- onUpdatePage={getPageChangeHandler<ProductBlockDefinition>(
261
- setDataDisplayParam,
262
- )}
245
+ onUpdateDataSorting={getDataSortHandler(setDataDisplayParam)}
263
246
  onUpdateQueryString={getQueryStringHandler<ProductBlockDefinition>(
264
247
  setDataDisplayParam,
265
248
  )}
@@ -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>(