@orchestrator-ui/orchestrator-ui-components 7.2.0 → 7.3.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 +8 -8
- package/.turbo/turbo-lint.log +3 -3
- package/.turbo/turbo-test.log +6 -6
- package/CHANGELOG.md +13 -0
- package/dist/index.d.ts +3502 -319
- package/dist/index.js +10699 -9940
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
- package/src/components/WfoAgent/ExportButton/styles.ts +9 -9
- package/src/components/WfoAgent/ToolProgress/SetFilterTreeDisplay.styles.ts +5 -5
- package/src/components/WfoAgent/ToolProgress/styles.ts +7 -7
- package/src/components/WfoAgent/WfoAgentChart/WfoAgentLineChart.tsx +2 -2
- package/src/components/WfoAgent/WfoAgentChart/WfoAgentPieChart.tsx +2 -2
- package/src/components/WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.tsx +2 -2
- package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +21 -29
- package/src/components/WfoBadges/WfoProcessStatusBadge/WfoProcessStatusBadge.tsx +12 -12
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +12 -12
- package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +8 -8
- package/src/components/WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx +8 -8
- package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/WfoSubscriptionSyncStatusBadge.tsx +5 -4
- package/src/components/WfoBadges/WfoWebsocketStatusBadge/styles.ts +5 -3
- package/src/components/WfoBadges/WfoWorkflowTargetBadge/WfoWorkflowTargetBadge.tsx +14 -13
- package/src/components/WfoButtonComboBox/styles.ts +6 -6
- package/src/components/WfoButtonWithConfirm/WfoButtonWithConfirm.tsx +35 -0
- package/src/components/WfoButtonWithConfirm/index.ts +1 -0
- package/src/components/WfoDiff/styles.ts +6 -6
- package/src/components/WfoError/WfoError.tsx +1 -1
- package/src/components/WfoExpandableField/styles.ts +2 -2
- package/src/components/WfoFilterTabs/styles.ts +2 -2
- package/src/components/WfoJsonCodeBlock/styles.ts +2 -2
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +1 -1
- package/src/components/WfoKeyValueTable/styles.ts +6 -6
- package/src/components/WfoLogoSpinner/styles.ts +6 -0
- package/src/components/WfoMonacoCodeBlock/WfoMonacoCodeBlock.tsx +7 -7
- package/src/components/WfoMonacoCodeBlock/styles.ts +5 -3
- package/src/components/WfoNoResults/styles.ts +3 -3
- package/src/components/WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx +1 -1
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoHamburgerMenu.tsx +3 -7
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +6 -6
- package/src/components/WfoPageTemplate/WfoPageHeader/styles.ts +3 -3
- package/src/components/WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx +56 -8
- package/src/components/WfoPageTemplate/WfoPageTemplate/styles.ts +4 -4
- package/src/components/WfoPageTemplate/WfoSidebar/styles.ts +26 -24
- package/src/components/WfoPageTemplate/paths.ts +2 -0
- package/src/components/WfoPopover/WfoPopover.tsx +43 -0
- package/src/components/WfoPopover/index.ts +1 -0
- package/src/components/WfoPydanticForm/Footer.tsx +8 -8
- package/src/components/WfoPydanticForm/WfoPydanticForm.tsx +10 -285
- package/src/components/WfoPydanticForm/fields/WfoArrayField/WfoArrayField.tsx +4 -3
- package/src/components/WfoPydanticForm/fields/WfoArrayField/styles.ts +4 -2
- package/src/components/WfoPydanticForm/fields/WfoInteger.tsx +5 -5
- package/src/components/WfoPydanticForm/fields/WfoLabel.tsx +1 -1
- package/src/components/WfoPydanticForm/fields/WfoReactSelect/styles.ts +36 -13
- package/src/components/WfoPydanticForm/fields/WfoTimestampField.tsx +67 -0
- package/src/components/WfoPydanticForm/fields/index.ts +1 -0
- package/src/components/WfoPydanticForm/fields/styles.ts +8 -8
- package/src/components/WfoSearchPage/WfoConditionRow/WfoPathChips.tsx +1 -1
- package/src/components/WfoSearchPage/WfoConditionRow/WfoSelectedPathDisplay.tsx +8 -5
- package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +1 -1
- package/src/components/WfoSettings/styles.ts +5 -6
- package/src/components/WfoStartButton/WfoStartButtonComboBox.tsx +4 -7
- package/src/components/WfoStartButton/styles.ts +6 -6
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +10 -27
- package/src/components/WfoSubscription/WfoSubscriptionActions/styles.ts +3 -3
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock/styles.ts +8 -9
- package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +4 -2
- package/src/components/WfoSubscription/styles.ts +9 -4
- package/src/components/WfoSubscription/utils/utils.spec.ts +8 -8
- package/src/components/WfoSubscription/utils/utils.ts +4 -4
- package/src/components/WfoSummary/WfoSummaryCardHeader/WfoSummaryCardHeader.tsx +5 -1
- package/src/components/WfoSummary/WfoSummaryCardHeader/styles.ts +2 -2
- package/src/components/WfoSummary/WfoSummaryCardList/WfoSummaryCardListItem.tsx +3 -1
- package/src/components/WfoSummary/WfoSummaryCardList/styles.ts +4 -3
- package/src/components/WfoSummary/styles.ts +2 -2
- package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +5 -2
- package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +1 -1
- package/src/components/WfoTable/WfoFirstPartUUID/styles.ts +2 -2
- package/src/components/WfoTable/WfoSortButtons/WfoSortButton.tsx +5 -1
- package/src/components/WfoTable/WfoStatusColorField/styles.ts +2 -2
- package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +3 -3
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +9 -3
- package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/WfoSortDirectionIcon.tsx +3 -3
- package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/styles.ts +10 -10
- package/src/components/WfoTable/WfoTable/styles.ts +13 -14
- package/src/components/WfoTable/WfoTable/utils.ts +29 -1
- package/src/components/WfoTable/WfoTableSettingsModal/styles.ts +6 -6
- package/src/components/WfoTable/utils/tableUtils.ts +0 -1
- package/src/components/WfoTableCodeBlock/styles.ts +2 -2
- package/src/components/WfoTextAnchor/styles.ts +2 -2
- package/src/components/WfoTimeline/styles.ts +8 -8
- package/src/components/WfoTree/styles.ts +5 -6
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +6 -2
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +12 -21
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +12 -9
- package/src/components/WfoWorkflowSteps/WfoTraceback/styles.ts +2 -2
- package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +1 -1
- package/src/components/WfoWorkflowSteps/styles.ts +9 -6
- package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/configuration/constants.ts +1 -1
- package/src/configuration/version.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useGetPydanticFormsConfig.tsx +324 -0
- package/src/hooks/useOrchestratorTheme.ts +20 -18
- package/src/hooks/useWithOrchestratorTheme.ts +4 -4
- package/src/messages/en-GB.json +27 -3
- package/src/messages/nl-NL.json +28 -4
- package/src/pages/metadata/WfoScheduleTaskFormPage.tsx +464 -0
- package/src/pages/metadata/WfoScheduledTasksPage.tsx +43 -3
- package/src/pages/metadata/WfoTasksPage.tsx +75 -1
- package/src/pages/metadata/index.ts +1 -0
- package/src/pages/processes/WfoProcessDetail.tsx +3 -3
- package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +1 -1
- package/src/pages/processes/WfoProductInformationWithLink.tsx +1 -1
- package/src/pages/processes/WfoStartProcessPage.tsx +6 -1
- package/src/pages/settings/WfoSettingsPage.tsx +2 -1
- package/src/pages/tasks/WfoTasksListPage.tsx +1 -1
- package/src/rtk/api.ts +1 -0
- package/src/rtk/endpoints/metadata/scheduledTasks.ts +131 -3
- package/src/rtk/endpoints/metadata/tasks.ts +2 -0
- package/src/theme/baseStyles/formFieldsBaseStyle.ts +8 -6
- package/src/theme/index.ts +1 -1
- package/src/theme/wfoThemeModifications.ts +117 -0
- package/src/types/types.ts +18 -0
- package/src/theme/defaultOrchestratorTheme.ts +0 -129
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import { EuiButtonIcon } from '@elastic/eui';
|
|
4
|
+
import type { EuiIconType } from '@elastic/eui/src/components/icon/icon';
|
|
5
|
+
|
|
6
|
+
import { ConfirmationDialogContext } from '@/contexts';
|
|
7
|
+
|
|
8
|
+
interface WfoButtonWithConfirmProps {
|
|
9
|
+
question: string;
|
|
10
|
+
onConfirm: () => void;
|
|
11
|
+
iconType?: EuiIconType;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const WfoButtonWithConfirm = ({
|
|
16
|
+
question,
|
|
17
|
+
onConfirm,
|
|
18
|
+
iconType = 'trash',
|
|
19
|
+
ariaLabel = 'Confirmation button',
|
|
20
|
+
}: WfoButtonWithConfirmProps) => {
|
|
21
|
+
const { showConfirmDialog } = useContext(ConfirmationDialogContext);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<EuiButtonIcon
|
|
25
|
+
iconType={iconType}
|
|
26
|
+
onClick={() => {
|
|
27
|
+
showConfirmDialog({
|
|
28
|
+
question,
|
|
29
|
+
onConfirm,
|
|
30
|
+
});
|
|
31
|
+
}}
|
|
32
|
+
aria-label={ariaLabel}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WfoButtonWithConfirm';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { shade, tint } from '@elastic/eui';
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
5
5
|
|
|
6
6
|
export const getWfoDiffStyles = ({
|
|
7
7
|
theme,
|
|
8
8
|
toSecondaryColor,
|
|
9
|
-
|
|
10
|
-
}:
|
|
9
|
+
isDarkModeActive,
|
|
10
|
+
}: WfoThemeHelpers) => {
|
|
11
11
|
const SHADE_FACTOR = 0.5;
|
|
12
12
|
const TINT_FACTOR = 0.65;
|
|
13
13
|
|
|
14
14
|
const insertGutterColor = toSecondaryColor(theme.colors.success);
|
|
15
|
-
const insertCodeColor =
|
|
15
|
+
const insertCodeColor = isDarkModeActive
|
|
16
16
|
? shade(insertGutterColor, SHADE_FACTOR)
|
|
17
17
|
: tint(insertGutterColor, TINT_FACTOR);
|
|
18
18
|
|
|
19
19
|
const deleteColor = toSecondaryColor(theme.colors.danger);
|
|
20
|
-
const deleteSecondaryColor =
|
|
20
|
+
const deleteSecondaryColor = isDarkModeActive
|
|
21
21
|
? shade(deleteColor, SHADE_FACTOR)
|
|
22
22
|
: tint(deleteColor, TINT_FACTOR);
|
|
23
23
|
|
|
@@ -36,7 +36,7 @@ export const getWfoDiffStyles = ({
|
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
'.operator, .punctuation': {
|
|
39
|
-
color: theme.colors.
|
|
39
|
+
color: theme.colors.textParagraph,
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -34,7 +34,7 @@ export const WfoErrorWithMessage = ({ error }: WfoErrorWithMessageProps) => {
|
|
|
34
34
|
<>
|
|
35
35
|
<EuiFlexGroup direction="row" alignItems="center" gutterSize="s">
|
|
36
36
|
<WfoXCircleFill color={theme.colors.danger} />
|
|
37
|
-
<EuiText color={theme.colors.
|
|
37
|
+
<EuiText color={theme.colors.textDanger}>
|
|
38
38
|
{t('errorMessage')} ({message})
|
|
39
39
|
</EuiText>
|
|
40
40
|
</EuiFlexGroup>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const titleRowStyle = css({
|
|
7
7
|
display: 'flex',
|
|
8
8
|
alignItems: 'center',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const tabStyle = css({
|
|
7
7
|
gap: `${theme.size.xxs}`,
|
|
8
8
|
'.euiTab__prepend': {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const euiCodeBlockStyle = css({
|
|
7
7
|
marginTop: 10,
|
|
8
8
|
borderRadius: theme.border.radius.medium,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const padding = theme.font.baseline * 2.5;
|
|
7
7
|
const clipboardIconMargin = theme.font.baseline * 2;
|
|
8
8
|
const keyColumnWidth = theme.base * 12;
|
|
@@ -25,11 +25,11 @@ export const getStyles = ({ theme }: WfoTheme) => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const lightBackground = css({
|
|
28
|
-
backgroundColor: theme.colors.
|
|
28
|
+
backgroundColor: theme.colors.backgroundBaseNeutral,
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const darkBackground = css({
|
|
32
|
-
backgroundColor: theme.colors.
|
|
32
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const getBackgroundColorStyleForRow = (rowNumber: number) =>
|
|
@@ -56,12 +56,12 @@ export const getStyles = ({ theme }: WfoTheme) => {
|
|
|
56
56
|
|
|
57
57
|
const keyCellStyle = css({
|
|
58
58
|
fontWeight: theme.font.weight.medium,
|
|
59
|
-
color: theme.colors.
|
|
59
|
+
color: theme.colors.textHeading,
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
const valueCellStyle = css({
|
|
63
63
|
fontWeight: theme.font.weight.regular,
|
|
64
|
-
color: theme.colors.
|
|
64
|
+
color: theme.colors.textParagraph,
|
|
65
65
|
display: 'flex',
|
|
66
66
|
alignItems: 'center',
|
|
67
67
|
overflowWrap: 'anywhere',
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
3
|
export const getWfoLogoSpinnerStyles = () => {
|
|
4
|
+
const isDark =
|
|
5
|
+
typeof window !== 'undefined' &&
|
|
6
|
+
localStorage?.getItem('colorMode') === 'DARK';
|
|
7
|
+
|
|
4
8
|
const spinCenteringCss = css({
|
|
5
9
|
width: '100vw',
|
|
6
10
|
height: '100vh',
|
|
7
11
|
display: 'flex',
|
|
8
12
|
alignItems: 'center',
|
|
9
13
|
justifyContent: 'center',
|
|
14
|
+
|
|
15
|
+
backgroundColor: isDark ? '#101827' : '#FFFFFF',
|
|
10
16
|
});
|
|
11
17
|
|
|
12
18
|
const spinContainerCss = css({
|
|
@@ -26,7 +26,7 @@ const MONACO_THEME: { light: editor.BuiltinTheme; dark: editor.BuiltinTheme } =
|
|
|
26
26
|
* @constructor
|
|
27
27
|
*/
|
|
28
28
|
export const WfoMonacoCodeBlock: FC<WfoMonacoCodeBlockProps> = ({ data }) => {
|
|
29
|
-
const { theme,
|
|
29
|
+
const { theme, isDarkModeActive } = useOrchestratorTheme();
|
|
30
30
|
const { monacoEditorStyle } = useWithOrchestratorTheme(getStyles);
|
|
31
31
|
const [monacoInstance, setMonacoInstance] = useState<Monaco | undefined>(
|
|
32
32
|
undefined,
|
|
@@ -38,25 +38,25 @@ export const WfoMonacoCodeBlock: FC<WfoMonacoCodeBlockProps> = ({ data }) => {
|
|
|
38
38
|
const addThemeToEditor = useCallback(
|
|
39
39
|
(monaco: Monaco) => {
|
|
40
40
|
monaco.editor.defineTheme('wfoTheme', {
|
|
41
|
-
base:
|
|
42
|
-
? MONACO_THEME.dark
|
|
43
|
-
: MONACO_THEME.light,
|
|
41
|
+
base: isDarkModeActive ? MONACO_THEME.dark : MONACO_THEME.light,
|
|
44
42
|
inherit: true,
|
|
45
43
|
rules: [],
|
|
46
44
|
colors: {
|
|
47
|
-
'editor.background':
|
|
45
|
+
'editor.background': isDarkModeActive
|
|
46
|
+
? theme.colors.backgroundBaseNeutral
|
|
47
|
+
: theme.colors.backgroundBaseSubdued,
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
monaco.editor.setTheme('wfoTheme');
|
|
51
51
|
},
|
|
52
|
-
[theme,
|
|
52
|
+
[theme, isDarkModeActive],
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
useEffect(() => {
|
|
56
56
|
if (monacoInstance) {
|
|
57
57
|
addThemeToEditor(monacoInstance);
|
|
58
58
|
}
|
|
59
|
-
}, [addThemeToEditor,
|
|
59
|
+
}, [addThemeToEditor, isDarkModeActive, monacoInstance]);
|
|
60
60
|
|
|
61
61
|
function editorDidMount(
|
|
62
62
|
editor: editor.IStandaloneCodeEditor,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme, isDarkModeActive }: WfoThemeHelpers) => {
|
|
6
6
|
const monacoEditorStyle = css({
|
|
7
7
|
marginTop: 10,
|
|
8
8
|
padding: 10,
|
|
9
|
-
backgroundColor:
|
|
9
|
+
backgroundColor: isDarkModeActive
|
|
10
|
+
? theme.colors.backgroundBaseNeutral
|
|
11
|
+
: theme.colors.backgroundBaseSubdued,
|
|
10
12
|
borderRadius: theme.border.radius.medium,
|
|
11
13
|
});
|
|
12
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getStyles = ({ theme }:
|
|
5
|
+
export const getStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const panelStyle = css({
|
|
7
7
|
display: 'flex',
|
|
8
8
|
padding: theme.base * 2,
|
|
@@ -10,7 +10,7 @@ export const getStyles = ({ theme }: WfoTheme) => {
|
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
justifyContent: 'center',
|
|
12
12
|
gap: theme.base / 2,
|
|
13
|
-
backgroundColor: theme.colors.
|
|
13
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
14
14
|
borderRadius: theme.border.radius.medium,
|
|
15
15
|
color: theme.colors.link,
|
|
16
16
|
fontFamily: theme.font.family,
|
|
@@ -22,7 +22,7 @@ import { toOptionalArrayEntry } from '@/utils';
|
|
|
22
22
|
export const WfoHamburgerMenu = () => {
|
|
23
23
|
const t = useTranslations('hamburgerMenu');
|
|
24
24
|
const [isPopoverOpen, setPopoverIsOpen] = useState(false);
|
|
25
|
-
const { theme,
|
|
25
|
+
const { theme, isDarkModeActive } = useOrchestratorTheme();
|
|
26
26
|
const {
|
|
27
27
|
enableSupportMenuItem,
|
|
28
28
|
supportMenuItemUrl,
|
|
@@ -87,9 +87,7 @@ export const WfoHamburgerMenu = () => {
|
|
|
87
87
|
name: t('logout'),
|
|
88
88
|
icon: (
|
|
89
89
|
<WfoLogoutIcon
|
|
90
|
-
color={
|
|
91
|
-
isDarkThemeActive ? theme.colors.ghost : theme.colors.ink
|
|
92
|
-
}
|
|
90
|
+
color={isDarkModeActive ? theme.colors.ghost : theme.colors.ink}
|
|
93
91
|
/>
|
|
94
92
|
),
|
|
95
93
|
onClick: () => signOut(),
|
|
@@ -99,9 +97,7 @@ export const WfoHamburgerMenu = () => {
|
|
|
99
97
|
name: t('support'),
|
|
100
98
|
icon: (
|
|
101
99
|
<WfoQuestionCircle
|
|
102
|
-
color={
|
|
103
|
-
isDarkThemeActive ? theme.colors.ghost : theme.colors.ink
|
|
104
|
-
}
|
|
100
|
+
color={isDarkModeActive ? theme.colors.ghost : theme.colors.ink}
|
|
105
101
|
/>
|
|
106
102
|
),
|
|
107
103
|
onClick: handleOpenSupport,
|
|
@@ -37,13 +37,13 @@ export interface WfoPageHeaderProps {
|
|
|
37
37
|
// todo: should be part of theme!
|
|
38
38
|
navigationHeight: number;
|
|
39
39
|
getAppLogo: (navigationHeight: number) => ReactElement;
|
|
40
|
-
|
|
40
|
+
onColorModeSwitch: (newColorMode: EuiThemeColorMode) => void;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
|
|
44
44
|
navigationHeight,
|
|
45
45
|
getAppLogo,
|
|
46
|
-
|
|
46
|
+
onColorModeSwitch,
|
|
47
47
|
}) => {
|
|
48
48
|
const t = useTranslations('main');
|
|
49
49
|
const { multiplyByBaseUnit, colorMode, theme } = useOrchestratorTheme();
|
|
@@ -107,13 +107,13 @@ export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
|
|
|
107
107
|
? 'darkMode'
|
|
108
108
|
: 'lightMode',
|
|
109
109
|
)}
|
|
110
|
-
onClick={() =>
|
|
111
|
-
|
|
110
|
+
onClick={() => {
|
|
111
|
+
onColorModeSwitch(
|
|
112
112
|
colorMode === ColorModes.LIGHT
|
|
113
113
|
? ColorModes.DARK
|
|
114
114
|
: ColorModes.LIGHT,
|
|
115
|
-
)
|
|
116
|
-
}
|
|
115
|
+
);
|
|
116
|
+
}}
|
|
117
117
|
/>
|
|
118
118
|
)}
|
|
119
119
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getWfoPageHeaderStyles = ({ theme }:
|
|
5
|
+
export const getWfoPageHeaderStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const appNameStyle = css({
|
|
7
7
|
paddingRight: theme.base,
|
|
8
8
|
marginRight: theme.base,
|
|
9
|
-
borderRight: `${theme.border.width.thick} solid ${theme.colors.
|
|
9
|
+
borderRight: `${theme.border.width.thick} solid ${theme.colors.textSubdued}`,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
const getHeaderStyle = (navigationHeight: number) => {
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
FC,
|
|
3
|
+
ReactElement,
|
|
4
|
+
ReactNode,
|
|
5
|
+
useEffect,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
2
9
|
|
|
3
10
|
import type { EuiThemeColorMode } from '@elastic/eui';
|
|
4
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
EuiPageTemplate,
|
|
13
|
+
EuiSideNavItemType,
|
|
14
|
+
EuiThemeProvider,
|
|
15
|
+
} from '@elastic/eui';
|
|
5
16
|
|
|
6
17
|
import { WfoBreadcrumbs, WfoPageHeader, WfoSidebar } from '@/components';
|
|
7
18
|
import { useWithOrchestratorTheme } from '@/hooks';
|
|
8
|
-
import {
|
|
19
|
+
import { wfoThemeModifications } from '@/theme';
|
|
20
|
+
import { ColorModes, ProductLifecycleStatus } from '@/types';
|
|
9
21
|
|
|
10
22
|
import { ContentContextProvider } from './ContentContext';
|
|
11
23
|
import { getPageTemplateStyles } from './styles';
|
|
@@ -16,23 +28,59 @@ export interface WfoPageTemplateProps {
|
|
|
16
28
|
defaultMenuItems: EuiSideNavItemType<object>[],
|
|
17
29
|
) => EuiSideNavItemType<object>[];
|
|
18
30
|
overrideStartWorkflowFilters?: (ProductLifecycleStatus | string)[];
|
|
19
|
-
onThemeSwitch: (theme: EuiThemeColorMode) => void;
|
|
20
31
|
children: ReactNode;
|
|
32
|
+
colorModeState: [
|
|
33
|
+
EuiThemeColorMode,
|
|
34
|
+
React.Dispatch<React.SetStateAction<EuiThemeColorMode>>,
|
|
35
|
+
];
|
|
21
36
|
}
|
|
22
37
|
|
|
23
|
-
export const WfoPageTemplate: FC<WfoPageTemplateProps> = ({
|
|
38
|
+
export const WfoPageTemplate: FC<WfoPageTemplateProps> = (props) => {
|
|
39
|
+
const [colorMode, setColorMode] = props.colorModeState;
|
|
40
|
+
const handleColorModeSwitch = (newColorMode: EuiThemeColorMode) => {
|
|
41
|
+
setColorMode(newColorMode);
|
|
42
|
+
localStorage.setItem('colorMode', newColorMode);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
// Initialize theme mode from localStorage or set it to 'light' if not present
|
|
47
|
+
const storedColorMode = localStorage.getItem('colorMode');
|
|
48
|
+
if (
|
|
49
|
+
storedColorMode !== ColorModes.LIGHT &&
|
|
50
|
+
storedColorMode !== ColorModes.DARK
|
|
51
|
+
) {
|
|
52
|
+
handleColorModeSwitch(ColorModes.LIGHT);
|
|
53
|
+
} else {
|
|
54
|
+
handleColorModeSwitch(storedColorMode);
|
|
55
|
+
}
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<EuiThemeProvider modify={wfoThemeModifications} colorMode={colorMode}>
|
|
60
|
+
<WfoPageTemplateContent
|
|
61
|
+
{...props}
|
|
62
|
+
handleColorModeSwitch={handleColorModeSwitch}
|
|
63
|
+
/>
|
|
64
|
+
</EuiThemeProvider>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const WfoPageTemplateContent: FC<
|
|
69
|
+
WfoPageTemplateProps & {
|
|
70
|
+
handleColorModeSwitch: (mode: EuiThemeColorMode) => void;
|
|
71
|
+
}
|
|
72
|
+
> = ({
|
|
24
73
|
children,
|
|
25
74
|
getAppLogo,
|
|
26
75
|
overrideMenuItems,
|
|
27
76
|
overrideStartWorkflowFilters,
|
|
28
|
-
|
|
77
|
+
handleColorModeSwitch,
|
|
29
78
|
}) => {
|
|
30
79
|
const { getSidebarStyle, NAVIGATION_HEIGHT } = useWithOrchestratorTheme(
|
|
31
80
|
getPageTemplateStyles,
|
|
32
81
|
);
|
|
33
82
|
|
|
34
83
|
const [isSideMenuVisible, setIsSideMenuVisible] = useState(true);
|
|
35
|
-
|
|
36
84
|
const headerRowRef = useRef<HTMLDivElement>(null);
|
|
37
85
|
|
|
38
86
|
return (
|
|
@@ -40,7 +88,7 @@ export const WfoPageTemplate: FC<WfoPageTemplateProps> = ({
|
|
|
40
88
|
<WfoPageHeader
|
|
41
89
|
getAppLogo={getAppLogo}
|
|
42
90
|
navigationHeight={NAVIGATION_HEIGHT}
|
|
43
|
-
|
|
91
|
+
onColorModeSwitch={handleColorModeSwitch}
|
|
44
92
|
/>
|
|
45
93
|
{/* Sidebar and content area */}
|
|
46
94
|
<EuiPageTemplate
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
5
|
export const getPageTemplateStyles = ({
|
|
6
6
|
theme,
|
|
7
7
|
multiplyByBaseUnit,
|
|
8
|
-
}:
|
|
8
|
+
}: WfoThemeHelpers) => {
|
|
9
9
|
const NAVIGATION_HEIGHT = multiplyByBaseUnit(3);
|
|
10
10
|
|
|
11
11
|
const getSidebarStyle = (navigationHeight: number) =>
|
|
12
12
|
css({
|
|
13
|
-
backgroundColor: theme.colors.
|
|
13
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
14
14
|
overflowY: 'auto',
|
|
15
15
|
maxHeight: `calc(100vh - ${navigationHeight}px)`,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const getContentStyle = (navigationHeight: number) =>
|
|
19
19
|
css({
|
|
20
|
-
backgroundColor: theme.colors.
|
|
20
|
+
backgroundColor: theme.colors.backgroundBaseNeutral,
|
|
21
21
|
overflowY: 'auto',
|
|
22
22
|
maxHeight: `calc(100vh - ${navigationHeight}px)`,
|
|
23
23
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CSSObject, css } from '@emotion/react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { WfoThemeHelpers } from '@/hooks';
|
|
4
4
|
|
|
5
|
-
export const getCopyrightStyles = ({ theme }:
|
|
5
|
+
export const getCopyrightStyles = ({ theme }: WfoThemeHelpers) => {
|
|
6
6
|
const copyrightStyle = css({
|
|
7
7
|
position: 'fixed',
|
|
8
8
|
bottom: 0,
|
|
9
9
|
left: 0,
|
|
10
10
|
padding: 10,
|
|
11
11
|
fontSize: theme.size.s,
|
|
12
|
-
color: theme.colors.
|
|
12
|
+
color: theme.colors.textPrimary,
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
return {
|
|
@@ -17,11 +17,12 @@ export const getCopyrightStyles = ({ theme }: WfoTheme) => {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export const getMenuStyles = ({ theme }:
|
|
20
|
+
export const getMenuStyles = ({ theme }: WfoThemeHelpers) => {
|
|
21
21
|
const menuStyle = css({
|
|
22
|
+
backgroundColor: theme.colors.backgroundBaseSubdued,
|
|
22
23
|
'.euiSideNavItem--branch': {
|
|
23
24
|
'&:after': {
|
|
24
|
-
backgroundColor: theme.colors.
|
|
25
|
+
backgroundColor: theme.colors.borderBaseSubdued,
|
|
25
26
|
height: '100%',
|
|
26
27
|
},
|
|
27
28
|
':last-child': {
|
|
@@ -31,13 +32,15 @@ export const getMenuStyles = ({ theme }: WfoTheme) => {
|
|
|
31
32
|
},
|
|
32
33
|
},
|
|
33
34
|
});
|
|
34
|
-
|
|
35
35
|
return {
|
|
36
36
|
menuStyle,
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export const getMenuItemStyles = ({
|
|
40
|
+
export const getMenuItemStyles = ({
|
|
41
|
+
theme,
|
|
42
|
+
isDarkModeActive,
|
|
43
|
+
}: WfoThemeHelpers) => {
|
|
41
44
|
const baseStyles: CSSObject = {
|
|
42
45
|
lineHeight: `${theme.base * 1.25}px`,
|
|
43
46
|
display: 'flex',
|
|
@@ -45,7 +48,7 @@ export const getMenuItemStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
45
48
|
':hover': {
|
|
46
49
|
textDecoration: 'underline',
|
|
47
50
|
},
|
|
48
|
-
color: theme.colors.
|
|
51
|
+
color: theme.colors.textSubdued,
|
|
49
52
|
padding: `${theme.base * 0.5}px ${theme.base * 0.75}px`,
|
|
50
53
|
};
|
|
51
54
|
|
|
@@ -53,17 +56,13 @@ export const getMenuItemStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
53
56
|
...baseStyles,
|
|
54
57
|
':after': {
|
|
55
58
|
content: "''",
|
|
56
|
-
top: '
|
|
59
|
+
top: '50%',
|
|
57
60
|
left: 0,
|
|
58
61
|
width: '4px',
|
|
59
62
|
height: '1px',
|
|
60
|
-
backgroundColor: theme.colors.
|
|
63
|
+
backgroundColor: theme.colors.borderBaseSubdued,
|
|
61
64
|
position: 'absolute',
|
|
62
|
-
|
|
63
|
-
':last-child': {
|
|
64
|
-
':after': {
|
|
65
|
-
top: '18px',
|
|
66
|
-
},
|
|
65
|
+
transform: 'translateY(-50%)',
|
|
67
66
|
},
|
|
68
67
|
};
|
|
69
68
|
|
|
@@ -74,11 +73,12 @@ export const getMenuItemStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
74
73
|
const selectedMenuItemBaseStyle = {
|
|
75
74
|
...baseStyles,
|
|
76
75
|
height: `${theme.base * 2.25}px`,
|
|
77
|
-
backgroundColor:
|
|
78
|
-
? theme.colors.
|
|
79
|
-
: theme.colors.
|
|
76
|
+
backgroundColor: isDarkModeActive
|
|
77
|
+
? theme.colors.header
|
|
78
|
+
: theme.colors.backgroundLightPrimary,
|
|
80
79
|
borderRadius: theme.border.radius.medium,
|
|
81
|
-
color: theme.colors.ghost,
|
|
80
|
+
color: isDarkModeActive ? theme.colors.ghost : theme.colors.textPrimary,
|
|
81
|
+
fontWeight: theme.font.weight.medium,
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
const selectedMenuItem = css({
|
|
@@ -94,18 +94,20 @@ export const getMenuItemStyles = ({ theme, isDarkThemeActive }: WfoTheme) => {
|
|
|
94
94
|
const selectedSubMenuItem = css({
|
|
95
95
|
...baseSubMenuStyles,
|
|
96
96
|
height: `${theme.base * 2.25}px`,
|
|
97
|
-
backgroundColor:
|
|
98
|
-
? theme.colors.
|
|
99
|
-
: theme.colors.
|
|
97
|
+
backgroundColor: isDarkModeActive
|
|
98
|
+
? theme.colors.header
|
|
99
|
+
: theme.colors.backgroundLightPrimary,
|
|
100
100
|
borderRadius: theme.border.radius.medium,
|
|
101
|
-
color: theme.colors.ghost,
|
|
101
|
+
color: isDarkModeActive ? theme.colors.ghost : theme.colors.textPrimary,
|
|
102
|
+
fontWeight: theme.font.weight.medium,
|
|
102
103
|
marginLeft: `${theme.size.xs}`,
|
|
103
104
|
paddingLeft: `${theme.size.s}`,
|
|
104
105
|
});
|
|
105
106
|
|
|
106
107
|
const subMenuHeaderStyle = css({
|
|
107
108
|
...baseStyles,
|
|
108
|
-
color: theme.colors.
|
|
109
|
+
color: theme.colors.link,
|
|
110
|
+
fontWeight: theme.font.weight.medium,
|
|
109
111
|
});
|
|
110
112
|
return {
|
|
111
113
|
menuItemStyle,
|
|
@@ -10,5 +10,7 @@ export const PATH_METADATA_RESOURCE_TYPES = '/metadata/resource-types';
|
|
|
10
10
|
export const PATH_METADATA_WORKFLOWS = '/metadata/workflows';
|
|
11
11
|
export const PATH_METADATA_TASKS = '/metadata/tasks';
|
|
12
12
|
export const PATH_METADATA_SCHEDULED_TASKS = '/metadata/scheduled-tasks';
|
|
13
|
+
export const PATH_METADATA_ADD_SCHEDULE_TASK_FORM =
|
|
14
|
+
'/metadata/schedule-task-form';
|
|
13
15
|
export const PATH_TASKS = '/tasks';
|
|
14
16
|
export const PATH_SETTINGS = '/settings';
|