@orchestrator-ui/orchestrator-ui-components 8.9.2 → 9.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.
Files changed (63) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +262 -19
  4. package/CHANGELOG.md +28 -0
  5. package/dist/index.d.ts +2082 -2505
  6. package/dist/index.js +2045 -2190
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/WfoError/WfoError.tsx +2 -2
  10. package/src/components/WfoInlineNoteEdit/WfoSubscriptionDetailNoteEdit.tsx +4 -8
  11. package/src/components/WfoInlineNoteEdit/WfoSubscriptionNoteEdit.tsx +6 -7
  12. package/src/components/WfoKeyValueTable/styles.ts +24 -0
  13. package/src/components/WfoPageTemplate/paths.ts +0 -1
  14. package/src/components/WfoPydanticForm/fields/WfoLabel.tsx +5 -1
  15. package/src/components/WfoPydanticForm/fields/styles.ts +12 -3
  16. package/src/components/WfoSettingsModal/WfoInformationModal.tsx +3 -2
  17. package/src/components/WfoSubscriptionsList/index.ts +1 -2
  18. package/src/components/WfoSubscriptionsList/subscriptionListItem.ts +14 -0
  19. package/src/components/WfoSubscriptionsList/subscriptionListTabs.ts +1 -20
  20. package/src/components/WfoSummary/WfoLatestActiveSubscriptionsSummaryCard.tsx +17 -13
  21. package/src/components/WfoSummary/WfoLatestOutOfSyncSubscriptionSummaryCard.tsx +28 -15
  22. package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +5 -1
  23. package/src/components/WfoTable/WfoStructuredSearchTable/WfoApplyFilterButton.tsx +37 -0
  24. package/src/components/WfoTable/WfoStructuredSearchTable/WfoDebounceCountdown.tsx +58 -0
  25. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.spec.tsx +180 -0
  26. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFieldSelector.tsx +66 -51
  27. package/src/components/WfoTable/WfoStructuredSearchTable/WfoFilterBuilder.tsx +33 -98
  28. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRangeEditor.tsx +0 -1
  29. package/src/components/WfoTable/WfoStructuredSearchTable/WfoRestoreLoop.spec.tsx +2 -2
  30. package/src/components/WfoTable/WfoStructuredSearchTable/WfoStructuredSearchTable.tsx +5 -7
  31. package/src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx +9 -13
  32. package/src/components/WfoTable/WfoStructuredSearchTable/styles.ts +7 -0
  33. package/src/components/WfoTable/WfoStructuredSearchTable/useSearchWithDebouncedCallback.spec.tsx +147 -0
  34. package/src/components/WfoTable/WfoStructuredSearchTable/utils.spec.ts +60 -1
  35. package/src/components/WfoTable/WfoStructuredSearchTable/utils.ts +133 -1
  36. package/src/configuration/version.ts +1 -1
  37. package/src/hooks/index.ts +1 -0
  38. package/src/hooks/useDebouncedCallback.ts +48 -0
  39. package/src/hooks/usePathAutoComplete.spec.tsx +94 -9
  40. package/src/hooks/usePathAutoComplete.ts +10 -15
  41. package/src/hooks/useSearchPagination.ts +1 -1
  42. package/src/messages/en-GB.json +4 -2
  43. package/src/messages/nl-NL.json +4 -2
  44. package/src/pages/index.ts +0 -1
  45. package/src/pages/startPage/index.ts +1 -0
  46. package/src/pages/startPage/mappers.ts +15 -8
  47. package/src/pages/startPage/queryVariables.ts +0 -29
  48. package/src/pages/startPage/searchPayloads.ts +22 -0
  49. package/src/pages/subscriptions/WfoSubscriptionsListPage.tsx +511 -39
  50. package/src/rtk/endpoints/index.ts +0 -1
  51. package/src/rtk/endpoints/search.ts +3 -0
  52. package/src/rtk/endpoints/subscriptionListMutation.spec.ts +80 -0
  53. package/src/rtk/endpoints/subscriptionListMutation.ts +71 -52
  54. package/src/rtk/utils.spec.ts +30 -1
  55. package/src/rtk/utils.ts +2 -1
  56. package/src/types/search.ts +1 -3
  57. package/src/types/types.ts +0 -2
  58. package/src/utils/getDefaultTableConfig.ts +1 -6
  59. package/src/utils/getQueryParams.ts +1 -0
  60. package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +0 -243
  61. package/src/components/WfoSubscriptionsList/subscriptionResultMappers.ts +0 -49
  62. package/src/pages/WfoSearchPocPage.tsx +0 -575
  63. package/src/rtk/endpoints/subscriptionListSummary.ts +0 -66
@@ -23,6 +23,7 @@
23
23
  "retrieverHybrid": "Hybrid",
24
24
  "retrieverSemantic": "Semantic",
25
25
  "search": "Search",
26
+ "searchError": "Search failed",
26
27
  "searchModalText": "<p>Different options are available from free text search covering all data columns, or column specific filtering. Note that: <p></p><ul><li>Hidden columns are included</li> <li>Searching is case-insensitive</li> <li>Ordering of words does not matter (unless it is a Phrase)</li> <li>TSV (text search vector) search only available for subscriptions table</li></ul></p> <p>For example:</p> <li><b>\"l2vpn\"</b> – free text search</li> <li><b>tag:l2vpn</b> – search in a specific column</li><li><b>tag:lp description:test</b> – search in multiple columns</li><li><b>tag:(lp|lr)</b> – multiselect within 1 column</li><li><b>-tag:lp</b> – negated filter</li><li><b>test*</b> – prefix filter</li> <p></p><p><b>Note:</b> Search words containing characters `|-*():\"` may not be valid, as they are part of the search query grammar</p><p>Invalid search strings are for example:</p><ul><li>2a10:e300:fff0::/48</li> <li>\"node123(planned)\"</li> <li>\"node123|planned\"</li></ul>",
27
28
  "searchModalTitle": "Search string options",
28
29
  "showAllColumnsInDetailView": "Show all columns in detail view",
@@ -372,6 +373,7 @@
372
373
  "previousPage": "Previous page",
373
374
  "removeConditionAriaLabel": "Remove condition",
374
375
  "removeGroup": "Remove group",
376
+ "loadingOptions": "Loading options",
375
377
  "removeRule": "Remove rule",
376
378
  "resultsOnPage": "{resultCount} result(s) on this page",
377
379
  "retrieval": "Retrieval",
@@ -380,7 +382,7 @@
380
382
  "retrieverHybrid": "Hybrid",
381
383
  "retrieverSemantic": "Semantic",
382
384
  "searchError": "Error",
383
- "searchFieldsPlaceholder": "Search fields...",
385
+ "searchFieldsPlaceholder": "Type to select fields",
384
386
  "searchPlaceholder": "Search for {entityType}…",
385
387
  "searchResultsPagination": "Search results pagination",
386
388
  "selectDateAndTime": "Select date",
@@ -388,6 +390,7 @@
388
390
  "selectOrEnterValue": "Select or type value",
389
391
  "selectSpecificPathPlaceholder": "Select a specific path...",
390
392
  "showFilters": "Show filters",
393
+ "startTypingToLoadOptions": "Start typing to load options",
391
394
  "structuredFilters": "Structured filters",
392
395
  "toDate": "To date",
393
396
  "toNumber": "To",
@@ -548,7 +551,6 @@
548
551
  },
549
552
  "index": {
550
553
  "customerFullname": "Customer",
551
- "customerId": "Customer ID",
552
554
  "customerShortcode": "Customer abbr",
553
555
  "description": "Description",
554
556
  "endDate": "End date",
@@ -23,6 +23,7 @@
23
23
  "retrieverHybrid": "Hybride",
24
24
  "retrieverSemantic": "Semantic",
25
25
  "search": "Zoeken",
26
+ "searchError": "Zoeken mislukt",
26
27
  "searchModalText": "<p>Er zijn verschillende opties beschikbaar: zoeken in vrije tekst voor alle datakolommen en specifiek per kolom te filteren. Houd er rekening mee dat: </p><p></p><ul><li>Verborgen kolommen zijn inbegrepen</li> <li>Zoeken is niet hoofdlettergevoelig</li> <li>De volgorde van woorden doet er niet toe (tenzij het een quote)</li> <li>TSV (text search vector) zoekactie alleen beschikbaar voor subscription tabel</li></ul><p>Bijvoorbeeld:</p> <li><b>\"l2vpn\"</b> – vrije tekst search</li> <li><b>tag:l2vpn</b> – zoeken in een specifieke kolom</li> <li><b>tag:lp beschrijving: test</b> – zoeken in meerdere kolommen</li><li><b>tag:(lp|lr)</b> – multi select binnen 1 kolom</li> <li><b>-tag:lp</b> – omgekeerd filteren</li> <li><b>test*</b> – prefix filter</li> <p></p><p><b>Opmerking:</b> Zoeken op woorden die tekens `|-*():\"` bevatten, zijn mogelijk niet geldig, omdat ze deel uitmaken van de grammatica van de zoekfunctie</p><p>Ongeldige zoekwoorden zijn bijvoorbeeld:</p><ul><li>2a10:e300:fff0::/48</li> <li>\"node123(gepland)\"</li> <li>\"node123|gepland\"</li></ul>",
27
28
  "searchModalTitle": "Zoekwoorden opties",
28
29
  "showAllColumnsInDetailView": "Toon alle kolommen in detailweergave",
@@ -372,6 +373,7 @@
372
373
  "previousPage": "Vorige pagina",
373
374
  "removeConditionAriaLabel": "Conditie verwijderen",
374
375
  "removeGroup": "Groep verwijderen",
376
+ "loadingOptions": "Opties laden",
375
377
  "removeRule": "Regel verwijderen",
376
378
  "resultsOnPage": "{resultCount} resulta(a)t(en) op deze pagina",
377
379
  "retrieval": "Retrieval",
@@ -380,7 +382,7 @@
380
382
  "retrieverHybrid": "Hybride",
381
383
  "retrieverSemantic": "Semantic",
382
384
  "searchError": "Fout",
383
- "searchFieldsPlaceholder": "Zoek velden...",
385
+ "searchFieldsPlaceholder": "Typ om velden te selecteren",
384
386
  "searchPlaceholder": "Zoek naar {entityType}…",
385
387
  "searchResultsPagination": "Paginering zoekresultaten",
386
388
  "selectDateAndTime": "Selecteer datum",
@@ -388,6 +390,7 @@
388
390
  "selectOrEnterValue": "Selecteer of typ een waarde",
389
391
  "selectSpecificPathPlaceholder": "Selecteer een specifiek pad...",
390
392
  "showFilters": "Toon filters",
393
+ "startTypingToLoadOptions": "Begin met typen om opties te laden",
391
394
  "structuredFilters": "Gestructureerde filters",
392
395
  "toDate": "Tot datum",
393
396
  "toNumber": "Tot",
@@ -548,7 +551,6 @@
548
551
  },
549
552
  "index": {
550
553
  "customerFullname": "Klant",
551
- "customerId": "Klant ID",
552
554
  "customerShortcode": "Klantafkorting",
553
555
  "description": "Beschrijving",
554
556
  "endDate": "Einddatum",
@@ -5,4 +5,3 @@ export * from './startPage';
5
5
  export * from './subscriptions';
6
6
  export * from './tasks';
7
7
  export * from './workflows';
8
- export * from './WfoSearchPocPage';
@@ -1,2 +1,3 @@
1
1
  export * from './WfoStartPage';
2
2
  export * from './mappers';
3
+ export * from './searchPayloads';
@@ -1,19 +1,26 @@
1
1
  import { PATH_SUBSCRIPTIONS, PATH_WORKFLOWS } from '@/components';
2
2
  import { SummaryCardListItem } from '@/components/WfoSummary';
3
3
  import { ProcessSummary } from '@/rtk';
4
- import { SubscriptionSummary } from '@/types';
4
+ import { SearchResult } from '@/types';
5
5
  import { formatDate } from '@/utils';
6
6
 
7
+ import {
8
+ SUBSCRIPTION_DESCRIPTION_COLUMN,
9
+ SUBSCRIPTION_ID_COLUMN,
10
+ SUBSCRIPTION_START_DATE_COLUMN,
11
+ } from './searchPayloads';
12
+
7
13
  export const mapProcessSummaryToSummaryCardListItem = (processSummary: ProcessSummary): SummaryCardListItem => ({
8
14
  title: processSummary.workflowName,
9
15
  value: formatDate(processSummary?.startedAt),
10
16
  url: `${PATH_WORKFLOWS}/${processSummary.processId}`,
11
17
  });
12
18
 
13
- export const mapSubscriptionSummaryToSummaryCardListItem = (
14
- subscription: SubscriptionSummary,
15
- ): SummaryCardListItem => ({
16
- title: subscription.description,
17
- value: formatDate(subscription.startDate),
18
- url: `${PATH_SUBSCRIPTIONS}/${subscription.subscriptionId}`,
19
- });
19
+ export const mapSubscriptionSearchResultToSummaryCardListItem = (result: SearchResult): SummaryCardListItem => {
20
+ const { response_columns } = result;
21
+ return {
22
+ title: String(response_columns[SUBSCRIPTION_DESCRIPTION_COLUMN] ?? ''),
23
+ value: formatDate(response_columns[SUBSCRIPTION_START_DATE_COLUMN] as string | null),
24
+ url: `${PATH_SUBSCRIPTIONS}/${response_columns[SUBSCRIPTION_ID_COLUMN]}`,
25
+ };
26
+ };
@@ -13,14 +13,6 @@ const baseQueryVariables: Partial<GraphqlQueryVariables<unknown>> = {
13
13
  first: 5,
14
14
  after: 0,
15
15
  };
16
- const baseQueryVariablesForSubscription: Partial<GraphqlQueryVariables<Subscription>> = {
17
- ...baseQueryVariables,
18
- sortBy: {
19
- field: 'startDate',
20
- order: SortOrder.DESC,
21
- },
22
- };
23
-
24
16
  const baseQueryVariablesForProcess: Partial<GraphqlQueryVariables<Process>> = {
25
17
  ...baseQueryVariables,
26
18
  sortBy: {
@@ -41,27 +33,6 @@ const getTaskFilter = (isTask: boolean): GraphqlFilter<Process> => {
41
33
  };
42
34
  };
43
35
 
44
- export const subscriptionsListSummaryQueryVariables: GraphqlQueryVariables<Subscription> = {
45
- ...baseQueryVariablesForSubscription,
46
- filterBy: [
47
- {
48
- field: 'status',
49
- value: 'Active',
50
- },
51
- ],
52
- };
53
-
54
- export const outOfSyncSubscriptionsListSummaryQueryVariables: GraphqlQueryVariables<Subscription> = {
55
- ...baseQueryVariablesForSubscription,
56
- query: 'insync:false',
57
- filterBy: [
58
- {
59
- field: 'status',
60
- value: 'Active-Provisioning',
61
- },
62
- ],
63
- };
64
-
65
36
  export const getMyWorkflowListSummaryQueryVariables = (username: string): GraphqlQueryVariables<Process> => ({
66
37
  ...baseQueryVariablesForProcess,
67
38
  filterBy: [
@@ -0,0 +1,22 @@
1
+ import { SearchPayload } from '@/rtk';
2
+ import { EntityKind, Filter } from '@/types';
3
+
4
+ export const SUBSCRIPTION_ID_COLUMN = 'subscription.subscription_id';
5
+ export const SUBSCRIPTION_DESCRIPTION_COLUMN = 'subscription.description';
6
+ export const SUBSCRIPTION_START_DATE_COLUMN = 'subscription.start_date';
7
+
8
+ const SUMMARY_CARD_ITEM_COUNT = 5;
9
+
10
+ /**
11
+ * Builds the search payload shared by the subscription summary cards on the start page: the five
12
+ * most recently started subscriptions matching `filters`, with just the columns the card renders.
13
+ * `filters` is an Elasticsearch bool query, the same shape the subscriptions list page sends.
14
+ */
15
+ export const getSubscriptionSummarySearchPayload = (filters: Filter): SearchPayload => ({
16
+ entity_type: EntityKind.SUBSCRIPTION,
17
+ query: '',
18
+ filters,
19
+ limit: SUMMARY_CARD_ITEM_COUNT,
20
+ order_by: { element: SUBSCRIPTION_START_DATE_COLUMN, direction: 'desc' },
21
+ response_columns: [SUBSCRIPTION_ID_COLUMN, SUBSCRIPTION_DESCRIPTION_COLUMN, SUBSCRIPTION_START_DATE_COLUMN],
22
+ });