@orchestrator-ui/orchestrator-ui-components 6.7.8 → 7.0.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 +8 -8
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +10 -11
- package/CHANGELOG.md +16 -0
- package/dist/index.d.ts +180 -4325
- package/dist/index.js +1774 -5741
- package/dist/index.js.map +1 -1
- package/package.json +4 -8
- package/src/components/WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx +9 -1
- package/src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx +9 -2
- package/src/components/WfoPydanticForm/RenderFormErrors.tsx +2 -1
- package/src/components/WfoPydanticForm/Row.tsx +3 -1
- package/src/components/WfoPydanticForm/fields/WfoSummary.tsx +3 -5
- package/src/components/WfoPydanticForm/fields/styles.ts +72 -0
- package/src/components/WfoStartButton/WfoStartButtonComboBox.tsx +73 -3
- package/src/components/WfoStartButton/WfoStartWorkflowComboBox.tsx +15 -3
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +10 -27
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/configuration/version.ts +1 -1
- package/src/contexts/OrchestratorConfigContext.tsx +0 -1
- package/src/pages/processes/WfoStartProcessPage.tsx +5 -107
- package/src/rtk/endpoints/index.ts +0 -2
- package/src/rtk/endpoints/startOptions.ts +23 -10
- package/src/types/index.ts +0 -1
- package/src/types/types.ts +0 -1
- package/src/components/WfoForms/AutoFieldLoader.tsx +0 -118
- package/src/components/WfoForms/AutoFields.tsx +0 -49
- package/src/components/WfoForms/CreateForm.tsx +0 -75
- package/src/components/WfoForms/UserInputForm.tsx +0 -697
- package/src/components/WfoForms/UserInputFormStyling.ts +0 -80
- package/src/components/WfoForms/UserInputFormWizard.tsx +0 -127
- package/src/components/WfoForms/formFields/AcceptField.tsx +0 -243
- package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +0 -35
- package/src/components/WfoForms/formFields/BoolField.tsx +0 -77
- package/src/components/WfoForms/formFields/BoolFieldStyling.ts +0 -64
- package/src/components/WfoForms/formFields/ConnectedSelectField.tsx +0 -19
- package/src/components/WfoForms/formFields/CustomerField.tsx +0 -77
- package/src/components/WfoForms/formFields/DateField.tsx +0 -72
- package/src/components/WfoForms/formFields/DividerField.tsx +0 -29
- package/src/components/WfoForms/formFields/ErrorField.tsx +0 -40
- package/src/components/WfoForms/formFields/ErrorsField.tsx +0 -34
- package/src/components/WfoForms/formFields/LabelField.tsx +0 -43
- package/src/components/WfoForms/formFields/ListAddField.tsx +0 -95
- package/src/components/WfoForms/formFields/ListDelField.tsx +0 -95
- package/src/components/WfoForms/formFields/ListField.tsx +0 -117
- package/src/components/WfoForms/formFields/ListItemField.tsx +0 -40
- package/src/components/WfoForms/formFields/ListSelectField.tsx +0 -95
- package/src/components/WfoForms/formFields/LocationCodeField.tsx +0 -60
- package/src/components/WfoForms/formFields/LongTextField.tsx +0 -68
- package/src/components/WfoForms/formFields/NestField.tsx +0 -107
- package/src/components/WfoForms/formFields/NumField.tsx +0 -85
- package/src/components/WfoForms/formFields/OptGroupField.tsx +0 -74
- package/src/components/WfoForms/formFields/RadioField.tsx +0 -87
- package/src/components/WfoForms/formFields/SelectField/SelectField.tsx +0 -177
- package/src/components/WfoForms/formFields/SelectField/index.ts +0 -1
- package/src/components/WfoForms/formFields/SelectField/styles.ts +0 -52
- package/src/components/WfoForms/formFields/SubmitField.tsx +0 -50
- package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +0 -74
- package/src/components/WfoForms/formFields/SummaryField.tsx +0 -104
- package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +0 -44
- package/src/components/WfoForms/formFields/TextField.tsx +0 -81
- package/src/components/WfoForms/formFields/commonStyles.ts +0 -32
- package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocomplete.tsx +0 -99
- package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocompleteStyles.ts +0 -41
- package/src/components/WfoForms/formFields/deprecated/ContactPersonNameField.tsx +0 -263
- package/src/components/WfoForms/formFields/deprecated/FileUploadField.tsx +0 -151
- package/src/components/WfoForms/formFields/deprecated/ImsNodeIdField.tsx +0 -109
- package/src/components/WfoForms/formFields/deprecated/ImsPortIdField.tsx +0 -233
- package/src/components/WfoForms/formFields/deprecated/ImsPortIdFieldStyling.ts +0 -17
- package/src/components/WfoForms/formFields/deprecated/IpNetworkField.tsx +0 -105
- package/src/components/WfoForms/formFields/deprecated/IpPrefixTableField.tsx +0 -390
- package/src/components/WfoForms/formFields/deprecated/IpPrefixTableFieldStyling.ts +0 -117
- package/src/components/WfoForms/formFields/deprecated/SplitPrefix.tsx +0 -138
- package/src/components/WfoForms/formFields/deprecated/SplitPrefixStyling.ts +0 -11
- package/src/components/WfoForms/formFields/deprecated/SubscriptionField.tsx +0 -263
- package/src/components/WfoForms/formFields/deprecated/SubscriptionFieldStyling.ts +0 -33
- package/src/components/WfoForms/formFields/deprecated/TimestampField.tsx +0 -110
- package/src/components/WfoForms/formFields/deprecated/VlanField.tsx +0 -300
- package/src/components/WfoForms/formFields/deprecated/index.ts +0 -15
- package/src/components/WfoForms/formFields/deprecated/types.ts +0 -74
- package/src/components/WfoForms/formFields/deprecated/utils.ts +0 -1
- package/src/components/WfoForms/formFields/index.ts +0 -30
- package/src/components/WfoForms/formFields/listFieldStyling.ts +0 -86
- package/src/components/WfoForms/formFields/types.ts +0 -41
- package/src/components/WfoForms/formFields/utils.spec.ts +0 -296
- package/src/components/WfoForms/formFields/utils.ts +0 -69
- package/src/components/WfoForms/index.ts +0 -5
- package/src/components/WfoWorkflowSteps/WfoStep/WfoStepFormOld.tsx +0 -67
- package/src/hooks/deprecated/useGetSurfSubcriptionDropdownOptions.ts +0 -37
- package/src/hooks/deprecated/useIsTaggedPort.ts +0 -25
- package/src/rtk/endpoints/deprecated/index.ts +0 -1
- package/src/rtk/endpoints/deprecated/surfSubscriptionDropdownOptions.ts +0 -53
- package/src/rtk/endpoints/formFields.ts +0 -131
- package/src/rtk/endpoints/ipam.ts +0 -54
- package/src/types/deprecated/SurfSubscriptionDropdownOptionsFilterParams.ts +0 -10
- package/src/types/deprecated/index.ts +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProductDefinition,
|
|
3
|
+
ProductLifecycleStatus,
|
|
3
4
|
StartOptionsResult,
|
|
4
5
|
WorkflowDefinition,
|
|
5
6
|
WorkflowTarget,
|
|
@@ -18,6 +19,7 @@ const workflowOptionsQuery = `
|
|
|
18
19
|
productId
|
|
19
20
|
name
|
|
20
21
|
tag
|
|
22
|
+
status
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -53,6 +55,7 @@ type WorkflowOptionsResult = StartOptionsResult<{
|
|
|
53
55
|
productId: ProductDefinition['productId'];
|
|
54
56
|
productType: ProductDefinition['productType'];
|
|
55
57
|
tag: ProductDefinition['tag'];
|
|
58
|
+
status: ProductDefinition['status'];
|
|
56
59
|
}[];
|
|
57
60
|
}>;
|
|
58
61
|
|
|
@@ -70,28 +73,38 @@ const startButtonOptionsApi = orchestratorApi.injectEndpoints({
|
|
|
70
73
|
endpoints: (build) => ({
|
|
71
74
|
getWorkflowOptions: build.query<
|
|
72
75
|
StartOptionsResponse<WorkflowOption>,
|
|
73
|
-
|
|
76
|
+
ProductLifecycleStatus | string
|
|
74
77
|
>({
|
|
75
78
|
query: () => ({
|
|
76
79
|
document: workflowOptionsQuery,
|
|
77
80
|
}),
|
|
78
81
|
transformResponse: (
|
|
79
82
|
response: WorkflowOptionsResult | undefined,
|
|
83
|
+
_,
|
|
84
|
+
productStatus,
|
|
80
85
|
) => {
|
|
86
|
+
const statusToMatch = (
|
|
87
|
+
productStatus ?? ProductLifecycleStatus.ACTIVE
|
|
88
|
+
).toLowerCase();
|
|
81
89
|
const startOptions: WorkflowOption[] = [];
|
|
82
90
|
const workflows = response?.workflows?.page || [];
|
|
83
91
|
workflows.forEach((workflow) => {
|
|
84
92
|
const workflowName = workflow.name;
|
|
85
|
-
workflow.products
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
workflow.products
|
|
94
|
+
.filter(
|
|
95
|
+
(product) =>
|
|
96
|
+
product.status.toLowerCase() === statusToMatch,
|
|
97
|
+
)
|
|
98
|
+
.forEach((product) => {
|
|
99
|
+
startOptions.push({
|
|
100
|
+
workflowName,
|
|
101
|
+
isAllowed: workflow.isAllowed,
|
|
102
|
+
productName: product.name,
|
|
103
|
+
productId: product.productId,
|
|
104
|
+
productType: product.productType,
|
|
105
|
+
productTag: product.tag,
|
|
106
|
+
});
|
|
93
107
|
});
|
|
94
|
-
});
|
|
95
108
|
});
|
|
96
109
|
|
|
97
110
|
return { startOptions };
|
package/src/types/index.ts
CHANGED
package/src/types/types.ts
CHANGED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { Context, GuaranteedProps } from 'uniforms';
|
|
2
|
-
import { AutoField } from 'uniforms-unstyled';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
AcceptField,
|
|
6
|
-
BoolField,
|
|
7
|
-
ConnectedSelectField,
|
|
8
|
-
ContactPersonNameField,
|
|
9
|
-
CustomerField,
|
|
10
|
-
DateField,
|
|
11
|
-
DividerField,
|
|
12
|
-
FileUploadField,
|
|
13
|
-
ImsNodeIdField,
|
|
14
|
-
ImsPortIdField,
|
|
15
|
-
IpNetworkField,
|
|
16
|
-
LabelField,
|
|
17
|
-
ListField,
|
|
18
|
-
LocationCodeField,
|
|
19
|
-
LongTextField,
|
|
20
|
-
NestField,
|
|
21
|
-
NumField,
|
|
22
|
-
OptGroupField,
|
|
23
|
-
RadioField,
|
|
24
|
-
SubscriptionField,
|
|
25
|
-
SubscriptionSummaryField,
|
|
26
|
-
SummaryField,
|
|
27
|
-
TextField,
|
|
28
|
-
TimestampField,
|
|
29
|
-
VlanField,
|
|
30
|
-
} from './formFields';
|
|
31
|
-
|
|
32
|
-
export function autoFieldFunction(
|
|
33
|
-
props: GuaranteedProps<unknown> & Record<string, unknown>,
|
|
34
|
-
uniforms: Context<Record<string, unknown>>,
|
|
35
|
-
) {
|
|
36
|
-
const { allowedValues, checkboxes, fieldType, field } = props;
|
|
37
|
-
const { format } = field;
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
Note, uniforms adds the fieldType property with one of the primitive types (Number, String..) based on the value of "type" in
|
|
41
|
-
node_modules/uniforms-bridge-json-schema/src/JSONSchemaBridge.ts. The only exception being dateFields where it matches on the
|
|
42
|
-
"format" field being "date-time" to populate fieldType with a Date constructor
|
|
43
|
-
*/
|
|
44
|
-
switch (fieldType) {
|
|
45
|
-
case Number:
|
|
46
|
-
switch (format) {
|
|
47
|
-
case 'imsPortId': // Deprecated
|
|
48
|
-
return ImsPortIdField;
|
|
49
|
-
case 'imsNodeId': // Deprecated
|
|
50
|
-
return ImsNodeIdField;
|
|
51
|
-
case 'timestamp':
|
|
52
|
-
return TimestampField; // Deprecated
|
|
53
|
-
}
|
|
54
|
-
break;
|
|
55
|
-
case Object:
|
|
56
|
-
switch (format) {
|
|
57
|
-
case 'optGroup':
|
|
58
|
-
return OptGroupField;
|
|
59
|
-
case 'summary':
|
|
60
|
-
return SummaryField;
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
case String:
|
|
64
|
-
switch (format) {
|
|
65
|
-
case 'subscriptionId':
|
|
66
|
-
return SubscriptionField;
|
|
67
|
-
case 'long':
|
|
68
|
-
return LongTextField;
|
|
69
|
-
case 'label':
|
|
70
|
-
return LabelField;
|
|
71
|
-
case 'divider':
|
|
72
|
-
return DividerField;
|
|
73
|
-
case 'summary':
|
|
74
|
-
return SummaryField;
|
|
75
|
-
case 'subscription':
|
|
76
|
-
return SubscriptionSummaryField;
|
|
77
|
-
case 'customerId':
|
|
78
|
-
return CustomerField;
|
|
79
|
-
case 'locationCode':
|
|
80
|
-
return LocationCodeField;
|
|
81
|
-
case 'contactPersonName': // Deprecated
|
|
82
|
-
return ContactPersonNameField;
|
|
83
|
-
case 'vlan': // Deprecated
|
|
84
|
-
return VlanField;
|
|
85
|
-
case 'accept':
|
|
86
|
-
return AcceptField;
|
|
87
|
-
case 'ipvanynetwork': // Deprecated
|
|
88
|
-
return IpNetworkField;
|
|
89
|
-
case 'file': // Deprecated
|
|
90
|
-
return FileUploadField;
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (allowedValues && format !== 'accept') {
|
|
96
|
-
return checkboxes && fieldType !== Array
|
|
97
|
-
? RadioField
|
|
98
|
-
: ConnectedSelectField;
|
|
99
|
-
} else {
|
|
100
|
-
switch (fieldType) {
|
|
101
|
-
case Array:
|
|
102
|
-
return ListField;
|
|
103
|
-
case Boolean:
|
|
104
|
-
return BoolField;
|
|
105
|
-
case Number:
|
|
106
|
-
return NumField;
|
|
107
|
-
case Object:
|
|
108
|
-
return NestField;
|
|
109
|
-
case String:
|
|
110
|
-
return TextField;
|
|
111
|
-
case Date:
|
|
112
|
-
// See the note at line above about how Date fields are matched on the "format" field instead of "type" like other fields
|
|
113
|
-
return DateField;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return AutoField.defaultComponentDetector(props, uniforms);
|
|
118
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2019-2023 SURF.
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
*
|
|
8
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
* See the License for the specific language governing permissions and
|
|
12
|
-
* limitations under the License.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
import { ComponentType, createElement } from 'react';
|
|
16
|
-
|
|
17
|
-
import { useForm } from 'uniforms';
|
|
18
|
-
import { AutoField } from 'uniforms-unstyled';
|
|
19
|
-
|
|
20
|
-
export type AutoFieldsProps = {
|
|
21
|
-
autoField?: ComponentType<{ className: string; name: string }>;
|
|
22
|
-
element?: ComponentType<object> | string;
|
|
23
|
-
fields?: string[];
|
|
24
|
-
omitFields?: string[];
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default function AutoFields({
|
|
28
|
-
autoField = AutoField,
|
|
29
|
-
element = 'section',
|
|
30
|
-
fields,
|
|
31
|
-
omitFields = [],
|
|
32
|
-
...props
|
|
33
|
-
}: AutoFieldsProps) {
|
|
34
|
-
const { schema } = useForm();
|
|
35
|
-
|
|
36
|
-
return createElement(
|
|
37
|
-
element,
|
|
38
|
-
{ ...props },
|
|
39
|
-
(fields ?? schema.getSubfields())
|
|
40
|
-
.filter((field) => !omitFields.includes(field))
|
|
41
|
-
.map((field) =>
|
|
42
|
-
createElement(autoField, {
|
|
43
|
-
key: field,
|
|
44
|
-
name: field,
|
|
45
|
-
className: 'form-input',
|
|
46
|
-
}),
|
|
47
|
-
),
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2019-2023 SURF.
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
*
|
|
8
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
* See the License for the specific language governing permissions and
|
|
12
|
-
* limitations under the License.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
16
|
-
|
|
17
|
-
import { UserInputFormWizard } from '@/components';
|
|
18
|
-
import { handlePromiseErrorWithCallback } from '@/rtk';
|
|
19
|
-
import { useStartFormMutation } from '@/rtk/endpoints/forms';
|
|
20
|
-
import { Form, FormNotCompleteResponse } from '@/types/forms';
|
|
21
|
-
|
|
22
|
-
interface IProps {
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
24
|
-
preselectedInput?: unknown;
|
|
25
|
-
formKey: string;
|
|
26
|
-
handleSubmit: (userInputs: any) => void;
|
|
27
|
-
handleCancel?: () => void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function CreateForm(props: IProps) {
|
|
31
|
-
const { preselectedInput, formKey, handleSubmit, handleCancel } = props;
|
|
32
|
-
const [form, setForm] = useState<Form>({});
|
|
33
|
-
const { stepUserInput, hasNext } = form;
|
|
34
|
-
const [startForm] = useStartFormMutation();
|
|
35
|
-
|
|
36
|
-
const submit = useCallback(
|
|
37
|
-
(userInputs: object[]) => {
|
|
38
|
-
return startForm({ formKey, userInputs })
|
|
39
|
-
.unwrap()
|
|
40
|
-
.then((form) => {
|
|
41
|
-
handleSubmit(form);
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
[formKey, handleSubmit, startForm],
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (formKey) {
|
|
49
|
-
handlePromiseErrorWithCallback<FormNotCompleteResponse>(
|
|
50
|
-
submit([]),
|
|
51
|
-
510,
|
|
52
|
-
(json) => {
|
|
53
|
-
setForm({
|
|
54
|
-
stepUserInput: json.form,
|
|
55
|
-
hasNext: json.meta?.hasNext ?? false,
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
}, [formKey, submit, preselectedInput]);
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div>
|
|
64
|
-
{stepUserInput && (
|
|
65
|
-
<UserInputFormWizard
|
|
66
|
-
stepUserInput={stepUserInput}
|
|
67
|
-
stepSubmit={submit}
|
|
68
|
-
cancel={handleCancel}
|
|
69
|
-
hasNext={hasNext ?? false}
|
|
70
|
-
isTask={false}
|
|
71
|
-
/>
|
|
72
|
-
)}
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
}
|