@orchestrator-ui/orchestrator-ui-components 7.1.0 → 7.2.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 (35) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +8 -8
  4. package/CHANGELOG.md +12 -0
  5. package/dist/index.d.ts +930 -6
  6. package/dist/index.js +2340 -1942
  7. package/dist/index.js.map +1 -1
  8. package/package.json +2 -2
  9. package/src/components/WfoBadges/WfoScheduledTasksBadges/WfoScheduledTasksBadges.tsx +38 -0
  10. package/src/components/WfoBadges/WfoScheduledTasksBadges/WfoScheduledTasksBadgesContainer.tsx +27 -0
  11. package/src/components/WfoBadges/WfoScheduledTasksBadges/index.ts +2 -0
  12. package/src/components/WfoBadges/index.ts +1 -0
  13. package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +19 -0
  14. package/src/components/WfoPageTemplate/paths.ts +1 -0
  15. package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +16 -10
  16. package/src/components/WfoTable/utils/constants.ts +1 -0
  17. package/src/configuration/constants.ts +1 -0
  18. package/src/configuration/version.ts +1 -1
  19. package/src/hooks/index.ts +2 -0
  20. package/src/hooks/useGetSchedulesForWorkflow.tsx +30 -0
  21. package/src/hooks/useGetWorkflowNameById.tsx +23 -0
  22. package/src/icons/heroicons/WfoScheduledTaskOnce.tsx +32 -0
  23. package/src/icons/heroicons/WfoScheduledTaskRecurring.tsx +32 -0
  24. package/src/icons/heroicons/index.ts +2 -0
  25. package/src/messages/en-GB.json +11 -1
  26. package/src/messages/nl-NL.json +10 -1
  27. package/src/pages/metadata/WfoMetadataPageLayout.tsx +6 -1
  28. package/src/pages/metadata/WfoScheduledTasksPage.tsx +223 -0
  29. package/src/pages/metadata/WfoTasksPage.tsx +20 -3
  30. package/src/pages/metadata/index.ts +1 -0
  31. package/src/pages/metadata/taskListObjectMapper.ts +3 -0
  32. package/src/rtk/endpoints/metadata/index.ts +1 -0
  33. package/src/rtk/endpoints/metadata/scheduledTasks.ts +66 -0
  34. package/src/rtk/endpoints/metadata/tasks.ts +1 -1
  35. package/src/types/types.ts +18 -3
@@ -7,6 +7,7 @@ import { EuiBadgeGroup } from '@elastic/eui';
7
7
  import {
8
8
  PATH_METADATA_PRODUCTS,
9
9
  WfoFirstPartUUID,
10
+ WfoScheduledTasksBadgesContainer,
10
11
  WfoWorkflowTargetBadge,
11
12
  getPageIndexChangeHandler,
12
13
  getPageSizeChangeHandler,
@@ -42,7 +43,7 @@ import {
42
43
  } from '@/rtk';
43
44
  import { mapRtkErrorToWfoError } from '@/rtk/utils';
44
45
  import type { GraphqlQueryVariables, TaskDefinition } from '@/types';
45
- import { BadgeType, SortOrder } from '@/types';
46
+ import { BadgeType, ScheduleFrequency, SortOrder } from '@/types';
46
47
  import {
47
48
  getConcatenatedResult,
48
49
  getQueryUrl,
@@ -67,9 +68,13 @@ export type TaskListItem = Pick<
67
68
  'workflowId' | 'name' | 'description' | 'target' | 'createdAt'
68
69
  > & {
69
70
  productTags: string[];
71
+ scheduleFrequency: ScheduleFrequency[];
70
72
  };
71
73
 
72
- type TaskListExportItem = Omit<TaskListItem, 'productTags'> & {
74
+ export type TaskListExportItem = Omit<
75
+ TaskListItem,
76
+ 'productTags' | 'scheduleFrequency'
77
+ > & {
73
78
  productTags: string;
74
79
  };
75
80
 
@@ -109,7 +114,7 @@ export const WfoTasksPage = () => {
109
114
  workflowId: {
110
115
  columnType: ColumnType.DATA,
111
116
  label: t('workflowId'),
112
- width: '90px',
117
+ width: '95px',
113
118
  renderData: (value) => <WfoFirstPartUUID UUID={value} />,
114
119
  renderDetails: (value) => value,
115
120
  renderTooltip: (value) => value,
@@ -195,6 +200,16 @@ export const WfoTasksPage = () => {
195
200
  ));
196
201
  },
197
202
  },
203
+ scheduleFrequency: {
204
+ columnType: ColumnType.DATA,
205
+ label: t('scheduled'),
206
+ renderData: (_, taskListItem) => (
207
+ <WfoScheduledTasksBadgesContainer
208
+ workflowId={taskListItem.workflowId}
209
+ />
210
+ ),
211
+ width: '80px',
212
+ },
198
213
  createdAt: {
199
214
  columnType: ColumnType.DATA,
200
215
  label: t('createdAt'),
@@ -214,6 +229,7 @@ export const WfoTasksPage = () => {
214
229
  sortBy: graphQlTaskListMapper(sortBy),
215
230
  query: queryString || undefined,
216
231
  };
232
+
217
233
  const { data, isFetching, error } = useGetTasksQuery(
218
234
  taskListQueryVariables,
219
235
  );
@@ -246,6 +262,7 @@ export const WfoTasksPage = () => {
246
262
  tasksResponse: TasksResponse,
247
263
  ): TaskListExportItem[] => {
248
264
  const { tasks } = tasksResponse;
265
+
249
266
  return tasks.map(
250
267
  ({
251
268
  workflowId,
@@ -4,4 +4,5 @@ export * from './WfoProductsPage';
4
4
  export * from './WfoWorkflowsPage';
5
5
  export * from './WfoTasksPage';
6
6
  export * from './WfoMetadataPageLayout';
7
+ export * from './WfoScheduledTasksPage';
7
8
  export * from './workflowListObjectMapper';
@@ -18,6 +18,7 @@ export const mapTaskDefinitionToTaskListItem = (
18
18
  target,
19
19
  createdAt,
20
20
  productTags,
21
+ scheduleFrequency: [],
21
22
  };
22
23
  });
23
24
 
@@ -27,6 +28,8 @@ export const taskFieldMapper = (
27
28
  switch (field) {
28
29
  case 'productTags':
29
30
  return 'productTag' as keyof TaskDefinition;
31
+ case 'scheduleFrequency':
32
+ return 'scheduleFrequency' as keyof TaskDefinition;
30
33
  default:
31
34
  return field;
32
35
  }
@@ -2,3 +2,4 @@ export * from './productBlocks';
2
2
  export * from './resourceTypes';
3
3
  export * from './workflows';
4
4
  export * from './tasks';
5
+ export * from './scheduledTasks';
@@ -0,0 +1,66 @@
1
+ import { orchestratorApi } from '@/rtk';
2
+ import {
3
+ BaseGraphQlResult,
4
+ GraphqlQueryVariables,
5
+ ScheduledTaskDefinition,
6
+ ScheduledTasksDefinitionsResult,
7
+ } from '@/types';
8
+
9
+ export const scheduledTasks = `
10
+ query ScheduledTasks(
11
+ $first: Int!
12
+ $after: Int!
13
+ $sortBy: [GraphqlSort!]
14
+ ) {
15
+ scheduledTasks(first: $first, after: $after, sortBy: $sortBy) {
16
+ page {
17
+ id
18
+ name
19
+ nextRunTime
20
+ trigger
21
+ workflowId
22
+ }
23
+ pageInfo {
24
+ endCursor
25
+ hasNextPage
26
+ hasPreviousPage
27
+ startCursor
28
+ totalItems
29
+ sortFields
30
+ filterFields
31
+ }
32
+ }
33
+ }
34
+ `;
35
+
36
+ export type ScheduledTasksResponse = {
37
+ schedules: ScheduledTaskDefinition[];
38
+ } & BaseGraphQlResult;
39
+
40
+ const scheduledTasksApi = orchestratorApi.injectEndpoints({
41
+ endpoints: (builder) => ({
42
+ getScheduledTasks: builder.query<
43
+ ScheduledTasksResponse,
44
+ GraphqlQueryVariables<ScheduledTaskDefinition>
45
+ >({
46
+ query: (variables) => ({
47
+ document: scheduledTasks,
48
+ variables,
49
+ }),
50
+ transformResponse: (
51
+ response: ScheduledTasksDefinitionsResult,
52
+ ): ScheduledTasksResponse => {
53
+ const schedules = response.scheduledTasks.page || [];
54
+ const pageInfo = response.scheduledTasks.pageInfo || {};
55
+
56
+ return {
57
+ schedules,
58
+ pageInfo,
59
+ };
60
+ },
61
+ }),
62
+ }),
63
+ });
64
+
65
+ export const { useGetScheduledTasksQuery, useLazyGetScheduledTasksQuery } =
66
+ scheduledTasksApi;
@@ -7,7 +7,7 @@ import {
7
7
  } from '@/types';
8
8
 
9
9
  export const tasksQuery = `
10
- query MetadataWorkflows(
10
+ query MetadataTasks(
11
11
  $first: Int!
12
12
  $after: Int!
13
13
  $sortBy: [GraphqlSort!]
@@ -278,8 +278,21 @@ export interface TaskDefinition {
278
278
  createdAt: string;
279
279
  }
280
280
 
281
+ export interface ScheduledTaskDefinition {
282
+ id: string;
283
+ name: string;
284
+ nextRunTime: string;
285
+ trigger: string;
286
+ workflowId: string;
287
+ }
288
+
281
289
  //// Utility types
282
290
 
291
+ export enum ScheduleFrequency {
292
+ RECURRING = 'RECURRING',
293
+ ONCE = 'ONCE',
294
+ }
295
+
283
296
  export enum SortOrder {
284
297
  ASC = 'ASC',
285
298
  DESC = 'DESC',
@@ -322,7 +335,9 @@ export type BaseGraphQlResult = {
322
335
  export interface SubscriptionsResult<T = Subscription> {
323
336
  subscriptions: GraphQlResultPage<T>;
324
337
  }
325
-
338
+ export interface ProductDefinitionsResult<T = ProductDefinition> {
339
+ products: GraphQlResultPage<T>;
340
+ }
326
341
  export interface SubscriptionDropdownOptionsResult {
327
342
  subscriptions: GraphQlSinglePage<SubscriptionDropdownOption>;
328
343
  }
@@ -331,8 +346,8 @@ export interface SubscriptionDetailResult {
331
346
  subscriptions: GraphQlResultPage<SubscriptionDetail>;
332
347
  }
333
348
 
334
- export interface ProductDefinitionsResult<T = ProductDefinition> {
335
- products: GraphQlResultPage<T>;
349
+ export interface ScheduledTasksDefinitionsResult<T = ScheduledTaskDefinition> {
350
+ scheduledTasks: GraphQlResultPage<T>;
336
351
  }
337
352
  export interface StartProcessStep {
338
353
  name: Step['name'];