@orchestrator-ui/orchestrator-ui-components 1.4.0 → 1.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/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-lint.log +7 -1
- package/.turbo/turbo-test.log +8 -8
- package/CHANGELOG.md +36 -11
- package/LICENSE.txt +202 -0
- package/README.md +22 -0
- package/dist/index.d.ts +148 -31
- package/dist/index.js +2125 -1989
- package/package.json +21 -2
- package/src/api/index.ts +4 -3
- package/src/api/types.ts +53 -0
- package/src/components/WfoBadges/WfoProductBlockBadge/WfoProductBlockBadge.tsx +1 -0
- package/src/components/WfoDropdownButton/WfoDropdownButton.tsx +2 -0
- package/src/components/WfoForms/AutoFieldLoader.tsx +6 -6
- package/src/components/WfoForms/formFields/AcceptField.tsx +2 -1
- package/src/components/WfoForms/formFields/BoolField.tsx +2 -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/ListAddField.tsx +2 -1
- package/src/components/WfoForms/formFields/ListDelField.tsx +2 -1
- package/src/components/WfoForms/formFields/LongTextField.tsx +1 -1
- package/src/components/WfoForms/formFields/NumField.tsx +1 -1
- package/src/components/WfoForms/formFields/ProductField.tsx +8 -7
- package/src/components/WfoForms/formFields/RadioField.tsx +1 -1
- package/src/components/WfoForms/formFields/SelectField.tsx +4 -2
- package/src/components/WfoForms/formFields/SubmitField.tsx +1 -1
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +5 -4
- package/src/components/WfoForms/formFields/TextField.tsx +1 -1
- package/src/components/WfoForms/formFields/{ContactPersonAutocomplete.tsx → deprecated/ContactPersonAutocomplete.tsx} +4 -3
- package/src/components/WfoForms/formFields/{ContactPersonNameField.tsx → deprecated/ContactPersonNameField.tsx} +3 -2
- package/src/components/WfoForms/formFields/{ImsNodeIdField.tsx → deprecated/ImsNodeIdField.tsx} +4 -3
- package/src/components/WfoForms/formFields/{ImsPortIdField.tsx → deprecated/ImsPortIdField.tsx} +7 -4
- package/src/components/WfoForms/formFields/{IpNetworkField.tsx → deprecated/IpNetworkField.tsx} +4 -3
- package/src/components/WfoForms/formFields/{IpPrefixTableField.tsx → deprecated/IpPrefixTableField.tsx} +5 -4
- package/src/components/WfoForms/formFields/{SplitPrefix.tsx → deprecated/SplitPrefix.tsx} +3 -2
- package/src/components/WfoForms/formFields/{TimestampField.tsx → deprecated/TimestampField.tsx} +1 -1
- package/src/components/WfoForms/formFields/{VlanField.tsx → deprecated/VlanField.tsx} +5 -4
- package/src/components/WfoForms/formFields/deprecated/index.ts +13 -0
- package/src/components/WfoForms/formFields/{surf → deprecated}/types.ts +1 -1
- package/src/components/WfoForms/formFields/index.ts +1 -6
- package/src/components/WfoForms/formFields/utils.spec.ts +2 -1
- package/src/components/WfoForms/formFields/utils.ts +3 -2
- package/src/components/WfoJsonCodeBlock/WfoJsonCodeBlock.tsx +11 -5
- package/src/components/WfoJsonCodeBlock/styles.ts +13 -0
- package/src/components/WfoKeyValueTable/WfoValueCell.tsx +8 -1
- package/src/components/WfoSubscription/WfoSubscription.tsx +5 -5
- package/src/components/WfoSubscription/WfoSubscriptionGeneral.tsx +70 -62
- package/src/components/WfoSubscription/WfoSubscriptionProductBlock.tsx +24 -5
- package/src/components/WfoSubscriptionsList/WfoSubscriptionsList.tsx +11 -1
- package/src/components/WfoSubscriptionsList/subscriptionResultMappers.ts +3 -0
- package/src/components/WfoTable/WfoInlineJson/WfoInlineJson.tsx +14 -0
- package/src/components/WfoTable/WfoInlineJson/index.ts +1 -0
- package/src/components/WfoTable/index.ts +1 -0
- package/src/components/WfoTable/utils/constants.ts +2 -2
- package/src/components/WfoWorkflowSteps/WfoStepStatusIcon/WfoStepStatusIcon.tsx +7 -0
- package/src/icons/WfoExternalLink.tsx +30 -0
- package/src/icons/index.ts +1 -0
- package/src/messages/en-GB.json +2 -0
- package/src/messages/nl-NL.json +2 -0
- package/src/pages/metadata/WfoProductsPage.tsx +5 -0
- package/src/pages/processes/WfoStartProcessPage.tsx +0 -6
- package/src/rtk/endpoints/subscriptionDetail.ts +1 -0
- package/src/rtk/endpoints/subscriptionList.ts +1 -0
- package/src/types/types.ts +3 -0
- package/src/utils/getDefaultTableConfig.ts +1 -0
- /package/src/components/WfoForms/formFields/{ContactPersonAutocompleteStyles.ts → deprecated/ContactPersonAutocompleteStyles.ts} +0 -0
- /package/src/components/WfoForms/formFields/{ImsPortIdFieldStyling.ts → deprecated/ImsPortIdFieldStyling.ts} +0 -0
- /package/src/components/WfoForms/formFields/{IpPrefixTableFieldStyling.ts → deprecated/IpPrefixTableFieldStyling.ts} +0 -0
- /package/src/components/WfoForms/formFields/{SplitPrefixStyling.ts → deprecated/SplitPrefixStyling.ts} +0 -0
- /package/src/components/WfoForms/formFields/{surf → deprecated}/utils.ts +0 -0
- /package/src/hooks/{surf → deprecated}/useGetSubscriptionDropdownOptions.ts +0 -0
- /package/src/hooks/{surf → deprecated}/useIsTaggedPort.ts +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchestrator-ui/orchestrator-ui-components",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Library of UI Components used to display the workflow orchestrator frontend",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Workflow Orchestrator Programme",
|
|
8
|
+
"email": "workfloworchestrator.board@commonsconservancy.org",
|
|
9
|
+
"url": "https://www.workfloworchestrator.org"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/workfloworchestrator/orchestrator-ui-library.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://www.workfloworchestrator.org",
|
|
16
|
+
"bugs": "https://github.com/workfloworchestrator/orchestrator-ui-library/issues",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"orchestrator",
|
|
19
|
+
"workflow",
|
|
20
|
+
"workflow orchestrator",
|
|
21
|
+
"network",
|
|
22
|
+
"automation"
|
|
23
|
+
],
|
|
5
24
|
"scripts": {
|
|
6
25
|
"test": "jest",
|
|
7
26
|
"build": "tsup src/index.ts --format esm --dts --tsconfig tsconfig.build.json",
|
package/src/api/index.ts
CHANGED
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { AxiosInstance } from 'axios';
|
|
16
16
|
|
|
17
|
+
import { LegacyProduct } from '@/api/types';
|
|
17
18
|
import {
|
|
18
19
|
ImsPort,
|
|
19
20
|
IpBlock,
|
|
20
21
|
IpPrefix,
|
|
21
22
|
NodeSubscription,
|
|
22
|
-
} from '@/components/WfoForms/formFields/
|
|
23
|
+
} from '@/components/WfoForms/formFields/deprecated/types';
|
|
23
24
|
import { ProductDefinition } from '@/types';
|
|
24
25
|
|
|
25
26
|
import { getAxiosInstance } from './axios';
|
|
@@ -142,8 +143,8 @@ export class ApiClient extends BaseApiClient {
|
|
|
142
143
|
);
|
|
143
144
|
};
|
|
144
145
|
|
|
145
|
-
products = (): Promise<
|
|
146
|
-
return this.fetchJson<
|
|
146
|
+
products = (): Promise<LegacyProduct[]> => {
|
|
147
|
+
return this.fetchJson<LegacyProduct[]>(PRODUCTS_ENDPOINT);
|
|
147
148
|
};
|
|
148
149
|
productById = (productId: string): Promise<ProductDefinition> => {
|
|
149
150
|
return this.fetchJson(`${PRODUCTS_ENDPOINT}${productId}`);
|
package/src/api/types.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// These types are specifically for the axios calls
|
|
2
|
+
// When replacing the REST calls with GraphQL, these types should be removed
|
|
3
|
+
|
|
4
|
+
export type LegacyFixedInput = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
created_at: number;
|
|
8
|
+
fixed_input_id: string;
|
|
9
|
+
product_id: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type LegacyWorkflow = {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
target: string;
|
|
16
|
+
created_at: number;
|
|
17
|
+
workflow_id: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type LegacyResourceType = {
|
|
21
|
+
resource_type_id: string;
|
|
22
|
+
resource_type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type LegacyProductBlock = {
|
|
27
|
+
product_block_id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
tag: string;
|
|
30
|
+
description: string;
|
|
31
|
+
status: string;
|
|
32
|
+
created_at: number;
|
|
33
|
+
end_date: number;
|
|
34
|
+
resource_types: LegacyResourceType[];
|
|
35
|
+
parent_ids: string[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type LegacyProduct = {
|
|
39
|
+
name: string;
|
|
40
|
+
tag: string;
|
|
41
|
+
description: string;
|
|
42
|
+
product_id: string;
|
|
43
|
+
created_at: number;
|
|
44
|
+
product_type: string;
|
|
45
|
+
end_date: number;
|
|
46
|
+
status: string;
|
|
47
|
+
fixed_inputs: LegacyFixedInput[];
|
|
48
|
+
workflows: LegacyWorkflow[];
|
|
49
|
+
product_blocks: LegacyProductBlock[];
|
|
50
|
+
create_subscription_workflow_key: string;
|
|
51
|
+
modify_subscription_workflow_key: string;
|
|
52
|
+
terminate_subscription_workflow_key: string;
|
|
53
|
+
};
|
|
@@ -12,6 +12,7 @@ interface WfoDropdownButtonProps {
|
|
|
12
12
|
|
|
13
13
|
export const WfoDropdownButton = ({
|
|
14
14
|
label,
|
|
15
|
+
isDisabled = false,
|
|
15
16
|
children,
|
|
16
17
|
}: WfoDropdownButtonProps) => {
|
|
17
18
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -58,6 +59,7 @@ export const WfoDropdownButton = ({
|
|
|
58
59
|
legend={'Buttons'}
|
|
59
60
|
options={buttonOptions}
|
|
60
61
|
onChange={onButtonClick}
|
|
62
|
+
isDisabled={isDisabled}
|
|
61
63
|
/>
|
|
62
64
|
}
|
|
63
65
|
isOpen={isPopoverOpen}
|
|
@@ -44,12 +44,12 @@ export function autoFieldFunction(
|
|
|
44
44
|
switch (fieldType) {
|
|
45
45
|
case Number:
|
|
46
46
|
switch (format) {
|
|
47
|
-
case 'imsPortId': //
|
|
47
|
+
case 'imsPortId': // Deprecated
|
|
48
48
|
return ImsPortIdField;
|
|
49
|
-
case 'imsNodeId': //
|
|
49
|
+
case 'imsNodeId': // Deprecated
|
|
50
50
|
return ImsNodeIdField;
|
|
51
51
|
case 'timestamp':
|
|
52
|
-
return TimestampField; //
|
|
52
|
+
return TimestampField; // Deprecated
|
|
53
53
|
}
|
|
54
54
|
break;
|
|
55
55
|
case Object:
|
|
@@ -78,13 +78,13 @@ export function autoFieldFunction(
|
|
|
78
78
|
return CustomerField;
|
|
79
79
|
case 'locationCode':
|
|
80
80
|
return LocationCodeField;
|
|
81
|
-
case 'contactPersonName': //
|
|
81
|
+
case 'contactPersonName': // Deprecated
|
|
82
82
|
return ContactPersonNameField;
|
|
83
|
-
case 'vlan': //
|
|
83
|
+
case 'vlan': // Deprecated
|
|
84
84
|
return VlanField;
|
|
85
85
|
case 'accept':
|
|
86
86
|
return AcceptField;
|
|
87
|
-
case 'ipvanynetwork': //
|
|
87
|
+
case 'ipvanynetwork': // Deprecated
|
|
88
88
|
return IpNetworkField;
|
|
89
89
|
}
|
|
90
90
|
break;
|
|
@@ -19,7 +19,8 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
19
19
|
|
|
20
20
|
import { EuiCheckbox, EuiFlexItem, EuiText } from '@elastic/eui';
|
|
21
21
|
|
|
22
|
-
import { useWithOrchestratorTheme } from '
|
|
22
|
+
import { useWithOrchestratorTheme } from '@/hooks';
|
|
23
|
+
|
|
23
24
|
import { getStyles } from './AcceptFieldStyling';
|
|
24
25
|
import { FieldProps } from './types';
|
|
25
26
|
|
|
@@ -18,7 +18,8 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
18
18
|
|
|
19
19
|
import { EuiCheckbox, EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { FieldProps } from '
|
|
21
|
+
import { FieldProps } from '@/types';
|
|
22
|
+
|
|
22
23
|
import { boolFieldStyling } from './BoolFieldStyling';
|
|
23
24
|
|
|
24
25
|
export type BoolFieldProps = FieldProps<boolean>;
|
|
@@ -18,7 +18,7 @@ import { connectField } from 'uniforms';
|
|
|
18
18
|
|
|
19
19
|
import { EuiHorizontalRule } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { FieldProps } from '
|
|
21
|
+
import { FieldProps } from '@/types';
|
|
22
22
|
|
|
23
23
|
export type DividerFieldProps = FieldProps<null, object, null, HTMLDivElement>;
|
|
24
24
|
|
|
@@ -16,7 +16,7 @@ import React from 'react';
|
|
|
16
16
|
|
|
17
17
|
import { connectField, filterDOMProps } from 'uniforms';
|
|
18
18
|
|
|
19
|
-
import { FieldProps } from '
|
|
19
|
+
import { FieldProps } from '@/types';
|
|
20
20
|
|
|
21
21
|
export type LabelFieldProps = FieldProps<null, object, null, HTMLDivElement>;
|
|
22
22
|
|
|
@@ -20,7 +20,8 @@ import { connectField, filterDOMProps, joinName, useField } from 'uniforms';
|
|
|
20
20
|
|
|
21
21
|
import { EuiIcon, EuiText } from '@elastic/eui';
|
|
22
22
|
|
|
23
|
-
import { useOrchestratorTheme } from '
|
|
23
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
24
|
+
|
|
24
25
|
import { FieldProps } from './types';
|
|
25
26
|
|
|
26
27
|
export type ListAddFieldProps = FieldProps<
|
|
@@ -19,7 +19,8 @@ import { connectField, filterDOMProps, joinName, useField } from 'uniforms';
|
|
|
19
19
|
|
|
20
20
|
import { EuiIcon, EuiText } from '@elastic/eui';
|
|
21
21
|
|
|
22
|
-
import { useOrchestratorTheme } from '
|
|
22
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
23
|
+
|
|
23
24
|
import { FieldProps } from './types';
|
|
24
25
|
|
|
25
26
|
export type ListDelFieldProps = FieldProps<
|
|
@@ -18,7 +18,7 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
18
18
|
|
|
19
19
|
import { EuiFormRow, EuiText, EuiTextArea } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { FieldProps } from '
|
|
21
|
+
import { FieldProps } from '@/types';
|
|
22
22
|
|
|
23
23
|
export type LongTextFieldProps = FieldProps<
|
|
24
24
|
string,
|
|
@@ -18,7 +18,7 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
18
18
|
|
|
19
19
|
import { EuiFieldNumber, EuiFormRow, EuiText } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { FieldProps } from '
|
|
21
|
+
import { FieldProps } from '@/types';
|
|
22
22
|
|
|
23
23
|
export type NumFieldProps = FieldProps<
|
|
24
24
|
number,
|
|
@@ -19,7 +19,8 @@ import get from 'lodash/get';
|
|
|
19
19
|
import { useTranslations } from 'next-intl';
|
|
20
20
|
import { connectField, filterDOMProps } from 'uniforms';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import type { LegacyProduct } from '@/api/types';
|
|
23
|
+
|
|
23
24
|
import { useAxiosApiClient } from '../useAxiosApiClient';
|
|
24
25
|
import { SelectFieldProps, UnconnectedSelectField } from './SelectField';
|
|
25
26
|
|
|
@@ -44,15 +45,15 @@ function Product({ name, productIds, ...props }: ProductFieldProps) {
|
|
|
44
45
|
|
|
45
46
|
const productById = (
|
|
46
47
|
id: string,
|
|
47
|
-
products:
|
|
48
|
-
):
|
|
49
|
-
return products.find((prod) => prod.
|
|
48
|
+
products: LegacyProduct[],
|
|
49
|
+
): LegacyProduct => {
|
|
50
|
+
return products.find((prod) => prod.product_id === id)!;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
if (isLoading || error) return null;
|
|
53
|
+
if (isLoading || error || !data) return null;
|
|
53
54
|
|
|
54
55
|
const products = productIds
|
|
55
|
-
?
|
|
56
|
+
? productIds?.map((id) => productById(id, data))
|
|
56
57
|
: data;
|
|
57
58
|
|
|
58
59
|
const productLabelLookup =
|
|
@@ -60,7 +61,7 @@ function Product({ name, productIds, ...props }: ProductFieldProps) {
|
|
|
60
61
|
mapping,
|
|
61
62
|
product,
|
|
62
63
|
) {
|
|
63
|
-
mapping[product.
|
|
64
|
+
mapping[product.product_id] = product.name;
|
|
64
65
|
return mapping;
|
|
65
66
|
}, {}) ?? {};
|
|
66
67
|
|
|
@@ -19,7 +19,7 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
19
19
|
|
|
20
20
|
import { EuiFormRow, EuiRadio, EuiText } from '@elastic/eui';
|
|
21
21
|
|
|
22
|
-
import { FieldProps } from '
|
|
22
|
+
import { FieldProps } from '@/types';
|
|
23
23
|
|
|
24
24
|
const base64 =
|
|
25
25
|
typeof btoa !== 'undefined'
|
|
@@ -21,7 +21,8 @@ import { joinName, useField, useForm } from 'uniforms';
|
|
|
21
21
|
|
|
22
22
|
import { EuiFormRow, EuiText } from '@elastic/eui';
|
|
23
23
|
|
|
24
|
-
import { useOrchestratorTheme } from '
|
|
24
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
25
|
+
|
|
25
26
|
import { ListField, ListFieldProps } from './ListField';
|
|
26
27
|
import { ListItemField } from './ListItemField';
|
|
27
28
|
import { ListSelectField } from './ListSelectField';
|
|
@@ -146,7 +147,8 @@ export function UnconnectedSelectField({
|
|
|
146
147
|
name={name}
|
|
147
148
|
onChange={(option) => {
|
|
148
149
|
if (!readOnly) {
|
|
149
|
-
|
|
150
|
+
// @ts-expect-error - null needs to be passed in some cases to remove something (eg. a fw endpoint in an l2vpn)
|
|
151
|
+
onChange(option?.value ?? null);
|
|
150
152
|
}
|
|
151
153
|
}}
|
|
152
154
|
styles={reactSelectInnerComponentStyles}
|
|
@@ -33,12 +33,13 @@ import {
|
|
|
33
33
|
EuiText,
|
|
34
34
|
} from '@elastic/eui';
|
|
35
35
|
|
|
36
|
-
import { useOrchestratorTheme } from '
|
|
37
|
-
import { useGetSubscriptionDropdownOptions } from '
|
|
38
|
-
import { SubscriptionDropdownOption } from '
|
|
36
|
+
import { useOrchestratorTheme } from '@/hooks';
|
|
37
|
+
import { useGetSubscriptionDropdownOptions } from '@/hooks/deprecated/useGetSubscriptionDropdownOptions';
|
|
38
|
+
import { SubscriptionDropdownOption } from '@/types';
|
|
39
|
+
|
|
39
40
|
import { subscriptionFieldStyling } from './SubscriptionFieldStyling';
|
|
41
|
+
import { PortMode, ProductTag } from './deprecated/types';
|
|
40
42
|
import { getReactSelectInnerComponentStyles } from './reactSelectStyles';
|
|
41
|
-
import { PortMode, ProductTag } from './surf/types';
|
|
42
43
|
import { FieldProps, Option } from './types';
|
|
43
44
|
import { getPortMode } from './utils';
|
|
44
45
|
|
|
@@ -18,7 +18,7 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
18
18
|
|
|
19
19
|
import { EuiFieldText, EuiFormRow, EuiText } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { FieldProps } from '
|
|
21
|
+
import { FieldProps } from '@/types';
|
|
22
22
|
|
|
23
23
|
export type TextFieldProps = FieldProps<string>;
|
|
24
24
|
|
|
@@ -18,10 +18,11 @@ import scrollIntoView from 'scroll-into-view';
|
|
|
18
18
|
|
|
19
19
|
import { EuiFlexItem } from '@elastic/eui';
|
|
20
20
|
|
|
21
|
-
import { useWithOrchestratorTheme } from '
|
|
21
|
+
import { useWithOrchestratorTheme } from '@/hooks';
|
|
22
|
+
|
|
23
|
+
import { ContactPerson } from '../types';
|
|
24
|
+
import { isEmpty } from '../utils';
|
|
22
25
|
import { getStyles } from './ContactPersonAutocompleteStyles';
|
|
23
|
-
import { ContactPerson } from './types';
|
|
24
|
-
import { isEmpty } from './utils';
|
|
25
26
|
|
|
26
27
|
interface ContactPersonAutocompleteProps {
|
|
27
28
|
query: string;
|
|
@@ -27,9 +27,10 @@ import {
|
|
|
27
27
|
|
|
28
28
|
import { EuiFieldText, EuiFormRow, EuiText } from '@elastic/eui';
|
|
29
29
|
|
|
30
|
-
import { useAxiosApiClient } from '
|
|
30
|
+
import { useAxiosApiClient } from '@/components/WfoForms/useAxiosApiClient';
|
|
31
|
+
|
|
32
|
+
import { ContactPerson, FieldProps } from '../types';
|
|
31
33
|
import { ContactPersonAutocomplete } from './ContactPersonAutocomplete';
|
|
32
|
-
import { ContactPerson, FieldProps } from './types';
|
|
33
34
|
|
|
34
35
|
export function stop(e: React.SyntheticEvent) {
|
|
35
36
|
if (e !== undefined && e !== null) {
|
package/src/components/WfoForms/formFields/{ImsNodeIdField.tsx → deprecated/ImsNodeIdField.tsx}
RENAMED
|
@@ -18,9 +18,10 @@ import { get } from 'lodash';
|
|
|
18
18
|
import { useTranslations } from 'next-intl';
|
|
19
19
|
import { connectField, filterDOMProps } from 'uniforms';
|
|
20
20
|
|
|
21
|
-
import { useAxiosApiClient } from '
|
|
22
|
-
|
|
23
|
-
import {
|
|
21
|
+
import { useAxiosApiClient } from '@/components/WfoForms/useAxiosApiClient';
|
|
22
|
+
|
|
23
|
+
import { SelectFieldProps, UnconnectedSelectField } from '../SelectField';
|
|
24
|
+
import { ImsNode } from './types';
|
|
24
25
|
|
|
25
26
|
export type ImsNodeIdFieldProps = {
|
|
26
27
|
onChange: (value?: number | undefined) => void;
|
package/src/components/WfoForms/formFields/{ImsPortIdField.tsx → deprecated/ImsPortIdField.tsx}
RENAMED
|
@@ -21,12 +21,12 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
21
21
|
import { EuiFlexItem, EuiFormRow, EuiText } from '@elastic/eui';
|
|
22
22
|
|
|
23
23
|
import { getReactSelectInnerComponentStyles } from '@/components/WfoForms/formFields/reactSelectStyles';
|
|
24
|
+
import { useAxiosApiClient } from '@/components/WfoForms/useAxiosApiClient';
|
|
24
25
|
import { useOrchestratorTheme } from '@/hooks';
|
|
25
26
|
|
|
26
|
-
import {
|
|
27
|
+
import { FieldProps, Option } from '../types';
|
|
27
28
|
import { imsPortIdFieldStyling } from './ImsPortIdFieldStyling';
|
|
28
|
-
import { ImsNode, ImsPort, NodeSubscription } from './
|
|
29
|
-
import { FieldProps, Option } from './types';
|
|
29
|
+
import { ImsNode, ImsPort, NodeSubscription } from './types';
|
|
30
30
|
|
|
31
31
|
export type ImsPortFieldProps = FieldProps<
|
|
32
32
|
number,
|
|
@@ -102,6 +102,9 @@ function ImsPortId({
|
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
// Clears the value when another selection is made
|
|
106
|
+
onChange(undefined);
|
|
107
|
+
|
|
105
108
|
setLoading(true);
|
|
106
109
|
setNodeId(value);
|
|
107
110
|
setPorts([]);
|
|
@@ -217,7 +220,7 @@ function ImsPortId({
|
|
|
217
220
|
}}
|
|
218
221
|
options={port_options}
|
|
219
222
|
placeholder={portPlaceholder}
|
|
220
|
-
value={port_value}
|
|
223
|
+
value={port_value || null}
|
|
221
224
|
isSearchable={true}
|
|
222
225
|
isDisabled={
|
|
223
226
|
disabled ||
|
package/src/components/WfoForms/formFields/{IpNetworkField.tsx → deprecated/IpNetworkField.tsx}
RENAMED
|
@@ -19,10 +19,11 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
19
19
|
|
|
20
20
|
import { EuiCallOut, EuiFormRow, EuiText } from '@elastic/eui';
|
|
21
21
|
|
|
22
|
+
import SplitPrefix from '@/components/WfoForms/formFields/deprecated/SplitPrefix';
|
|
23
|
+
|
|
24
|
+
import { FieldProps } from '../types';
|
|
22
25
|
import IpPrefixTableField from './IpPrefixTableField';
|
|
23
|
-
import
|
|
24
|
-
import { IpBlock } from './surf/types';
|
|
25
|
-
import { FieldProps } from './types';
|
|
26
|
+
import { IpBlock } from './types';
|
|
26
27
|
|
|
27
28
|
export type IPvAnyNetworkFieldProps = FieldProps<
|
|
28
29
|
string,
|
|
@@ -29,11 +29,12 @@ import {
|
|
|
29
29
|
EuiText,
|
|
30
30
|
} from '@elastic/eui';
|
|
31
31
|
|
|
32
|
-
import { ApiClientContext } from '
|
|
32
|
+
import { ApiClientContext } from '@/contexts';
|
|
33
|
+
|
|
34
|
+
import { Option, prop } from '../types';
|
|
33
35
|
import { ipPrefixTableFieldStyling } from './IpPrefixTableFieldStyling';
|
|
34
|
-
import { IpBlock, IpPrefix, SortOption } from './
|
|
35
|
-
import { ipamStates } from './
|
|
36
|
-
import { Option, prop } from './types';
|
|
36
|
+
import { IpBlock, IpPrefix, SortOption } from './types';
|
|
37
|
+
import { ipamStates } from './utils';
|
|
37
38
|
|
|
38
39
|
type SortKeys = 'id' | 'prefix' | 'description' | 'state_repr';
|
|
39
40
|
|
|
@@ -19,9 +19,10 @@ import { range } from 'lodash';
|
|
|
19
19
|
|
|
20
20
|
import { EuiFlexItem } from '@elastic/eui';
|
|
21
21
|
|
|
22
|
-
import { ApiClientContext } from '
|
|
22
|
+
import { ApiClientContext } from '@/contexts';
|
|
23
|
+
|
|
24
|
+
import { Option } from '../types';
|
|
23
25
|
import { splitPrefixStyling } from './SplitPrefixStyling';
|
|
24
|
-
import { Option } from './types';
|
|
25
26
|
|
|
26
27
|
interface IProps {
|
|
27
28
|
id: string;
|
package/src/components/WfoForms/formFields/{TimestampField.tsx → deprecated/TimestampField.tsx}
RENAMED
|
@@ -19,7 +19,7 @@ import { connectField, filterDOMProps } from 'uniforms';
|
|
|
19
19
|
|
|
20
20
|
import { EuiDatePicker, EuiFormRow, EuiText } from '@elastic/eui';
|
|
21
21
|
|
|
22
|
-
import { FieldProps } from '
|
|
22
|
+
import { FieldProps } from '../types';
|
|
23
23
|
|
|
24
24
|
export function utcTimestampToLocalMoment(utc_timestamp: number) {
|
|
25
25
|
// Convert UTC timestamp to localized Moment object
|
|
@@ -20,10 +20,11 @@ import { connectField, filterDOMProps, joinName, useForm } from 'uniforms';
|
|
|
20
20
|
|
|
21
21
|
import { EuiFieldText, EuiFormRow, EuiText } from '@elastic/eui';
|
|
22
22
|
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
import { FieldProps } from '
|
|
23
|
+
import { useAxiosApiClient } from '@/components/WfoForms/useAxiosApiClient';
|
|
24
|
+
import { useIsTaggedPort } from '@/hooks/deprecated/useIsTaggedPort';
|
|
25
|
+
|
|
26
|
+
import { FieldProps } from '../types';
|
|
27
|
+
import { ServicePort } from './types';
|
|
27
28
|
|
|
28
29
|
function inValidVlan(vlan: string) {
|
|
29
30
|
const value = vlan || '0';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './ContactPersonAutocomplete';
|
|
2
|
+
export * from './ContactPersonAutocompleteStyles';
|
|
3
|
+
export * from './ContactPersonNameField';
|
|
4
|
+
export * from './ImsNodeIdField';
|
|
5
|
+
export * from './ImsPortIdField';
|
|
6
|
+
export * from './ImsPortIdFieldStyling';
|
|
7
|
+
export * from './IpNetworkField';
|
|
8
|
+
export * from './IpPrefixTableFieldStyling';
|
|
9
|
+
export * from './SplitPrefixStyling';
|
|
10
|
+
export * from './TimestampField';
|
|
11
|
+
export * from './VlanField';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './utils';
|
|
@@ -17,16 +17,11 @@ export * from './SubmitField';
|
|
|
17
17
|
export * from './SubscriptionSummaryField';
|
|
18
18
|
export * from './TextField';
|
|
19
19
|
export * from './DateField';
|
|
20
|
-
export * from './TimestampField';
|
|
21
|
-
export * from './ContactPersonNameField';
|
|
22
|
-
export * from './ImsNodeIdField';
|
|
23
|
-
export * from './ImsPortIdField';
|
|
24
20
|
export * from './LocationCodeField';
|
|
25
|
-
export * from './
|
|
21
|
+
export * from './deprecated';
|
|
26
22
|
export * from './NestField';
|
|
27
23
|
export * from './OptGroupField';
|
|
28
24
|
export * from './SubscriptionField';
|
|
29
|
-
export * from './IpNetworkField';
|
|
30
25
|
export * from './SummaryField';
|
|
31
26
|
export * from './CustomerField';
|
|
32
27
|
export * from './ConnectedSelectField';
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
SubscriptionStatus,
|
|
7
7
|
WorkflowTarget,
|
|
8
8
|
} from '../../../types';
|
|
9
|
-
import { ProductTag } from './
|
|
9
|
+
import { ProductTag } from './deprecated/types';
|
|
10
10
|
import {
|
|
11
11
|
getPortMode,
|
|
12
12
|
subscriptionHasTaggedPortModeInstanceValue,
|
|
@@ -49,6 +49,7 @@ const testSubscriptionDetail: SubscriptionDetail = {
|
|
|
49
49
|
startDate: '1111-01-01',
|
|
50
50
|
status: SubscriptionStatus.ACTIVE,
|
|
51
51
|
productBlockInstances: testProductBlockInstances,
|
|
52
|
+
metadata: {},
|
|
52
53
|
processes: {
|
|
53
54
|
page: [
|
|
54
55
|
{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isDate } from 'moment';
|
|
2
2
|
|
|
3
|
-
import { ProductBlockInstance, SubscriptionDetail } from '
|
|
4
|
-
|
|
3
|
+
import { ProductBlockInstance, SubscriptionDetail } from '@/types';
|
|
4
|
+
|
|
5
|
+
import { PortMode, ProductTag } from './deprecated/types';
|
|
5
6
|
|
|
6
7
|
// NOTE: There might potentially (?) be more productBlockInstances with portMod but we get the last one here
|
|
7
8
|
export const getPortMode = (
|
|
@@ -2,24 +2,30 @@ import React, { FC } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { EuiCodeBlock } from '@elastic/eui';
|
|
4
4
|
|
|
5
|
-
import { useWithOrchestratorTheme } from '
|
|
5
|
+
import { useWithOrchestratorTheme } from '@/hooks';
|
|
6
|
+
|
|
6
7
|
import { getStyles } from './styles';
|
|
7
8
|
|
|
8
9
|
export type WfoJsonCodeBlockProps = {
|
|
9
10
|
data: object;
|
|
11
|
+
isBasicStyle?: boolean;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
|
-
export const WfoJsonCodeBlock: FC<WfoJsonCodeBlockProps> = ({
|
|
13
|
-
|
|
14
|
+
export const WfoJsonCodeBlock: FC<WfoJsonCodeBlockProps> = ({
|
|
15
|
+
data,
|
|
16
|
+
isBasicStyle = false,
|
|
17
|
+
}) => {
|
|
18
|
+
const { euiCodeBlockStyle, euiBasicCodeBlockStyle } =
|
|
19
|
+
useWithOrchestratorTheme(getStyles);
|
|
14
20
|
|
|
15
21
|
const json = JSON.stringify(data, null, 4);
|
|
16
22
|
|
|
17
23
|
return (
|
|
18
24
|
<EuiCodeBlock
|
|
19
|
-
css={euiCodeBlockStyle}
|
|
25
|
+
css={isBasicStyle ? euiBasicCodeBlockStyle : euiCodeBlockStyle}
|
|
20
26
|
isCopyable={true}
|
|
21
27
|
language="json"
|
|
22
|
-
lineNumbers={
|
|
28
|
+
lineNumbers={!isBasicStyle}
|
|
23
29
|
>
|
|
24
30
|
{json}
|
|
25
31
|
</EuiCodeBlock>
|