@orchestrator-ui/orchestrator-ui-components 8.6.0 → 8.7.1
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 +1 -1
- package/.turbo/turbo-test.log +15 -12
- package/CHANGELOG.md +18 -0
- package/dist/index.d.ts +416 -1183
- package/dist/index.js +3457 -3072
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/src/components/WfoPydanticForm/fields/WfoCron.spec.ts +88 -0
- package/src/components/WfoPydanticForm/fields/WfoCron.tsx +233 -0
- package/src/components/WfoPydanticForm/fields/WfoSummary.tsx +42 -7
- package/src/components/WfoPydanticForm/fields/index.ts +1 -0
- package/src/components/WfoPydanticForm/fields/styles.ts +92 -0
- package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +1 -1
- package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchResultItem.tsx +2 -1
- package/src/components/WfoSearchPage/utils.ts +37 -1
- package/src/components/WfoSubscription/WfoInUseByRelations.tsx +6 -2
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx +19 -14
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +13 -1
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem.tsx +3 -0
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx +1 -1
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +5 -0
- package/src/components/WfoSubscriptionsList/subscriptionResultMappers.ts +3 -1
- package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +2 -12
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoExpandingSearchRow.tsx +21 -14
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +27 -1
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +97 -91
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoOperatorSelector.tsx +32 -7
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoRuleGroup.tsx +5 -4
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +32 -30
- package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +41 -11
- package/src/components/WfoTable/WfoStructuredSearchTable/styles.ts +22 -5
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +1 -0
- package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +16 -4
- package/src/components/WfoTable/WfoTable/styles.ts +8 -0
- package/src/components/WfoTable/WfoTable/utils.spec.ts +62 -1
- package/src/components/WfoTable/WfoTable/utils.ts +4 -1
- package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.spec.ts +45 -0
- package/src/components/WfoTable/WfoTableSettingsModal/index.ts +1 -0
- package/src/components/WfoTable/WfoTableSettingsModal/utils.ts +17 -0
- package/src/configuration/version.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useGetPydanticFormsConfig.tsx +12 -0
- package/src/hooks/useLanguageCode.ts +11 -0
- package/src/messages/en-GB.json +442 -549
- package/src/messages/getTranslationMessages.spec.ts +47 -30
- package/src/messages/nl-NL.json +450 -411
- package/src/pages/WfoSearchPocPage.tsx +14 -5
- package/src/rtk/endpoints/subscriptionList.ts +1 -0
- package/src/theme/baseStyles/formFieldsBaseStyle.ts +0 -1
- package/src/types/search.ts +1 -1
- package/src/types/types.ts +1 -1
- package/src/utils/getDefaultTableConfig.ts +6 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/integer.spec.ts +20 -0
- package/src/utils/integer.ts +3 -0
|
@@ -9,7 +9,7 @@ import { StringParam, useQueryParam, withDefault } from 'use-query-params';
|
|
|
9
9
|
|
|
10
10
|
import { EuiSpacer } from '@elastic/eui';
|
|
11
11
|
|
|
12
|
-
import { SearchParams,
|
|
12
|
+
import { SearchParams, addStatusFilterFromTab, removeTabStatusMatchingFields } from '@/components';
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_PAGE_SIZE,
|
|
15
15
|
StoredTableConfig,
|
|
@@ -56,6 +56,7 @@ const getDataFromResponse = <T extends object>(
|
|
|
56
56
|
data: PaginatedSearchResults,
|
|
57
57
|
resultColumToPropertyMap: ResultColumToPropertyMap<T>,
|
|
58
58
|
uniqueRowId: keyof T,
|
|
59
|
+
selectedTab: WfoSubscriptionListTab,
|
|
59
60
|
): {
|
|
60
61
|
items: T[];
|
|
61
62
|
rowExpandingConfiguration?: WfoTableProps<T>['rowExpandingConfiguration'];
|
|
@@ -72,18 +73,23 @@ const getDataFromResponse = <T extends object>(
|
|
|
72
73
|
const rowExpandingConfiguration: WfoTableProps<T>['rowExpandingConfiguration'] = {
|
|
73
74
|
uniqueRowId: uniqueRowId as keyof WfoTableColumnConfig<T>,
|
|
74
75
|
uniqueRowIdToExpandedRowMap: searchResult.reduce(
|
|
75
|
-
(rowMap, { response_columns, score, perfect_match,
|
|
76
|
+
(rowMap, { response_columns, score, perfect_match, matching_fields }) => {
|
|
76
77
|
const idColumnInResponseColumn = getKeyByValueFromMap<T>(resultColumToPropertyMap, uniqueRowId);
|
|
77
78
|
const rowId = response_columns[idColumnInResponseColumn];
|
|
78
79
|
if (rowId) {
|
|
79
80
|
rowMap[rowId] = (
|
|
80
|
-
<WfoExpandingSearchRow
|
|
81
|
+
<WfoExpandingSearchRow
|
|
82
|
+
score={score}
|
|
83
|
+
matchingFields={removeTabStatusMatchingFields(matching_fields, selectedTab, EntityKind.SUBSCRIPTION)}
|
|
84
|
+
perfectMatch={perfect_match}
|
|
85
|
+
/>
|
|
81
86
|
);
|
|
82
87
|
}
|
|
83
88
|
return rowMap;
|
|
84
89
|
},
|
|
85
90
|
{} as Record<string, ReactNode>,
|
|
86
91
|
),
|
|
92
|
+
shouldOnlyShowOnHover: true,
|
|
87
93
|
};
|
|
88
94
|
|
|
89
95
|
const items: T[] = responseColumns.map((responseColumn) => {
|
|
@@ -203,7 +209,7 @@ export const WfoSearchPocPage = () => {
|
|
|
203
209
|
// Cursor is stripped from the RTK cache key, so a cursor change appends to the accumulated
|
|
204
210
|
// result set instead of creating a new cache entry — see search endpoint's merge() logic.
|
|
205
211
|
const searchPayload: SearchPayload = useMemo(() => {
|
|
206
|
-
const filters =
|
|
212
|
+
const filters = addStatusFilterFromTab(committedRuleGroup, selectedTab);
|
|
207
213
|
const order_by = {
|
|
208
214
|
element: getKeyByValueFromMap(resultColumToPropertyMap, dataSorting.field),
|
|
209
215
|
direction: dataSorting.sortOrder.toLowerCase(),
|
|
@@ -453,7 +459,9 @@ export const WfoSearchPocPage = () => {
|
|
|
453
459
|
};
|
|
454
460
|
|
|
455
461
|
const { items: subscriptionListItems, rowExpandingConfiguration } =
|
|
456
|
-
data ?
|
|
462
|
+
data ?
|
|
463
|
+
getDataFromResponse<SubscriptionListItem>(data, resultColumToPropertyMap, 'subscriptionId', selectedTab)
|
|
464
|
+
: { items: [] };
|
|
457
465
|
|
|
458
466
|
const totalItems = getTotalItemsFromResponse(data);
|
|
459
467
|
const hasNextPage = data?.page_info?.has_next_page ?? false;
|
|
@@ -465,6 +473,7 @@ export const WfoSearchPocPage = () => {
|
|
|
465
473
|
exportResult,
|
|
466
474
|
resultColumToPropertyMap,
|
|
467
475
|
'subscriptionId',
|
|
476
|
+
selectedTab,
|
|
468
477
|
);
|
|
469
478
|
if (!exportItems.length) {
|
|
470
479
|
return;
|
|
@@ -10,7 +10,6 @@ export const getFormFieldsBaseStyle = ({ theme }: WfoThemeHelpers) => {
|
|
|
10
10
|
backgroundColor: theme.colors.backgroundBaseNeutral,
|
|
11
11
|
boxShadow: `0 0 0 1px ${theme.colors.primary}`,
|
|
12
12
|
},
|
|
13
|
-
// boxShadow: `0 0 0 1px ${theme.colors.borderBaseSubdued} !important`,
|
|
14
13
|
});
|
|
15
14
|
|
|
16
15
|
return {
|
package/src/types/search.ts
CHANGED
package/src/types/types.ts
CHANGED
|
@@ -471,7 +471,7 @@ export type Subscription = {
|
|
|
471
471
|
status: SubscriptionStatus;
|
|
472
472
|
product: Pick<ProductDefinition, 'name' | 'tag' | 'productType'>;
|
|
473
473
|
productBlockInstances: ProductBlockInstance[];
|
|
474
|
-
customer: Pick<Customer, 'fullname' | 'shortcode'>;
|
|
474
|
+
customer: Pick<Customer, 'customerId' | 'fullname' | 'shortcode'>;
|
|
475
475
|
metadata: object;
|
|
476
476
|
};
|
|
477
477
|
|
|
@@ -95,7 +95,12 @@ export const getDefaultTableConfig = <T>(storageKey: string) => {
|
|
|
95
95
|
return getTableConfig<T>(completedTasksColumns as (keyof T)[]);
|
|
96
96
|
}
|
|
97
97
|
case SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY: {
|
|
98
|
-
const subscriptionColumns: (keyof SubscriptionListItem)[] = [
|
|
98
|
+
const subscriptionColumns: (keyof SubscriptionListItem)[] = [
|
|
99
|
+
'productName',
|
|
100
|
+
'customerId',
|
|
101
|
+
'customerFullname',
|
|
102
|
+
'metadata',
|
|
103
|
+
];
|
|
99
104
|
return getTableConfig<T>(subscriptionColumns as (keyof T)[]);
|
|
100
105
|
}
|
|
101
106
|
default:
|
package/src/utils/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './getProductNamesFromProcess';
|
|
|
10
10
|
export * from './getQueryVariablesForExport';
|
|
11
11
|
export * from './getStatusBadgeColor';
|
|
12
12
|
export * from './getTypedFieldFromObject';
|
|
13
|
+
export * from './integer';
|
|
13
14
|
export * from './onlyUnique';
|
|
14
15
|
export * from './optionalArray';
|
|
15
16
|
export * from './resultFlattener';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { toPercentage } from './integer';
|
|
2
|
+
|
|
3
|
+
describe('toPercentage()', () => {
|
|
4
|
+
it('converts a fraction to a percentage string with one decimal', () => {
|
|
5
|
+
expect(toPercentage(0.5)).toEqual('50.0%');
|
|
6
|
+
});
|
|
7
|
+
it('converts 1 to 100.0%', () => {
|
|
8
|
+
expect(toPercentage(1)).toEqual('100.0%');
|
|
9
|
+
});
|
|
10
|
+
it('converts 0 to 0.0%', () => {
|
|
11
|
+
expect(toPercentage(0)).toEqual('0.0%');
|
|
12
|
+
});
|
|
13
|
+
it('rounds to one decimal place', () => {
|
|
14
|
+
expect(toPercentage(0.12345)).toEqual('12.3%');
|
|
15
|
+
expect(toPercentage(0.6789)).toEqual('67.9%');
|
|
16
|
+
});
|
|
17
|
+
it('handles fractions greater than 1', () => {
|
|
18
|
+
expect(toPercentage(1.5)).toEqual('150.0%');
|
|
19
|
+
});
|
|
20
|
+
});
|