@orchestrator-ui/orchestrator-ui-components 2.4.0 → 2.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Library of UI Components used to display the workflow orchestrator frontend",
6
6
  "author": {
@@ -17,8 +17,8 @@ export const WfoBadge: FC<WfoBadgeProps> = ({
17
17
  size,
18
18
  ...restProps
19
19
  }) => (
20
- <EuiBadge {...restProps}>
21
- <EuiText title="" color={textColor} size={size ?? 'xs'}>
20
+ <EuiBadge title="" {...restProps}>
21
+ <EuiText color={textColor} size={size ?? 'xs'}>
22
22
  <b>{children}</b>
23
23
  </EuiText>
24
24
  </EuiBadge>
@@ -1,16 +1,24 @@
1
1
  import React from 'react';
2
2
 
3
+ import { useGetOrchestratorConfig, useOrchestratorTheme } from '@/hooks';
4
+ import { WfoStatusDotIcon } from '@/icons/WfoStatusDotIcon';
3
5
  import { useGetEngineStatusQuery } from '@/rtk';
6
+ import { useLazyStreamMessagesQuery } from '@/rtk/endpoints/streamMessages';
4
7
  import { EngineStatus } from '@/types';
5
8
 
6
- import { useOrchestratorTheme } from '../../../hooks/useOrchestratorTheme';
7
- import { WfoStatusDotIcon } from '../../../icons/WfoStatusDotIcon';
8
9
  import { WfoHeaderBadge } from '../WfoHeaderBadge';
9
10
 
10
11
  export const WfoEngineStatusBadge = () => {
11
12
  const { theme } = useOrchestratorTheme();
12
13
  const { data } = useGetEngineStatusQuery();
13
14
  const { engineStatus } = data || {};
15
+ const { useWebSockets } = useGetOrchestratorConfig();
16
+ const [websocketTrigger, { isUninitialized }] =
17
+ useLazyStreamMessagesQuery();
18
+
19
+ if (useWebSockets && isUninitialized) {
20
+ websocketTrigger();
21
+ }
14
22
 
15
23
  const engineStatusText: string = engineStatus
16
24
  ? `Engine is ${engineStatus}`
@@ -108,12 +108,12 @@ export const WfoProcessesList = ({
108
108
  renderData: (value, { processId }) => (
109
109
  <Link href={`${PATH_WORKFLOWS}/${processId}`}>{value}</Link>
110
110
  ),
111
+ renderTooltip: (value) => value,
111
112
  },
112
113
  lastStep: {
113
114
  columnType: ColumnType.DATA,
114
115
  label: t('step'),
115
116
  width: '15%',
116
- renderTooltip: (value) => value,
117
117
  },
118
118
  lastStatus: {
119
119
  columnType: ColumnType.DATA,
@@ -164,6 +164,10 @@ export const WfoProcessesList = ({
164
164
  subscriptions={subscriptions}
165
165
  />
166
166
  ),
167
+ renderTooltip: ({ page: subscriptions }) =>
168
+ subscriptions.map(({ description, subscriptionId }) => (
169
+ <p key={subscriptionId}>- {description}</p>
170
+ )),
167
171
  clipboardText: ({ page: subscriptions }) =>
168
172
  subscriptions
169
173
  .map(({ subscriptionId }) => subscriptionId)
@@ -4,13 +4,13 @@ import { EuiBadge } from '@elastic/eui';
4
4
 
5
5
  import { useSubscriptionDetailValueOverride } from '@/components';
6
6
  import { useWithOrchestratorTheme } from '@/hooks';
7
- import { FieldValue } from '@/types';
7
+ import { FieldValue, RenderableFieldValue } from '@/types';
8
8
  import { camelToHuman } from '@/utils';
9
9
 
10
10
  import { getStyles } from './styles';
11
11
 
12
12
  export type WfoProductBlockKeyValueRowProps = {
13
- fieldValue: FieldValue;
13
+ fieldValue: FieldValue | RenderableFieldValue;
14
14
  };
15
15
 
16
16
  export const WfoProductBlockKeyValueRow: FC<
@@ -21,14 +21,18 @@ export const WfoProductBlockKeyValueRow: FC<
21
21
 
22
22
  const { field, value } = fieldValue;
23
23
 
24
- const WfoProductBlockValue: FC<{ value: FieldValue['value'] }> = ({
25
- value,
26
- }) =>
27
- typeof value === 'boolean' ? (
28
- <EuiBadge>{value.toString()}</EuiBadge>
29
- ) : (
30
- <>{value}</>
31
- );
24
+ const WfoProductBlockValue: FC<{
25
+ value: RenderableFieldValue['value'];
26
+ }> = ({ value }) => {
27
+ if (typeof value === 'boolean') {
28
+ return <EuiBadge>{value.toString()}</EuiBadge>;
29
+ } else if (Array.isArray(value)) {
30
+ const result = value.join(', ');
31
+ return <>{result}</>;
32
+ } else {
33
+ return <>{value}</>;
34
+ }
35
+ };
32
36
 
33
37
  return (
34
38
  <tr css={rowStyle}>
@@ -229,9 +229,10 @@ export const WfoSubscriptionProductBlock = ({
229
229
  .map((productBlockInstanceValue, index) => {
230
230
  if (
231
231
  productBlockInstanceValue &&
232
- !isEmpty(
232
+ (!isEmpty(
233
233
  productBlockInstanceValue.value,
234
- )
234
+ ) ||
235
+ showDetails)
235
236
  ) {
236
237
  return (
237
238
  <WfoProductBlockKeyValueRow
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { ValueOverrideFunction } from '@/rtk';
4
4
  import { useAppSelector } from '@/rtk/hooks';
5
- import { FieldValue } from '@/types';
5
+ import { FieldValue, RenderableFieldValue } from '@/types';
6
6
 
7
7
  export const useSubscriptionDetailValueOverride = () => {
8
8
  const valueOverrideConfiguration = useAppSelector(
@@ -12,7 +12,7 @@ export const useSubscriptionDetailValueOverride = () => {
12
12
  );
13
13
 
14
14
  const getOverriddenValue = (
15
- fieldValue: FieldValue,
15
+ fieldValue: FieldValue | RenderableFieldValue,
16
16
  ): React.ReactNode | null => {
17
17
  if (!valueOverrideConfiguration) {
18
18
  return null;
@@ -93,6 +93,7 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
93
93
  {value}
94
94
  </Link>
95
95
  ),
96
+ renderTooltip: (value) => value,
96
97
  },
97
98
  status: {
98
99
  columnType: ColumnType.DATA,
@@ -153,6 +154,10 @@ export const WfoSubscriptionsList: FC<WfoSubscriptionsListProps> = ({
153
154
  renderData: (value) => <WfoInlineJson data={value} />,
154
155
  renderDetails: (value) =>
155
156
  value && <WfoJsonCodeBlock data={value} isBasicStyle />,
157
+ renderTooltip: (value) =>
158
+ value && (
159
+ <WfoJsonCodeBlock data={value} isBasicStyle={false} />
160
+ ),
156
161
  },
157
162
  };
158
163
 
@@ -17,7 +17,7 @@ export const WfoFirstPartUUID: FC<WfoFirstUUIDPartProps> = ({ UUID }) => {
17
17
  const { theme } = useOrchestratorTheme();
18
18
 
19
19
  return (
20
- <span css={uuidFieldStyle} title={UUID}>
20
+ <span css={uuidFieldStyle}>
21
21
  {getFirstUuidPart(UUID)}
22
22
  <EuiCopy textToCopy={UUID}>
23
23
  {(copy) => (
@@ -10,5 +10,5 @@ export const WfoInlineJson: FC<WfoInlineJsonProps> = ({ data }) => {
10
10
  }
11
11
 
12
12
  const valueAsString = JSON.stringify(data);
13
- return <span title={valueAsString}>{valueAsString}</span>;
13
+ return <span>{valueAsString}</span>;
14
14
  };
@@ -1 +1 @@
1
- export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.4.0';
1
+ export const ORCHESTRATOR_UI_LIBRARY_VERSION = '2.6.0';
@@ -0,0 +1,23 @@
1
+ import React, { FC } from 'react';
2
+
3
+ import { WfoIconProps } from './WfoIconProps';
4
+
5
+ export const WfoPort: FC<WfoIconProps> = ({
6
+ width = 24,
7
+ height = 24,
8
+ color = '#000000',
9
+ }) => (
10
+ <svg
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ width={width}
13
+ height={height}
14
+ viewBox="0 0 24 24"
15
+ >
16
+ <path
17
+ fill={color}
18
+ id="icon-port-a"
19
+ d="M6.66666667,5.33333333 C5.930287,5.33333333 5.33333333,5.930287 5.33333333,6.66666667 L5.33333333,17.3333333 C5.33333333,18.069713 5.930287,18.6666667 6.66666667,18.6666667 L17.3333333,18.6666667 C18.069713,18.6666667 18.6666667,18.069713 18.6666667,17.3333333 L18.6666667,6.66666667 C18.6666667,5.930287 18.069713,5.33333333 17.3333333,5.33333333 L6.66666667,5.33333333 Z M6.66666667,4 L17.3333333,4 C18.8060927,4 20,5.19390733 20,6.66666667 L20,17.3333333 C20,18.8060927 18.8060927,20 17.3333333,20 L6.66666667,20 C5.19390733,20 4,18.8060927 4,17.3333333 L4,6.66666667 C4,5.19390733 5.19390733,4 6.66666667,4 Z M14,7.33333333 C14.3681898,7.33333333 14.6666667,7.63181017 14.6666667,8 L14.6666667,10 L16.6666667,10 C17.0348565,10 17.3333333,10.2984768 17.3333333,10.6666667 L17.3333333,16 C17.3333333,16.3681898 17.0348565,16.6666667 16.6666667,16.6666667 L7.33333333,16.6666667 C6.9651435,16.6666667 6.66666667,16.3681898 6.66666667,16 L6.66666667,10.6666667 C6.66666667,10.2984768 6.9651435,10 7.33333333,10 L9.33333333,10 L9.33333333,8 C9.33333333,7.63181017 9.63181017,7.33333333 10,7.33333333 L14,7.33333333 Z M13.3333333,8.66666667 L10.6666667,8.66666667 L10.6666667,10 C10.6666667,10.7363797 10.069713,11.3333333 9.33333333,11.3333333 L8,11.3333333 L8,15.3333333 L16,15.3333333 L16,11.3333333 L14.6666667,11.3333333 C13.930287,11.3333333 13.3333333,10.7363797 13.3333333,10 L13.3333333,8.66666667 Z M9.66666667,12.6666667 C9.85076158,12.6666667 10,12.8159051 10,13 L10,14.3333333 C10,14.5174282 9.85076158,14.6666667 9.66666667,14.6666667 L9,14.6666667 C8.81590508,14.6666667 8.66666667,14.5174282 8.66666667,14.3333333 L8.66666667,13 C8.66666667,12.8159051 8.81590508,12.6666667 9,12.6666667 L9.66666667,12.6666667 Z M12.3333333,12.6666667 C12.5174282,12.6666667 12.6666667,12.8159051 12.6666667,13 L12.6666667,14.3333333 C12.6666667,14.5174282 12.5174282,14.6666667 12.3333333,14.6666667 L11.6666667,14.6666667 C11.4825718,14.6666667 11.3333333,14.5174282 11.3333333,14.3333333 L11.3333333,13 C11.3333333,12.8159051 11.4825718,12.6666667 11.6666667,12.6666667 L12.3333333,12.6666667 Z M15,12.6666667 C15.1840949,12.6666667 15.3333333,12.8159051 15.3333333,13 L15.3333333,14.3333333 C15.3333333,14.5174282 15.1840949,14.6666667 15,14.6666667 L14.3333333,14.6666667 C14.1492384,14.6666667 14,14.5174282 14,14.3333333 L14,13 C14,12.8159051 14.1492384,12.6666667 14.3333333,12.6666667 L15,12.6666667 Z"
20
+ _ngcontent-ng-c520298222=""
21
+ ></path>
22
+ </svg>
23
+ );
@@ -36,3 +36,4 @@ export * from './WfoBell';
36
36
  export * from './WfoWarningTriangle';
37
37
  export * from './WfoExternalLink';
38
38
  export * from './WfoTrash';
39
+ export * from './WfoPort';
@@ -44,7 +44,7 @@
44
44
  "insyncTrue": "in-sync",
45
45
  "insyncFalse": "out-of-sync",
46
46
  "searchModalTitle": "Search string options",
47
- "searchModalText": "<p>The search bar filters the table using the search string</p> <p>Different options are available from free text search covering all data columns, or column specific filtering. <ul><li>Hidden columns are included</li> <li>TSV (text search vector) search only available for subscriptions table</li></ul></p> <p>For example:</p> <li><b>productTag:LP description:test</b> – search within columns (on column productTag and description)</li><li><b>“l2vpn”</b> – free text search</li><li><b>tag:(LP|LR)</b> – multiselect within 1 column</li><li><b>-tag:LP</b> – negated filter</li><li><b>test*</b> – prefix filter</li>"
47
+ "searchModalText": "<p>Different options are available from free text search covering all data columns, or column specific filtering. Note that: <p></p><ul><li>Hidden columns are included</li> <li>Searching is case-insensitive</li> <li>Ordering of words does not matter (unless it is a Phrase)</li> <li>TSV (text search vector) search only available for subscriptions table</li></ul></p> <p>For example:</p> <li><b>\"l2vpn\"</b> – free text search</li> <li><b>tag:l2vpn</b> – search in a specific column</li><li><b>tag:lp description:test</b> – search in multiple columns</li><li><b>tag:(lp|lr)</b> – multiselect within 1 column</li><li><b>-tag:lp</b> – negated filter</li><li><b>test*</b> – prefix filter</li> <p></p><p><b>Note:</b> Search words containing characters `|-*():\"` may not be valid, as they are part of the search query grammar</p><p>Invalid search strings are for example:</p><ul><li>2a10:e300:fff0::/48</li> <li>\"node123(planned)\"</li> <li>\"node123|planned\"</li></ul>"
48
48
  },
49
49
  "confirmationDialog": {
50
50
  "title": "Please confirm",
@@ -42,8 +42,8 @@
42
42
  "unauthorizedPage": "Niet geautoriseerd om deze pagina te bekijken",
43
43
  "insyncTrue": "in-sync",
44
44
  "insyncFalse": "out-of-sync",
45
- "searchModalTitle": "Search string options",
46
- "searchModalText": "<p>De zoekbalk filtert the tabel op bases van de zoektermen</p> <p>Verschillende opties zijn beschikbaar om tekst zoekacties uit te voeren over alla data, specifiek per kolom te filteren. <ul><li>Verborgen kolommen worden meegenomen in de zoekactie</li> <li>TSV (text search vector) zoekactie is alleen van toepassing op de subscriptions tabel</li></ul></p> <p>Bijvoorbeeld:</p> <li><b>productTag:LP description:test</b> – search within columns (op kolom productTag en description)</li><li><b>“l2vpn”</b> – vrije tekst search</li><li><b>tag:(LP|LR)</b> – multiselect binnen 1 column</li><li><b>-tag:LP</b> – omgekeerd filter</li><li><b>test*</b> – prefix filter</li>"
45
+ "searchModalTitle": "Zoekwoorden opties",
46
+ "searchModalText": "<p>Er zijn verschillende opties beschikbaar: zoeken in vrije tekst voor alle datakolommen en specifiek per kolom te filteren. Houd er rekening mee dat: </p><p></p><ul><li>Verborgen kolommen zijn inbegrepen</li> <li>Zoeken is niet hoofdlettergevoelig</li> <li>De volgorde van woorden doet er niet toe (tenzij het een quote)</li> <li>TSV (text search vector) zoekactie alleen beschikbaar voor subscription tabel</li></ul><p>Bijvoorbeeld:</p> <li><b>\"l2vpn\"</b> – vrije tekst search</li> <li><b>tag:l2vpn</b> – zoeken in een specifieke kolom</li> <li><b>tag:lp beschrijving: test</b> – zoeken in meerdere kolommen</li><li><b>tag:(lp|lr)</b> – multi select binnen 1 kolom</li> <li><b>-tag:lp</b> – omgekeerd filteren</li> <li><b>test*</b> – prefix filter</li> <p></p><p><b>Opmerking:</b> Zoeken op woorden die tekens `|-*():\"` bevatten, zijn mogelijk niet geldig, omdat ze deel uitmaken van de grammatica van de zoekfunctie</p><p>Ongeldige zoekwoorden zijn bijvoorbeeld:</p><ul><li>2a10:e300:fff0::/48</li> <li>\"node123(gepland)\"</li> <li>\"node123|gepland\"</li></ul>"
47
47
  },
48
48
  "confirmationDialog": {
49
49
  "title": "Graag bevestigen",
@@ -179,4 +179,5 @@ const streamMessagesApi = orchestratorApi.injectEndpoints({
179
179
  }),
180
180
  });
181
181
 
182
- export const { useStreamMessagesQuery } = streamMessagesApi;
182
+ export const { useStreamMessagesQuery, useLazyStreamMessagesQuery } =
183
+ streamMessagesApi;
@@ -2,9 +2,11 @@ import { ReactElement, ReactNode } from 'react';
2
2
 
3
3
  import { Slice, createSlice } from '@reduxjs/toolkit';
4
4
 
5
- import { FieldValue, SubscriptionDetail } from '@/types';
5
+ import { FieldValue, RenderableFieldValue, SubscriptionDetail } from '@/types';
6
6
 
7
- export type ValueOverrideFunction = (fieldValue: FieldValue) => ReactNode;
7
+ export type ValueOverrideFunction = (
8
+ fieldValue: FieldValue | RenderableFieldValue,
9
+ ) => ReactNode;
8
10
  export type ValueOverrideConfiguration = Record<string, ValueOverrideFunction>;
9
11
 
10
12
  export type WfoSubscriptionDetailGeneralConfiguration = {
@@ -1,3 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+
1
3
  import { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
2
4
 
3
5
  import { InputForm } from './forms';
@@ -11,6 +13,11 @@ export type FieldValue = {
11
13
  value: string | number | boolean | null;
12
14
  };
13
15
 
16
+ export type RenderableFieldValue = {
17
+ field: string;
18
+ value: FieldValue['value'] | ReactNode;
19
+ };
20
+
14
21
  export enum EngineStatus {
15
22
  RUNNING = 'RUNNING',
16
23
  PAUSING = 'PAUSING',
@@ -15,3 +15,4 @@ export * from './resultFlattener';
15
15
  export * from './strings';
16
16
  export * from './toObjectWithSortedKeys';
17
17
  export * from './uuid';
18
+ export * from './cacheTag';