@orchestrator-ui/orchestrator-ui-components 2.1.0 → 2.2.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 +8 -8
- package/.turbo/turbo-lint.log +2 -5
- package/.turbo/turbo-test.log +11 -11
- package/CHANGELOG.md +19 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.js +1160 -1075
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/WfoBadges/WfoBadge/WfoBadge.tsx +1 -1
- package/src/components/WfoContentHeader/WfoContentHeader.tsx +9 -8
- package/src/components/WfoDateTime/WfoDateTime.tsx +2 -10
- package/src/components/WfoForms/formFields/BoolField.tsx +1 -1
- package/src/components/WfoProcessList/WfoProcessesList.tsx +4 -0
- package/src/components/WfoStartButton/WfoStartTaskComboBox.tsx +5 -5
- package/src/components/WfoStartButton/WfoStartWorkflowComboBox.tsx +6 -4
- package/src/components/WfoSubscription/WfoRelatedSubscriptions.tsx +3 -0
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +3 -0
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +1 -5
- package/src/components/WfoTable/WfoTable/WfoDataCell.tsx +31 -0
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/useGroupedTableConfig.tsx +6 -6
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts +58 -33
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/utils.ts +11 -6
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +1 -0
- package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +12 -4
- package/src/components/WfoTable/WfoTable/index.ts +1 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/useWfoSession.ts +2 -0
- package/src/icons/WfoCheckmarkCircleFill.tsx +0 -1
- package/src/icons/WfoMinusCircleOutline.tsx +0 -1
- package/src/pages/metadata/WfoProductBlocksPage.tsx +15 -0
- package/src/pages/metadata/WfoProductsPage.tsx +15 -0
- package/src/pages/metadata/WfoResourceTypesPage.tsx +6 -0
- package/src/pages/metadata/WfoTasksPage.tsx +9 -0
- package/src/pages/metadata/WfoWorkflowsPage.tsx +9 -0
- package/src/rtk/api.ts +7 -2
- package/src/rtk/wfoGraphqlRequestBaseQuery.ts +14 -16
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ export const WfoBadge: FC<WfoBadgeProps> = ({
|
|
|
18
18
|
...restProps
|
|
19
19
|
}) => (
|
|
20
20
|
<EuiBadge {...restProps}>
|
|
21
|
-
<EuiText color={textColor} size={size ?? 'xs'}>
|
|
21
|
+
<EuiText title="" color={textColor} size={size ?? 'xs'}>
|
|
22
22
|
<b>{children}</b>
|
|
23
23
|
</EuiText>
|
|
24
24
|
</EuiBadge>
|
|
@@ -30,10 +30,18 @@ export const WfoContentHeader: FC<WfoContentHeaderProps> = ({
|
|
|
30
30
|
>
|
|
31
31
|
{title}
|
|
32
32
|
</WfoRenderElementOrString>
|
|
33
|
+
{subtitle && (
|
|
34
|
+
<div>
|
|
35
|
+
<EuiSpacer size="m" />
|
|
36
|
+
<WfoRenderElementOrString>
|
|
37
|
+
{subtitle}
|
|
38
|
+
</WfoRenderElementOrString>
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
33
41
|
</EuiFlexItem>
|
|
34
42
|
|
|
35
43
|
{children && (
|
|
36
|
-
<EuiFlexItem>
|
|
44
|
+
<EuiFlexItem grow={0}>
|
|
37
45
|
<EuiFlexGroup justifyContent="flexEnd">
|
|
38
46
|
<WfoRenderElementOrString>
|
|
39
47
|
{children}
|
|
@@ -43,13 +51,6 @@ export const WfoContentHeader: FC<WfoContentHeaderProps> = ({
|
|
|
43
51
|
)}
|
|
44
52
|
</EuiFlexGroup>
|
|
45
53
|
|
|
46
|
-
{subtitle && (
|
|
47
|
-
<>
|
|
48
|
-
<EuiSpacer size="m" />
|
|
49
|
-
<WfoRenderElementOrString>{subtitle}</WfoRenderElementOrString>
|
|
50
|
-
</>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
54
|
<EuiSpacer size="l" />
|
|
54
55
|
</>
|
|
55
56
|
);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
getDate,
|
|
5
|
-
parseDateOrTimeRelativeToToday,
|
|
6
|
-
parseDateToLocaleDateTimeString,
|
|
7
|
-
} from '@/utils';
|
|
3
|
+
import { getDate, parseDateOrTimeRelativeToToday } from '@/utils';
|
|
8
4
|
|
|
9
5
|
export type WfoDateTimeProps = {
|
|
10
6
|
dateOrIsoString: Date | string | null;
|
|
@@ -13,9 +9,5 @@ export type WfoDateTimeProps = {
|
|
|
13
9
|
export const WfoDateTime: FC<WfoDateTimeProps> = ({ dateOrIsoString }) => {
|
|
14
10
|
const date = getDate(dateOrIsoString);
|
|
15
11
|
|
|
16
|
-
return (
|
|
17
|
-
<span title={parseDateToLocaleDateTimeString(date)}>
|
|
18
|
-
{parseDateOrTimeRelativeToToday(date)}
|
|
19
|
-
</span>
|
|
20
|
-
);
|
|
12
|
+
return <span>{parseDateOrTimeRelativeToToday(date)}</span>;
|
|
21
13
|
};
|
|
@@ -113,6 +113,7 @@ export const WfoProcessesList = ({
|
|
|
113
113
|
columnType: ColumnType.DATA,
|
|
114
114
|
label: t('step'),
|
|
115
115
|
width: '15%',
|
|
116
|
+
renderTooltip: (value) => value,
|
|
116
117
|
},
|
|
117
118
|
lastStatus: {
|
|
118
119
|
columnType: ColumnType.DATA,
|
|
@@ -184,6 +185,7 @@ export const WfoProcessesList = ({
|
|
|
184
185
|
width: '90',
|
|
185
186
|
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
186
187
|
renderDetails: (value) => value,
|
|
188
|
+
renderTooltip: (value) => value,
|
|
187
189
|
},
|
|
188
190
|
startedAt: {
|
|
189
191
|
columnType: ColumnType.DATA,
|
|
@@ -192,6 +194,7 @@ export const WfoProcessesList = ({
|
|
|
192
194
|
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
193
195
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
194
196
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
197
|
+
renderTooltip: (value) => value.toString(),
|
|
195
198
|
},
|
|
196
199
|
lastModifiedAt: {
|
|
197
200
|
columnType: ColumnType.DATA,
|
|
@@ -200,6 +203,7 @@ export const WfoProcessesList = ({
|
|
|
200
203
|
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
201
204
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
202
205
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
206
|
+
renderTooltip: (value) => value.toString(),
|
|
203
207
|
},
|
|
204
208
|
};
|
|
205
209
|
|
|
@@ -18,14 +18,14 @@ export const WfoStartTaskButtonComboBox = () => {
|
|
|
18
18
|
const { data } = useGetTaskOptionsQuery();
|
|
19
19
|
const taskOptions = data?.startOptions || [];
|
|
20
20
|
|
|
21
|
-
const comboBoxOptions: StartComboBoxOption[] = taskOptions
|
|
22
|
-
(option) => ({
|
|
21
|
+
const comboBoxOptions: StartComboBoxOption[] = [...taskOptions]
|
|
22
|
+
.map((option) => ({
|
|
23
23
|
data: {
|
|
24
24
|
workflowName: option.name,
|
|
25
25
|
},
|
|
26
|
-
label: option.description
|
|
27
|
-
})
|
|
28
|
-
|
|
26
|
+
label: option.description ?? option.name,
|
|
27
|
+
}))
|
|
28
|
+
.sort((taskA, taskB) => taskA.label.localeCompare(taskB.label));
|
|
29
29
|
|
|
30
30
|
const handleOptionChange = async (selectedProduct: StartComboBoxOption) => {
|
|
31
31
|
if (await isEngineRunningNow()) {
|
|
@@ -18,15 +18,17 @@ export const WfoStartWorkflowButtonComboBox = () => {
|
|
|
18
18
|
const { data } = useGetWorkflowOptionsQuery();
|
|
19
19
|
const workflowOptions = data?.startOptions || [];
|
|
20
20
|
|
|
21
|
-
const comboBoxOptions: StartComboBoxOption[] = workflowOptions
|
|
22
|
-
(
|
|
21
|
+
const comboBoxOptions: StartComboBoxOption[] = [...workflowOptions]
|
|
22
|
+
.sort((workflowA, workflowB) =>
|
|
23
|
+
workflowA.productName.localeCompare(workflowB.productName),
|
|
24
|
+
)
|
|
25
|
+
.map((option) => ({
|
|
23
26
|
data: {
|
|
24
27
|
workflowName: option.workflowName,
|
|
25
28
|
productId: option.productId,
|
|
26
29
|
},
|
|
27
30
|
label: option.productName || '',
|
|
28
|
-
})
|
|
29
|
-
);
|
|
31
|
+
}));
|
|
30
32
|
|
|
31
33
|
const handleOptionChange = async (selectedProduct: StartComboBoxOption) => {
|
|
32
34
|
if (await isEngineRunningNow()) {
|
|
@@ -101,6 +101,7 @@ export const WfoRelatedSubscriptions = ({
|
|
|
101
101
|
columnType: ColumnType.DATA,
|
|
102
102
|
label: t('id'),
|
|
103
103
|
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
104
|
+
renderTooltip: (value) => value,
|
|
104
105
|
},
|
|
105
106
|
description: {
|
|
106
107
|
columnType: ColumnType.DATA,
|
|
@@ -129,6 +130,7 @@ export const WfoRelatedSubscriptions = ({
|
|
|
129
130
|
customerFullname: {
|
|
130
131
|
columnType: ColumnType.DATA,
|
|
131
132
|
label: t('customer'),
|
|
133
|
+
renderTooltip: (value) => value,
|
|
132
134
|
},
|
|
133
135
|
tag: {
|
|
134
136
|
columnType: ColumnType.DATA,
|
|
@@ -139,6 +141,7 @@ export const WfoRelatedSubscriptions = ({
|
|
|
139
141
|
columnType: ColumnType.DATA,
|
|
140
142
|
label: t('startDate'),
|
|
141
143
|
renderData: parseDateToLocaleDateString,
|
|
144
|
+
renderTooltip: parseDateToLocaleDateString,
|
|
142
145
|
},
|
|
143
146
|
};
|
|
144
147
|
|
|
@@ -82,6 +82,7 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
82
82
|
label: t('id'),
|
|
83
83
|
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
84
84
|
renderDetails: (value) => value,
|
|
85
|
+
renderTooltip: (value) => value,
|
|
85
86
|
},
|
|
86
87
|
description: {
|
|
87
88
|
columnType: ColumnType.DATA,
|
|
@@ -130,6 +131,7 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
130
131
|
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
131
132
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
132
133
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
134
|
+
renderTooltip: (cellValue) => cellValue?.toString(),
|
|
133
135
|
},
|
|
134
136
|
endDate: {
|
|
135
137
|
columnType: ColumnType.DATA,
|
|
@@ -137,6 +139,7 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
|
|
|
137
139
|
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
138
140
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
139
141
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
142
|
+
renderTooltip: (cellValue) => cellValue?.toString(),
|
|
140
143
|
},
|
|
141
144
|
note: {
|
|
142
145
|
columnType: ColumnType.DATA,
|
|
@@ -12,9 +12,5 @@ export type WfoFirstUUIDPartProps = {
|
|
|
12
12
|
export const WfoFirstPartUUID: FC<WfoFirstUUIDPartProps> = ({ UUID }) => {
|
|
13
13
|
const { uuidFieldStyle } = useWithOrchestratorTheme(getStyles);
|
|
14
14
|
|
|
15
|
-
return (
|
|
16
|
-
<span css={uuidFieldStyle} title={UUID}>
|
|
17
|
-
{getFirstUuidPart(UUID)}
|
|
18
|
-
</span>
|
|
19
|
-
);
|
|
15
|
+
return <span css={uuidFieldStyle}>{getFirstUuidPart(UUID)}</span>;
|
|
20
16
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiToolTip } from '@elastic/eui';
|
|
4
|
+
|
|
5
|
+
interface WfoDataCellProps {
|
|
6
|
+
customTooltip: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const WfoDataCell: FC<WfoDataCellProps> = ({
|
|
11
|
+
customTooltip,
|
|
12
|
+
children,
|
|
13
|
+
}) => {
|
|
14
|
+
const tooltipContent =
|
|
15
|
+
customTooltip || (typeof children === 'string' ? children : <></>);
|
|
16
|
+
|
|
17
|
+
if (tooltipContent) {
|
|
18
|
+
return (
|
|
19
|
+
<EuiToolTip
|
|
20
|
+
position="bottom"
|
|
21
|
+
delay="long"
|
|
22
|
+
content={tooltipContent}
|
|
23
|
+
css={{ maxWidth: 'fit-content' }}
|
|
24
|
+
repositionOnScroll
|
|
25
|
+
>
|
|
26
|
+
<>{children}</>
|
|
27
|
+
</EuiToolTip>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return <>{children}</>;
|
|
31
|
+
};
|
|
@@ -35,6 +35,11 @@ export const useGroupedTableConfig = <T extends object>({
|
|
|
35
35
|
// Expanding all children needs another render cycle, because they do not exist in the DOM yet
|
|
36
36
|
const [isExpanding, setIsExpanding] = useState(false);
|
|
37
37
|
|
|
38
|
+
const groups: GroupType[] = getObjectKeys(data).map((key) => ({
|
|
39
|
+
groupName: key.toString(),
|
|
40
|
+
}));
|
|
41
|
+
const numberOfColumnsInnerTable = Object.keys(columnConfig).length;
|
|
42
|
+
|
|
38
43
|
useEffect(() => {
|
|
39
44
|
if (isExpanding) {
|
|
40
45
|
groupReferences.current.forEach((ref) => {
|
|
@@ -53,12 +58,7 @@ export const useGroupedTableConfig = <T extends object>({
|
|
|
53
58
|
),
|
|
54
59
|
);
|
|
55
60
|
}
|
|
56
|
-
}, [isAllSubgroupsExpanded, isAllGroupsExpanded]);
|
|
57
|
-
|
|
58
|
-
const groups: GroupType[] = getObjectKeys(data).map((key) => ({
|
|
59
|
-
groupName: key.toString(),
|
|
60
|
-
}));
|
|
61
|
-
const numberOfColumnsInnerTable = Object.keys(columnConfig).length;
|
|
61
|
+
}, [isAllSubgroupsExpanded, isAllGroupsExpanded, notifyParent, groups]);
|
|
62
62
|
|
|
63
63
|
const groupColumnConfig: WfoTableColumnConfig<GroupType> = {
|
|
64
64
|
groupName: {
|
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
import { GroupedData } from './WfoGroupedTable';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getTotalNumberOfRows,
|
|
4
|
+
groupData,
|
|
5
|
+
toObjectWithSortedProperties,
|
|
6
|
+
} from './utils';
|
|
3
7
|
|
|
4
8
|
type TestObject = {
|
|
5
9
|
name: string;
|
|
6
10
|
age: number;
|
|
7
|
-
group: '
|
|
8
|
-
subGroup: '
|
|
11
|
+
group: 'groupA' | 'groupB';
|
|
12
|
+
subGroup: 'subGroupA' | 'subGroupB';
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
describe('WfoGroupedTable - utils', () => {
|
|
12
16
|
describe('groupData()', () => {
|
|
13
|
-
it('successfully groups the data', () => {
|
|
17
|
+
it('successfully groups the data. Sorting alphabetically by group name', () => {
|
|
14
18
|
// Given
|
|
15
19
|
const testData: TestObject[] = [
|
|
16
20
|
{
|
|
17
21
|
name: 'John',
|
|
18
22
|
age: 25,
|
|
19
|
-
group: '
|
|
20
|
-
subGroup: '
|
|
23
|
+
group: 'groupB',
|
|
24
|
+
subGroup: 'subGroupA',
|
|
21
25
|
},
|
|
22
26
|
{
|
|
23
27
|
name: 'Bob',
|
|
24
28
|
age: 40,
|
|
25
|
-
group: '
|
|
26
|
-
subGroup: '
|
|
29
|
+
group: 'groupB',
|
|
30
|
+
subGroup: 'subGroupB',
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
33
|
name: 'Jane',
|
|
30
34
|
age: 30,
|
|
31
|
-
group: '
|
|
32
|
-
subGroup: '
|
|
35
|
+
group: 'groupB',
|
|
36
|
+
subGroup: 'subGroupB',
|
|
33
37
|
},
|
|
34
38
|
{
|
|
35
39
|
name: 'Tom',
|
|
36
40
|
age: 35,
|
|
37
|
-
group: '
|
|
38
|
-
subGroup: '
|
|
41
|
+
group: 'groupA',
|
|
42
|
+
subGroup: 'subGroupA',
|
|
39
43
|
},
|
|
40
44
|
];
|
|
41
45
|
|
|
@@ -47,37 +51,37 @@ describe('WfoGroupedTable - utils', () => {
|
|
|
47
51
|
|
|
48
52
|
// Then
|
|
49
53
|
const expected: GroupedData<TestObject> = {
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
groupA: {
|
|
55
|
+
subGroupA: [
|
|
52
56
|
{
|
|
53
57
|
name: 'Tom',
|
|
54
58
|
age: 35,
|
|
55
|
-
group: '
|
|
56
|
-
subGroup: '
|
|
59
|
+
group: 'groupA',
|
|
60
|
+
subGroup: 'subGroupA',
|
|
57
61
|
},
|
|
58
62
|
],
|
|
59
63
|
},
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
groupB: {
|
|
65
|
+
subGroupA: [
|
|
62
66
|
{
|
|
63
67
|
name: 'John',
|
|
64
68
|
age: 25,
|
|
65
|
-
group: '
|
|
66
|
-
subGroup: '
|
|
69
|
+
group: 'groupB',
|
|
70
|
+
subGroup: 'subGroupA',
|
|
67
71
|
},
|
|
68
72
|
],
|
|
69
|
-
|
|
73
|
+
subGroupB: [
|
|
70
74
|
{
|
|
71
75
|
name: 'Bob',
|
|
72
76
|
age: 40,
|
|
73
|
-
group: '
|
|
74
|
-
subGroup: '
|
|
77
|
+
group: 'groupB',
|
|
78
|
+
subGroup: 'subGroupB',
|
|
75
79
|
},
|
|
76
80
|
{
|
|
77
81
|
name: 'Jane',
|
|
78
82
|
age: 30,
|
|
79
|
-
group: '
|
|
80
|
-
subGroup: '
|
|
83
|
+
group: 'groupB',
|
|
84
|
+
subGroup: 'subGroupB',
|
|
81
85
|
},
|
|
82
86
|
],
|
|
83
87
|
},
|
|
@@ -86,6 +90,27 @@ describe('WfoGroupedTable - utils', () => {
|
|
|
86
90
|
});
|
|
87
91
|
});
|
|
88
92
|
|
|
93
|
+
describe('sort object by properties', () => {
|
|
94
|
+
// Given
|
|
95
|
+
const testObject = {
|
|
96
|
+
c: 'c',
|
|
97
|
+
a: 'a',
|
|
98
|
+
b: 'b',
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// When
|
|
102
|
+
const sortedObject = toObjectWithSortedProperties(testObject);
|
|
103
|
+
|
|
104
|
+
// Then
|
|
105
|
+
it('sorts the object by properties', () => {
|
|
106
|
+
expect(sortedObject).toEqual({
|
|
107
|
+
a: 'a',
|
|
108
|
+
b: 'b',
|
|
109
|
+
c: 'c',
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
89
114
|
describe('getTotalNumberOfRows()', () => {
|
|
90
115
|
it('counts the total number of data rows', () => {
|
|
91
116
|
const testData: GroupedData<TestObject> = {
|
|
@@ -94,22 +119,22 @@ describe('WfoGroupedTable - utils', () => {
|
|
|
94
119
|
{
|
|
95
120
|
name: 'John',
|
|
96
121
|
age: 25,
|
|
97
|
-
group: '
|
|
98
|
-
subGroup: '
|
|
122
|
+
group: 'groupA',
|
|
123
|
+
subGroup: 'subGroupA',
|
|
99
124
|
},
|
|
100
125
|
{
|
|
101
126
|
name: 'Bob',
|
|
102
127
|
age: 40,
|
|
103
|
-
group: '
|
|
104
|
-
subGroup: '
|
|
128
|
+
group: 'groupA',
|
|
129
|
+
subGroup: 'subGroupA',
|
|
105
130
|
},
|
|
106
131
|
],
|
|
107
132
|
subGroup2: [
|
|
108
133
|
{
|
|
109
134
|
name: 'Jane',
|
|
110
135
|
age: 30,
|
|
111
|
-
group: '
|
|
112
|
-
subGroup: '
|
|
136
|
+
group: 'groupA',
|
|
137
|
+
subGroup: 'subGroupB',
|
|
113
138
|
},
|
|
114
139
|
],
|
|
115
140
|
},
|
|
@@ -118,8 +143,8 @@ describe('WfoGroupedTable - utils', () => {
|
|
|
118
143
|
{
|
|
119
144
|
name: 'Tom',
|
|
120
145
|
age: 35,
|
|
121
|
-
group: '
|
|
122
|
-
subGroup: '
|
|
146
|
+
group: 'groupA',
|
|
147
|
+
subGroup: 'subGroupA',
|
|
123
148
|
},
|
|
124
149
|
],
|
|
125
150
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { sortBy, toPairs } from 'lodash';
|
|
2
|
+
|
|
1
3
|
import { GroupedData } from './WfoGroupedTable';
|
|
2
4
|
|
|
3
5
|
export const groupData = <T>(
|
|
@@ -22,14 +24,17 @@ export const groupData = <T>(
|
|
|
22
24
|
);
|
|
23
25
|
|
|
24
26
|
if (groupByFunctions.length <= 1) {
|
|
25
|
-
return groupedData;
|
|
27
|
+
return toObjectWithSortedProperties(groupedData);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
const entries = Object.entries(groupedData).map(([key, value]) =>
|
|
29
|
-
key,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const entries = Object.entries(groupedData).map(([key, value]) => {
|
|
31
|
+
return [key, groupData(value, groupByFunctions.slice(1))];
|
|
32
|
+
});
|
|
33
|
+
return toObjectWithSortedProperties(Object.fromEntries(entries));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const toObjectWithSortedProperties = (object: object) => {
|
|
37
|
+
return Object.fromEntries(sortBy(toPairs(object), ([key]) => key));
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
export const getTotalNumberOfRows = <T>(groupedData: GroupedData<T>): number =>
|
|
@@ -46,6 +46,7 @@ export type WfoTableDataColumnConfigItem<
|
|
|
46
46
|
isSortable?: boolean;
|
|
47
47
|
isFilterable?: boolean;
|
|
48
48
|
renderData?: (cellValue: T[Property], row: T) => ReactNode;
|
|
49
|
+
renderTooltip?: (cellValue: T[Property], row: T) => ReactNode;
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
export type WfoTableControlColumnConfigItem<T extends object> =
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
|
|
3
|
+
import { WfoDataCell } from '@/components';
|
|
3
4
|
import { useWithOrchestratorTheme } from '@/hooks';
|
|
4
5
|
import { toOptionalArrayEntry } from '@/utils';
|
|
5
6
|
|
|
@@ -91,10 +92,17 @@ export const WfoTableDataRows = <T extends object>({
|
|
|
91
92
|
]}
|
|
92
93
|
>
|
|
93
94
|
<div>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
<WfoDataCell
|
|
96
|
+
customTooltip={columnConfig.renderTooltip?.(
|
|
97
|
+
result,
|
|
98
|
+
row,
|
|
99
|
+
)}
|
|
100
|
+
>
|
|
101
|
+
{columnConfig.renderData?.(
|
|
102
|
+
result,
|
|
103
|
+
row,
|
|
104
|
+
) ?? result?.toString()}
|
|
105
|
+
</WfoDataCell>
|
|
98
106
|
</div>
|
|
99
107
|
</td>
|
|
100
108
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.2.0';
|
|
@@ -98,6 +98,7 @@ export const WfoProductBlocksPage = () => {
|
|
|
98
98
|
width: '90',
|
|
99
99
|
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
100
100
|
renderDetails: (value) => value,
|
|
101
|
+
renderTooltip: (value) => value,
|
|
101
102
|
},
|
|
102
103
|
name: {
|
|
103
104
|
columnType: ColumnType.DATA,
|
|
@@ -138,6 +139,11 @@ export const WfoProductBlocksPage = () => {
|
|
|
138
139
|
))}
|
|
139
140
|
</>
|
|
140
141
|
),
|
|
142
|
+
renderTooltip: (productBlocks) => {
|
|
143
|
+
return productBlocks.map((productBlock) => (
|
|
144
|
+
<p key={productBlock.name}>- {productBlock.name}</p>
|
|
145
|
+
));
|
|
146
|
+
},
|
|
141
147
|
},
|
|
142
148
|
resourceTypes: {
|
|
143
149
|
columnType: ColumnType.DATA,
|
|
@@ -166,6 +172,13 @@ export const WfoProductBlocksPage = () => {
|
|
|
166
172
|
))}
|
|
167
173
|
</EuiBadgeGroup>
|
|
168
174
|
),
|
|
175
|
+
renderTooltip: (resourceTypes) => {
|
|
176
|
+
return resourceTypes.map((resourceType) => (
|
|
177
|
+
<p key={resourceType.resourceType}>
|
|
178
|
+
- {resourceType.resourceType}
|
|
179
|
+
</p>
|
|
180
|
+
));
|
|
181
|
+
},
|
|
169
182
|
},
|
|
170
183
|
createdAt: {
|
|
171
184
|
columnType: ColumnType.DATA,
|
|
@@ -173,6 +186,7 @@ export const WfoProductBlocksPage = () => {
|
|
|
173
186
|
renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
|
|
174
187
|
renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
|
|
175
188
|
clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
|
|
189
|
+
renderTooltip: parseIsoString(parseDateToLocaleDateTimeString),
|
|
176
190
|
},
|
|
177
191
|
endDate: {
|
|
178
192
|
columnType: ColumnType.DATA,
|
|
@@ -180,6 +194,7 @@ export const WfoProductBlocksPage = () => {
|
|
|
180
194
|
renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
|
|
181
195
|
renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
|
|
182
196
|
clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
|
|
197
|
+
renderTooltip: parseIsoString(parseDateToLocaleDateTimeString),
|
|
183
198
|
},
|
|
184
199
|
};
|
|
185
200
|
|
|
@@ -95,6 +95,7 @@ export const WfoProductsPage = () => {
|
|
|
95
95
|
width: '90',
|
|
96
96
|
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
97
97
|
renderDetails: (value) => value,
|
|
98
|
+
renderTooltip: (value) => value,
|
|
98
99
|
},
|
|
99
100
|
name: {
|
|
100
101
|
columnType: ColumnType.DATA,
|
|
@@ -120,6 +121,7 @@ export const WfoProductsPage = () => {
|
|
|
120
121
|
columnType: ColumnType.DATA,
|
|
121
122
|
label: t('description'),
|
|
122
123
|
width: '400',
|
|
124
|
+
renderTooltip: (value) => value,
|
|
123
125
|
},
|
|
124
126
|
productType: {
|
|
125
127
|
columnType: ColumnType.DATA,
|
|
@@ -146,6 +148,13 @@ export const WfoProductsPage = () => {
|
|
|
146
148
|
))}
|
|
147
149
|
</>
|
|
148
150
|
),
|
|
151
|
+
renderTooltip: (fixedInputs) => {
|
|
152
|
+
return fixedInputs.map((fixedInput) => (
|
|
153
|
+
<p key={fixedInput.name}>
|
|
154
|
+
- {`${fixedInput.name}: ${fixedInput.value}`}
|
|
155
|
+
</p>
|
|
156
|
+
));
|
|
157
|
+
},
|
|
149
158
|
},
|
|
150
159
|
productBlocks: {
|
|
151
160
|
columnType: ColumnType.DATA,
|
|
@@ -162,6 +171,11 @@ export const WfoProductsPage = () => {
|
|
|
162
171
|
))}
|
|
163
172
|
</>
|
|
164
173
|
),
|
|
174
|
+
renderTooltip: (productBlocks) => {
|
|
175
|
+
return productBlocks.map((productBlock) => (
|
|
176
|
+
<p key={productBlock.name}>- {productBlock.name}</p>
|
|
177
|
+
));
|
|
178
|
+
},
|
|
165
179
|
},
|
|
166
180
|
createdAt: {
|
|
167
181
|
columnType: ColumnType.DATA,
|
|
@@ -169,6 +183,7 @@ export const WfoProductsPage = () => {
|
|
|
169
183
|
renderData: (date) => <WfoDateTime dateOrIsoString={date} />,
|
|
170
184
|
renderDetails: parseIsoString(parseDateToLocaleDateTimeString),
|
|
171
185
|
clipboardText: parseIsoString(parseDateToLocaleDateTimeString),
|
|
186
|
+
renderTooltip: parseIsoString(parseDateToLocaleDateTimeString),
|
|
172
187
|
},
|
|
173
188
|
};
|
|
174
189
|
|