@orchestrator-ui/orchestrator-ui-components 6.8.0 → 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.
Files changed (92) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +8 -9
  4. package/CHANGELOG.md +10 -0
  5. package/dist/index.d.ts +155 -4305
  6. package/dist/index.js +1636 -5688
  7. package/dist/index.js.map +1 -1
  8. package/package.json +4 -8
  9. package/src/components/WfoPydanticForm/RenderFormErrors.tsx +2 -1
  10. package/src/components/WfoPydanticForm/Row.tsx +3 -1
  11. package/src/components/WfoPydanticForm/fields/WfoSummary.tsx +3 -5
  12. package/src/components/WfoPydanticForm/fields/styles.ts +72 -0
  13. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +10 -27
  14. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +1 -1
  15. package/src/components/index.ts +0 -1
  16. package/src/configuration/version.ts +1 -1
  17. package/src/contexts/OrchestratorConfigContext.tsx +0 -1
  18. package/src/pages/processes/WfoStartProcessPage.tsx +5 -107
  19. package/src/rtk/endpoints/index.ts +0 -2
  20. package/src/types/index.ts +0 -1
  21. package/src/types/types.ts +0 -1
  22. package/src/components/WfoForms/AutoFieldLoader.tsx +0 -118
  23. package/src/components/WfoForms/AutoFields.tsx +0 -49
  24. package/src/components/WfoForms/CreateForm.tsx +0 -75
  25. package/src/components/WfoForms/UserInputForm.tsx +0 -697
  26. package/src/components/WfoForms/UserInputFormStyling.ts +0 -80
  27. package/src/components/WfoForms/UserInputFormWizard.tsx +0 -127
  28. package/src/components/WfoForms/formFields/AcceptField.tsx +0 -243
  29. package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +0 -35
  30. package/src/components/WfoForms/formFields/BoolField.tsx +0 -77
  31. package/src/components/WfoForms/formFields/BoolFieldStyling.ts +0 -64
  32. package/src/components/WfoForms/formFields/ConnectedSelectField.tsx +0 -19
  33. package/src/components/WfoForms/formFields/CustomerField.tsx +0 -77
  34. package/src/components/WfoForms/formFields/DateField.tsx +0 -72
  35. package/src/components/WfoForms/formFields/DividerField.tsx +0 -29
  36. package/src/components/WfoForms/formFields/ErrorField.tsx +0 -40
  37. package/src/components/WfoForms/formFields/ErrorsField.tsx +0 -34
  38. package/src/components/WfoForms/formFields/LabelField.tsx +0 -43
  39. package/src/components/WfoForms/formFields/ListAddField.tsx +0 -95
  40. package/src/components/WfoForms/formFields/ListDelField.tsx +0 -95
  41. package/src/components/WfoForms/formFields/ListField.tsx +0 -117
  42. package/src/components/WfoForms/formFields/ListItemField.tsx +0 -40
  43. package/src/components/WfoForms/formFields/ListSelectField.tsx +0 -95
  44. package/src/components/WfoForms/formFields/LocationCodeField.tsx +0 -60
  45. package/src/components/WfoForms/formFields/LongTextField.tsx +0 -68
  46. package/src/components/WfoForms/formFields/NestField.tsx +0 -107
  47. package/src/components/WfoForms/formFields/NumField.tsx +0 -85
  48. package/src/components/WfoForms/formFields/OptGroupField.tsx +0 -74
  49. package/src/components/WfoForms/formFields/RadioField.tsx +0 -87
  50. package/src/components/WfoForms/formFields/SelectField/SelectField.tsx +0 -177
  51. package/src/components/WfoForms/formFields/SelectField/index.ts +0 -1
  52. package/src/components/WfoForms/formFields/SelectField/styles.ts +0 -52
  53. package/src/components/WfoForms/formFields/SubmitField.tsx +0 -50
  54. package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +0 -74
  55. package/src/components/WfoForms/formFields/SummaryField.tsx +0 -104
  56. package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +0 -44
  57. package/src/components/WfoForms/formFields/TextField.tsx +0 -81
  58. package/src/components/WfoForms/formFields/commonStyles.ts +0 -32
  59. package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocomplete.tsx +0 -99
  60. package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocompleteStyles.ts +0 -41
  61. package/src/components/WfoForms/formFields/deprecated/ContactPersonNameField.tsx +0 -263
  62. package/src/components/WfoForms/formFields/deprecated/FileUploadField.tsx +0 -151
  63. package/src/components/WfoForms/formFields/deprecated/ImsNodeIdField.tsx +0 -109
  64. package/src/components/WfoForms/formFields/deprecated/ImsPortIdField.tsx +0 -233
  65. package/src/components/WfoForms/formFields/deprecated/ImsPortIdFieldStyling.ts +0 -17
  66. package/src/components/WfoForms/formFields/deprecated/IpNetworkField.tsx +0 -105
  67. package/src/components/WfoForms/formFields/deprecated/IpPrefixTableField.tsx +0 -390
  68. package/src/components/WfoForms/formFields/deprecated/IpPrefixTableFieldStyling.ts +0 -117
  69. package/src/components/WfoForms/formFields/deprecated/SplitPrefix.tsx +0 -138
  70. package/src/components/WfoForms/formFields/deprecated/SplitPrefixStyling.ts +0 -11
  71. package/src/components/WfoForms/formFields/deprecated/SubscriptionField.tsx +0 -263
  72. package/src/components/WfoForms/formFields/deprecated/SubscriptionFieldStyling.ts +0 -33
  73. package/src/components/WfoForms/formFields/deprecated/TimestampField.tsx +0 -110
  74. package/src/components/WfoForms/formFields/deprecated/VlanField.tsx +0 -300
  75. package/src/components/WfoForms/formFields/deprecated/index.ts +0 -15
  76. package/src/components/WfoForms/formFields/deprecated/types.ts +0 -74
  77. package/src/components/WfoForms/formFields/deprecated/utils.ts +0 -1
  78. package/src/components/WfoForms/formFields/index.ts +0 -30
  79. package/src/components/WfoForms/formFields/listFieldStyling.ts +0 -86
  80. package/src/components/WfoForms/formFields/types.ts +0 -41
  81. package/src/components/WfoForms/formFields/utils.spec.ts +0 -296
  82. package/src/components/WfoForms/formFields/utils.ts +0 -69
  83. package/src/components/WfoForms/index.ts +0 -5
  84. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepFormOld.tsx +0 -67
  85. package/src/hooks/deprecated/useGetSurfSubcriptionDropdownOptions.ts +0 -37
  86. package/src/hooks/deprecated/useIsTaggedPort.ts +0 -25
  87. package/src/rtk/endpoints/deprecated/index.ts +0 -1
  88. package/src/rtk/endpoints/deprecated/surfSubscriptionDropdownOptions.ts +0 -53
  89. package/src/rtk/endpoints/formFields.ts +0 -131
  90. package/src/rtk/endpoints/ipam.ts +0 -54
  91. package/src/types/deprecated/SurfSubscriptionDropdownOptionsFilterParams.ts +0 -10
  92. package/src/types/deprecated/index.ts +0 -1
@@ -1,37 +0,0 @@
1
- import { useGetSurfSubscriptionDropdownOptionsQuery } from '@/rtk/endpoints/deprecated/surfSubscriptionDropdownOptions';
2
- import { SurfSubscriptionDropdownOptionsFilterParams } from '@/types';
3
-
4
- export const useGetSurfSubscriptionDropdownOptions = (
5
- tags: string[] = [],
6
- statuses: string[] = ['active'],
7
- productIds: string[] = [],
8
- excludeSubscriptionIds: string[] = [],
9
- customerId?: string,
10
- portModes: string[] = [],
11
- bandwidth?: number,
12
- ) => {
13
- const filter_params: SurfSubscriptionDropdownOptionsFilterParams = {
14
- product_tags: tags,
15
- statuses,
16
- product_ids: productIds,
17
- exclude_subscription_ids: excludeSubscriptionIds,
18
- port_modes: portModes,
19
- bandwidth,
20
- };
21
-
22
- if (customerId) {
23
- filter_params.customer_ids = [customerId];
24
- }
25
-
26
- const { data, isFetching, refetch, isError } =
27
- useGetSurfSubscriptionDropdownOptionsQuery({ params: filter_params });
28
-
29
- const options = (() => {
30
- if (!isFetching && !isError && data) {
31
- return data;
32
- }
33
- return [];
34
- })();
35
-
36
- return { isFetching, refetch, options };
37
- };
@@ -1,25 +0,0 @@
1
- import {
2
- subscriptionHasTaggedPortModeInstanceValue,
3
- subscriptionHasTaggedProduct,
4
- } from '@/components/WfoForms/formFields/utils';
5
- import { useGetSubscriptionDetailQuery } from '@/rtk/endpoints/subscriptionDetail';
6
-
7
- export const useIsTaggedPort = (subscriptionId: string): [boolean, boolean] => {
8
- const { data, isFetching } = useGetSubscriptionDetailQuery(
9
- { subscriptionId },
10
- { skip: !subscriptionId },
11
- );
12
- const subscriptionDetail = data?.subscription;
13
-
14
- // The ports portMode is tagged (with a vlan) when:
15
- // - The subscription contains a productBlockInstance with a productBlockInstanceValue with the property port_mode and
16
- // its value is 'tagged': subscriptionHasTaggedProduct: subscriptionHasPortModeInstanceValue
17
- // - The subscriptions product tag is MSC, MSCNL or IRBSP: subscriptionHasTaggedProduct
18
-
19
- const portIsTagged = subscriptionDetail
20
- ? subscriptionHasTaggedPortModeInstanceValue(subscriptionDetail) ||
21
- subscriptionHasTaggedProduct(subscriptionDetail)
22
- : false;
23
-
24
- return [!isFetching, portIsTagged];
25
- };
@@ -1 +0,0 @@
1
- export * from './surfSubscriptionDropdownOptions';
@@ -1,53 +0,0 @@
1
- import { SUBSCRIPTION_DROPDOWN_OPTIONS_ENDPOINT } from '@/configuration';
2
- import { BaseQueryTypes, orchestratorApi } from '@/rtk';
3
- import { Option } from '@/types';
4
- import { SurfSubscriptionDropdownOptionsFilterParams } from '@/types';
5
-
6
- // Custom endpoint used by the deprecated SubscriptionField formfield.
7
- // Has to be present in the library for now.
8
- // In the future, pydantic-forms will make it possible to add/override custom endpoints in the app implementation.
9
-
10
- /**
11
- * Serialize URL parameters object to a string.
12
- *
13
- * @param params Object with url parameters, values can be scalar or array, i.e. {a: [1, 2], b: [3], c: 4}
14
- * @returns the url parameter string, i.e. ?a=1&a=2&b=3&c=4
15
- */
16
- export function toUrlParams(params: Record<string, unknown>): string {
17
- const urlParams = new URLSearchParams();
18
-
19
- Object.entries(params).forEach(([key, value]) => {
20
- if (Array.isArray(value)) {
21
- value.forEach((v) => {
22
- urlParams.append(key, String(v));
23
- });
24
- } else if (value !== undefined) {
25
- urlParams.append(key, String(value));
26
- }
27
- });
28
-
29
- return urlParams.toString();
30
- }
31
-
32
- const surfSubscriptionDropdownOptionsApi = orchestratorApi.injectEndpoints({
33
- endpoints: (build) => ({
34
- getSurfSubscriptionDropdownOptions: build.query<
35
- Option<string>[],
36
- { params: SurfSubscriptionDropdownOptionsFilterParams }
37
- >({
38
- query: ({ params }) => ({
39
- url: SUBSCRIPTION_DROPDOWN_OPTIONS_ENDPOINT,
40
- params: params,
41
- }),
42
- extraOptions: {
43
- baseQueryType: BaseQueryTypes.fetch,
44
- paramsSerializer: toUrlParams,
45
- },
46
- }),
47
- }),
48
- });
49
-
50
- export const {
51
- useGetSurfSubscriptionDropdownOptionsQuery,
52
- useLazyGetSurfSubscriptionDropdownOptionsQuery,
53
- } = surfSubscriptionDropdownOptionsApi;
@@ -1,131 +0,0 @@
1
- import {
2
- ImsNode,
3
- ImsPort,
4
- NodeSubscriptionOption,
5
- NodeSubscriptionOptionsResult,
6
- VlanRange,
7
- } from '@/components';
8
- import { ContactPerson } from '@/components/WfoForms/formFields/types';
9
- import { NUMBER_OF_ITEMS_REPRESENTING_ALL_ITEMS } from '@/configuration';
10
- import { BaseQueryTypes, orchestratorApi } from '@/rtk';
11
-
12
- const LOCATION_CODES_ENDPOINT = 'surf/crm/location_codes';
13
- const CONTACT_PERSONS_ENDPOINT = 'surf/crm/contacts';
14
- const IMS_NODES_ENDPOINT = '/surf/ims/nodes';
15
- const VLANS_BY_SERVICE_PORT = 'surf/subscriptions/vlans-by-service-port';
16
- const FREE_PORTS_BY_NODE_SUBSCRIPTION_AND_SPEED = 'surf/ims/free_ports';
17
-
18
- const nodeSubscriptionsQuery = `query NodeSubscriptions(
19
- $statuses: String!
20
- ) {
21
- subscriptions(filterBy: [
22
- {field: "tag", value: "Node"},
23
- {field: "status", value: $statuses}
24
-
25
- ], first: ${NUMBER_OF_ITEMS_REPRESENTING_ALL_ITEMS}, after: 0) {
26
- page {
27
- description
28
- subscriptionId
29
- }
30
- }
31
- }`;
32
-
33
- const formFieldsApi = orchestratorApi.injectEndpoints({
34
- endpoints: (build) => ({
35
- locationCodes: build.query<string[], void>({
36
- query: () => ({
37
- url: `${LOCATION_CODES_ENDPOINT}`,
38
- method: 'GET',
39
- headers: {
40
- 'Content-Type': 'application/json',
41
- },
42
- }),
43
- extraOptions: {
44
- baseQueryType: BaseQueryTypes.fetch,
45
- },
46
- }),
47
- contactPersons: build.query<
48
- ContactPerson[],
49
- { customerIdValue: string }
50
- >({
51
- query: ({ customerIdValue }) => ({
52
- url: `${CONTACT_PERSONS_ENDPOINT}/${customerIdValue}`,
53
- method: 'GET',
54
- headers: {
55
- 'Content-Type': 'application/json',
56
- },
57
- }),
58
- extraOptions: {
59
- baseQueryType: BaseQueryTypes.fetch,
60
- },
61
- }),
62
- imsNodes: build.query<
63
- ImsNode[],
64
- { locationCode: string; status: string; unsubscribedOnly: boolean }
65
- >({
66
- query: ({ locationCode, status, unsubscribedOnly }) => ({
67
- url: `${IMS_NODES_ENDPOINT}/${locationCode}/${status}?unsubscribed_only=${unsubscribedOnly}`,
68
- method: 'GET',
69
- headers: {
70
- 'Content-Type': 'application/json',
71
- },
72
- }),
73
- extraOptions: {
74
- baseQueryType: BaseQueryTypes.fetch,
75
- },
76
- }),
77
- vlansByServicePort: build.query<
78
- VlanRange[],
79
- { subscriptionId: string; nsiVlansOnly: boolean }
80
- >({
81
- query: ({ subscriptionId, nsiVlansOnly }) => ({
82
- url: `${VLANS_BY_SERVICE_PORT}/${subscriptionId}?nsi_vlans_only=${nsiVlansOnly}`,
83
- method: 'GET',
84
- headers: {
85
- 'Content-Type': 'application/json',
86
- },
87
- }),
88
- extraOptions: {
89
- baseQueryType: BaseQueryTypes.fetch,
90
- },
91
- }),
92
- freePortsByNodeSubscriptionIdAndSpeed: build.query<
93
- ImsPort[],
94
- { nodeSubscriptionId: string; interfaceSpeed: number; mode: string }
95
- >({
96
- query: ({ nodeSubscriptionId, interfaceSpeed, mode }) => ({
97
- url: `${FREE_PORTS_BY_NODE_SUBSCRIPTION_AND_SPEED}/${nodeSubscriptionId}/${interfaceSpeed}/${mode}`,
98
- method: 'GET',
99
- headers: {
100
- 'Content-Type': 'application/json',
101
- },
102
- }),
103
- extraOptions: {
104
- baseQueryType: BaseQueryTypes.fetch,
105
- },
106
- }),
107
- getNodeSubscriptionOptions: build.query<
108
- NodeSubscriptionOption[],
109
- { statuses: string }
110
- >({
111
- query: ({ statuses }) => ({
112
- document: nodeSubscriptionsQuery,
113
- variables: {
114
- statuses,
115
- },
116
- }),
117
- transformResponse: (
118
- response: NodeSubscriptionOptionsResult,
119
- ): NodeSubscriptionOption[] => response?.subscriptions?.page || [],
120
- }),
121
- }),
122
- });
123
-
124
- export const {
125
- useLocationCodesQuery,
126
- useContactPersonsQuery,
127
- useImsNodesQuery,
128
- useVlansByServicePortQuery,
129
- useFreePortsByNodeSubscriptionIdAndSpeedQuery,
130
- useGetNodeSubscriptionOptionsQuery,
131
- } = formFieldsApi;
@@ -1,54 +0,0 @@
1
- import { IpBlock, IpPrefix } from '@/components';
2
- import {
3
- IPAM_FREE_SUBNETS_ENDPOINT,
4
- IPAM_IP_BLOCKS_ENDPOINT,
5
- IPAM_PREFIX_FILTERS_ENDPOINT,
6
- } from '@/configuration';
7
- import { BaseQueryTypes, orchestratorApi } from '@/rtk';
8
-
9
- const ipamApi = orchestratorApi.injectEndpoints({
10
- endpoints: (build) => ({
11
- prefixFilters: build.query<IpPrefix[], void>({
12
- query: () => ({
13
- url: `${IPAM_PREFIX_FILTERS_ENDPOINT}`,
14
- method: 'GET',
15
- headers: {
16
- 'Content-Type': 'application/json',
17
- },
18
- }),
19
- extraOptions: {
20
- baseQueryType: BaseQueryTypes.fetch,
21
- },
22
- }),
23
- ipBlocks: build.query<IpBlock[], { parentPrefix: number }>({
24
- query: ({ parentPrefix }) => ({
25
- url: `${IPAM_IP_BLOCKS_ENDPOINT}/${parentPrefix}`,
26
- method: 'GET',
27
- headers: {
28
- 'Content-Type': 'application/json',
29
- },
30
- }),
31
- extraOptions: {
32
- baseQueryType: BaseQueryTypes.fetch,
33
- },
34
- }),
35
- freeSubnets: build.query<
36
- string[],
37
- { subnet: string; netmask: number; prefixLen: number }
38
- >({
39
- query: ({ subnet, netmask, prefixLen }) => ({
40
- url: `${IPAM_FREE_SUBNETS_ENDPOINT}/${subnet}/${netmask}/${prefixLen}`,
41
- method: 'GET',
42
- headers: {
43
- 'Content-Type': 'application/json',
44
- },
45
- }),
46
- extraOptions: {
47
- baseQueryType: BaseQueryTypes.fetch,
48
- },
49
- }),
50
- }),
51
- });
52
-
53
- export const { usePrefixFiltersQuery, useIpBlocksQuery, useFreeSubnetsQuery } =
54
- ipamApi;
@@ -1,10 +0,0 @@
1
- export type SurfSubscriptionDropdownOptionsFilterParams = {
2
- product_tags?: string[];
3
- product_ids?: string[];
4
- statuses?: string[];
5
- exclude_subscription_ids?: string[];
6
- customer_ids?: string[];
7
-
8
- port_modes?: string[];
9
- bandwidth?: number;
10
- };
@@ -1 +0,0 @@
1
- export * from './SurfSubscriptionDropdownOptionsFilterParams';