@orchestrator-ui/orchestrator-ui-components 8.5.0 → 8.7.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.
Files changed (65) hide show
  1. package/.turbo/turbo-build.log +10 -14
  2. package/.turbo/turbo-lint.log +2 -4
  3. package/.turbo/turbo-test.log +16 -15
  4. package/CHANGELOG.md +17 -0
  5. package/dist/index.d.ts +188 -80
  6. package/dist/index.js +3509 -2731
  7. package/dist/index.js.map +1 -1
  8. package/package.json +3 -1
  9. package/src/components/WfoAutoExpandableTextArea/WfoAutoExpandableTextArea.tsx +54 -0
  10. package/src/components/WfoAutoExpandableTextArea/index.ts +1 -0
  11. package/src/components/WfoAutoExpandableTextArea/styles.ts +18 -0
  12. package/src/components/WfoPageTemplate/paths.ts +1 -0
  13. package/src/components/WfoPydanticForm/fields/WfoCron.spec.ts +88 -0
  14. package/src/components/WfoPydanticForm/fields/WfoCron.tsx +233 -0
  15. package/src/components/WfoPydanticForm/fields/index.ts +1 -0
  16. package/src/components/WfoPydanticForm/fields/styles.ts +92 -0
  17. package/src/components/WfoSearchPage/WfoSearchResults/WfoSearchResultItem.tsx +2 -1
  18. package/src/components/WfoSearchPage/utils.ts +37 -1
  19. package/src/components/WfoSubscription/WfoInUseByRelations.tsx +6 -2
  20. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx +19 -14
  21. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +13 -1
  22. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionsMenuItem.tsx +3 -0
  23. package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx +1 -1
  24. package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +5 -0
  25. package/src/components/WfoSubscriptionsList/subscriptionResultMappers.ts +3 -1
  26. package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +2 -12
  27. package/src/components/WfoTable/WfoStructuredSearchTable/WfoAddGroupAction.tsx +1 -1
  28. package/src/components/WfoTable/WfoStructuredSearchTable/WfoCombinatorSelector.tsx +3 -0
  29. package/src/components/WfoTable/WfoStructuredSearchTable/WfoExpandingSearchRow.tsx +21 -14
  30. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +84 -4
  31. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +119 -104
  32. package/src/components/WfoTable/WfoStructuredSearchTable/WfoInlineCombinator.tsx +17 -0
  33. package/src/components/WfoTable/WfoStructuredSearchTable/WfoOperatorSelector.tsx +32 -7
  34. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRemoveRuleAction.tsx +3 -3
  35. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRuleGroup.tsx +11 -7
  36. package/src/components/WfoTable/WfoStructuredSearchTable/WfoSearchFieldWithActions.tsx +56 -0
  37. package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +92 -87
  38. package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +41 -11
  39. package/src/components/WfoTable/WfoStructuredSearchTable/styles.ts +74 -21
  40. package/src/components/WfoTable/WfoStructuredSearchTable/utils.ts +45 -0
  41. package/src/components/WfoTable/WfoTable/WfoTable.tsx +1 -0
  42. package/src/components/WfoTable/WfoTable/WfoTableDataRows.tsx +16 -4
  43. package/src/components/WfoTable/WfoTable/styles.ts +8 -0
  44. package/src/components/WfoTable/WfoTable/utils.spec.ts +62 -1
  45. package/src/components/WfoTable/WfoTable/utils.ts +4 -1
  46. package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.spec.ts +45 -0
  47. package/src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx +9 -0
  48. package/src/components/WfoTable/WfoTableSettingsModal/index.ts +1 -0
  49. package/src/components/WfoTable/WfoTableSettingsModal/utils.ts +17 -0
  50. package/src/components/index.ts +1 -0
  51. package/src/configuration/version.ts +1 -1
  52. package/src/hooks/index.ts +1 -0
  53. package/src/hooks/useGetPydanticFormsConfig.tsx +12 -0
  54. package/src/hooks/useLanguageCode.ts +11 -0
  55. package/src/messages/en-GB.json +20 -0
  56. package/src/messages/nl-NL.json +20 -0
  57. package/src/pages/WfoSearchPocPage.tsx +165 -30
  58. package/src/rtk/endpoints/subscriptionList.ts +1 -0
  59. package/src/theme/baseStyles/formFieldsBaseStyle.ts +0 -1
  60. package/src/types/search.ts +4 -1
  61. package/src/types/types.ts +1 -1
  62. package/src/utils/getDefaultTableConfig.ts +6 -1
  63. package/src/utils/index.ts +1 -0
  64. package/src/utils/integer.spec.ts +20 -0
  65. package/src/utils/integer.ts +3 -0
@@ -1,7 +1,12 @@
1
+ import { TableColumnKeys } from '@/components';
1
2
  import { ColumnType, WfoTableColumnConfig } from '@/components/WfoTable/WfoTable/WfoTable';
2
3
  import { SortOrder } from '@/types';
3
4
 
4
- import { getUpdatedSortOrder, mapSortableAndFilterableValuesToTableColumnConfig } from './utils';
5
+ import {
6
+ getSortedVisibleColumns,
7
+ getUpdatedSortOrder,
8
+ mapSortableAndFilterableValuesToTableColumnConfig,
9
+ } from './utils';
5
10
 
6
11
  type TestObject = {
7
12
  name: string;
@@ -19,6 +24,21 @@ const tableColumnConfig: WfoTableColumnConfig<TestObject> = {
19
24
  },
20
25
  };
21
26
 
27
+ const tableColumnConfigWithControlColumn: WfoTableColumnConfig<TestObject> = {
28
+ actions: {
29
+ columnType: ColumnType.CONTROL,
30
+ renderControl: () => null,
31
+ },
32
+ name: {
33
+ columnType: ColumnType.DATA,
34
+ label: 'testName',
35
+ },
36
+ age: {
37
+ columnType: ColumnType.DATA,
38
+ label: 'testAge',
39
+ },
40
+ };
41
+
22
42
  describe('utils', () => {
23
43
  describe('getUpdatedSortOrder()', () => {
24
44
  it('returns SortOrder.DESC if the currentSortOrder is SortOrder.ASC', () => {
@@ -38,6 +58,47 @@ describe('utils', () => {
38
58
  });
39
59
  });
40
60
 
61
+ describe('getSortedVisibleColumns()', () => {
62
+ it('keeps a control column visible even when its key is present in hiddenColumns', () => {
63
+ // Given a stale hiddenColumns still listing the control column (e.g. from localStorage)
64
+ const hiddenColumns = ['actions'] as unknown as TableColumnKeys<TestObject>;
65
+
66
+ // When
67
+ const result = getSortedVisibleColumns(tableColumnConfigWithControlColumn, [], hiddenColumns);
68
+
69
+ // Then the control column is still rendered
70
+ const visibleKeys = result.map(([key]) => key);
71
+ expect(visibleKeys).toContain('actions');
72
+ });
73
+
74
+ it('hides data columns that are listed in hiddenColumns', () => {
75
+ // Given
76
+ const hiddenColumns: TableColumnKeys<TestObject> = ['age'];
77
+
78
+ // When
79
+ const result = getSortedVisibleColumns(tableColumnConfigWithControlColumn, [], hiddenColumns);
80
+
81
+ // Then
82
+ const visibleKeys = result.map(([key]) => key);
83
+ expect(visibleKeys).not.toContain('age');
84
+ expect(visibleKeys).toContain('name');
85
+ });
86
+
87
+ it('keeps the control column visible while still hiding a hidden data column', () => {
88
+ // Given both a control key and a data key are marked hidden
89
+ const hiddenColumns = ['actions', 'age'] as unknown as TableColumnKeys<TestObject>;
90
+
91
+ // When
92
+ const result = getSortedVisibleColumns(tableColumnConfigWithControlColumn, [], hiddenColumns);
93
+
94
+ // Then only the data column is hidden; the control column stays visible
95
+ const visibleKeys = result.map(([key]) => key);
96
+ expect(visibleKeys).toContain('actions');
97
+ expect(visibleKeys).toContain('name');
98
+ expect(visibleKeys).not.toContain('age');
99
+ });
100
+ });
101
+
41
102
  describe('mapSortableAndFilterableValuesToTableColumnConfig()', () => {
42
103
  it('sets the sortable and filterable properties for the columnConfig object to true when the colum name is specified in the list', () => {
43
104
  // Given
@@ -25,7 +25,10 @@ export const getSortedVisibleColumns = <T extends object>(
25
25
  ),
26
26
  );
27
27
 
28
- return tableHeadersEntries.filter(([columnId]) => !hiddenColumns.includes(columnId as keyof T));
28
+ return tableHeadersEntries.filter(
29
+ ([columnId, columnConfig]) =>
30
+ columnConfig.columnType === ColumnType.CONTROL || !hiddenColumns.includes(columnId as keyof T),
31
+ );
29
32
  };
30
33
 
31
34
  export const getUpdatedSortOrder = (currentSortOrder?: SortOrder) =>
@@ -0,0 +1,45 @@
1
+ import { TableColumnKeys } from '@/components';
2
+ import { ColumnType, WfoTableColumnConfig } from '@/components/WfoTable/WfoTable/WfoTable';
3
+ import { getTableSettingsColumns } from '@/components/WfoTable/WfoTableSettingsModal/utils';
4
+
5
+ type TestObject = {
6
+ name: string;
7
+ age: number;
8
+ };
9
+
10
+ const columnConfig: WfoTableColumnConfig<TestObject> = {
11
+ actions: {
12
+ columnType: ColumnType.CONTROL,
13
+ renderControl: () => null,
14
+ },
15
+ name: {
16
+ columnType: ColumnType.DATA,
17
+ label: 'Name',
18
+ },
19
+ age: {
20
+ columnType: ColumnType.DATA,
21
+ label: 'Age',
22
+ },
23
+ };
24
+
25
+ describe('getTableSettingsColumns()', () => {
26
+ it('excludes control columns and keeps only data columns as toggles', () => {
27
+ const result = getTableSettingsColumns(columnConfig, []);
28
+ expect(result.map((column) => column.field)).toEqual(['name', 'age']);
29
+ });
30
+
31
+ it('maps each data column label to name and marks all visible when nothing is hidden', () => {
32
+ const result = getTableSettingsColumns(columnConfig, []);
33
+ expect(result).toEqual([
34
+ { field: 'name', name: 'Name', isVisible: true },
35
+ { field: 'age', name: 'Age', isVisible: true },
36
+ ]);
37
+ });
38
+
39
+ it('marks a data column as not visible when it is present in hiddenColumns', () => {
40
+ const hiddenColumns: TableColumnKeys<TestObject> = ['age'];
41
+ const result = getTableSettingsColumns(columnConfig, hiddenColumns);
42
+ expect(result.find((column) => column.field === 'age')?.isVisible).toBe(false);
43
+ expect(result.find((column) => column.field === 'name')?.isVisible).toBe(true);
44
+ });
45
+ });
@@ -25,6 +25,7 @@ export type TableSettingsModalProps<T> = {
25
25
  onClose: () => void;
26
26
  onUpdateTableConfig: (updatedTableConfig: TableSettingsConfig<T>) => void;
27
27
  onResetToDefaults: () => void;
28
+ extraSettings?: React.ReactNode;
28
29
  };
29
30
 
30
31
  export const TableSettingsModal = <T,>({
@@ -33,6 +34,7 @@ export const TableSettingsModal = <T,>({
33
34
  onUpdateTableConfig,
34
35
  onResetToDefaults,
35
36
  onClose,
37
+ extraSettings,
36
38
  }: TableSettingsModalProps<T>) => {
37
39
  const t = useTranslations('main');
38
40
  const { formRowStyle, selectFieldStyle } = useWithOrchestratorTheme(getWfoTableSettingsModalStyles);
@@ -97,6 +99,13 @@ export const TableSettingsModal = <T,>({
97
99
  options={options}
98
100
  />
99
101
  </EuiFormRow>
102
+
103
+ {extraSettings && (
104
+ <>
105
+ <EuiSpacer size="xs" />
106
+ {extraSettings}
107
+ </>
108
+ )}
100
109
  </EuiForm>
101
110
  </WfoSettingsModal>
102
111
  );
@@ -1 +1,2 @@
1
1
  export * from './WfoTableSettingsModal';
2
+ export * from './utils';
@@ -0,0 +1,17 @@
1
+ import { ColumnType, TableColumnKeys, TableSettingsColumnConfig, WfoTableColumnConfig } from '@/components';
2
+
3
+ export const getTableSettingsColumns = <T extends object>(
4
+ columnConfig: WfoTableColumnConfig<T>,
5
+ hiddenColumns: TableColumnKeys<T>,
6
+ ): TableSettingsColumnConfig<T>[] =>
7
+ Object.entries(columnConfig)
8
+ .filter(([, columnItemConfig]) => columnItemConfig.columnType === ColumnType.DATA)
9
+ .map(([key, { label }]): TableSettingsColumnConfig<T> => {
10
+ const field = key as keyof T;
11
+
12
+ return {
13
+ field,
14
+ name: label,
15
+ isVisible: hiddenColumns.indexOf(field) === -1,
16
+ };
17
+ });
@@ -1,3 +1,4 @@
1
+ export * from './WfoAutoExpandableTextArea';
1
2
  export * from './WfoBadges';
2
3
  export * from './WfoBackendUnavailable';
3
4
  export * from './WfoAvailabilityCheck';
@@ -1 +1 @@
1
- export const ORCHESTRATOR_UI_LIBRARY_VERSION = '8.5.0';
1
+ export const ORCHESTRATOR_UI_LIBRARY_VERSION = '8.7.0';
@@ -15,3 +15,4 @@ export * from './useGetSchedulesForWorkflow';
15
15
  export * from './useGetWorkflowNameById';
16
16
  export * from './usePathAutoComplete';
17
17
  export * from './useGetPydanticFormsConfig';
18
+ export * from './useLanguageCode';
@@ -23,6 +23,7 @@ import {
23
23
  WfoArrayField,
24
24
  WfoCallout,
25
25
  WfoCheckbox,
26
+ WfoCron,
26
27
  WfoDivider,
27
28
  WfoDropdown,
28
29
  WfoInteger,
@@ -181,6 +182,17 @@ const useGetComponentMatcherExtender = (): ComponentMatcherExtender => {
181
182
  return type === PydanticFormFieldType.STRING && format === ('callout' as PydanticFormFieldFormat);
182
183
  },
183
184
  },
185
+ {
186
+ id: 'cron',
187
+ ElementMatch: {
188
+ isControlledElement: true,
189
+ Element: WfoCron,
190
+ },
191
+ matcher: (field) => {
192
+ const { type, schema } = field;
193
+ return type === PydanticFormFieldType.STRING && schema.title === 'Cron';
194
+ },
195
+ },
184
196
  {
185
197
  id: 'markdownField',
186
198
  ElementMatch: {
@@ -0,0 +1,11 @@
1
+ import { useLocale } from 'next-intl';
2
+
3
+ export const useLanguageCode = () => {
4
+ const locale = useLocale();
5
+ if (!locale) return 'en';
6
+ try {
7
+ return typeof Intl !== 'undefined' && 'Locale' in Intl ? new Intl.Locale(locale).language : locale.split(/[-_]/)[0];
8
+ } catch {
9
+ return locale.split(/[-_]/)[0] || 'en';
10
+ }
11
+ };
@@ -36,6 +36,7 @@
36
36
  "deselect": "Deselect",
37
37
  "close": "Close",
38
38
  "editColumns": "Edit columns",
39
+ "tableSettings": "Table settings",
39
40
  "loading": "Loading",
40
41
  "newSubscription": "New subscription",
41
42
  "newTask": "New task",
@@ -106,6 +107,24 @@
106
107
  "contactPersonName": {
107
108
  "placeholder": "Search and add contact persons..."
108
109
  },
110
+ "cron": {
111
+ "second": "second",
112
+ "minute": "minute",
113
+ "hour": "hour",
114
+ "dayOfMonth": "day (month)",
115
+ "month": "month",
116
+ "dayOfWeek": "day (week)",
117
+ "anyValue": "any value",
118
+ "valueListSeparator": "value list separator",
119
+ "rangeOfValues": "range of values",
120
+ "stepValues": "step values",
121
+ "allowedValues": "allowed values",
122
+ "alternativeSingleValues": "alternative single values",
123
+ "sundayNonStandard": "sunday (non-standard)",
124
+ "invalidExpression": "Invalid cron expression: {error}",
125
+ "nextOccurrences": "Next: {dates}",
126
+ "possibleValues": "Possible values for this field"
127
+ },
109
128
  "ipvAnyNetworkField": {
110
129
  "manuallySelectedPrefix": "Manually selected prefix"
111
130
  },
@@ -346,6 +365,7 @@
346
365
  "endDate": "End date",
347
366
  "metadata": "Metadata",
348
367
  "note": "Note",
368
+ "customerId": "Customer ID",
349
369
  "customerFullname": "Customer",
350
370
  "customerShortcode": "Customer abbr",
351
371
  "actions": "Actions"
@@ -36,6 +36,7 @@
36
36
  "deselect": "Deselecteer",
37
37
  "close": "Sluiten",
38
38
  "editColumns": "Wijzig kolommen",
39
+ "tableSettings": "Tabel instellingen",
39
40
  "loading": "Laden",
40
41
  "newSubscription": "Nieuwe subscription",
41
42
  "newTask": "Nieuwe task",
@@ -107,6 +108,24 @@
107
108
  "contactPersonName": {
108
109
  "placeholder": "Zoek en voeg contactpersonen toe..."
109
110
  },
111
+ "cron": {
112
+ "second": "seconde",
113
+ "minute": "minuut",
114
+ "hour": "uur",
115
+ "dayOfMonth": "dag (maand)",
116
+ "month": "maand",
117
+ "dayOfWeek": "dag (week)",
118
+ "anyValue": "elke waarde",
119
+ "valueListSeparator": "scheidingsteken voor waardenlijst",
120
+ "rangeOfValues": "bereik van waarden",
121
+ "stepValues": "stapwaarden",
122
+ "allowedValues": "toegestane waarden",
123
+ "alternativeSingleValues": "alternatieve losse waarden",
124
+ "sundayNonStandard": "zondag (niet-standaard)",
125
+ "invalidExpression": "Ongeldige cron-expressie: {error}",
126
+ "nextOccurrences": "Volgende: {dates}",
127
+ "possibleValues": "Mogelijke waarden voor dit veld"
128
+ },
110
129
  "ipvAnyNetworkField": {
111
130
  "manuallySelectedPrefix": "Manually selected prefix"
112
131
  },
@@ -346,6 +365,7 @@
346
365
  "endDate": "Einddatum",
347
366
  "note": "Notitie",
348
367
  "metadata": "Metadata",
368
+ "customerId": "Klant ID",
349
369
  "customerFullname": "Klant",
350
370
  "customerShortcode": "Klantafkorting",
351
371
  "actions": "Acties"