@orchestrator-ui/orchestrator-ui-components 2.12.0 → 2.13.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.
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +8 -8
- package/CHANGELOG.md +10 -0
- package/dist/index.d.ts +76 -57
- package/dist/index.js +1241 -1202
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/WfoForms/UserInputForm.tsx +6 -2
- package/src/components/WfoSubscription/styles.ts +16 -11
- package/src/configuration/version.ts +1 -1
- package/src/contexts/WfoErrorMonitoringProvider.tsx +37 -0
- package/src/contexts/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useWfoErrorMonitoring.ts +6 -0
- package/src/rtk/endpoints/streamMessages.ts +1 -1
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from '@elastic/eui';
|
|
35
35
|
|
|
36
36
|
import { ConfirmDialogHandler, ConfirmationDialogContext } from '@/contexts';
|
|
37
|
-
import { useOrchestratorTheme } from '@/hooks';
|
|
37
|
+
import { useOrchestratorTheme, useWfoErrorMonitoring } from '@/hooks';
|
|
38
38
|
import { WfoPlayFill } from '@/icons';
|
|
39
39
|
import { FormValidationError, ValidationError } from '@/types/forms';
|
|
40
40
|
|
|
@@ -429,6 +429,7 @@ export function WfoUserInputForm({
|
|
|
429
429
|
const [processing, setProcessing] = useState<boolean>(false);
|
|
430
430
|
const [nrOfValidationErrors, setNrOfValidationErrors] = useState<number>(0);
|
|
431
431
|
const [rootErrors, setRootErrors] = useState<string[]>([]);
|
|
432
|
+
const { reportError } = useWfoErrorMonitoring();
|
|
432
433
|
|
|
433
434
|
const openLeavePageDialog = (
|
|
434
435
|
leaveAction: ConfirmDialogHandler,
|
|
@@ -457,7 +458,7 @@ export function WfoUserInputForm({
|
|
|
457
458
|
await validSubmit(userInput);
|
|
458
459
|
setProcessing(false);
|
|
459
460
|
return null;
|
|
460
|
-
} catch (error
|
|
461
|
+
} catch (error) {
|
|
461
462
|
setProcessing(false);
|
|
462
463
|
if (typeof error === 'object' && error !== null) {
|
|
463
464
|
const validationError = error as FormValidationError;
|
|
@@ -485,6 +486,9 @@ export function WfoUserInputForm({
|
|
|
485
486
|
}
|
|
486
487
|
// Let the error escape, so it can be caught by our own onerror handler instead of being silenced by uniforms
|
|
487
488
|
setTimeout(() => {
|
|
489
|
+
reportError(
|
|
490
|
+
new Error(`Forms error: ${JSON.stringify({ error })}`),
|
|
491
|
+
);
|
|
488
492
|
throw error;
|
|
489
493
|
}, 0);
|
|
490
494
|
|
|
@@ -34,18 +34,23 @@ export const getSubscriptionDetailStyles = ({ theme }: WfoTheme) => {
|
|
|
34
34
|
});
|
|
35
35
|
const workflowTargetStyle = css({ fontWeight: theme.font.weight.bold });
|
|
36
36
|
|
|
37
|
-
const lastContentCellStyle = css(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const lastContentCellStyle = css([
|
|
38
|
+
{
|
|
39
|
+
...contentCellStyle,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
borderBottom: 0,
|
|
43
|
+
},
|
|
44
|
+
]);
|
|
41
45
|
|
|
42
|
-
const lastHeaderCellStyle = css(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const lastHeaderCellStyle = css([
|
|
47
|
+
{
|
|
48
|
+
...headerCellStyle,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
borderBottomWidth: 0,
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
49
54
|
|
|
50
55
|
const inUseByRelationDetailsStyle = css({
|
|
51
56
|
borderColor: theme.colors.lightShade,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.13.0';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { FC, ReactNode, createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
export type WfoErrorMonitoring = {
|
|
4
|
+
reportError: (error: Error | string) => void;
|
|
5
|
+
reportMessage: (message: string) => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const emptyWfoErrorMonitoring: WfoErrorMonitoring = {
|
|
9
|
+
reportError: () => {},
|
|
10
|
+
reportMessage: () => {},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const WfoErrorMonitoringContext = createContext<WfoErrorMonitoring>(
|
|
14
|
+
emptyWfoErrorMonitoring,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export type WfoErrorMonitoringProviderProps = {
|
|
18
|
+
errorMonitoringHandler?: WfoErrorMonitoring;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param errorMonitoringHandler for implementing the error monitoring. When not provided, all report calls are no-ops.
|
|
25
|
+
* @param children
|
|
26
|
+
*/
|
|
27
|
+
export const WfoErrorMonitoringProvider: FC<
|
|
28
|
+
WfoErrorMonitoringProviderProps
|
|
29
|
+
> = ({ errorMonitoringHandler, children }) => {
|
|
30
|
+
return (
|
|
31
|
+
<WfoErrorMonitoringContext.Provider
|
|
32
|
+
value={errorMonitoringHandler ?? emptyWfoErrorMonitoring}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</WfoErrorMonitoringContext.Provider>
|
|
36
|
+
);
|
|
37
|
+
};
|
package/src/contexts/index.ts
CHANGED
package/src/hooks/index.ts
CHANGED
|
@@ -6,5 +6,6 @@ export * from './useDataDisplayParams';
|
|
|
6
6
|
export * from './useShowToastMessage';
|
|
7
7
|
export * from './useStoredTableConfig';
|
|
8
8
|
export * from './useWithOrchestratorTheme';
|
|
9
|
+
export * from './useWfoErrorMonitoring';
|
|
9
10
|
export * from './useWfoSession';
|
|
10
11
|
export * from './useGetOrchestratorConfig';
|
|
@@ -97,7 +97,7 @@ const streamMessagesApi = orchestratorApi.injectEndpoints({
|
|
|
97
97
|
const getDebounce = (delay: number) => {
|
|
98
98
|
return debounce(() => {
|
|
99
99
|
webSocket.close();
|
|
100
|
-
// note: websocket.close
|
|
100
|
+
// note: websocket.close doesn't trigger the onClose handler when closing
|
|
101
101
|
// internet connection so we call the cleanup event from here to be sure it's called
|
|
102
102
|
cleanUp();
|
|
103
103
|
}, delay);
|