@orchestrator-ui/orchestrator-ui-components 1.38.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-lint.log +5 -2
- package/.turbo/turbo-test.log +11 -11
- package/CHANGELOG.md +25 -0
- package/dist/index.d.ts +252 -170
- package/dist/index.js +4355 -3498
- package/package.json +1 -1
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +6 -5
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +3 -1
- package/src/components/WfoPageTemplate/WfoSidebar/WfoCopyright.tsx +1 -1
- package/src/components/WfoProcessList/WfoProcessesList.tsx +52 -51
- package/src/components/WfoRadioDropdown/WfoRadioDropdown.tsx +88 -0
- package/src/components/WfoRadioDropdown/index.ts +1 -0
- package/src/components/WfoStartButton/WfoStartButtonComboBox.tsx +4 -0
- package/src/components/WfoStartButton/WfoStartTaskComboBox.tsx +1 -0
- package/src/components/WfoStartButton/WfoStartWorkflowComboBox.tsx +1 -0
- package/src/components/WfoStartButton/styles.ts +0 -4
- package/src/components/WfoSubscription/WfoInSyncField.tsx +13 -9
- package/src/components/WfoSubscription/WfoInUseByRelations.tsx +4 -2
- package/src/components/WfoSubscription/WfoProcessesTimeline.tsx +76 -29
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +50 -56
- package/src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx +17 -9
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +29 -160
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionDetailSection.tsx +113 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionFixedInputSection.tsx +28 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionMetadataSection.tsx +29 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionProductInfoSection.tsx +55 -0
- package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/index.ts +4 -0
- package/src/components/WfoSubscription/index.ts +3 -0
- package/src/components/WfoSubscription/overrides/index.ts +1 -0
- package/src/components/WfoSubscription/styles.ts +4 -1
- package/src/components/WfoSubscription/utils/utils.spec.ts +0 -13
- package/src/components/WfoSubscription/utils/utils.ts +18 -5
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +105 -100
- package/src/components/WfoTable/{WfoTableWithFilter/WfoTableWithFilter.tsx → WfoAdvancedTable/WfoAdvancedTable.tsx} +65 -123
- package/src/components/WfoTable/WfoAdvancedTable/getRowDetailData.tsx +55 -0
- package/src/components/WfoTable/WfoAdvancedTable/index.ts +4 -0
- package/src/components/WfoTable/WfoAdvancedTable/toSortedTableColumnConfig.ts +12 -0
- package/src/components/WfoTable/WfoAdvancedTable/types.ts +23 -0
- package/src/components/WfoTable/WfoStatusColorField/WfoStatusColorField.tsx +16 -0
- package/src/components/WfoTable/WfoStatusColorField/index.ts +1 -0
- package/src/components/WfoTable/WfoStatusColorField/styles.ts +20 -0
- package/src/components/WfoTable/WfoTable/WfoExpandedRow.tsx +33 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandableRow.tsx +48 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandedGroupRow.tsx +71 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTable.tsx +100 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/WfoGroupedTableGroups.tsx +74 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +39 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/useGroupedTableConfig.tsx +184 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts +133 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.ts +41 -0
- package/src/components/WfoTable/WfoTable/WfoMultilineCell.tsx +13 -0
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +201 -0
- package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +112 -0
- package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoSortDirectionIcon.tsx +3 -3
- package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/WfoTableHeaderCell.tsx +4 -3
- package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/index.ts +2 -0
- package/src/components/WfoTable/WfoTable/WfoTableHeaderRow.tsx +114 -0
- package/src/components/WfoTable/WfoTable/WfoTruncateCell.tsx +23 -0
- package/src/components/WfoTable/WfoTable/constants.ts +1 -0
- package/src/components/WfoTable/WfoTable/index.ts +14 -0
- package/src/components/WfoTable/WfoTable/styles.ts +117 -0
- package/src/components/WfoTable/WfoTable/utils.spec.ts +79 -0
- package/src/components/WfoTable/WfoTable/utils.ts +78 -0
- package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +13 -12
- package/src/components/WfoTable/WfoTableWithFilter/index.ts +1 -1
- package/src/components/WfoTable/index.ts +4 -5
- package/src/components/WfoTable/utils/columns.ts +1 -48
- package/src/components/WfoTable/utils/tableUtils.ts +13 -10
- package/src/components/WfoTree/WfoTreeBranch.tsx +10 -1
- package/src/components/WfoTree/WfoTreeNode.tsx +8 -57
- package/src/components/WfoTree/WfoTreeNodeListItem.tsx +65 -0
- package/src/components/WfoTree/styles.ts +28 -4
- package/src/components/index.ts +1 -0
- package/src/configuration/policy-resources.ts +1 -0
- package/src/configuration/version.ts +1 -1
- package/src/icons/WfoXMarkSmall.tsx +29 -0
- package/src/messages/en-GB.json +4 -0
- package/src/messages/nl-NL.json +4 -0
- package/src/pages/metadata/WfoProductBlocksPage.tsx +42 -59
- package/src/pages/metadata/WfoProductsPage.tsx +41 -47
- package/src/pages/metadata/WfoResourceTypesPage.tsx +26 -35
- package/src/pages/metadata/WfoTasksPage.tsx +35 -33
- package/src/pages/metadata/WfoWorkflowsPage.tsx +33 -29
- package/src/pages/tasks/WfoTasksListPage.tsx +25 -19
- package/src/utils/getObjectKeys.ts +3 -0
- package/src/utils/index.ts +5 -3
- package/src/components/WfoTable/WfoBasicTable/WfoBasicTable.tsx +0 -194
- package/src/components/WfoTable/WfoBasicTable/WfoStatusColorField.tsx +0 -21
- package/src/components/WfoTable/WfoBasicTable/index.ts +0 -5
- package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.stories.tsx +0 -136
- package/src/components/WfoTable/WfoDataGridTable/WfoDataGridTable.tsx +0 -146
- package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.spec.ts +0 -113
- package/src/components/WfoTable/WfoDataGridTable/WfodataGridColumns.ts +0 -81
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.spec.ts +0 -52
- package/src/components/WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig.ts +0 -23
- /package/src/components/WfoTable/{WfoBasicTable → WfoTable/WfoTableHeaderCell}/styles.ts +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import { SubscriptionKeyValueBlock, WfoProductStatusBadge } from '@/components';
|
|
6
|
+
import { SubscriptionDetail } from '@/types';
|
|
7
|
+
import { formatDate } from '@/utils';
|
|
8
|
+
|
|
9
|
+
interface WfoSubscriptionProductInfoSectionProps {
|
|
10
|
+
product: SubscriptionDetail['product'];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const WfoSubscriptionProductInfoSection = ({
|
|
14
|
+
product,
|
|
15
|
+
}: WfoSubscriptionProductInfoSectionProps) => {
|
|
16
|
+
const t = useTranslations('subscriptions.detail');
|
|
17
|
+
|
|
18
|
+
const productInfoBlockData = [
|
|
19
|
+
{
|
|
20
|
+
key: t('name'),
|
|
21
|
+
value: product.name,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: t('description'),
|
|
25
|
+
value: product.description,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: t('productType'),
|
|
29
|
+
value: product.productType,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: t('tag'),
|
|
33
|
+
value: product.tag,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: t('status'),
|
|
37
|
+
value: <WfoProductStatusBadge status={product.status} />,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: t('created'),
|
|
41
|
+
value: formatDate(product.createdAt),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: t('endDate'),
|
|
45
|
+
value: formatDate(product.endDate),
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<SubscriptionKeyValueBlock
|
|
51
|
+
title={t('blockTitleProductInfo')}
|
|
52
|
+
keyValues={productInfoBlockData}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -2,6 +2,8 @@ export * from './utils';
|
|
|
2
2
|
|
|
3
3
|
export * from './overrides';
|
|
4
4
|
|
|
5
|
+
export * from './WfoSubscriptionGeneralSections';
|
|
6
|
+
|
|
5
7
|
export * from './SubscriptionKeyValueBlock';
|
|
6
8
|
export * from './WfoInSyncField';
|
|
7
9
|
export * from './WfoProcessesTimeline';
|
|
@@ -11,3 +13,4 @@ export * from './WfoSubscriptionActions';
|
|
|
11
13
|
export * from './WfoSubscriptionProductBlock';
|
|
12
14
|
export * from './WfoSubscriptionDetailTree';
|
|
13
15
|
export * from './WfoSubscriptionGeneral';
|
|
16
|
+
export * from './WfoCustomerDescriptionsField';
|
|
@@ -2,7 +2,9 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
|
|
3
3
|
import { WfoTheme } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const getSubscriptionDetailStyles = ({ theme }: WfoTheme) => {
|
|
6
|
+
const productBlockTreeWidth = theme.base * 28;
|
|
7
|
+
|
|
6
8
|
const contentCellStyle = css({
|
|
7
9
|
padding: (theme.base / 4) * 3,
|
|
8
10
|
borderBottom: theme.border.thin,
|
|
@@ -63,5 +65,6 @@ export const getStyles = ({ theme }: WfoTheme) => {
|
|
|
63
65
|
lastContentCellStyle,
|
|
64
66
|
lastHeaderCellStyle,
|
|
65
67
|
inUseByRelationDetailsStyle,
|
|
68
|
+
productBlockTreeWidth,
|
|
66
69
|
};
|
|
67
70
|
};
|
|
@@ -64,19 +64,6 @@ describe('getProductBlockTitle()', () => {
|
|
|
64
64
|
);
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
it("returns '[title]...' when title field is to long", () => {
|
|
68
|
-
const longTitle =
|
|
69
|
-
'title_value title_value title_value title_value title_value';
|
|
70
|
-
const valuesWithNameAndLongTitle = [
|
|
71
|
-
...instanceValues,
|
|
72
|
-
{ field: 'name', value: 'name_value' },
|
|
73
|
-
{ field: 'title', value: longTitle },
|
|
74
|
-
];
|
|
75
|
-
expect(getProductBlockTitle(valuesWithNameAndLongTitle)).toBe(
|
|
76
|
-
'title_value title_value title_value title_val...',
|
|
77
|
-
);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
67
|
it('returns empty string when there are no title or name fields', () => {
|
|
81
68
|
expect(getProductBlockTitle(instanceValues)).toBe('');
|
|
82
69
|
});
|
|
@@ -5,13 +5,12 @@ import { EuiThemeComputed } from '@elastic/eui';
|
|
|
5
5
|
import {
|
|
6
6
|
FieldValue,
|
|
7
7
|
ProcessStatus,
|
|
8
|
+
SortOrder,
|
|
8
9
|
SubscriptionAction,
|
|
9
10
|
SubscriptionDetailProcess,
|
|
10
11
|
WorkflowTarget,
|
|
11
12
|
} from '@/types';
|
|
12
13
|
|
|
13
|
-
const MAX_LABEL_LENGTH = 45;
|
|
14
|
-
|
|
15
14
|
export enum SubscriptionDetailTab {
|
|
16
15
|
GENERAL_TAB = 'general',
|
|
17
16
|
SERVICE_CONFIGURATION_TAB = 'service-configuration',
|
|
@@ -41,9 +40,7 @@ export const getProductBlockTitle = (
|
|
|
41
40
|
return getFieldFromProductBlockInstanceValues(instanceValues, 'name');
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
return title
|
|
45
|
-
? `${title.substring(0, MAX_LABEL_LENGTH)}...`
|
|
46
|
-
: title;
|
|
43
|
+
return title;
|
|
47
44
|
};
|
|
48
45
|
|
|
49
46
|
export const flattenArrayProps = (
|
|
@@ -130,3 +127,19 @@ export const getLatestTaskDate = (processes: SubscriptionDetailProcess[]) => {
|
|
|
130
127
|
|
|
131
128
|
return tasks.length > 0 ? tasks[0].startedAt : '';
|
|
132
129
|
};
|
|
130
|
+
|
|
131
|
+
export const sortProcessesByDate = (
|
|
132
|
+
processList: SubscriptionDetailProcess[],
|
|
133
|
+
sortOrder: SortOrder,
|
|
134
|
+
) => {
|
|
135
|
+
return [...processList].sort((a, b) => {
|
|
136
|
+
const dateA = new Date(a.startedAt).getTime();
|
|
137
|
+
const dateB = new Date(b.startedAt).getTime();
|
|
138
|
+
|
|
139
|
+
if (sortOrder === SortOrder.ASC) {
|
|
140
|
+
return dateA - dateB; // Ascending order (oldest first)
|
|
141
|
+
} else {
|
|
142
|
+
return dateB - dateA; // Descending order (newest first)
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
};
|
|
@@ -4,17 +4,22 @@ import { useTranslations } from 'next-intl';
|
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import { useRouter } from 'next/router';
|
|
6
6
|
|
|
7
|
-
import { Pagination } from '@elastic/eui';
|
|
8
|
-
|
|
9
7
|
import {
|
|
10
8
|
FilterQuery,
|
|
11
9
|
PATH_SUBSCRIPTIONS,
|
|
10
|
+
Pagination,
|
|
12
11
|
WfoDateTime,
|
|
13
12
|
WfoInlineJson,
|
|
14
13
|
WfoInsyncIcon,
|
|
15
14
|
WfoJsonCodeBlock,
|
|
16
15
|
WfoSubscriptionStatusBadge,
|
|
16
|
+
getPageIndexChangeHandler,
|
|
17
|
+
getPageSizeChangeHandler,
|
|
17
18
|
} from '@/components';
|
|
19
|
+
import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable';
|
|
20
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
21
|
+
import { ColumnType } from '@/components/WfoTable/WfoTable';
|
|
22
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
18
23
|
import { DataDisplayParams, useShowToastMessage } from '@/hooks';
|
|
19
24
|
import {
|
|
20
25
|
useGetSubscriptionListQuery,
|
|
@@ -37,14 +42,10 @@ import {
|
|
|
37
42
|
SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY,
|
|
38
43
|
TableColumnKeys,
|
|
39
44
|
WfoDataSorting,
|
|
40
|
-
|
|
41
|
-
WfoTableWithFilter,
|
|
45
|
+
WfoFirstPartUUID,
|
|
42
46
|
getDataSortHandler,
|
|
43
|
-
getPageChangeHandler,
|
|
44
47
|
getQueryStringHandler,
|
|
45
48
|
} from '../WfoTable';
|
|
46
|
-
import { WfoFirstPartUUID } from '../WfoTable/WfoFirstPartUUID';
|
|
47
|
-
import { mapSortableAndFilterableValuesToTableColumnConfig } from '../WfoTable/utils/mapSortableAndFilterableValuesToTableColumnConfig';
|
|
48
49
|
import {
|
|
49
50
|
SubscriptionListItem,
|
|
50
51
|
mapGraphQlSubscriptionsResultToPageInfo,
|
|
@@ -69,91 +70,88 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
69
70
|
setDataDisplayParam,
|
|
70
71
|
hiddenColumns,
|
|
71
72
|
}) => {
|
|
72
|
-
// TODO: There seems to be a problem showing the product/productName in this list
|
|
73
|
-
// https://github.com/workfloworchestrator/orchestrator-ui/issues/262
|
|
74
|
-
|
|
75
73
|
const router = useRouter();
|
|
76
74
|
const t = useTranslations('subscriptions.index');
|
|
77
75
|
const tError = useTranslations('errors');
|
|
78
76
|
const { showToastMessage } = useShowToastMessage();
|
|
79
77
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
78
|
+
const tableColumnConfig: WfoAdvancedTableColumnConfig<SubscriptionListItem> =
|
|
79
|
+
{
|
|
80
|
+
subscriptionId: {
|
|
81
|
+
columnType: ColumnType.DATA,
|
|
82
|
+
label: t('id'),
|
|
83
|
+
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
84
|
+
renderDetails: (value) => value,
|
|
85
|
+
},
|
|
86
|
+
description: {
|
|
87
|
+
columnType: ColumnType.DATA,
|
|
88
|
+
label: t('description'),
|
|
89
|
+
width: '400px',
|
|
90
|
+
renderData: (value, record) => (
|
|
91
|
+
<Link href={`/subscriptions/${record.subscriptionId}`}>
|
|
92
|
+
{value}
|
|
93
|
+
</Link>
|
|
94
|
+
),
|
|
95
|
+
},
|
|
96
|
+
status: {
|
|
97
|
+
columnType: ColumnType.DATA,
|
|
98
|
+
label: t('status'),
|
|
99
|
+
renderData: (value) => (
|
|
100
|
+
<WfoSubscriptionStatusBadge status={value} />
|
|
101
|
+
),
|
|
102
|
+
},
|
|
103
|
+
insync: {
|
|
104
|
+
columnType: ColumnType.DATA,
|
|
105
|
+
label: t('insync'),
|
|
106
|
+
renderData: (value) => <WfoInsyncIcon inSync={value} />,
|
|
107
|
+
},
|
|
108
|
+
productName: {
|
|
109
|
+
columnType: ColumnType.DATA,
|
|
110
|
+
label: t('product'),
|
|
111
|
+
},
|
|
112
|
+
tag: {
|
|
113
|
+
columnType: ColumnType.DATA,
|
|
114
|
+
label: t('tag'),
|
|
115
|
+
width: '100px',
|
|
116
|
+
},
|
|
117
|
+
customerFullname: {
|
|
118
|
+
columnType: ColumnType.DATA,
|
|
119
|
+
label: t('customerFullname'),
|
|
120
|
+
width: '150px',
|
|
121
|
+
},
|
|
122
|
+
customerShortcode: {
|
|
123
|
+
columnType: ColumnType.DATA,
|
|
124
|
+
label: t('customerShortcode'),
|
|
125
|
+
width: '150px',
|
|
126
|
+
},
|
|
127
|
+
startDate: {
|
|
128
|
+
columnType: ColumnType.DATA,
|
|
129
|
+
label: t('startDate'),
|
|
130
|
+
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
131
|
+
renderDetails: parseDateToLocaleDateTimeString,
|
|
132
|
+
clipboardText: parseDateToLocaleDateTimeString,
|
|
133
|
+
},
|
|
134
|
+
endDate: {
|
|
135
|
+
columnType: ColumnType.DATA,
|
|
136
|
+
label: t('endDate'),
|
|
137
|
+
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
138
|
+
renderDetails: parseDateToLocaleDateTimeString,
|
|
139
|
+
clipboardText: parseDateToLocaleDateTimeString,
|
|
140
|
+
},
|
|
141
|
+
note: {
|
|
142
|
+
columnType: ColumnType.DATA,
|
|
143
|
+
label: t('note'),
|
|
144
|
+
width: '100px',
|
|
145
|
+
},
|
|
146
|
+
metadata: {
|
|
147
|
+
columnType: ColumnType.DATA,
|
|
148
|
+
label: t('metadata'),
|
|
149
|
+
width: '100px',
|
|
150
|
+
renderData: (value) => <WfoInlineJson data={value} />,
|
|
151
|
+
renderDetails: (value) =>
|
|
152
|
+
value && <WfoJsonCodeBlock data={value} isBasicStyle />,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
157
155
|
|
|
158
156
|
const { sortBy, queryString, pageIndex, pageSize } = dataDisplayParams;
|
|
159
157
|
|
|
@@ -175,7 +173,10 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
175
173
|
getQueryVariablesForExport(graphqlQueryVariables),
|
|
176
174
|
).unwrap();
|
|
177
175
|
|
|
178
|
-
const sortedColumnId = getTypedFieldFromObject(
|
|
176
|
+
const sortedColumnId = getTypedFieldFromObject(
|
|
177
|
+
sortBy?.field,
|
|
178
|
+
tableColumnConfig,
|
|
179
|
+
);
|
|
179
180
|
if (!sortedColumnId) {
|
|
180
181
|
router.replace(PATH_SUBSCRIPTIONS);
|
|
181
182
|
return null;
|
|
@@ -186,15 +187,22 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
186
187
|
sortOrder: dataDisplayParams.sortBy?.order ?? SortOrder.ASC,
|
|
187
188
|
};
|
|
188
189
|
const { totalItems, sortFields, filterFields } = data?.pageInfo ?? {};
|
|
190
|
+
|
|
189
191
|
const pagination: Pagination = {
|
|
190
|
-
pageSize: dataDisplayParams.pageSize,
|
|
191
192
|
pageIndex: dataDisplayParams.pageIndex,
|
|
193
|
+
pageSize: dataDisplayParams.pageSize,
|
|
192
194
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
193
195
|
totalItemCount: totalItems ?? 0,
|
|
196
|
+
onChangePage:
|
|
197
|
+
getPageIndexChangeHandler<SubscriptionListItem>(
|
|
198
|
+
setDataDisplayParam,
|
|
199
|
+
),
|
|
200
|
+
onChangeItemsPerPage:
|
|
201
|
+
getPageSizeChangeHandler<SubscriptionListItem>(setDataDisplayParam),
|
|
194
202
|
};
|
|
195
203
|
|
|
196
204
|
return (
|
|
197
|
-
<
|
|
205
|
+
<WfoAdvancedTable
|
|
198
206
|
queryString={dataDisplayParams.queryString}
|
|
199
207
|
onUpdateQueryString={getQueryStringHandler<SubscriptionListItem>(
|
|
200
208
|
setDataDisplayParam,
|
|
@@ -204,29 +212,26 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
204
212
|
? mapGraphQlSubscriptionsResultToSubscriptionListItems(data)
|
|
205
213
|
: []
|
|
206
214
|
}
|
|
207
|
-
|
|
208
|
-
|
|
215
|
+
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
216
|
+
tableColumnConfig,
|
|
209
217
|
sortFields,
|
|
210
218
|
filterFields,
|
|
211
219
|
)}
|
|
212
220
|
defaultHiddenColumns={hiddenColumns}
|
|
213
|
-
dataSorting={dataSorting}
|
|
214
|
-
pagination={pagination}
|
|
221
|
+
dataSorting={[dataSorting]}
|
|
215
222
|
isLoading={isFetching}
|
|
216
223
|
localStorageKey={SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY}
|
|
217
224
|
detailModalTitle={'Details - Subscription'}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
onUpdateDataSort={getDataSortHandler<SubscriptionListItem>(
|
|
225
|
+
pagination={pagination}
|
|
226
|
+
error={mapRtkErrorToWfoError(error)}
|
|
227
|
+
onUpdateDataSorting={getDataSortHandler<SubscriptionListItem>(
|
|
222
228
|
setDataDisplayParam,
|
|
223
229
|
)}
|
|
224
|
-
error={mapRtkErrorToWfoError(error)}
|
|
225
230
|
onExportData={csvDownloadHandler(
|
|
226
231
|
getSubscriptionListForExport,
|
|
227
232
|
mapGraphQlSubscriptionsResultToSubscriptionListItems,
|
|
228
233
|
mapGraphQlSubscriptionsResultToPageInfo,
|
|
229
|
-
Object.keys(
|
|
234
|
+
Object.keys(tableColumnConfig),
|
|
230
235
|
getCsvFileNameWithDate('Subscriptions'),
|
|
231
236
|
showToastMessage,
|
|
232
237
|
tError,
|