@orchestrator-ui/orchestrator-ui-components 3.2.0 → 3.3.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.
Files changed (40) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +7 -7
  4. package/CHANGELOG.md +14 -0
  5. package/dist/index.d.ts +603 -16
  6. package/dist/index.js +1892 -1609
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/{WfoInlineNoteEdit/WfoInlineNoteEdit.tsx → WfoInlineEdit/WfoInlineEdit.tsx} +10 -10
  10. package/src/components/WfoInlineEdit/index.ts +1 -0
  11. package/src/components/WfoInlineNoteEdit/WfoSubscriptionDetailNoteEdit.tsx +4 -3
  12. package/src/components/WfoInlineNoteEdit/WfoSubscriptionNoteEdit.tsx +4 -3
  13. package/src/components/WfoInlineNoteEdit/index.ts +0 -1
  14. package/src/components/WfoPageTemplate/WfoPageHeader/WfoHamburgerMenu.tsx +66 -5
  15. package/src/components/WfoSubscription/WfoCustomerDescriptionsField.tsx +100 -26
  16. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx +1 -2
  17. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +2 -3
  18. package/src/components/WfoSubscription/WfoSubscriptionGeneralSections/WfoSubscriptionDetailSection.tsx +11 -15
  19. package/src/components/WfoSubscription/styles.ts +12 -0
  20. package/src/components/WfoSummary/WfoSummaryCard.tsx +11 -3
  21. package/src/components/WfoTable/utils/tableUtils.spec.ts +37 -1
  22. package/src/components/WfoTable/utils/tableUtils.ts +11 -1
  23. package/src/components/index.ts +1 -0
  24. package/src/configuration/constants.ts +2 -0
  25. package/src/configuration/version.ts +1 -1
  26. package/src/icons/heroicons/WfoSquareStack3dStack.tsx +27 -0
  27. package/src/icons/heroicons/index.ts +1 -0
  28. package/src/messages/en-GB.json +10 -3
  29. package/src/messages/nl-NL.json +6 -1
  30. package/src/pages/metadata/WfoTasksPage.tsx +21 -6
  31. package/src/pages/metadata/WfoWorkflowsPage.tsx +19 -2
  32. package/src/pages/metadata/taskListObjectMapper.ts +2 -1
  33. package/src/pages/metadata/workflowListObjectMapper.ts +2 -2
  34. package/src/rtk/endpoints/customerDescriptions.ts +54 -0
  35. package/src/rtk/endpoints/metadata/tasks.ts +1 -0
  36. package/src/rtk/endpoints/metadata/workflows.ts +1 -0
  37. package/src/rtk/endpoints/subscriptionDetail.ts +1 -0
  38. package/src/rtk/endpoints/versions.ts +27 -0
  39. package/src/types/types.ts +3 -0
  40. package/src/utils/getDefaultTableConfig.ts +11 -2
@@ -0,0 +1,27 @@
1
+ import React, { FC } from 'react';
2
+
3
+ import { WfoIconProps } from '@/icons';
4
+
5
+ import { withWfoHeroIconsWrapper } from './WfoHeroIconsWrapper';
6
+
7
+ const WfoSquareStack3dStackSvg: FC<WfoIconProps> = ({
8
+ width = 20,
9
+ height = 20,
10
+ color = 'currentColor',
11
+ }) => (
12
+ <svg
13
+ width={width}
14
+ height={height}
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ viewBox="0 0 24 24"
17
+ fill={color}
18
+ >
19
+ <path d="M11.644 1.59a.75.75 0 0 1 .712 0l9.75 5.25a.75.75 0 0 1 0 1.32l-9.75 5.25a.75.75 0 0 1-.712 0l-9.75-5.25a.75.75 0 0 1 0-1.32l9.75-5.25Z" />
20
+ <path d="m3.265 10.602 7.668 4.129a2.25 2.25 0 0 0 2.134 0l7.668-4.13 1.37.739a.75.75 0 0 1 0 1.32l-9.75 5.25a.75.75 0 0 1-.71 0l-9.75-5.25a.75.75 0 0 1 0-1.32l1.37-.738Z" />
21
+ <path d="m10.933 19.231-7.668-4.13-1.37.739a.75.75 0 0 0 0 1.32l9.75 5.25c.221.12.489.12.71 0l9.75-5.25a.75.75 0 0 0 0-1.32l-1.37-.738-7.668 4.13a2.25 2.25 0 0 1-2.134-.001Z" />
22
+ </svg>
23
+ );
24
+
25
+ export const WfoSquareStack3dStack = withWfoHeroIconsWrapper(
26
+ WfoSquareStack3dStackSvg,
27
+ );
@@ -4,3 +4,4 @@ export * from './WfoArrowDown';
4
4
  export * from './WfoArrowsUpDown';
5
5
  export * from './WfoArrowUp';
6
6
  export * from './WfoWrench';
7
+ export * from './WfoSquareStack3dStack';
@@ -24,8 +24,7 @@
24
24
  "resetToDefault": "Reset to default",
25
25
  "savePreferences": "Save preferences",
26
26
  "numberOfRows": "Number of rows",
27
- "tableSettings": "Table settings",
28
- "openMenu": "Open menu"
27
+ "tableSettings": "Table settings"
29
28
  },
30
29
  "common": {
31
30
  "product": "Product",
@@ -168,10 +167,11 @@
168
167
  "resourceTypes": {
169
168
  "type": "Resource type",
170
169
  "description": "Resource type description",
171
- "resourceId": "Resource ID",
170
+ "resourceId": "ID",
172
171
  "usedInProductBlocks": "Used in product blocks"
173
172
  },
174
173
  "workflows": {
174
+ "workflowId": "ID",
175
175
  "name": "Workflow",
176
176
  "description": "Workflow description",
177
177
  "target": "Target",
@@ -179,6 +179,7 @@
179
179
  "createdAt": "Created"
180
180
  },
181
181
  "tasks": {
182
+ "workflowId": "ID",
182
183
  "name": "Task",
183
184
  "description": "Task description",
184
185
  "target": "Target",
@@ -428,5 +429,11 @@
428
429
  "headerTitle": "Total number of products",
429
430
  "listTitle": "Total number of product instances"
430
431
  }
432
+ },
433
+ "hamburgerMenu": {
434
+ "openMenu": "Open menu",
435
+ "support": "Support",
436
+ "softwareVersions": "Software Versions",
437
+ "logout": "Logout"
431
438
  }
432
439
  }
@@ -168,7 +168,7 @@
168
168
  "resourceTypes": {
169
169
  "type": "Resource type",
170
170
  "description": "Resource type beschrijving",
171
- "resourceId": "Resource ID",
171
+ "resourceId": "ID",
172
172
  "usedInProductBlocks": "Gebruikt in product blocks"
173
173
  },
174
174
  "workflows": {
@@ -428,5 +428,10 @@
428
428
  "headerTitle": "Totaal aantal producten",
429
429
  "listTitle": "Totaal aantal productinstanties"
430
430
  }
431
+ },
432
+ "hamburgerMenu": {
433
+ "support": "Support",
434
+ "softwareVersions": "Software Versies",
435
+ "logout": "Logout"
431
436
  }
432
437
  }
@@ -6,6 +6,7 @@ import { EuiBadgeGroup } from '@elastic/eui';
6
6
 
7
7
  import {
8
8
  PATH_METADATA_PRODUCTS,
9
+ WfoFirstPartUUID,
9
10
  WfoWorkflowTargetBadge,
10
11
  getPageIndexChangeHandler,
11
12
  getPageSizeChangeHandler,
@@ -37,6 +38,7 @@ import { mapRtkErrorToWfoError } from '@/rtk/utils';
37
38
  import type { GraphqlQueryVariables, TaskDefinition } from '@/types';
38
39
  import { BadgeType, SortOrder } from '@/types';
39
40
  import {
41
+ getConcatenatedResult,
40
42
  getQueryUrl,
41
43
  getQueryVariablesForExport,
42
44
  onlyUnique,
@@ -56,7 +58,7 @@ import {
56
58
 
57
59
  export type TaskListItem = Pick<
58
60
  TaskDefinition,
59
- 'name' | 'description' | 'target' | 'createdAt'
61
+ 'workflowId' | 'name' | 'description' | 'target' | 'createdAt'
60
62
  > & {
61
63
  productTags: string[];
62
64
  };
@@ -99,6 +101,14 @@ export const WfoTasksPage = () => {
99
101
  });
100
102
 
101
103
  const tableColumns: WfoAdvancedTableColumnConfig<TaskListItem> = {
104
+ workflowId: {
105
+ columnType: ColumnType.DATA,
106
+ label: t('workflowId'),
107
+ width: '90px',
108
+ renderData: (value) => <WfoFirstPartUUID UUID={value} />,
109
+ renderDetails: (value) => value,
110
+ renderTooltip: (value) => value,
111
+ },
102
112
  name: {
103
113
  columnType: ColumnType.DATA,
104
114
  label: t('name'),
@@ -221,16 +231,21 @@ export const WfoTasksPage = () => {
221
231
  ): TaskListExportItem[] => {
222
232
  const { tasks } = tasksResponse;
223
233
  return tasks.map(
224
- ({ name, target, description, createdAt, products }) => {
225
- const uniqueProducts = products
226
- .map((product) => product.tag)
227
- .filter(onlyUnique);
234
+ ({
235
+ workflowId,
236
+ name,
237
+ target,
238
+ description,
239
+ createdAt,
240
+ products,
241
+ }) => {
228
242
  return {
243
+ workflowId,
229
244
  name,
230
245
  target,
231
246
  description,
232
247
  createdAt,
233
- productTags: uniqueProducts.join(' - '),
248
+ productTags: getConcatenatedResult(products, ['tag']),
234
249
  };
235
250
  },
236
251
  );
@@ -7,6 +7,7 @@ import { EuiBadgeGroup } from '@elastic/eui';
7
7
  import {
8
8
  PATH_METADATA_PRODUCTS,
9
9
  WfoDataSorting,
10
+ WfoFirstPartUUID,
10
11
  getPageIndexChangeHandler,
11
12
  getPageSizeChangeHandler,
12
13
  } from '@/components';
@@ -62,7 +63,7 @@ import {
62
63
 
63
64
  export type WorkflowListItem = Pick<
64
65
  WorkflowDefinition,
65
- 'name' | 'description' | 'target' | 'createdAt'
66
+ 'workflowId' | 'name' | 'description' | 'target' | 'createdAt'
66
67
  > & {
67
68
  productTags: string[];
68
69
  };
@@ -105,6 +106,14 @@ export const WfoWorkflowsPage = () => {
105
106
  });
106
107
 
107
108
  const tableColumns: WfoAdvancedTableColumnConfig<WorkflowListItem> = {
109
+ workflowId: {
110
+ columnType: ColumnType.DATA,
111
+ label: t('workflowId'),
112
+ width: '90px',
113
+ renderData: (value) => <WfoFirstPartUUID UUID={value} />,
114
+ renderDetails: (value) => value,
115
+ renderTooltip: (value) => value,
116
+ },
108
117
  name: {
109
118
  columnType: ColumnType.DATA,
110
119
  label: t('name'),
@@ -228,7 +237,15 @@ export const WfoWorkflowsPage = () => {
228
237
  ): WorkflowListExportItem[] => {
229
238
  const { workflows } = workflowsResponse;
230
239
  return workflows.map(
231
- ({ name, target, description, createdAt, products }) => ({
240
+ ({
241
+ workflowId,
242
+ name,
243
+ target,
244
+ description,
245
+ createdAt,
246
+ products,
247
+ }) => ({
248
+ workflowId,
232
249
  name,
233
250
  target,
234
251
  description,
@@ -6,12 +6,13 @@ export const mapTaskDefinitionToTaskListItem = (
6
6
  tasks: TaskDefinition[],
7
7
  ): TaskListItem[] =>
8
8
  tasks.map((taskDefinition) => {
9
- const { name, target, description, createdAt, products } =
9
+ const { workflowId, name, target, description, createdAt, products } =
10
10
  taskDefinition;
11
11
 
12
12
  const productTags = products.map((product) => product.tag);
13
13
 
14
14
  return {
15
+ workflowId,
15
16
  name,
16
17
  description,
17
18
  target,
@@ -6,12 +6,12 @@ export const mapWorkflowDefinitionToWorkflowListItem = (
6
6
  workflows: WorkflowDefinition[],
7
7
  ): WorkflowListItem[] =>
8
8
  workflows.map((workflowDefinition) => {
9
- const { name, target, description, createdAt, products } =
9
+ const { workflowId, name, target, description, createdAt, products } =
10
10
  workflowDefinition;
11
-
12
11
  const productTags = products.map((product) => product.tag);
13
12
 
14
13
  return {
14
+ workflowId,
15
15
  name,
16
16
  description,
17
17
  target,
@@ -0,0 +1,54 @@
1
+ import { CUSTOMER_DESCRIPTION_ENDPOINT } from '@/configuration';
2
+ import { BaseQueryTypes, orchestratorApi } from '@/rtk';
3
+ import { CustomerDescriptions } from '@/types';
4
+
5
+ const customerDescriptionsApi = orchestratorApi.injectEndpoints({
6
+ endpoints: (build) => ({
7
+ setCustomerDescription: build.mutation<
8
+ null,
9
+ Pick<
10
+ CustomerDescriptions,
11
+ 'description' | 'customerId' | 'subscriptionId'
12
+ >
13
+ >({
14
+ query: (customerDescription) => ({
15
+ url: `${CUSTOMER_DESCRIPTION_ENDPOINT}`,
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': 'application/json',
19
+ },
20
+ body: {
21
+ customer_id: customerDescription.customerId,
22
+ subscription_id: customerDescription.subscriptionId,
23
+ description: customerDescription.description,
24
+ },
25
+ }),
26
+ extraOptions: {
27
+ baseQueryType: BaseQueryTypes.fetch,
28
+ },
29
+ }),
30
+ updateCustomerDescription: build.mutation<null, CustomerDescriptions>({
31
+ query: (customerDescription) => ({
32
+ url: `${CUSTOMER_DESCRIPTION_ENDPOINT}`,
33
+ method: 'PUT',
34
+ headers: {
35
+ 'Content-Type': 'application/json',
36
+ },
37
+ body: {
38
+ id: customerDescription.id,
39
+ customer_id: customerDescription.customerId,
40
+ subscription_id: customerDescription.subscriptionId,
41
+ description: customerDescription.description,
42
+ },
43
+ }),
44
+ extraOptions: {
45
+ baseQueryType: BaseQueryTypes.fetch,
46
+ },
47
+ }),
48
+ }),
49
+ });
50
+
51
+ export const {
52
+ useSetCustomerDescriptionMutation,
53
+ useUpdateCustomerDescriptionMutation,
54
+ } = customerDescriptionsApi;
@@ -21,6 +21,7 @@ query MetadataWorkflows(
21
21
  filterBy: { field: "target", value: "SYSTEM" }
22
22
  ) {
23
23
  page {
24
+ workflowId
24
25
  name
25
26
  description
26
27
  target
@@ -36,6 +36,7 @@ query MetadataWorkflows(
36
36
  filterBy: { field: "target", value: "CREATE|MODIFY|TERMINATE" }
37
37
  ) {
38
38
  page {
39
+ workflowId
39
40
  name
40
41
  description
41
42
  target
@@ -36,6 +36,7 @@ fragment SubscriptionDetail on SubscriptionInterface {
36
36
  shortcode
37
37
  }
38
38
  customerDescriptions {
39
+ id
39
40
  subscriptionId
40
41
  description
41
42
  customerId
@@ -0,0 +1,27 @@
1
+ import { orchestratorApi } from '../api';
2
+
3
+ const versionsQuery = `
4
+ query Versions {
5
+ version {
6
+ applicationVersions
7
+ }
8
+ }
9
+ `;
10
+
11
+ export type VersionsResponse = {
12
+ version: {
13
+ applicationVersions: [string];
14
+ };
15
+ };
16
+
17
+ const versionsApi = orchestratorApi.injectEndpoints({
18
+ endpoints: (build) => ({
19
+ getVersions: build.query<VersionsResponse, void>({
20
+ query: () => ({
21
+ document: versionsQuery,
22
+ }),
23
+ }),
24
+ }),
25
+ });
26
+
27
+ export const { useGetVersionsQuery } = versionsApi;
@@ -251,6 +251,7 @@ export interface Step {
251
251
  }
252
252
 
253
253
  export interface WorkflowDefinition {
254
+ workflowId: string;
254
255
  name: string;
255
256
  description?: string;
256
257
  target: WorkflowTarget;
@@ -259,6 +260,7 @@ export interface WorkflowDefinition {
259
260
  }
260
261
 
261
262
  export interface TaskDefinition {
263
+ workflowId: string;
262
264
  name: string;
263
265
  description?: string;
264
266
  target: WorkflowTarget;
@@ -461,6 +463,7 @@ export type SubscriptionDropdownOption = {
461
463
  };
462
464
 
463
465
  export type CustomerDescriptions = {
466
+ id: string;
464
467
  subscriptionId: string;
465
468
  description: string;
466
469
  customerId: string;
@@ -58,10 +58,19 @@ export const getDefaultTableConfig = <T>(storageKey: string) => {
58
58
  return getTableConfig<T>(productColumns as (keyof T)[]);
59
59
 
60
60
  case METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY:
61
- case METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY:
62
- const workflowColumns: (keyof WorkflowDefinition)[] = ['createdAt'];
61
+ const workflowColumns: (keyof WorkflowDefinition)[] = [
62
+ 'workflowId',
63
+ 'createdAt',
64
+ ];
63
65
  return getTableConfig<T>(workflowColumns as (keyof T)[]);
64
66
 
67
+ case METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY:
68
+ const taskColumns: (keyof WorkflowDefinition)[] = [
69
+ 'workflowId',
70
+ 'createdAt',
71
+ ];
72
+ return getTableConfig<T>(taskColumns as (keyof T)[]);
73
+
65
74
  case ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY:
66
75
  const activeProcessColumns: (keyof ProcessListItem)[] = [
67
76
  'productName',