@orchestrator-ui/orchestrator-ui-components 8.8.1 → 8.9.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 +1 -1
- package/.turbo/turbo-test.log +15 -14
- package/CHANGELOG.md +23 -0
- package/dist/index.d.ts +63 -24
- package/dist/index.js +2695 -2480
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +2 -5
- package/src/components/WfoPydanticForm/fields/WfoMultiCheckboxField.tsx +2 -1
- package/src/components/WfoStartButton/WfoStartButtonComboBox.tsx +6 -11
- package/src/components/WfoStartButton/WfoStartWorkflowComboBox.tsx +1 -1
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +6 -16
- package/src/components/WfoSubscription/utils/utils.spec.ts +57 -0
- package/src/components/WfoSubscription/utils/utils.ts +15 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +12 -8
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +23 -10
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoSearchHelpModal.tsx +59 -0
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +37 -20
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +4 -2
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +77 -46
- package/src/components/WfoTable/WfoTable/WfoTableSkeletonRows.tsx +52 -0
- package/src/components/WfoTable/WfoTable/index.ts +1 -0
- package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +21 -18
- package/src/components/WfoTable/WfoTableSettingsModal/styles.ts +17 -0
- package/src/components/WfoTable/utils/tableConfigPersistence.ts +1 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/useGetPydanticFormsConfig.tsx +5 -3
- package/src/hooks/useSearch.ts +2 -2
- package/src/hooks/useStoredTableConfig.ts +1 -0
- package/src/messages/en-GB.json +21 -0
- package/src/messages/nl-NL.json +22 -1
- package/src/pages/WfoSearchPocPage.tsx +28 -23
- package/src/pages/processes/WfoProductInformationWithLink.tsx +9 -4
- package/src/rtk/endpoints/metadata/productBlocks.ts +9 -1
- package/src/rtk/endpoints/metadata/products.ts +5 -2
- package/src/rtk/endpoints/startOptions.ts +4 -3
- package/src/types/search.ts +8 -0
- package/src/types/types.ts +3 -3
- package/src/utils/getProductLifecycleStatus.spec.ts +26 -0
- package/src/utils/getProductLifecycleStatus.ts +13 -0
- package/src/utils/index.ts +1 -0
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { useTranslations } from 'next-intl';
|
|
4
4
|
|
|
5
|
-
import { EuiButtonIcon, EuiFlexGroup, EuiText, EuiToolTip } from '@elastic/eui';
|
|
5
|
+
import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiToolTip } from '@elastic/eui';
|
|
6
6
|
|
|
7
|
-
import { useGetOrchestratorConfig } from '@/hooks';
|
|
7
|
+
import { useGetOrchestratorConfig, useOrchestratorTheme } from '@/hooks';
|
|
8
8
|
|
|
9
9
|
interface WfoProductInformationWithLinkProps {
|
|
10
10
|
workflowName: string;
|
|
@@ -15,8 +15,10 @@ export const WfoProductInformationWithLink = ({ workflowName, productNames }: Wf
|
|
|
15
15
|
const { workflowInformationLinkUrl, showWorkflowInformationLink } = useGetOrchestratorConfig();
|
|
16
16
|
const t = useTranslations('processes.detail');
|
|
17
17
|
const docsUrl = workflowInformationLinkUrl + workflowName;
|
|
18
|
+
const { theme } = useOrchestratorTheme();
|
|
19
|
+
|
|
18
20
|
return (
|
|
19
|
-
<EuiFlexGroup gutterSize={'s'} alignItems={'center'}>
|
|
21
|
+
<EuiFlexGroup css={{ paddingBottom: theme.size.xs }} gutterSize={'s'} alignItems={'center'}>
|
|
20
22
|
{showWorkflowInformationLink && (
|
|
21
23
|
<EuiToolTip content={t('openWorkflowTaskInfo')}>
|
|
22
24
|
<a href={docsUrl} target="_blank">
|
|
@@ -24,7 +26,10 @@ export const WfoProductInformationWithLink = ({ workflowName, productNames }: Wf
|
|
|
24
26
|
</a>
|
|
25
27
|
</EuiToolTip>
|
|
26
28
|
)}
|
|
27
|
-
<
|
|
29
|
+
<EuiFlexItem>
|
|
30
|
+
<EuiSpacer size={'xs'} />
|
|
31
|
+
<EuiText size="m">{productNames}</EuiText>
|
|
32
|
+
</EuiFlexItem>
|
|
28
33
|
</EuiFlexGroup>
|
|
29
34
|
);
|
|
30
35
|
};
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ProductBlockDefinition,
|
|
8
8
|
ProductBlockDefinitionsResult,
|
|
9
9
|
} from '@/types';
|
|
10
|
+
import { getProductLifecycleStatus } from '@/utils';
|
|
10
11
|
|
|
11
12
|
export const productBlocksQuery = `
|
|
12
13
|
query MetadataProductBlocks(
|
|
@@ -69,7 +70,14 @@ const productBlocksApi = orchestratorApi.injectEndpoints({
|
|
|
69
70
|
variables,
|
|
70
71
|
}),
|
|
71
72
|
transformResponse: (response: ProductBlockDefinitionsResult): ProductBlocksResponse => {
|
|
72
|
-
const productBlocks = response.productBlocks.page || []
|
|
73
|
+
const productBlocks = (response.productBlocks.page || []).map((productBlock) => ({
|
|
74
|
+
...productBlock,
|
|
75
|
+
status: getProductLifecycleStatus(productBlock.status),
|
|
76
|
+
dependsOn: productBlock.dependsOn.map((dependsOnBlock) => ({
|
|
77
|
+
...dependsOnBlock,
|
|
78
|
+
status: getProductLifecycleStatus(dependsOnBlock.status),
|
|
79
|
+
})),
|
|
80
|
+
}));
|
|
73
81
|
const pageInfo = response.productBlocks.pageInfo || {};
|
|
74
82
|
|
|
75
83
|
return {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ProductDefinition,
|
|
10
10
|
ProductDefinitionsResult,
|
|
11
11
|
} from '@/types';
|
|
12
|
-
import { getCacheTag } from '@/utils';
|
|
12
|
+
import { getCacheTag, getProductLifecycleStatus } from '@/utils';
|
|
13
13
|
|
|
14
14
|
export const products = `
|
|
15
15
|
query MetadataProducts(
|
|
@@ -61,7 +61,10 @@ const productsApi = orchestratorApi.injectEndpoints({
|
|
|
61
61
|
variables,
|
|
62
62
|
}),
|
|
63
63
|
transformResponse: (response: ProductDefinitionsResult): ProductsResponse => {
|
|
64
|
-
const products = response.products.page || []
|
|
64
|
+
const products = (response.products.page || []).map((product) => ({
|
|
65
|
+
...product,
|
|
66
|
+
status: getProductLifecycleStatus(product.status),
|
|
67
|
+
}));
|
|
65
68
|
const pageInfo = response.products.pageInfo || {};
|
|
66
69
|
|
|
67
70
|
return {
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
WorkflowDefinition,
|
|
6
6
|
WorkflowTarget,
|
|
7
7
|
} from '@/types';
|
|
8
|
+
import { getProductLifecycleStatus } from '@/utils';
|
|
8
9
|
|
|
9
10
|
import { orchestratorApi } from '../api';
|
|
10
11
|
|
|
@@ -68,18 +69,18 @@ type TaskOptionsResult = StartOptionsResult<TaskOption>;
|
|
|
68
69
|
|
|
69
70
|
const startButtonOptionsApi = orchestratorApi.injectEndpoints({
|
|
70
71
|
endpoints: (build) => ({
|
|
71
|
-
getWorkflowOptions: build.query<StartOptionsResponse<WorkflowOption>, ProductLifecycleStatus
|
|
72
|
+
getWorkflowOptions: build.query<StartOptionsResponse<WorkflowOption>, ProductLifecycleStatus>({
|
|
72
73
|
query: () => ({
|
|
73
74
|
document: workflowOptionsQuery,
|
|
74
75
|
}),
|
|
75
76
|
transformResponse: (response: WorkflowOptionsResult | undefined, _, productStatus) => {
|
|
76
|
-
const statusToMatch =
|
|
77
|
+
const statusToMatch = productStatus ?? ProductLifecycleStatus.ACTIVE;
|
|
77
78
|
const startOptions: WorkflowOption[] = [];
|
|
78
79
|
const workflows = response?.workflows?.page || [];
|
|
79
80
|
workflows.forEach((workflow) => {
|
|
80
81
|
const workflowName = workflow.name;
|
|
81
82
|
workflow.products
|
|
82
|
-
.filter((product) => product.status
|
|
83
|
+
.filter((product) => getProductLifecycleStatus(product.status) === statusToMatch)
|
|
83
84
|
.forEach((product) => {
|
|
84
85
|
startOptions.push({
|
|
85
86
|
workflowName,
|
package/src/types/search.ts
CHANGED
|
@@ -214,3 +214,11 @@ export type ExportArtifact = {
|
|
|
214
214
|
|
|
215
215
|
export type ResultColumToPropertyMap<T> = Map<string, keyof T>;
|
|
216
216
|
export type FieldToOperatorMap = Map<string, string[]>;
|
|
217
|
+
|
|
218
|
+
export type WfoQueryBuilderContext = {
|
|
219
|
+
onFieldSelected: (field: string, operators: string[], pathInfo?: PathInfo) => void;
|
|
220
|
+
prefilledFieldOptions: FieldToOperatorMap;
|
|
221
|
+
fieldPathInfoMap: Map<string, PathInfo>;
|
|
222
|
+
onValueEditorEnter: () => void;
|
|
223
|
+
useAdvancedNestedSearch: boolean;
|
|
224
|
+
};
|
package/src/types/types.ts
CHANGED
|
@@ -83,9 +83,9 @@ export interface ProductBlockDefinition {
|
|
|
83
83
|
|
|
84
84
|
export enum ProductLifecycleStatus {
|
|
85
85
|
ACTIVE = 'active',
|
|
86
|
-
PRE_PRODUCTION = '
|
|
87
|
-
PHASE_OUT = '
|
|
88
|
-
END_OF_LIFE = '
|
|
86
|
+
PRE_PRODUCTION = 'pre production',
|
|
87
|
+
PHASE_OUT = 'phase out',
|
|
88
|
+
END_OF_LIFE = 'end of life',
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export enum BadgeType {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ProductLifecycleStatus } from '@/types';
|
|
2
|
+
|
|
3
|
+
import { getProductLifecycleStatus } from './getProductLifecycleStatus';
|
|
4
|
+
|
|
5
|
+
describe('getProductLifecycleStatus()', () => {
|
|
6
|
+
it('converts an uppercase GraphQL key to its ProductLifecycleStatus value', () => {
|
|
7
|
+
expect(getProductLifecycleStatus('ACTIVE')).toBe(ProductLifecycleStatus.ACTIVE);
|
|
8
|
+
expect(getProductLifecycleStatus('PRE_PRODUCTION')).toBe(ProductLifecycleStatus.PRE_PRODUCTION);
|
|
9
|
+
expect(getProductLifecycleStatus('PHASE_OUT')).toBe(ProductLifecycleStatus.PHASE_OUT);
|
|
10
|
+
expect(getProductLifecycleStatus('END_OF_LIFE')).toBe(ProductLifecycleStatus.END_OF_LIFE);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('converts a lowercase key to its ProductLifecycleStatus value', () => {
|
|
14
|
+
expect(getProductLifecycleStatus('pre_production')).toBe(ProductLifecycleStatus.PRE_PRODUCTION);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('converts a mixed case key to its ProductLifecycleStatus value', () => {
|
|
18
|
+
expect(getProductLifecycleStatus('Phase_Out')).toBe(ProductLifecycleStatus.PHASE_OUT);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('returns undefined for a status that does not match any ProductLifecycleStatus key', () => {
|
|
22
|
+
expect(getProductLifecycleStatus('not_a_status')).toBeUndefined();
|
|
23
|
+
expect(getProductLifecycleStatus('')).toBeUndefined();
|
|
24
|
+
expect(getProductLifecycleStatus('active_pending')).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ProductLifecycleStatus } from '@/types';
|
|
2
|
+
|
|
3
|
+
const productStatusAsString = Object.values(ProductLifecycleStatus) as string[];
|
|
4
|
+
|
|
5
|
+
export const getProductLifecycleStatus = (rawStatus: string): ProductLifecycleStatus => {
|
|
6
|
+
const trimmed = rawStatus.trim();
|
|
7
|
+
if (productStatusAsString.includes(trimmed)) {
|
|
8
|
+
return trimmed as ProductLifecycleStatus;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const normalizedKey = trimmed.replace(/\s+/g, '_').toUpperCase();
|
|
12
|
+
return ProductLifecycleStatus[normalizedKey as keyof typeof ProductLifecycleStatus];
|
|
13
|
+
};
|
package/src/utils/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './getDefaultTableConfig';
|
|
|
6
6
|
export * from './getEnvironmentVariables';
|
|
7
7
|
export * from './getObjectKeys';
|
|
8
8
|
export * from './getQueryUrl';
|
|
9
|
+
export * from './getProductLifecycleStatus';
|
|
9
10
|
export * from './getProductNamesFromProcess';
|
|
10
11
|
export * from './getQueryVariablesForExport';
|
|
11
12
|
export * from './getStatusBadgeColor';
|