@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.
Files changed (125) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +3 -3
  3. package/.turbo/turbo-test.log +6 -6
  4. package/CHANGELOG.md +13 -0
  5. package/dist/index.d.ts +3502 -319
  6. package/dist/index.js +10699 -9940
  7. package/dist/index.js.map +1 -1
  8. package/package.json +6 -5
  9. package/src/components/WfoAgent/ExportButton/styles.ts +9 -9
  10. package/src/components/WfoAgent/ToolProgress/SetFilterTreeDisplay.styles.ts +5 -5
  11. package/src/components/WfoAgent/ToolProgress/styles.ts +7 -7
  12. package/src/components/WfoAgent/WfoAgentChart/WfoAgentLineChart.tsx +2 -2
  13. package/src/components/WfoAgent/WfoAgentChart/WfoAgentPieChart.tsx +2 -2
  14. package/src/components/WfoBadges/WfoEngineStatusBadge/WfoEngineStatusBadge.tsx +2 -2
  15. package/src/components/WfoBadges/WfoFailedTasksBadge/WfoFailedTasksBadge.tsx +21 -29
  16. package/src/components/WfoBadges/WfoProcessStatusBadge/WfoProcessStatusBadge.tsx +12 -12
  17. package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +12 -12
  18. package/src/components/WfoBadges/WfoProductStatusBadge/WfoProductStatusBadge.tsx +8 -8
  19. package/src/components/WfoBadges/WfoSubscriptionStatusBadge/WfoSubscriptionStatusBadge.tsx +8 -8
  20. package/src/components/WfoBadges/WfoSubscriptionSyncStatusBadge/WfoSubscriptionSyncStatusBadge.tsx +5 -4
  21. package/src/components/WfoBadges/WfoWebsocketStatusBadge/styles.ts +5 -3
  22. package/src/components/WfoBadges/WfoWorkflowTargetBadge/WfoWorkflowTargetBadge.tsx +14 -13
  23. package/src/components/WfoButtonComboBox/styles.ts +6 -6
  24. package/src/components/WfoButtonWithConfirm/WfoButtonWithConfirm.tsx +35 -0
  25. package/src/components/WfoButtonWithConfirm/index.ts +1 -0
  26. package/src/components/WfoDiff/styles.ts +6 -6
  27. package/src/components/WfoError/WfoError.tsx +1 -1
  28. package/src/components/WfoExpandableField/styles.ts +2 -2
  29. package/src/components/WfoFilterTabs/styles.ts +2 -2
  30. package/src/components/WfoJsonCodeBlock/styles.ts +2 -2
  31. package/src/components/WfoKeyValueTable/WfoValueCell.tsx +1 -1
  32. package/src/components/WfoKeyValueTable/styles.ts +6 -6
  33. package/src/components/WfoLogoSpinner/styles.ts +6 -0
  34. package/src/components/WfoMonacoCodeBlock/WfoMonacoCodeBlock.tsx +7 -7
  35. package/src/components/WfoMonacoCodeBlock/styles.ts +5 -3
  36. package/src/components/WfoNoResults/styles.ts +3 -3
  37. package/src/components/WfoPageTemplate/WfoBreadcrumbs/WfoBreadcrumbs.tsx +1 -1
  38. package/src/components/WfoPageTemplate/WfoPageHeader/WfoHamburgerMenu.tsx +3 -7
  39. package/src/components/WfoPageTemplate/WfoPageHeader/WfoPageHeader.tsx +6 -6
  40. package/src/components/WfoPageTemplate/WfoPageHeader/styles.ts +3 -3
  41. package/src/components/WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx +56 -8
  42. package/src/components/WfoPageTemplate/WfoPageTemplate/styles.ts +4 -4
  43. package/src/components/WfoPageTemplate/WfoSidebar/styles.ts +26 -24
  44. package/src/components/WfoPageTemplate/paths.ts +2 -0
  45. package/src/components/WfoPopover/WfoPopover.tsx +43 -0
  46. package/src/components/WfoPopover/index.ts +1 -0
  47. package/src/components/WfoPydanticForm/Footer.tsx +8 -8
  48. package/src/components/WfoPydanticForm/WfoPydanticForm.tsx +10 -285
  49. package/src/components/WfoPydanticForm/fields/WfoArrayField/WfoArrayField.tsx +4 -3
  50. package/src/components/WfoPydanticForm/fields/WfoArrayField/styles.ts +4 -2
  51. package/src/components/WfoPydanticForm/fields/WfoInteger.tsx +5 -5
  52. package/src/components/WfoPydanticForm/fields/WfoLabel.tsx +1 -1
  53. package/src/components/WfoPydanticForm/fields/WfoReactSelect/styles.ts +36 -13
  54. package/src/components/WfoPydanticForm/fields/WfoTimestampField.tsx +67 -0
  55. package/src/components/WfoPydanticForm/fields/index.ts +1 -0
  56. package/src/components/WfoPydanticForm/fields/styles.ts +8 -8
  57. package/src/components/WfoSearchPage/WfoConditionRow/WfoPathChips.tsx +1 -1
  58. package/src/components/WfoSearchPage/WfoConditionRow/WfoSelectedPathDisplay.tsx +8 -5
  59. package/src/components/WfoSearchPage/WfoFilterGroup/WfoFilterGroup.tsx +1 -1
  60. package/src/components/WfoSettings/styles.ts +5 -6
  61. package/src/components/WfoStartButton/WfoStartButtonComboBox.tsx +4 -7
  62. package/src/components/WfoStartButton/styles.ts +6 -6
  63. package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActions.tsx +10 -27
  64. package/src/components/WfoSubscription/WfoSubscriptionActions/styles.ts +3 -3
  65. package/src/components/WfoSubscription/WfoSubscriptionProductBlock/styles.ts +8 -9
  66. package/src/components/WfoSubscription/WfoTargetTypeIcon.tsx +4 -2
  67. package/src/components/WfoSubscription/styles.ts +9 -4
  68. package/src/components/WfoSubscription/utils/utils.spec.ts +8 -8
  69. package/src/components/WfoSubscription/utils/utils.ts +4 -4
  70. package/src/components/WfoSummary/WfoSummaryCardHeader/WfoSummaryCardHeader.tsx +5 -1
  71. package/src/components/WfoSummary/WfoSummaryCardHeader/styles.ts +2 -2
  72. package/src/components/WfoSummary/WfoSummaryCardList/WfoSummaryCardListItem.tsx +3 -1
  73. package/src/components/WfoSummary/WfoSummaryCardList/styles.ts +4 -3
  74. package/src/components/WfoSummary/styles.ts +2 -2
  75. package/src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx +5 -2
  76. package/src/components/WfoTable/WfoFirstPartUUID/WfoFirstPartUUID.tsx +1 -1
  77. package/src/components/WfoTable/WfoFirstPartUUID/styles.ts +2 -2
  78. package/src/components/WfoTable/WfoSortButtons/WfoSortButton.tsx +5 -1
  79. package/src/components/WfoTable/WfoStatusColorField/styles.ts +2 -2
  80. package/src/components/WfoTable/WfoTable/WfoGroupedTable/styles.ts +3 -3
  81. package/src/components/WfoTable/WfoTable/WfoTable.tsx +9 -3
  82. package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/WfoSortDirectionIcon.tsx +3 -3
  83. package/src/components/WfoTable/WfoTable/WfoTableHeaderCell/styles.ts +10 -10
  84. package/src/components/WfoTable/WfoTable/styles.ts +13 -14
  85. package/src/components/WfoTable/WfoTable/utils.ts +29 -1
  86. package/src/components/WfoTable/WfoTableSettingsModal/styles.ts +6 -6
  87. package/src/components/WfoTable/utils/tableUtils.ts +0 -1
  88. package/src/components/WfoTableCodeBlock/styles.ts +2 -2
  89. package/src/components/WfoTextAnchor/styles.ts +2 -2
  90. package/src/components/WfoTimeline/styles.ts +8 -8
  91. package/src/components/WfoTree/styles.ts +5 -6
  92. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +6 -2
  93. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +12 -21
  94. package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +12 -9
  95. package/src/components/WfoWorkflowSteps/WfoTraceback/styles.ts +2 -2
  96. package/src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx +1 -1
  97. package/src/components/WfoWorkflowSteps/styles.ts +9 -6
  98. package/src/components/confirmationDialog/WfoConfirmationDialog.tsx +1 -1
  99. package/src/components/index.ts +2 -0
  100. package/src/configuration/constants.ts +1 -1
  101. package/src/configuration/version.ts +1 -1
  102. package/src/hooks/index.ts +1 -0
  103. package/src/hooks/useGetPydanticFormsConfig.tsx +324 -0
  104. package/src/hooks/useOrchestratorTheme.ts +20 -18
  105. package/src/hooks/useWithOrchestratorTheme.ts +4 -4
  106. package/src/messages/en-GB.json +27 -3
  107. package/src/messages/nl-NL.json +28 -4
  108. package/src/pages/metadata/WfoScheduleTaskFormPage.tsx +464 -0
  109. package/src/pages/metadata/WfoScheduledTasksPage.tsx +43 -3
  110. package/src/pages/metadata/WfoTasksPage.tsx +75 -1
  111. package/src/pages/metadata/index.ts +1 -0
  112. package/src/pages/processes/WfoProcessDetail.tsx +3 -3
  113. package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +1 -1
  114. package/src/pages/processes/WfoProductInformationWithLink.tsx +1 -1
  115. package/src/pages/processes/WfoStartProcessPage.tsx +6 -1
  116. package/src/pages/settings/WfoSettingsPage.tsx +2 -1
  117. package/src/pages/tasks/WfoTasksListPage.tsx +1 -1
  118. package/src/rtk/api.ts +1 -0
  119. package/src/rtk/endpoints/metadata/scheduledTasks.ts +131 -3
  120. package/src/rtk/endpoints/metadata/tasks.ts +2 -0
  121. package/src/theme/baseStyles/formFieldsBaseStyle.ts +8 -6
  122. package/src/theme/index.ts +1 -1
  123. package/src/theme/wfoThemeModifications.ts +117 -0
  124. package/src/types/types.ts +18 -0
  125. 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 { WfoTheme } from '@/hooks';
4
+ import { WfoThemeHelpers } from '@/hooks';
5
5
 
6
6
  export const getWfoDiffStyles = ({
7
7
  theme,
8
8
  toSecondaryColor,
9
- isDarkThemeActive,
10
- }: WfoTheme) => {
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 = isDarkThemeActive
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 = isDarkThemeActive
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.text,
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.dangerText}>
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getStyles = ({ theme }: WfoTheme) => {
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getStyles = ({ theme }: WfoTheme) => {
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getStyles = ({ theme }: WfoTheme) => {
5
+ export const getStyles = ({ theme }: WfoThemeHelpers) => {
6
6
  const euiCodeBlockStyle = css({
7
7
  marginTop: 10,
8
8
  borderRadius: theme.border.radius.medium,
@@ -55,7 +55,7 @@ export const WfoValueCell: FC<WfoValueCellProps> = ({
55
55
  <WfoClipboardCopy
56
56
  width={clipboardIconSize}
57
57
  height={clipboardIconSize}
58
- color={theme.colors.mediumShade}
58
+ color={theme.colors.backgroundBaseDisabled}
59
59
  />
60
60
  </div>
61
61
  )}
@@ -1,8 +1,8 @@
1
1
  import { css } from '@emotion/react';
2
2
 
3
- import { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getStyles = ({ theme }: WfoTheme) => {
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.emptyShade,
28
+ backgroundColor: theme.colors.backgroundBaseNeutral,
29
29
  });
30
30
 
31
31
  const darkBackground = css({
32
- backgroundColor: theme.colors.lightestShade,
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.title,
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.text,
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, isDarkThemeActive } = useOrchestratorTheme();
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: isDarkThemeActive
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': theme.colors.body,
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, isDarkThemeActive],
52
+ [theme, isDarkModeActive],
53
53
  );
54
54
 
55
55
  useEffect(() => {
56
56
  if (monacoInstance) {
57
57
  addThemeToEditor(monacoInstance);
58
58
  }
59
- }, [addThemeToEditor, isDarkThemeActive, monacoInstance]);
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getStyles = ({ theme }: WfoTheme) => {
5
+ export const getStyles = ({ theme, isDarkModeActive }: WfoThemeHelpers) => {
6
6
  const monacoEditorStyle = css({
7
7
  marginTop: 10,
8
8
  padding: 10,
9
- backgroundColor: theme.colors.body,
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getStyles = ({ theme }: WfoTheme) => {
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.body,
13
+ backgroundColor: theme.colors.backgroundBaseSubdued,
14
14
  borderRadius: theme.border.radius.medium,
15
15
  color: theme.colors.link,
16
16
  fontFamily: theme.font.family,
@@ -78,7 +78,7 @@ export const WfoBreadcrumbs = ({
78
78
  aria-label={t('ariaLabelToggleSideMenu')}
79
79
  display="empty"
80
80
  iconType={() => (
81
- <WfoSideMenu color={theme.colors.subduedText} />
81
+ <WfoSideMenu color={theme.colors.textSubdued} />
82
82
  )}
83
83
  color="text"
84
84
  css={{
@@ -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, isDarkThemeActive } = useOrchestratorTheme();
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
- onThemeSwitch: (theme: EuiThemeColorMode) => void;
40
+ onColorModeSwitch: (newColorMode: EuiThemeColorMode) => void;
41
41
  }
42
42
 
43
43
  export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
44
44
  navigationHeight,
45
45
  getAppLogo,
46
- onThemeSwitch,
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
- onThemeSwitch(
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getWfoPageHeaderStyles = ({ theme }: WfoTheme) => {
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.subduedText}`,
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, { FC, ReactElement, ReactNode, useRef, useState } from '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 { EuiPageTemplate, EuiSideNavItemType } from '@elastic/eui';
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 { ProductLifecycleStatus } from '@/types';
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
- onThemeSwitch,
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
- onThemeSwitch={onThemeSwitch}
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
5
  export const getPageTemplateStyles = ({
6
6
  theme,
7
7
  multiplyByBaseUnit,
8
- }: WfoTheme) => {
8
+ }: WfoThemeHelpers) => {
9
9
  const NAVIGATION_HEIGHT = multiplyByBaseUnit(3);
10
10
 
11
11
  const getSidebarStyle = (navigationHeight: number) =>
12
12
  css({
13
- backgroundColor: theme.colors.body,
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.emptyShade,
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 { WfoTheme } from '@/hooks';
3
+ import { WfoThemeHelpers } from '@/hooks';
4
4
 
5
- export const getCopyrightStyles = ({ theme }: WfoTheme) => {
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.primaryText,
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 }: WfoTheme) => {
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.lightShade,
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 = ({ theme, isDarkThemeActive }: WfoTheme) => {
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.subduedText,
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: '16px',
59
+ top: '50%',
57
60
  left: 0,
58
61
  width: '4px',
59
62
  height: '1px',
60
- backgroundColor: theme.colors.lightShade,
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: isDarkThemeActive
78
- ? theme.colors.mediumShade
79
- : theme.colors.header,
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: isDarkThemeActive
98
- ? theme.colors.mediumShade
99
- : theme.colors.header,
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.text,
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';