@orchestrator-ui/orchestrator-ui-components 6.1.1 → 6.2.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 (31) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +6 -6
  4. package/CHANGELOG.md +16 -0
  5. package/dist/index.d.ts +44 -8
  6. package/dist/index.js +2196 -1889
  7. package/dist/index.js.map +1 -1
  8. package/package.json +7 -3
  9. package/src/components/WfoMonacoCodeBlock/WfoMonacoCodeBlock.tsx +92 -0
  10. package/src/components/WfoMonacoCodeBlock/index.ts +1 -0
  11. package/src/components/WfoMonacoCodeBlock/styles.ts +16 -0
  12. package/src/components/WfoSubscription/WfoInSyncField/WfoInSyncErrorToastMessage.tsx +25 -0
  13. package/src/components/WfoSubscription/{WfoInSyncField.tsx → WfoInSyncField/WfoInSyncField.tsx} +12 -4
  14. package/src/components/WfoSubscription/index.ts +1 -1
  15. package/src/components/WfoSubscription/utils/utils.spec.ts +50 -0
  16. package/src/components/WfoSubscription/utils/utils.ts +22 -0
  17. package/src/components/WfoWorkflowSteps/WfoStep/WfoCodeViewSelector.tsx +116 -0
  18. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +24 -27
  19. package/src/components/index.ts +1 -0
  20. package/src/configuration/version.ts +1 -1
  21. package/src/hooks/useShowToastMessage.ts +3 -1
  22. package/src/icons/heroicons/WfoBracketSquare.tsx +29 -0
  23. package/src/icons/heroicons/WfoCommandLine.tsx +29 -0
  24. package/src/icons/heroicons/WfoTableCells.tsx +29 -0
  25. package/src/icons/heroicons/index.ts +3 -0
  26. package/src/messages/en-GB.json +5 -2
  27. package/src/messages/nl-NL.json +5 -2
  28. package/src/pages/processes/WfoProcessDetail.tsx +20 -2
  29. package/src/rtk/slices/toastMessages.ts +1 -1
  30. package/src/types/types.ts +4 -5
  31. package/src/utils/getToastMessage.ts +6 -4
@@ -249,8 +249,11 @@
249
249
  "submitTaskFormLabel": "Verstuur het formulier om deze taak te starten",
250
250
  "submitWorkflowFormLabel": "Verstuur het formulier om deze workflow te starten",
251
251
  "traceback": "Traceback",
252
- "tableView": "Tabelweergave",
253
- "jsonView": "JSON weergave"
252
+ "codeView": {
253
+ "json": "JSON",
254
+ "table": "Tab",
255
+ "raw": "Raw"
256
+ }
254
257
  },
255
258
  "delta": {
256
259
  "title": "Subscription delta",
@@ -1,4 +1,4 @@
1
- import React, { useContext } from 'react';
1
+ import React, { useContext, useEffect, useRef } from 'react';
2
2
 
3
3
  import { useTranslations } from 'next-intl';
4
4
  import { useRouter } from 'next/router';
@@ -88,6 +88,18 @@ interface ProcessDetailProps {
88
88
  hasError?: boolean;
89
89
  }
90
90
 
91
+ function useHasPreviousRoute() {
92
+ const hasPrev = useRef(false);
93
+
94
+ useEffect(() => {
95
+ if (document.referrer && document.referrer !== window.location.href) {
96
+ hasPrev.current = true;
97
+ }
98
+ }, []);
99
+
100
+ return hasPrev.current;
101
+ }
102
+
91
103
  export const WfoProcessDetail = ({
92
104
  children,
93
105
  processDetail,
@@ -105,6 +117,7 @@ export const WfoProcessDetail = ({
105
117
  const [retryProcess] = useRetryProcessMutation();
106
118
  const [deleteProcess] = useDeleteProcessMutation();
107
119
  const [abortProcess] = useAbortProcessMutation();
120
+ const hasPreviousRoute = useHasPreviousRoute();
108
121
 
109
122
  const router = useRouter();
110
123
  const { isEngineRunningNow } = useCheckEngineStatus();
@@ -177,7 +190,12 @@ export const WfoProcessDetail = ({
177
190
  if (processDetail?.processId) {
178
191
  abortProcess({ processId: processDetail.processId });
179
192
  }
180
- router.push(processIsTask ? PATH_TASKS : PATH_WORKFLOWS);
193
+
194
+ if (hasPreviousRoute) {
195
+ router.back();
196
+ } else {
197
+ router.push(processIsTask ? PATH_TASKS : PATH_WORKFLOWS);
198
+ }
181
199
  },
182
200
  });
183
201
 
@@ -1,7 +1,7 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import type { PayloadAction, Reducer, Slice } from '@reduxjs/toolkit';
3
3
 
4
- import { Toast } from '@/types';
4
+ import type { Toast } from '@/types';
5
5
 
6
6
  export type ToastState = {
7
7
  messages: Toast[];
@@ -1,7 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
- import { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
4
-
5
3
  import { FormUserPermissions, InputForm } from './forms';
6
4
 
7
5
  export type Nullable<T> = T | null;
@@ -570,13 +568,14 @@ export type ExternalService = {
570
568
 
571
569
  export type WfoTreeNodeMap = { [key: number]: TreeBlock };
572
570
 
573
- export type { Toast };
574
-
575
571
  export enum ToastTypes {
576
572
  ERROR = 'ERROR',
577
573
  SUCCESS = 'SUCCESS',
578
574
  }
579
-
575
+ export type Toast = {
576
+ id: string;
577
+ [key: string]: unknown;
578
+ };
580
579
  export enum Environment {
581
580
  DEVELOPMENT = 'Development',
582
581
  PRODUCTION = 'Production',
@@ -1,10 +1,12 @@
1
- import { ToastTypes } from '../types';
2
- import type { Toast } from '../types';
1
+ import { ReactNode } from 'react';
2
+
3
+ import { ToastTypes } from '@/types';
4
+ import type { Toast } from '@/types';
3
5
 
4
6
  export const getToastMessage = (
5
7
  type: ToastTypes,
6
- text: string, // We use string here instead of Toast['text'] because we want to prevent passing in react component because they trigger an "unsynchronizable values in payload detected" error',
7
- title: string, // same as above for string instead of Toast['title']
8
+ text: ReactNode,
9
+ title: string,
8
10
  ) => {
9
11
  const getTypeProps = (type: ToastTypes): Partial<Toast> => {
10
12
  switch (type) {