@orchestrator-ui/orchestrator-ui-components 3.7.0 → 3.8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "3.7.0",
3
+ "version": "3.8.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Library of UI Components used to display the workflow orchestrator frontend",
6
6
  "author": {
@@ -22,7 +22,7 @@ export const getMenuStyles = ({ theme }: WfoTheme) => {
22
22
  '.euiSideNavItem--branch': {
23
23
  '&:after': {
24
24
  backgroundColor: theme.colors.lightShade,
25
- height: '120%',
25
+ height: '100%',
26
26
  },
27
27
  ':last-child': {
28
28
  '&:after': {
@@ -6,8 +6,10 @@ import { EuiFlexItem, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui';
6
6
 
7
7
  import {
8
8
  WfoEngineStatusButton,
9
+ WfoIsAllowedToRender,
9
10
  WfoResetTextSearchIndexButton,
10
11
  } from '@/components';
12
+ import { PolicyResource } from '@/configuration';
11
13
 
12
14
  export const WfoModifySettings = () => {
13
15
  const t = useTranslations('settings.page');
@@ -20,14 +22,19 @@ export const WfoModifySettings = () => {
20
22
  <EuiSpacer size="m"></EuiSpacer>
21
23
  <WfoResetTextSearchIndexButton />
22
24
  </EuiPanel>
23
- <EuiSpacer />
24
- <EuiPanel hasShadow={false} color="subdued" paddingSize="l">
25
- <EuiText size="s">
26
- <h4>{t('modifyEngine')}</h4>
27
- </EuiText>
28
- <EuiSpacer size="m"></EuiSpacer>
29
- <WfoEngineStatusButton />
30
- </EuiPanel>
25
+
26
+ <WfoIsAllowedToRender
27
+ resource={PolicyResource.SETTINGS_START_STOP_ENGINE}
28
+ >
29
+ <EuiSpacer />
30
+ <EuiPanel hasShadow={false} color="subdued" paddingSize="l">
31
+ <EuiText size="s">
32
+ <h4>{t('modifyEngine')}</h4>
33
+ </EuiText>
34
+ <EuiSpacer size="m"></EuiSpacer>
35
+ <WfoEngineStatusButton />
36
+ </EuiPanel>
37
+ </WfoIsAllowedToRender>
31
38
  </EuiFlexItem>
32
39
  );
33
40
  };
@@ -11,11 +11,12 @@ import { getStyles } from './styles';
11
11
 
12
12
  export type WfoProductBlockKeyValueRowProps = {
13
13
  fieldValue: FieldValue | RenderableFieldValue;
14
+ allFieldValues: FieldValue[] | RenderableFieldValue[];
14
15
  };
15
16
 
16
17
  export const WfoProductBlockKeyValueRow: FC<
17
18
  WfoProductBlockKeyValueRowProps
18
- > = ({ fieldValue }) => {
19
+ > = ({ fieldValue, allFieldValues }) => {
19
20
  const { leftColumnStyle, rowStyle } = useWithOrchestratorTheme(getStyles);
20
21
  const { getOverriddenValue } = useSubscriptionDetailValueOverride();
21
22
 
@@ -40,7 +41,7 @@ export const WfoProductBlockKeyValueRow: FC<
40
41
  <b>{camelToHuman(field)}</b>
41
42
  </td>
42
43
  <td>
43
- {getOverriddenValue(fieldValue) ?? (
44
+ {getOverriddenValue(fieldValue, allFieldValues) ?? (
44
45
  <WfoProductBlockValue value={value} />
45
46
  )}
46
47
  </td>
@@ -246,6 +246,9 @@ export const WfoSubscriptionProductBlock = ({
246
246
  fieldValue={
247
247
  productBlockInstanceValue
248
248
  }
249
+ allFieldValues={
250
+ productBlock.productBlockInstanceValues
251
+ }
249
252
  key={index}
250
253
  />
251
254
  );
@@ -13,6 +13,7 @@ export const useSubscriptionDetailValueOverride = () => {
13
13
 
14
14
  const getOverriddenValue = (
15
15
  fieldValue: FieldValue | RenderableFieldValue,
16
+ allFieldValues: FieldValue[] | RenderableFieldValue[],
16
17
  ): React.ReactNode | null => {
17
18
  if (!valueOverrideConfiguration) {
18
19
  return null;
@@ -23,7 +24,7 @@ export const useSubscriptionDetailValueOverride = () => {
23
24
 
24
25
  // This check is needed because TS does not infer the type correctly
25
26
  if (renderFunctionForField) {
26
- return renderFunctionForField(fieldValue);
27
+ return renderFunctionForField(fieldValue, allFieldValues);
27
28
  }
28
29
 
29
30
  return null;
@@ -17,5 +17,6 @@ export enum PolicyResource {
17
17
  TASKS_CREATE = '/orchestrator/processes/create/task',
18
18
  TASKS_RETRY_ALL = '/orchestrator/processes/all-tasks/retry',
19
19
  SETTINGS_FLUSH_CACHE = '/orchestrator/settings/flush-cache',
20
+ SETTINGS_START_STOP_ENGINE = '/orchestrator/settings/start-stop-engine',
20
21
  SET_IN_SYNC = '/orchestrator/subscriptions/set-in-sync',
21
22
  }
@@ -1 +1 @@
1
- export const ORCHESTRATOR_UI_LIBRARY_VERSION = '3.7.0';
1
+ export const ORCHESTRATOR_UI_LIBRARY_VERSION = '3.8.1';
@@ -6,6 +6,7 @@ import { FieldValue, RenderableFieldValue, SubscriptionDetail } from '@/types';
6
6
 
7
7
  export type ValueOverrideFunction = (
8
8
  fieldValue: FieldValue | RenderableFieldValue,
9
+ allFieldValues: FieldValue[] | RenderableFieldValue[],
9
10
  ) => ReactNode;
10
11
  export type ValueOverrideConfiguration = Record<string, ValueOverrideFunction>;
11
12