@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.
- package/.turbo/turbo-build.log +11 -9
- package/.turbo/turbo-lint.log +5 -2
- package/.turbo/turbo-test.log +14 -14
- package/CHANGELOG.md +30 -0
- package/dist/index.d.ts +329 -172
- package/dist/index.js +6152 -5545
- package/dist/index.js.map +1 -0
- package/package.json +2 -2
- package/src/components/WfoContentHeader/WfoContentHeader.tsx +55 -0
- package/src/components/WfoContentHeader/index.ts +1 -0
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +6 -5
- package/src/components/WfoInlineNoteEdit/WfoInlineNoteEdit.tsx +105 -0
- package/src/components/WfoInlineNoteEdit/index.ts +1 -0
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +3 -1
- package/src/components/WfoPageTemplate/WfoSidebar/WfoCopyright.tsx +1 -1
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +6 -6
- 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/WfoRenderElementOrString/WfoRenderElementOrString.tsx +16 -0
- package/src/components/WfoRenderElementOrString/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 +92 -84
- package/src/components/WfoSubscription/WfoSubscription.tsx +19 -37
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +17 -9
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +18 -156
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionDetailSection.tsx +119 -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/relatedSubscriptionsListItemsObjectMappers.ts +62 -0
- 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 +4 -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/WfoMetadataPageLayout.tsx +4 -4
- 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/processes/WfoProcessDetail.tsx +47 -55
- package/src/pages/settings/WfoSettingsPage.tsx +9 -4
- package/src/pages/startPage/WfoStartPage.tsx +17 -1
- package/src/pages/subscriptions/WfoSubscriptionsListPage.tsx +4 -5
- package/src/pages/tasks/WfoTasksListPage.tsx +44 -52
- package/src/pages/workflows/WfoWorkflowsListPage.tsx +4 -5
- package/src/rtk/endpoints/index.ts +1 -0
- package/src/rtk/endpoints/relatedSubscriptions.ts +5 -4
- package/src/rtk/endpoints/subscriptionActions.ts +11 -1
- package/src/utils/getObjectKeys.ts +3 -0
- package/src/utils/index.ts +5 -3
- package/tsup.config.ts +10 -0
- 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
|
@@ -12,14 +12,38 @@ export const getStyles = (wfoTheme: WfoTheme) => {
|
|
|
12
12
|
marginRight: `-${theme.size.s}`,
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
46
|
+
selectedTreeItemStyle,
|
|
47
|
+
treeItemStyle,
|
|
24
48
|
};
|
|
25
49
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -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.
|
|
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
|
+
);
|
package/src/messages/en-GB.json
CHANGED
|
@@ -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
|
},
|
package/src/messages/nl-NL.json
CHANGED
|
@@ -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 {
|
|
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
|
-
<
|
|
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
|
-
|
|
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:
|
|
94
|
+
const tableColumns: WfoAdvancedTableColumnConfig<ProductBlockDefinition> = {
|
|
107
95
|
productBlockId: {
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
columnType: ColumnType.DATA,
|
|
97
|
+
label: t('id'),
|
|
110
98
|
width: '90',
|
|
111
|
-
|
|
99
|
+
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
112
100
|
renderDetails: (value) => value,
|
|
113
101
|
},
|
|
114
102
|
name: {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
width: '140',
|
|
112
|
+
columnType: ColumnType.DATA,
|
|
113
|
+
label: t('tag'),
|
|
128
114
|
},
|
|
129
115
|
description: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
width: '
|
|
116
|
+
columnType: ColumnType.DATA,
|
|
117
|
+
label: t('description'),
|
|
118
|
+
width: '400px',
|
|
133
119
|
},
|
|
134
120
|
status: {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
width: '
|
|
138
|
-
|
|
121
|
+
columnType: ColumnType.DATA,
|
|
122
|
+
label: t('status'),
|
|
123
|
+
width: '90px',
|
|
124
|
+
renderData: (value) => <WfoProductStatusBadge status={value} />,
|
|
139
125
|
},
|
|
140
126
|
dependsOn: {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
227
|
-
|
|
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
|
-
<
|
|
236
|
+
<WfoAdvancedTable
|
|
249
237
|
data={data?.productBlocks || []}
|
|
250
|
-
|
|
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
|
-
|
|
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
|
|
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>(
|