@orchestrator-ui/orchestrator-ui-components 5.3.0 → 5.3.2
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 +1 -1
- package/.turbo/turbo-test.log +7 -7
- package/CHANGELOG.md +16 -0
- package/dist/index.d.ts +82 -31
- package/dist/index.js +2435 -1420
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/WfoContentHeader/WfoContentHeader.tsx +4 -1
- package/src/components/WfoForms/formFields/AcceptField.tsx +2 -2
- package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +1 -1
- package/src/components/WfoForms/formFields/BoolField.tsx +1 -1
- package/src/components/WfoForms/formFields/DividerField.tsx +1 -1
- package/src/components/WfoForms/formFields/ErrorField.tsx +1 -1
- package/src/components/WfoForms/formFields/LabelField.tsx +1 -1
- package/src/components/WfoForms/formFields/LongTextField.tsx +1 -1
- package/src/components/WfoForms/formFields/NumField.tsx +1 -1
- package/src/components/WfoForms/formFields/RadioField.tsx +1 -1
- package/src/components/WfoForms/formFields/SubmitField.tsx +1 -1
- package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +8 -11
- package/src/components/WfoForms/formFields/TextField.tsx +1 -1
- package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocomplete.tsx +4 -3
- package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocompleteStyles.ts +1 -1
- package/src/components/WfoForms/formFields/deprecated/FileUploadField.tsx +1 -1
- package/src/components/WfoForms/formFields/deprecated/SubscriptionField.tsx +0 -1
- package/src/components/WfoForms/formFields/index.ts +1 -0
- package/src/components/WfoForms/formFields/types.ts +1 -0
- package/src/components/WfoPageTemplate/WfoPageHeader/WfoHamburgerMenu.tsx +26 -4
- package/src/components/WfoPydanticForm/Footer.tsx +0 -1
- package/src/components/WfoPydanticForm/Header.tsx +4 -1
- package/src/components/WfoPydanticForm/Row.tsx +1 -1
- package/src/components/WfoPydanticForm/WfoPydanticForm.tsx +92 -45
- package/src/components/WfoPydanticForm/fields/Integer.tsx +44 -0
- package/src/components/WfoPydanticForm/fields/Radio.tsx +27 -0
- package/src/components/WfoPydanticForm/fields/Summary.tsx +2 -3
- package/src/components/WfoPydanticForm/fields/WfoArrayField/WfoArrayField.tsx +108 -0
- package/src/components/WfoPydanticForm/fields/WfoArrayField/arrayFieldStyles.ts +34 -0
- package/src/components/WfoPydanticForm/fields/WfoArrayField/index.ts +2 -0
- package/src/components/WfoPydanticForm/fields/WfoArrayField/styles.ts +34 -0
- package/src/components/WfoPydanticForm/fields/WfoObjectField/WfoObjectField.tsx +29 -0
- package/src/components/WfoPydanticForm/fields/WfoObjectField/getWfoObjectFieldStyles.ts +13 -0
- package/src/components/WfoPydanticForm/fields/WfoObjectField/index.ts +2 -0
- package/src/components/WfoPydanticForm/fields/index.ts +4 -0
- package/src/components/WfoPydanticForm/fields/styles.ts +13 -0
- package/src/components/WfoPydanticForm/index.ts +3 -0
- package/src/components/WfoSettings/WfoAoStackStatus.tsx +40 -0
- package/src/components/WfoSubscription/WfoSubscriptionActions/WfoSubscriptionActionExpandableMenuItem.tsx +1 -0
- package/src/components/WfoTable/WfoTable/WfoTable.tsx +2 -3
- package/src/components/WfoTable/utils/tableUtils.spec.ts +29 -0
- package/src/components/WfoTable/utils/tableUtils.ts +9 -0
- package/src/configuration/version.ts +1 -1
- package/src/contexts/OrchestratorConfigContext.tsx +2 -0
- package/src/icons/WfoChartBar.tsx +34 -0
- package/src/icons/index.ts +1 -0
- package/src/messages/en-GB.json +6 -2
- package/src/messages/nl-NL.json +1 -0
- package/src/pages/processes/WfoProcessListSubscriptionsCell.tsx +0 -1
- package/src/pages/settings/WfoSettingsPage.tsx +9 -1
- package/src/rtk/slices/pydanticForm.ts +2 -2
- package/src/rtk/storeProvider.tsx +4 -4
- package/src/rtk/utils.ts +20 -0
- package/src/theme/defaultOrchestratorTheme.ts +25 -0
- package/src/types/forms.ts +0 -17
- package/src/types/types.ts +2 -0
|
@@ -5,10 +5,9 @@ import type { PydanticFormElement } from 'pydantic-forms';
|
|
|
5
5
|
import { EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
|
|
6
6
|
import { tint } from '@elastic/eui';
|
|
7
7
|
import { css } from '@emotion/react';
|
|
8
|
-
import type { WfoTheme } from '@orchestrator-ui/orchestrator-ui-components';
|
|
9
8
|
|
|
10
|
-
import { getCommonFormFieldStyles } from '@/components
|
|
11
|
-
import { useWithOrchestratorTheme } from '@/hooks';
|
|
9
|
+
import { getCommonFormFieldStyles } from '@/components';
|
|
10
|
+
import { WfoTheme, useWithOrchestratorTheme } from '@/hooks';
|
|
12
11
|
|
|
13
12
|
export const getStyles = ({ theme }: WfoTheme) => {
|
|
14
13
|
const toShadeColor = (color: string) => tint(color, 0.9);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useFieldArray } from 'react-hook-form';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
PydanticFormElementProps,
|
|
6
|
+
RenderFields,
|
|
7
|
+
fieldToComponentMatcher,
|
|
8
|
+
itemizeArrayItem,
|
|
9
|
+
usePydanticFormContext,
|
|
10
|
+
} from 'pydantic-forms';
|
|
11
|
+
|
|
12
|
+
import { EuiIcon } from '@elastic/eui';
|
|
13
|
+
|
|
14
|
+
import { getWfoArrayFieldStyles } from '@/components';
|
|
15
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
16
|
+
|
|
17
|
+
export const MinusButton = ({
|
|
18
|
+
index,
|
|
19
|
+
onRemove,
|
|
20
|
+
}: {
|
|
21
|
+
index: number;
|
|
22
|
+
onRemove: (index: number) => void;
|
|
23
|
+
}) => {
|
|
24
|
+
const { theme } = useOrchestratorTheme();
|
|
25
|
+
const { minusButton } = getWfoArrayFieldStyles();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<span css={minusButton} onClick={() => onRemove(index)}>
|
|
29
|
+
<EuiIcon type="minus" size="xxl" color={theme.colors.danger} />
|
|
30
|
+
</span>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const PlusButton = ({ onClick }: { onClick: () => void }) => {
|
|
35
|
+
const { theme } = useOrchestratorTheme();
|
|
36
|
+
const { plusButtonWrapper } = getWfoArrayFieldStyles();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div css={plusButtonWrapper}>
|
|
40
|
+
<EuiIcon
|
|
41
|
+
onClick={onClick}
|
|
42
|
+
type="plus"
|
|
43
|
+
size="xxl"
|
|
44
|
+
color={theme.colors.success}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WfoArrayField = ({
|
|
51
|
+
pydanticFormField,
|
|
52
|
+
}: PydanticFormElementProps) => {
|
|
53
|
+
const { config, rhf } = usePydanticFormContext();
|
|
54
|
+
const { control } = rhf;
|
|
55
|
+
const { id: arrayName, arrayItem } = pydanticFormField;
|
|
56
|
+
const { minItems, maxItems } = pydanticFormField.validations;
|
|
57
|
+
const { container, fieldWrapper } = getWfoArrayFieldStyles();
|
|
58
|
+
|
|
59
|
+
const { fields, append, remove } = useFieldArray({
|
|
60
|
+
control,
|
|
61
|
+
name: arrayName,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const showMinus = !minItems || fields.length > minItems;
|
|
65
|
+
const showPlus = !maxItems || fields.length < maxItems;
|
|
66
|
+
|
|
67
|
+
if (!arrayItem) return null;
|
|
68
|
+
|
|
69
|
+
const component = fieldToComponentMatcher(
|
|
70
|
+
arrayItem,
|
|
71
|
+
config?.componentMatcherExtender,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const renderField = (field: Record<'id', string>, index: number) => {
|
|
75
|
+
const arrayField = itemizeArrayItem(index, arrayItem);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div key={field.id} css={fieldWrapper}>
|
|
79
|
+
<RenderFields
|
|
80
|
+
pydanticFormComponents={[
|
|
81
|
+
{
|
|
82
|
+
Element: component.Element,
|
|
83
|
+
pydanticFormField: arrayField,
|
|
84
|
+
},
|
|
85
|
+
]}
|
|
86
|
+
extraTriggerFields={[arrayName]}
|
|
87
|
+
/>
|
|
88
|
+
{showMinus && <MinusButton index={index} onRemove={remove} />}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div css={container}>
|
|
95
|
+
{fields.map(renderField)}
|
|
96
|
+
|
|
97
|
+
{showPlus && (
|
|
98
|
+
<PlusButton
|
|
99
|
+
onClick={() => {
|
|
100
|
+
append({
|
|
101
|
+
[arrayName]: arrayItem.default ?? undefined,
|
|
102
|
+
});
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
export const getWfoArrayFieldStyles = () => {
|
|
4
|
+
const container = css({
|
|
5
|
+
padding: '1rem',
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
flexGrow: 1,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const fieldWrapper = css({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
gap: '10px',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const minusButton = css({
|
|
18
|
+
width: '40px',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const plusButtonWrapper = css({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
justifyContent: 'end',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
container,
|
|
30
|
+
fieldWrapper,
|
|
31
|
+
minusButton,
|
|
32
|
+
plusButtonWrapper,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
export const getWfoArrayFieldStyles = () => {
|
|
4
|
+
const container = css({
|
|
5
|
+
padding: '1rem',
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
flexGrow: 1,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const fieldWrapper = css({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
gap: '10px',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const minusButton = css({
|
|
18
|
+
width: '40px',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const plusButtonWrapper = css({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
justifyContent: 'end',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
container,
|
|
30
|
+
fieldWrapper,
|
|
31
|
+
minusButton,
|
|
32
|
+
plusButtonWrapper,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
PydanticFormElementProps,
|
|
5
|
+
RenderFields,
|
|
6
|
+
getPydanticFormComponents,
|
|
7
|
+
usePydanticFormContext,
|
|
8
|
+
} from 'pydantic-forms';
|
|
9
|
+
|
|
10
|
+
import { EuiFlexGroup } from '@elastic/eui';
|
|
11
|
+
|
|
12
|
+
import { getWfoObjectFieldStyles } from './getWfoObjectFieldStyles';
|
|
13
|
+
|
|
14
|
+
export const WfoObjectField = ({
|
|
15
|
+
pydanticFormField,
|
|
16
|
+
}: PydanticFormElementProps) => {
|
|
17
|
+
const { config } = usePydanticFormContext();
|
|
18
|
+
const { wfoObjectFieldStyles } = getWfoObjectFieldStyles();
|
|
19
|
+
const components = getPydanticFormComponents(
|
|
20
|
+
pydanticFormField.properties || {},
|
|
21
|
+
config?.componentMatcherExtender,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<EuiFlexGroup css={wfoObjectFieldStyles}>
|
|
26
|
+
<RenderFields pydanticFormComponents={components} />
|
|
27
|
+
</EuiFlexGroup>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslations } from 'next-intl';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
EuiButton,
|
|
7
|
+
EuiFlexItem,
|
|
8
|
+
EuiPanel,
|
|
9
|
+
EuiSpacer,
|
|
10
|
+
EuiText,
|
|
11
|
+
} from '@elastic/eui';
|
|
12
|
+
|
|
13
|
+
import { useGetOrchestratorConfig } from '@/hooks';
|
|
14
|
+
import { WfoChartBar } from '@/icons';
|
|
15
|
+
|
|
16
|
+
export const WfoAoStackStatus = () => {
|
|
17
|
+
const t = useTranslations('settings.page');
|
|
18
|
+
const { aoStackStatusUrl } = useGetOrchestratorConfig();
|
|
19
|
+
|
|
20
|
+
const openStatusPage = () => {
|
|
21
|
+
window.open(aoStackStatusUrl, '_blank');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<EuiFlexItem>
|
|
26
|
+
<EuiPanel hasShadow={false} color="subdued" paddingSize="l">
|
|
27
|
+
<EuiText size="s">
|
|
28
|
+
<h4>{t('aoStackStatus')}</h4>
|
|
29
|
+
</EuiText>
|
|
30
|
+
<EuiSpacer size="m" />
|
|
31
|
+
<EuiButton
|
|
32
|
+
iconType={() => <WfoChartBar />}
|
|
33
|
+
onClick={openStatusPage}
|
|
34
|
+
>
|
|
35
|
+
{t('viewStatusPage')}
|
|
36
|
+
</EuiButton>
|
|
37
|
+
</EuiPanel>
|
|
38
|
+
</EuiFlexItem>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
WfoDataSorting,
|
|
14
14
|
} from '../utils/columns';
|
|
15
15
|
import { DEFAULT_PAGE_SIZES } from '../utils/constants';
|
|
16
|
+
import { getPageCount } from '../utils/tableUtils';
|
|
16
17
|
import { WfoTableDataRows } from './WfoTableDataRows';
|
|
17
18
|
import { WfoTableHeaderRow } from './WfoTableHeaderRow';
|
|
18
19
|
import { getWfoTableStyles } from './styles';
|
|
@@ -232,9 +233,7 @@ export const WfoTable = <T extends object>({
|
|
|
232
233
|
<div css={paginationStyle}>
|
|
233
234
|
<EuiSpacer size="xs" />
|
|
234
235
|
<EuiTablePagination
|
|
235
|
-
pageCount={
|
|
236
|
-
pagination.totalItemCount / pagination.pageSize,
|
|
237
|
-
)}
|
|
236
|
+
pageCount={getPageCount(pagination)}
|
|
238
237
|
activePage={pagination.pageIndex}
|
|
239
238
|
itemsPerPage={pagination.pageSize}
|
|
240
239
|
itemsPerPageOptions={
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { Pagination } from '@/components';
|
|
2
|
+
|
|
1
3
|
import { SortOrder } from '../../../types';
|
|
2
4
|
import {
|
|
3
5
|
determineNewSortOrder,
|
|
4
6
|
determinePageIndex,
|
|
7
|
+
getPageCount,
|
|
5
8
|
hasSpecialCharacterOrSpace,
|
|
6
9
|
} from './tableUtils';
|
|
7
10
|
|
|
@@ -103,4 +106,30 @@ describe('tableUtils', () => {
|
|
|
103
106
|
expect(hasSpecialCharacterOrSpace('@#$%^&*')).toBe(true);
|
|
104
107
|
});
|
|
105
108
|
});
|
|
109
|
+
|
|
110
|
+
describe('getPageCount', () => {
|
|
111
|
+
it('returns the page count', () => {
|
|
112
|
+
const pagination: Pagination = {
|
|
113
|
+
pageIndex: 0,
|
|
114
|
+
pageSize: 10,
|
|
115
|
+
totalItemCount: 101,
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const result = getPageCount(pagination);
|
|
119
|
+
|
|
120
|
+
expect(result).toEqual(11);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('returns the current page as value when the current page is out of range', () => {
|
|
124
|
+
const pagination: Pagination = {
|
|
125
|
+
pageIndex: 50,
|
|
126
|
+
pageSize: 10,
|
|
127
|
+
totalItemCount: 101,
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const result = getPageCount(pagination);
|
|
131
|
+
|
|
132
|
+
expect(result).toEqual(51);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
106
135
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Pagination } from '@/components';
|
|
1
2
|
import type { DataDisplayReturnValues } from '@/hooks';
|
|
2
3
|
import { SortOrder } from '@/types';
|
|
3
4
|
|
|
@@ -63,4 +64,12 @@ export const getQueryStringHandler =
|
|
|
63
64
|
? `${queryString}*`
|
|
64
65
|
: queryString;
|
|
65
66
|
setDataDisplayParam('queryString', query);
|
|
67
|
+
setDataDisplayParam('pageIndex', 0);
|
|
66
68
|
};
|
|
69
|
+
|
|
70
|
+
export const getPageCount = (pagination: Pagination) =>
|
|
71
|
+
// In case the pageIndex is out of range calculated by totalItemCount and pageSize, the pageIndex should be returned to be transparent to the user
|
|
72
|
+
Math.max(
|
|
73
|
+
Math.ceil(pagination.totalItemCount / pagination.pageSize),
|
|
74
|
+
pagination.pageIndex + 1,
|
|
75
|
+
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '5.3.
|
|
1
|
+
export const ORCHESTRATOR_UI_LIBRARY_VERSION = '5.3.2';
|
|
@@ -16,6 +16,8 @@ export const emptyOrchestratorConfig: OrchestratorConfig = {
|
|
|
16
16
|
workflowInformationLinkUrl: '',
|
|
17
17
|
enableSupportMenuItem: false,
|
|
18
18
|
supportMenuItemUrl: '',
|
|
19
|
+
enableAoStackStatus: false,
|
|
20
|
+
aoStackStatusUrl: '',
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export const OrchestratorConfigContext = createContext<OrchestratorConfig>(
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { WfoIconProps } from './WfoIconProps';
|
|
4
|
+
|
|
5
|
+
export const WfoChartBar: FC<WfoIconProps> = ({
|
|
6
|
+
width = 24,
|
|
7
|
+
height = 24,
|
|
8
|
+
color = 'currentColor',
|
|
9
|
+
}) => (
|
|
10
|
+
<svg
|
|
11
|
+
width={width}
|
|
12
|
+
height={height}
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
version="1.1"
|
|
15
|
+
color={color}
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
className="wfoChartBarSquareIcon"
|
|
18
|
+
>
|
|
19
|
+
<svg
|
|
20
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
21
|
+
fill="none"
|
|
22
|
+
viewBox="0 0 24 24"
|
|
23
|
+
stroke-width="2"
|
|
24
|
+
stroke="currentColor"
|
|
25
|
+
className="size-6"
|
|
26
|
+
>
|
|
27
|
+
<path
|
|
28
|
+
stroke-linecap="round"
|
|
29
|
+
stroke-linejoin="round"
|
|
30
|
+
d="M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
</svg>
|
|
34
|
+
);
|
package/src/icons/index.ts
CHANGED
package/src/messages/en-GB.json
CHANGED
|
@@ -130,6 +130,7 @@
|
|
|
130
130
|
"nodePort": {
|
|
131
131
|
"loadingNodes": "Loading Node subscriptions...",
|
|
132
132
|
"loadingPorts": "Loading IMS ports...",
|
|
133
|
+
"noPorts": "NO PORTS FOUND FOR THIS NODE",
|
|
133
134
|
"selectNode": "Select node",
|
|
134
135
|
"selectPort": "Select port",
|
|
135
136
|
"selectNodeFirst": "Select a node first"
|
|
@@ -409,7 +410,9 @@
|
|
|
409
410
|
"status": "Status",
|
|
410
411
|
"numberOfQueuedJobs": "Number of queued jobs",
|
|
411
412
|
"numberOfRunningJobs": "Number of running jobs",
|
|
412
|
-
"numberOfWorkersOnline": "Number of workers online"
|
|
413
|
+
"numberOfWorkersOnline": "Number of workers online",
|
|
414
|
+
"viewStatusPage": "View AO status page",
|
|
415
|
+
"aoStackStatus": "AO stack status"
|
|
413
416
|
}
|
|
414
417
|
},
|
|
415
418
|
"startPage": {
|
|
@@ -447,6 +450,7 @@
|
|
|
447
450
|
"openMenu": "Open menu",
|
|
448
451
|
"support": "Support",
|
|
449
452
|
"softwareVersions": "Software Versions",
|
|
450
|
-
"logout": "Logout"
|
|
453
|
+
"logout": "Logout",
|
|
454
|
+
"aoStatusPage": "A&O application status page"
|
|
451
455
|
}
|
|
452
456
|
}
|
package/src/messages/nl-NL.json
CHANGED
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
WfoWorkerStatus,
|
|
12
12
|
} from '@/components';
|
|
13
13
|
import { WfoContentHeader } from '@/components/WfoContentHeader/WfoContentHeader';
|
|
14
|
-
import {
|
|
14
|
+
import { WfoAoStackStatus } from '@/components/WfoSettings/WfoAoStackStatus';
|
|
15
|
+
import { useGetOrchestratorConfig, useOrchestratorTheme } from '@/hooks';
|
|
15
16
|
|
|
16
17
|
export const WfoSettingsPage = () => {
|
|
17
18
|
const { theme } = useOrchestratorTheme();
|
|
18
19
|
const t = useTranslations('main');
|
|
20
|
+
const { enableAoStackStatus } = useGetOrchestratorConfig();
|
|
19
21
|
|
|
20
22
|
return (
|
|
21
23
|
<>
|
|
@@ -30,6 +32,12 @@ export const WfoSettingsPage = () => {
|
|
|
30
32
|
<WfoModifySettings />
|
|
31
33
|
<EuiSpacer />
|
|
32
34
|
<WfoEngineStatus />
|
|
35
|
+
{enableAoStackStatus && (
|
|
36
|
+
<>
|
|
37
|
+
<EuiSpacer />
|
|
38
|
+
<WfoAoStackStatus />
|
|
39
|
+
</>
|
|
40
|
+
)}
|
|
33
41
|
<EuiSpacer />
|
|
34
42
|
<WfoWorkerStatus />
|
|
35
43
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentMatcherExtender } from 'pydantic-forms';
|
|
2
2
|
|
|
3
3
|
import { Slice, createSlice } from '@reduxjs/toolkit';
|
|
4
4
|
|
|
5
5
|
export type PydanticForm = {
|
|
6
|
-
|
|
6
|
+
componentMatcherExtender?: ComponentMatcherExtender;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
type PydanticFormComponentMatcherSlice = Slice<PydanticForm>;
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type { ComponentMatcherExtender } from 'pydantic-forms';
|
|
6
6
|
|
|
7
7
|
import { emptyOrchestratorConfig } from '@/contexts';
|
|
8
8
|
import { CustomApiConfig } from '@/rtk/slices/customApis';
|
|
@@ -14,7 +14,7 @@ import { getOrchestratorStore } from './store';
|
|
|
14
14
|
export type StoreProviderProps = {
|
|
15
15
|
initialOrchestratorConfig: OrchestratorConfig | null;
|
|
16
16
|
orchestratorComponentOverride?: OrchestratorComponentOverride;
|
|
17
|
-
|
|
17
|
+
componentMatcherExtender?: ComponentMatcherExtender;
|
|
18
18
|
customApis?: CustomApiConfig[];
|
|
19
19
|
children: ReactNode;
|
|
20
20
|
};
|
|
@@ -22,7 +22,7 @@ export type StoreProviderProps = {
|
|
|
22
22
|
export const StoreProvider = ({
|
|
23
23
|
initialOrchestratorConfig,
|
|
24
24
|
orchestratorComponentOverride,
|
|
25
|
-
|
|
25
|
+
componentMatcherExtender,
|
|
26
26
|
customApis = [],
|
|
27
27
|
children,
|
|
28
28
|
}: StoreProviderProps) => {
|
|
@@ -31,7 +31,7 @@ export const StoreProvider = ({
|
|
|
31
31
|
initialOrchestratorConfig ?? emptyOrchestratorConfig,
|
|
32
32
|
orchestratorComponentOverride,
|
|
33
33
|
pydanticForm: {
|
|
34
|
-
|
|
34
|
+
componentMatcherExtender: componentMatcherExtender || undefined,
|
|
35
35
|
},
|
|
36
36
|
customApis,
|
|
37
37
|
});
|
package/src/rtk/utils.ts
CHANGED
|
@@ -80,6 +80,26 @@ export const mapRtkErrorToWfoError = (
|
|
|
80
80
|
return error;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
export const isRecord = (value: unknown): value is Record<string, unknown> => {
|
|
84
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const isFetchBaseQueryError = (
|
|
88
|
+
error: FetchBaseQueryError | GraphQLError[] | SerializedError | undefined,
|
|
89
|
+
): error is FetchBaseQueryError => {
|
|
90
|
+
if (typeof error === 'object' && error !== null && 'status' in error) {
|
|
91
|
+
const status = error.status;
|
|
92
|
+
return (
|
|
93
|
+
typeof status === 'number' ||
|
|
94
|
+
status === 'FETCH_ERROR' ||
|
|
95
|
+
status === 'PARSING_ERROR' ||
|
|
96
|
+
status === 'TIMEOUT_ERROR' ||
|
|
97
|
+
status === 'CUSTOM_ERROR'
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
};
|
|
102
|
+
|
|
83
103
|
export const getWebSocket = async (url: string) => {
|
|
84
104
|
const session = (await getSession()) as WfoSession;
|
|
85
105
|
|