@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
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2019-
|
|
2
|
+
* Copyright 2019-2024 SURF.
|
|
3
3
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License.
|
|
5
5
|
* You may obtain a copy of the License at
|
|
@@ -18,7 +18,7 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
18
18
|
|
|
19
19
|
import { EuiFormRow, EuiText } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { WfoLoading,
|
|
21
|
+
import { WfoLoading, WfoSubscriptionDetailSection } from '@/components';
|
|
22
22
|
import { useGetSubscriptionDetailQuery } from '@/rtk';
|
|
23
23
|
|
|
24
24
|
import { FieldProps } from './types';
|
|
@@ -35,14 +35,15 @@ const SubscriptionSummaryDisplay = ({
|
|
|
35
35
|
const { data, isFetching } = useGetSubscriptionDetailQuery({
|
|
36
36
|
subscriptionId,
|
|
37
37
|
});
|
|
38
|
+
const subscriptionDetail = data?.subscription;
|
|
38
39
|
|
|
39
|
-
if (!
|
|
40
|
+
if (!subscriptionDetail) {
|
|
40
41
|
return <WfoLoading />;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
return (
|
|
44
|
-
<
|
|
45
|
-
subscriptionDetail={
|
|
45
|
+
<WfoSubscriptionDetailSection
|
|
46
|
+
subscriptionDetail={subscriptionDetail}
|
|
46
47
|
isFetching={isFetching}
|
|
47
48
|
/>
|
|
48
49
|
);
|
|
@@ -52,7 +52,9 @@ export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
|
|
|
52
52
|
return (
|
|
53
53
|
<EuiHeader css={getHeaderStyle(navigationHeight)}>
|
|
54
54
|
<EuiHeaderSection>
|
|
55
|
-
<EuiToolTip
|
|
55
|
+
<EuiToolTip
|
|
56
|
+
content={'UI version' + ORCHESTRATOR_UI_LIBRARY_VERSION}
|
|
57
|
+
>
|
|
56
58
|
<EuiHeaderSectionItem css={{ paddingTop: theme.size.xs }}>
|
|
57
59
|
<EuiHeaderLogo iconType={() => <WfoAppLogo />} />
|
|
58
60
|
<div css={appNameStyle}>
|
|
@@ -3,27 +3,27 @@ import React from 'react';
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
|
|
6
|
-
import { Pagination } from '@elastic/eui';
|
|
7
|
-
|
|
8
6
|
import {
|
|
9
7
|
FilterQuery,
|
|
10
8
|
PATH_WORKFLOWS,
|
|
11
9
|
WfoDateTime,
|
|
12
10
|
WfoProcessStatusBadge,
|
|
13
11
|
WfoWorkflowTargetBadge,
|
|
12
|
+
getPageIndexChangeHandler,
|
|
13
|
+
getPageSizeChangeHandler,
|
|
14
14
|
} from '@/components';
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_PAGE_SIZES,
|
|
17
17
|
TableColumnKeys,
|
|
18
18
|
WfoDataSorting,
|
|
19
19
|
WfoFirstPartUUID,
|
|
20
|
-
WfoTableColumns,
|
|
21
|
-
WfoTableWithFilter,
|
|
22
20
|
getDataSortHandler,
|
|
23
|
-
getPageChangeHandler,
|
|
24
21
|
getQueryStringHandler,
|
|
25
|
-
mapSortableAndFilterableValuesToTableColumnConfig,
|
|
26
22
|
} from '@/components/WfoTable';
|
|
23
|
+
import { WfoAdvancedTable } from '@/components/WfoTable/WfoAdvancedTable';
|
|
24
|
+
import { WfoAdvancedTableColumnConfig } from '@/components/WfoTable/WfoAdvancedTable/types';
|
|
25
|
+
import { ColumnType, Pagination } from '@/components/WfoTable/WfoTable';
|
|
26
|
+
import { mapSortableAndFilterableValuesToTableColumnConfig } from '@/components/WfoTable/WfoTable/utils';
|
|
27
27
|
import { useShowToastMessage } from '@/hooks';
|
|
28
28
|
import { DataDisplayParams } from '@/hooks';
|
|
29
29
|
import { WfoProcessListSubscriptionsCell } from '@/pages';
|
|
@@ -84,8 +84,8 @@ export type WfoProcessesListProps = {
|
|
|
84
84
|
value: DataDisplayParams<ProcessListItem>[DisplayParamKey],
|
|
85
85
|
) => void;
|
|
86
86
|
overrideDefaultTableColumns?: (
|
|
87
|
-
defaultTableColumns:
|
|
88
|
-
) =>
|
|
87
|
+
defaultTableColumns: WfoAdvancedTableColumnConfig<ProcessListItem>,
|
|
88
|
+
) => WfoAdvancedTableColumnConfig<ProcessListItem>;
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export const WfoProcessesList = ({
|
|
@@ -93,66 +93,66 @@ export const WfoProcessesList = ({
|
|
|
93
93
|
defaultHiddenColumns = [],
|
|
94
94
|
localStorageKey,
|
|
95
95
|
dataDisplayParams,
|
|
96
|
-
setDataDisplayParam,
|
|
97
96
|
overrideDefaultTableColumns,
|
|
97
|
+
setDataDisplayParam,
|
|
98
98
|
}: WfoProcessesListProps) => {
|
|
99
99
|
const t = useTranslations('processes.index');
|
|
100
100
|
const tError = useTranslations('errors');
|
|
101
101
|
const { showToastMessage } = useShowToastMessage();
|
|
102
102
|
|
|
103
|
-
const defaultTableColumns:
|
|
103
|
+
const defaultTableColumns: WfoAdvancedTableColumnConfig<ProcessListItem> = {
|
|
104
104
|
workflowName: {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
columnType: ColumnType.DATA,
|
|
106
|
+
label: t('workflowName'),
|
|
107
107
|
width: '20%',
|
|
108
|
-
|
|
108
|
+
renderData: (value, { processId }) => (
|
|
109
109
|
<Link href={`${PATH_WORKFLOWS}/${processId}`}>{value}</Link>
|
|
110
110
|
),
|
|
111
111
|
},
|
|
112
112
|
lastStep: {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
columnType: ColumnType.DATA,
|
|
114
|
+
label: t('step'),
|
|
115
115
|
width: '15%',
|
|
116
116
|
},
|
|
117
117
|
lastStatus: {
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
columnType: ColumnType.DATA,
|
|
119
|
+
label: t('status'),
|
|
120
120
|
width: '100',
|
|
121
|
-
|
|
121
|
+
renderData: (cellValue) => (
|
|
122
122
|
<WfoProcessStatusBadge processStatus={cellValue} />
|
|
123
123
|
),
|
|
124
124
|
},
|
|
125
125
|
workflowTarget: {
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
columnType: ColumnType.DATA,
|
|
127
|
+
label: t('workflowTarget'),
|
|
128
128
|
width: '100',
|
|
129
|
-
|
|
129
|
+
renderData: (target) => <WfoWorkflowTargetBadge target={target} />,
|
|
130
130
|
},
|
|
131
131
|
tag: {
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
columnType: ColumnType.DATA,
|
|
133
|
+
label: t('productTag'),
|
|
134
134
|
width: '100',
|
|
135
135
|
},
|
|
136
136
|
productName: {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
columnType: ColumnType.DATA,
|
|
138
|
+
label: t('product'),
|
|
139
139
|
width: '10%',
|
|
140
140
|
},
|
|
141
141
|
customer: {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
columnType: ColumnType.DATA,
|
|
143
|
+
label: t('customer'),
|
|
144
144
|
width: '10%',
|
|
145
145
|
},
|
|
146
146
|
customerAbbreviation: {
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
columnType: ColumnType.DATA,
|
|
148
|
+
label: t('customerAbbreviation'),
|
|
149
149
|
width: '10%',
|
|
150
150
|
},
|
|
151
151
|
subscriptions: {
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
columnType: ColumnType.DATA,
|
|
153
|
+
label: t('subscriptions'),
|
|
154
154
|
width: '15%',
|
|
155
|
-
|
|
155
|
+
renderData: ({ page: subscriptions }) => (
|
|
156
156
|
<WfoProcessListSubscriptionsCell
|
|
157
157
|
subscriptions={subscriptions}
|
|
158
158
|
numberOfSubscriptionsToRender={1}
|
|
@@ -169,41 +169,41 @@ export const WfoProcessesList = ({
|
|
|
169
169
|
.join(', '),
|
|
170
170
|
},
|
|
171
171
|
createdBy: {
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
columnType: ColumnType.DATA,
|
|
173
|
+
label: t('createdBy'),
|
|
174
174
|
width: '10%',
|
|
175
175
|
},
|
|
176
176
|
assignee: {
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
columnType: ColumnType.DATA,
|
|
178
|
+
label: t('assignee'),
|
|
179
179
|
width: '5%',
|
|
180
180
|
},
|
|
181
181
|
processId: {
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
columnType: ColumnType.DATA,
|
|
183
|
+
label: t('processId'),
|
|
184
184
|
width: '90',
|
|
185
|
-
|
|
185
|
+
renderData: (value) => <WfoFirstPartUUID UUID={value} />,
|
|
186
186
|
renderDetails: (value) => value,
|
|
187
187
|
},
|
|
188
188
|
startedAt: {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
columnType: ColumnType.DATA,
|
|
190
|
+
label: t('started'),
|
|
191
191
|
width: '100',
|
|
192
|
-
|
|
192
|
+
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
193
193
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
194
194
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
195
195
|
},
|
|
196
196
|
lastModifiedAt: {
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
columnType: ColumnType.DATA,
|
|
198
|
+
label: t('lastModified'),
|
|
199
199
|
width: '100',
|
|
200
|
-
|
|
200
|
+
renderData: (value) => <WfoDateTime dateOrIsoString={value} />,
|
|
201
201
|
renderDetails: parseDateToLocaleDateTimeString,
|
|
202
202
|
clipboardText: parseDateToLocaleDateTimeString,
|
|
203
203
|
},
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
const tableColumns:
|
|
206
|
+
const tableColumns: WfoAdvancedTableColumnConfig<ProcessListItem> =
|
|
207
207
|
overrideDefaultTableColumns
|
|
208
208
|
? overrideDefaultTableColumns(defaultTableColumns)
|
|
209
209
|
: defaultTableColumns;
|
|
@@ -231,6 +231,8 @@ export const WfoProcessesList = ({
|
|
|
231
231
|
pageIndex: pageIndex,
|
|
232
232
|
pageSizeOptions: DEFAULT_PAGE_SIZES,
|
|
233
233
|
totalItemCount: pageInfo?.totalItems ? pageInfo.totalItems : 0,
|
|
234
|
+
onChangePage: getPageIndexChangeHandler(setDataDisplayParam),
|
|
235
|
+
onChangeItemsPerPage: getPageSizeChangeHandler(setDataDisplayParam),
|
|
234
236
|
};
|
|
235
237
|
const dataSorting: WfoDataSorting<ProcessListItem> = {
|
|
236
238
|
field: sortBy?.field ?? 'lastModified',
|
|
@@ -243,17 +245,17 @@ export const WfoProcessesList = ({
|
|
|
243
245
|
).unwrap();
|
|
244
246
|
|
|
245
247
|
return (
|
|
246
|
-
<
|
|
248
|
+
<WfoAdvancedTable<ProcessListItem>
|
|
247
249
|
queryString={queryString}
|
|
248
250
|
data={mapGraphQlProcessListResultToProcessListItems(
|
|
249
251
|
processes || [],
|
|
250
252
|
)}
|
|
251
|
-
|
|
253
|
+
tableColumnConfig={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
252
254
|
tableColumns,
|
|
253
255
|
pageInfo?.sortFields,
|
|
254
256
|
pageInfo?.filterFields,
|
|
255
257
|
)}
|
|
256
|
-
dataSorting={dataSorting}
|
|
258
|
+
dataSorting={[dataSorting]}
|
|
257
259
|
pagination={pagination}
|
|
258
260
|
isLoading={isFetching}
|
|
259
261
|
error={mapRtkErrorToWfoError(error)}
|
|
@@ -261,8 +263,7 @@ export const WfoProcessesList = ({
|
|
|
261
263
|
localStorageKey={localStorageKey}
|
|
262
264
|
detailModalTitle={'Details - Process'}
|
|
263
265
|
onUpdateQueryString={getQueryStringHandler(setDataDisplayParam)}
|
|
264
|
-
|
|
265
|
-
onUpdateDataSort={getDataSortHandler(setDataDisplayParam)}
|
|
266
|
+
onUpdateDataSorting={getDataSortHandler(setDataDisplayParam)}
|
|
266
267
|
onExportData={csvDownloadHandler<
|
|
267
268
|
ProcessListResponse,
|
|
268
269
|
ProcessListExportItem
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
EuiButtonEmpty,
|
|
5
|
+
EuiFlexGroup,
|
|
6
|
+
EuiPopover,
|
|
7
|
+
EuiRadioGroup,
|
|
8
|
+
} from '@elastic/eui';
|
|
9
|
+
import { EuiRadioGroupOption } from '@elastic/eui/src/components/form/radio/radio_group';
|
|
10
|
+
|
|
11
|
+
export interface WfoRadioDropdownProps<T> {
|
|
12
|
+
options: WfoRadioDropdownOption<T>[];
|
|
13
|
+
selectedOption: WfoRadioDropdownOption<T>;
|
|
14
|
+
onUpdateOption: (value: WfoRadioDropdownOption<T>) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type WfoRadioDropdownOption<T> = {
|
|
18
|
+
label: string;
|
|
19
|
+
id: string;
|
|
20
|
+
value: T;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const WfoRadioDropdown = <T,>({
|
|
24
|
+
options,
|
|
25
|
+
onUpdateOption,
|
|
26
|
+
selectedOption,
|
|
27
|
+
}: WfoRadioDropdownProps<T>) => {
|
|
28
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
29
|
+
|
|
30
|
+
const handleClose = () => {
|
|
31
|
+
if (isOpen) {
|
|
32
|
+
setIsOpen(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const handleSelectRadio = (id: string) => {
|
|
36
|
+
const updatedOption = options.find((option) => option.id === id);
|
|
37
|
+
setTimeout(handleClose, 100);
|
|
38
|
+
if (updatedOption) {
|
|
39
|
+
onUpdateOption(updatedOption);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const buttonLabel = options.find(
|
|
44
|
+
(option) => option.id === selectedOption.id,
|
|
45
|
+
)?.label;
|
|
46
|
+
const radioGroupOptions: EuiRadioGroupOption[] = options.map((option) => ({
|
|
47
|
+
id: option.id,
|
|
48
|
+
label: option.label,
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<EuiFlexGroup
|
|
53
|
+
gutterSize="s"
|
|
54
|
+
alignItems="center"
|
|
55
|
+
justifyContent="flexEnd"
|
|
56
|
+
>
|
|
57
|
+
<EuiPopover
|
|
58
|
+
button={
|
|
59
|
+
<EuiButtonEmpty
|
|
60
|
+
size="s"
|
|
61
|
+
iconType="arrowDown"
|
|
62
|
+
iconSide="right"
|
|
63
|
+
onClick={() => {
|
|
64
|
+
setIsOpen((isOpen) => !isOpen);
|
|
65
|
+
}}
|
|
66
|
+
css={{
|
|
67
|
+
'&:focus': {
|
|
68
|
+
backgroundColor: 'transparent',
|
|
69
|
+
textDecoration: 'none',
|
|
70
|
+
},
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
{buttonLabel}
|
|
74
|
+
</EuiButtonEmpty>
|
|
75
|
+
}
|
|
76
|
+
isOpen={isOpen}
|
|
77
|
+
closePopover={handleClose}
|
|
78
|
+
anchorPosition="downLeft"
|
|
79
|
+
>
|
|
80
|
+
<EuiRadioGroup
|
|
81
|
+
options={radioGroupOptions}
|
|
82
|
+
idSelected={selectedOption.id}
|
|
83
|
+
onChange={handleSelectRadio}
|
|
84
|
+
/>
|
|
85
|
+
</EuiPopover>
|
|
86
|
+
</EuiFlexGroup>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoRadioDropdown';
|
|
@@ -13,6 +13,7 @@ export type WfoStartButtonComboBoxProps = {
|
|
|
13
13
|
options: StartComboBoxOption[];
|
|
14
14
|
onOptionChange: (selectedOption: StartComboBoxOption) => void;
|
|
15
15
|
isProcess: boolean;
|
|
16
|
+
className?: string;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export const WfoStartButtonComboBox = ({
|
|
@@ -20,6 +21,7 @@ export const WfoStartButtonComboBox = ({
|
|
|
20
21
|
options,
|
|
21
22
|
onOptionChange,
|
|
22
23
|
isProcess,
|
|
24
|
+
className,
|
|
23
25
|
}: WfoStartButtonComboBoxProps) => {
|
|
24
26
|
const [isPopoverOpen, setPopoverOpen] = useState(false);
|
|
25
27
|
const { theme, isDarkThemeActive } = useOrchestratorTheme();
|
|
@@ -48,12 +50,14 @@ export const WfoStartButtonComboBox = ({
|
|
|
48
50
|
closePopover={() => setPopoverOpen(false)}
|
|
49
51
|
>
|
|
50
52
|
<EuiSelectable<StartComboBoxOption>
|
|
53
|
+
className={className}
|
|
51
54
|
css={selectableStyle}
|
|
52
55
|
searchable
|
|
53
56
|
options={options}
|
|
54
57
|
onChange={(_, __, changedOption) =>
|
|
55
58
|
onOptionChange(changedOption)
|
|
56
59
|
}
|
|
60
|
+
height={200}
|
|
57
61
|
>
|
|
58
62
|
{(list, search) => (
|
|
59
63
|
<>
|
|
@@ -3,11 +3,7 @@ import { css } from '@emotion/react';
|
|
|
3
3
|
import { WfoTheme } from '@/hooks';
|
|
4
4
|
|
|
5
5
|
export const getStyles = ({ theme }: WfoTheme) => {
|
|
6
|
-
const comboBoxWidth = '300px';
|
|
7
|
-
|
|
8
6
|
const selectableStyle = css({
|
|
9
|
-
width: comboBoxWidth,
|
|
10
|
-
|
|
11
7
|
'.euiFieldSearch': {
|
|
12
8
|
backgroundColor: theme.colors.body,
|
|
13
9
|
color: theme.colors.text,
|
|
@@ -5,12 +5,14 @@ import Link from 'next/link';
|
|
|
5
5
|
|
|
6
6
|
import { EuiButton } from '@elastic/eui';
|
|
7
7
|
|
|
8
|
+
import { PolicyResource } from '@/configuration/policy-resources';
|
|
8
9
|
import { ConfirmationDialogContext } from '@/contexts';
|
|
9
10
|
import { useOrchestratorTheme, useShowToastMessage } from '@/hooks';
|
|
10
11
|
import { useSetSubscriptionInSyncMutation } from '@/rtk/endpoints';
|
|
11
12
|
import { SubscriptionDetail, ToastTypes } from '@/types';
|
|
12
13
|
import { formatDate } from '@/utils';
|
|
13
14
|
|
|
15
|
+
import { WfoIsAllowedToRender } from '../WfoAuth/WfoIsAllowedToRender';
|
|
14
16
|
import { WfoInsyncIcon } from '../WfoInsyncIcon/WfoInsyncIcon';
|
|
15
17
|
import { PATH_TASKS, PATH_WORKFLOWS } from '../WfoPageTemplate';
|
|
16
18
|
import { getLastUncompletedProcess, getLatestTaskDate } from './utils';
|
|
@@ -82,15 +84,17 @@ export const WfoInSyncField = ({
|
|
|
82
84
|
>
|
|
83
85
|
{t('see')} {lastUncompletedProcess?.processId}
|
|
84
86
|
</Link>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
<WfoIsAllowedToRender resource={PolicyResource.PROCESS_RETRY}>
|
|
88
|
+
<EuiButton
|
|
89
|
+
isLoading={isFetching}
|
|
90
|
+
isDisabled={isFetching}
|
|
91
|
+
color="danger"
|
|
92
|
+
size="s"
|
|
93
|
+
onClick={confirmSetInSync}
|
|
94
|
+
>
|
|
95
|
+
{t('setInSync')}
|
|
96
|
+
</EuiButton>
|
|
97
|
+
</WfoIsAllowedToRender>
|
|
94
98
|
</>
|
|
95
99
|
);
|
|
96
100
|
};
|
|
@@ -15,7 +15,7 @@ import { useWithOrchestratorTheme } from '@/hooks';
|
|
|
15
15
|
import { useGetInUseByRelationDetailsQuery } from '@/rtk';
|
|
16
16
|
import { InUseByRelation, InUseByRelationDetail } from '@/types';
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { getSubscriptionDetailStyles } from './styles';
|
|
19
19
|
|
|
20
20
|
interface WfoInUseByRelationsProps {
|
|
21
21
|
inUseByRelations: InUseByRelation[];
|
|
@@ -25,7 +25,9 @@ export const WfoInUseByRelations = ({
|
|
|
25
25
|
inUseByRelations,
|
|
26
26
|
}: WfoInUseByRelationsProps) => {
|
|
27
27
|
const t = useTranslations('subscriptions.detail');
|
|
28
|
-
const { inUseByRelationDetailsStyle } = useWithOrchestratorTheme(
|
|
28
|
+
const { inUseByRelationDetailsStyle } = useWithOrchestratorTheme(
|
|
29
|
+
getSubscriptionDetailStyles,
|
|
30
|
+
);
|
|
29
31
|
const subscriptionIds = inUseByRelations
|
|
30
32
|
.map((relation) => relation.subscription_id)
|
|
31
33
|
.join('|');
|
|
@@ -2,17 +2,28 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
EuiComment,
|
|
7
|
+
EuiCommentList,
|
|
8
|
+
EuiFlexGroup,
|
|
9
|
+
EuiSpacer,
|
|
10
|
+
EuiText,
|
|
11
|
+
} from '@elastic/eui';
|
|
12
|
+
|
|
13
|
+
import { WfoLoading, WfoRadioDropdownOption } from '@/components';
|
|
14
|
+
import { PATH_TASKS, PATH_WORKFLOWS } from '@/components';
|
|
15
|
+
import { WfoRadioDropdown, sortProcessesByDate } from '@/components';
|
|
16
|
+
import { useWithOrchestratorTheme } from '@/hooks';
|
|
17
|
+
import { SortOrder, SubscriptionDetailProcess } from '@/types';
|
|
18
|
+
import {
|
|
19
|
+
parseDate,
|
|
20
|
+
parseDateToLocaleDateTimeString,
|
|
21
|
+
upperCaseFirstChar,
|
|
22
|
+
} from '@/utils';
|
|
6
23
|
|
|
7
|
-
import { useWithOrchestratorTheme } from '../../hooks';
|
|
8
|
-
import { SubscriptionDetailProcess } from '../../types';
|
|
9
|
-
import { parseDate, parseDateToLocaleDateTimeString } from '../../utils';
|
|
10
|
-
import { upperCaseFirstChar } from '../../utils';
|
|
11
24
|
import { WfoProcessStatusBadge } from '../WfoBadges';
|
|
12
|
-
import { WfoLoading } from '../WfoLoading';
|
|
13
|
-
import { PATH_TASKS, PATH_WORKFLOWS } from '../WfoPageTemplate';
|
|
14
25
|
import { WfoTargetTypeIcon } from './WfoTargetTypeIcon';
|
|
15
|
-
import {
|
|
26
|
+
import { getSubscriptionDetailStyles } from './styles';
|
|
16
27
|
|
|
17
28
|
interface WfoProcessCardProps {
|
|
18
29
|
subscriptionDetailProcess: SubscriptionDetailProcess;
|
|
@@ -27,7 +38,7 @@ const WfoProcessCard = ({ subscriptionDetailProcess }: WfoProcessCardProps) => {
|
|
|
27
38
|
emptyCellStyle,
|
|
28
39
|
lastContentCellStyle,
|
|
29
40
|
lastHeaderCellStyle,
|
|
30
|
-
} = useWithOrchestratorTheme(
|
|
41
|
+
} = useWithOrchestratorTheme(getSubscriptionDetailStyles);
|
|
31
42
|
const processUrl = subscriptionDetailProcess.isTask
|
|
32
43
|
? PATH_TASKS
|
|
33
44
|
: PATH_WORKFLOWS;
|
|
@@ -90,8 +101,9 @@ interface WfoRenderSubscriptionProcess {
|
|
|
90
101
|
const WfoRenderSubscriptionProcess = ({
|
|
91
102
|
subscriptionDetailProcess,
|
|
92
103
|
}: WfoRenderSubscriptionProcess) => {
|
|
93
|
-
const { timeLineStyle, workflowTargetStyle } =
|
|
94
|
-
|
|
104
|
+
const { timeLineStyle, workflowTargetStyle } = useWithOrchestratorTheme(
|
|
105
|
+
getSubscriptionDetailStyles,
|
|
106
|
+
);
|
|
95
107
|
|
|
96
108
|
return (
|
|
97
109
|
<EuiComment
|
|
@@ -103,14 +115,19 @@ const WfoRenderSubscriptionProcess = ({
|
|
|
103
115
|
/>
|
|
104
116
|
}
|
|
105
117
|
>
|
|
106
|
-
<
|
|
118
|
+
<EuiFlexGroup
|
|
119
|
+
alignItems="center"
|
|
120
|
+
gutterSize="s"
|
|
121
|
+
css={timeLineStyle}
|
|
122
|
+
>
|
|
107
123
|
<EuiText css={workflowTargetStyle}>
|
|
108
124
|
{upperCaseFirstChar(
|
|
109
125
|
subscriptionDetailProcess.workflowTarget,
|
|
110
126
|
)}
|
|
111
127
|
</EuiText>
|
|
128
|
+
<EuiText>-</EuiText>
|
|
112
129
|
<EuiText>{subscriptionDetailProcess.workflowName}</EuiText>
|
|
113
|
-
</
|
|
130
|
+
</EuiFlexGroup>
|
|
114
131
|
|
|
115
132
|
<WfoProcessCard
|
|
116
133
|
subscriptionDetailProcess={subscriptionDetailProcess}
|
|
@@ -126,26 +143,56 @@ interface WfoProcessesTimelineProps {
|
|
|
126
143
|
export const WfoProcessesTimeline = ({
|
|
127
144
|
subscriptionDetailProcesses,
|
|
128
145
|
}: WfoProcessesTimelineProps) => {
|
|
146
|
+
const t = useTranslations('subscriptions.detail.workflowsTab');
|
|
147
|
+
const options: WfoRadioDropdownOption<SortOrder>[] = [
|
|
148
|
+
{
|
|
149
|
+
label: t('startWithOldestLabel'),
|
|
150
|
+
id: 'radioButtonOldest',
|
|
151
|
+
value: SortOrder.ASC,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: t('startWithNewestLabel'),
|
|
155
|
+
id: 'radioButtonNewest',
|
|
156
|
+
value: SortOrder.DESC,
|
|
157
|
+
},
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
const [selectedOption, setSelectedOption] = React.useState(options[0]);
|
|
161
|
+
|
|
162
|
+
const handleOnSelectOption = (
|
|
163
|
+
option: WfoRadioDropdownOption<SortOrder>,
|
|
164
|
+
) => {
|
|
165
|
+
setSelectedOption(option);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const sortedProcesses = sortProcessesByDate(
|
|
169
|
+
subscriptionDetailProcesses,
|
|
170
|
+
selectedOption.value,
|
|
171
|
+
);
|
|
172
|
+
|
|
129
173
|
return (
|
|
130
174
|
<>
|
|
131
175
|
<EuiSpacer size={'m'} />
|
|
132
176
|
{!subscriptionDetailProcesses && <WfoLoading />}
|
|
133
|
-
<
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
177
|
+
<WfoRadioDropdown
|
|
178
|
+
options={options}
|
|
179
|
+
onUpdateOption={handleOnSelectOption}
|
|
180
|
+
selectedOption={selectedOption}
|
|
181
|
+
/>
|
|
182
|
+
{sortedProcesses && (
|
|
183
|
+
<EuiCommentList aria-label="Processes">
|
|
184
|
+
{sortedProcesses
|
|
185
|
+
.filter((process) => !process.isTask)
|
|
186
|
+
.map((subscriptionDetailProcess, index) => (
|
|
187
|
+
<WfoRenderSubscriptionProcess
|
|
188
|
+
key={index}
|
|
189
|
+
subscriptionDetailProcess={
|
|
190
|
+
subscriptionDetailProcess
|
|
191
|
+
}
|
|
192
|
+
/>
|
|
193
|
+
))}
|
|
194
|
+
</EuiCommentList>
|
|
195
|
+
)}
|
|
149
196
|
</>
|
|
150
197
|
);
|
|
151
198
|
};
|