@orchestrator-ui/orchestrator-ui-components 1.7.0 → 1.9.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 +4 -4
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +6 -6
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +49 -16
- package/dist/index.js +1601 -1418
- package/package.json +1 -1
- package/src/components/WfoExpandableField/WfoExpandableField.tsx +46 -0
- package/src/components/WfoExpandableField/index.ts +1 -0
- package/src/components/WfoExpandableField/styles.ts +18 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoMenuLink.tsx +50 -0
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +106 -44
- package/src/components/WfoPageTemplate/WfoSidebar/index.ts +1 -0
- package/src/components/WfoPageTemplate/WfoSidebar/styles.ts +62 -1
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoProductBlockKeyValueRow.tsx +46 -0
- package/src/components/WfoSubscription/{WfoSubscriptionProductBlock.tsx → WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx} +34 -91
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/index.ts +2 -0
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/styles.ts +48 -0
- package/src/components/WfoSubscription/index.ts +2 -0
- package/src/components/WfoSubscription/overrides/index.ts +1 -0
- package/src/components/WfoSubscription/overrides/useSubscriptionDetailValueOverride.ts +35 -0
- package/src/components/WfoSubscription/styles.ts +0 -48
- package/src/components/index.ts +1 -0
- package/src/rtk/slices/index.ts +2 -1
- package/src/rtk/slices/orchestratorComponentOverride.ts +26 -0
- package/src/rtk/store.ts +22 -5
- package/src/rtk/storeProvider.tsx +8 -1
- package/src/types/types.ts +0 -7
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
export const getStyles = (theme: EuiThemeComputed) => {
|
|
5
|
+
const iconStyle = css({
|
|
6
|
+
width: 45,
|
|
7
|
+
height: 45,
|
|
8
|
+
backgroundColor: 'rgb(193,221,241,1)',
|
|
9
|
+
paddingTop: 13,
|
|
10
|
+
paddingLeft: 15,
|
|
11
|
+
borderRadius: 7,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const panelStyle = css({
|
|
15
|
+
backgroundColor: theme.colors.lightestShade,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const rowStyle = css({
|
|
19
|
+
'&:first-child': {
|
|
20
|
+
borderTop: `solid 1px ${theme.colors.lightShade}`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const leftColumnStyle = css({
|
|
25
|
+
verticalAlign: 'top',
|
|
26
|
+
width: 250,
|
|
27
|
+
paddingLeft: 0,
|
|
28
|
+
paddingTop: 10,
|
|
29
|
+
paddingBottom: 10,
|
|
30
|
+
borderBottom: `solid 1px ${theme.colors.lightShade}`,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const rightColumnStyle = css({
|
|
34
|
+
verticalAlign: 'top',
|
|
35
|
+
paddingLeft: 0,
|
|
36
|
+
paddingTop: 10,
|
|
37
|
+
paddingBottom: 10,
|
|
38
|
+
borderBottom: `solid 1px ${theme.colors.lightShade}`,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
iconStyle,
|
|
43
|
+
panelStyle,
|
|
44
|
+
leftColumnStyle,
|
|
45
|
+
rightColumnStyle,
|
|
46
|
+
rowStyle,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSubscriptionDetailValueOverride';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { ValueOverrideFunction } from '@/rtk';
|
|
4
|
+
import { useAppSelector } from '@/rtk/hooks';
|
|
5
|
+
import { FieldValue } from '@/types';
|
|
6
|
+
|
|
7
|
+
export const useSubscriptionDetailValueOverride = () => {
|
|
8
|
+
const valueOverrideConfiguration = useAppSelector(
|
|
9
|
+
(state) =>
|
|
10
|
+
state.orchestratorComponentOverride?.subscriptionDetail
|
|
11
|
+
?.valueOverrides,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const getOverriddenValue = (
|
|
15
|
+
fieldValue: FieldValue,
|
|
16
|
+
): React.ReactNode | null => {
|
|
17
|
+
if (!valueOverrideConfiguration) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const renderFunctionForField: ValueOverrideFunction | undefined =
|
|
22
|
+
valueOverrideConfiguration[fieldValue.field];
|
|
23
|
+
|
|
24
|
+
// This check is needed because TS does not infer the type correctly
|
|
25
|
+
if (renderFunctionForField) {
|
|
26
|
+
return renderFunctionForField(fieldValue);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
getOverriddenValue,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -43,48 +43,6 @@ export const getStyles = (theme: EuiThemeComputed) => {
|
|
|
43
43
|
border: 0,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
const productBlockIconStyle = css({
|
|
47
|
-
width: 45,
|
|
48
|
-
height: 45,
|
|
49
|
-
backgroundColor: 'rgb(193,221,241,1)',
|
|
50
|
-
paddingTop: 13,
|
|
51
|
-
paddingLeft: 15,
|
|
52
|
-
borderRadius: 7,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const productBlockPanelStyle = css({
|
|
56
|
-
backgroundColor: theme.colors.lightestShade,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const productBlockLeftCol = {
|
|
60
|
-
width: 250,
|
|
61
|
-
paddingLeft: 0,
|
|
62
|
-
paddingTop: 10,
|
|
63
|
-
paddingBottom: 10,
|
|
64
|
-
borderBottom: `solid 1px ${theme.colors.lightShade}`,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const productBlockLeftColStyle = css({ ...productBlockLeftCol });
|
|
68
|
-
|
|
69
|
-
const productBlockFirstLeftColStyle = css({
|
|
70
|
-
borderTop: `solid 1px ${theme.colors.lightShade}`,
|
|
71
|
-
...productBlockLeftCol,
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
const productBlockRightCol = {
|
|
75
|
-
paddingLeft: 0,
|
|
76
|
-
paddingTop: 10,
|
|
77
|
-
paddingBottom: 10,
|
|
78
|
-
borderBottom: `solid 1px ${theme.colors.lightShade}`,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const productBlockRightColStyle = css({ ...productBlockRightCol });
|
|
82
|
-
|
|
83
|
-
const productBlockFirstRightColStyle = css({
|
|
84
|
-
borderTop: `solid 1px ${theme.colors.lightShade}`,
|
|
85
|
-
...productBlockRightCol,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
46
|
return {
|
|
89
47
|
contentCellStyle,
|
|
90
48
|
headerCellStyle,
|
|
@@ -94,11 +52,5 @@ export const getStyles = (theme: EuiThemeComputed) => {
|
|
|
94
52
|
emptyCellStyle,
|
|
95
53
|
lastContentCellStyle,
|
|
96
54
|
lastHeaderCellStyle,
|
|
97
|
-
productBlockIconStyle,
|
|
98
|
-
productBlockPanelStyle,
|
|
99
|
-
productBlockLeftColStyle,
|
|
100
|
-
productBlockFirstLeftColStyle,
|
|
101
|
-
productBlockRightColStyle,
|
|
102
|
-
productBlockFirstRightColStyle,
|
|
103
55
|
};
|
|
104
56
|
};
|
package/src/components/index.ts
CHANGED
package/src/rtk/slices/index.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Slice, createSlice } from '@reduxjs/toolkit';
|
|
4
|
+
|
|
5
|
+
import { FieldValue } from '@/types';
|
|
6
|
+
|
|
7
|
+
export type ValueOverrideFunction = (fieldValue: FieldValue) => ReactNode;
|
|
8
|
+
export type ValueOverrideConfiguration = Record<string, ValueOverrideFunction>;
|
|
9
|
+
|
|
10
|
+
export type OrchestratorComponentOverride = {
|
|
11
|
+
subscriptionDetail?: {
|
|
12
|
+
valueOverrides?: ValueOverrideConfiguration;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type OrchestratorComponentOverrideSlice = Slice<OrchestratorComponentOverride>;
|
|
17
|
+
|
|
18
|
+
export const getOrchestratorComponentOverrideSlice = (
|
|
19
|
+
config: OrchestratorComponentOverride,
|
|
20
|
+
): OrchestratorComponentOverrideSlice => {
|
|
21
|
+
return createSlice({
|
|
22
|
+
name: 'orchestratorComponentOverride',
|
|
23
|
+
initialState: config,
|
|
24
|
+
reducers: {},
|
|
25
|
+
});
|
|
26
|
+
};
|
package/src/rtk/store.ts
CHANGED
|
@@ -4,6 +4,10 @@ import type { Dispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
|
4
4
|
import { CombinedState } from '@reduxjs/toolkit/query';
|
|
5
5
|
|
|
6
6
|
import { CustomApiConfig, getCustomApiSlice } from '@/rtk/slices';
|
|
7
|
+
import {
|
|
8
|
+
OrchestratorComponentOverride,
|
|
9
|
+
getOrchestratorComponentOverrideSlice,
|
|
10
|
+
} from '@/rtk/slices/orchestratorComponentOverride';
|
|
7
11
|
import type { OrchestratorConfig } from '@/types';
|
|
8
12
|
|
|
9
13
|
import { orchestratorApi } from './api';
|
|
@@ -17,14 +21,23 @@ export type RootState = {
|
|
|
17
21
|
>;
|
|
18
22
|
toastMessages: ReturnType<typeof toastMessagesReducer>;
|
|
19
23
|
orchestratorConfig: OrchestratorConfig;
|
|
24
|
+
orchestratorComponentOverride?: OrchestratorComponentOverride;
|
|
20
25
|
customApis: CustomApiConfig[];
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
customApis
|
|
26
|
-
|
|
28
|
+
export type InitialOrchestratorStoreConfig = Pick<
|
|
29
|
+
RootState,
|
|
30
|
+
'orchestratorConfig' | 'customApis' | 'orchestratorComponentOverride'
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export const getOrchestratorStore = ({
|
|
34
|
+
orchestratorConfig,
|
|
35
|
+
orchestratorComponentOverride = {},
|
|
36
|
+
customApis,
|
|
37
|
+
}: InitialOrchestratorStoreConfig): EnhancedStore<RootState> => {
|
|
27
38
|
const configSlice = getOrchestratorConfigSlice(orchestratorConfig);
|
|
39
|
+
const orchestratorComponentOverrideSlice =
|
|
40
|
+
getOrchestratorComponentOverrideSlice(orchestratorComponentOverride);
|
|
28
41
|
const customApisSlice = getCustomApiSlice(customApis);
|
|
29
42
|
|
|
30
43
|
const orchestratorStore = configureStore({
|
|
@@ -32,10 +45,14 @@ export const getOrchestratorStore = (
|
|
|
32
45
|
[orchestratorApi.reducerPath]: orchestratorApi.reducer,
|
|
33
46
|
toastMessages: toastMessagesReducer,
|
|
34
47
|
orchestratorConfig: configSlice.reducer,
|
|
48
|
+
orchestratorComponentOverride:
|
|
49
|
+
orchestratorComponentOverrideSlice.reducer,
|
|
35
50
|
customApis: customApisSlice?.reducer,
|
|
36
51
|
},
|
|
37
52
|
middleware: (getDefaultMiddleware) =>
|
|
38
|
-
getDefaultMiddleware(
|
|
53
|
+
getDefaultMiddleware({
|
|
54
|
+
serializableCheck: false,
|
|
55
|
+
}).concat(orchestratorApi.middleware),
|
|
39
56
|
});
|
|
40
57
|
|
|
41
58
|
return orchestratorStore;
|
|
@@ -3,22 +3,29 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
|
|
5
5
|
import { CustomApiConfig } from '@/rtk/slices/customApis';
|
|
6
|
+
import { OrchestratorComponentOverride } from '@/rtk/slices/orchestratorComponentOverride';
|
|
6
7
|
import type { OrchestratorConfig } from '@/types';
|
|
7
8
|
|
|
8
9
|
import { getOrchestratorStore } from './store';
|
|
9
10
|
|
|
10
11
|
export type StoreProviderProps = {
|
|
11
12
|
initialOrchestratorConfig: OrchestratorConfig;
|
|
13
|
+
orchestratorComponentOverride?: OrchestratorComponentOverride;
|
|
12
14
|
customApis?: CustomApiConfig[];
|
|
13
15
|
children: ReactNode;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export const StoreProvider = ({
|
|
17
19
|
initialOrchestratorConfig,
|
|
20
|
+
orchestratorComponentOverride,
|
|
18
21
|
customApis = [],
|
|
19
22
|
children,
|
|
20
23
|
}: StoreProviderProps) => {
|
|
21
|
-
const store = getOrchestratorStore(
|
|
24
|
+
const store = getOrchestratorStore({
|
|
25
|
+
orchestratorConfig: initialOrchestratorConfig,
|
|
26
|
+
orchestratorComponentOverride,
|
|
27
|
+
customApis,
|
|
28
|
+
});
|
|
22
29
|
const [orchestratorStore] = useState(store);
|
|
23
30
|
|
|
24
31
|
return <Provider store={orchestratorStore}>{children}</Provider>;
|
package/src/types/types.ts
CHANGED
|
@@ -11,11 +11,6 @@ export type FieldValue = {
|
|
|
11
11
|
value: string | number | boolean;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export type KeyValue = {
|
|
15
|
-
key: string;
|
|
16
|
-
value: string | number | boolean | undefined;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
14
|
export enum EngineStatus {
|
|
20
15
|
RUNNING = 'RUNNING',
|
|
21
16
|
PAUSING = 'PAUSING',
|
|
@@ -245,8 +240,6 @@ export interface TaskDefinition {
|
|
|
245
240
|
createdAt: string;
|
|
246
241
|
}
|
|
247
242
|
|
|
248
|
-
export type Field<Type> = keyof Type;
|
|
249
|
-
|
|
250
243
|
//// Utility types
|
|
251
244
|
|
|
252
245
|
export enum SortOrder {
|