@orchestrator-ui/orchestrator-ui-components 6.8.0 → 7.0.1

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 (101) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +5 -2
  3. package/.turbo/turbo-test.log +9 -10
  4. package/CHANGELOG.md +19 -0
  5. package/dist/index.d.ts +164 -4306
  6. package/dist/index.js +1739 -5747
  7. package/dist/index.js.map +1 -1
  8. package/package.json +4 -8
  9. package/src/components/WfoPydanticForm/Footer.tsx +33 -6
  10. package/src/components/WfoPydanticForm/RenderFormErrors.tsx +2 -1
  11. package/src/components/WfoPydanticForm/Row.tsx +3 -1
  12. package/src/components/WfoPydanticForm/fields/WfoInteger.tsx +5 -1
  13. package/src/components/WfoPydanticForm/fields/WfoSummary.tsx +3 -5
  14. package/src/components/WfoPydanticForm/fields/styles.ts +72 -0
  15. package/src/components/WfoSearchPage/WfoSearch/WfoSearch.tsx +42 -54
  16. package/src/components/WfoSearchPage/utils.ts +9 -1
  17. package/src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx +10 -27
  18. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx +1 -1
  19. package/src/components/index.ts +0 -1
  20. package/src/configuration/version.ts +1 -1
  21. package/src/contexts/OrchestratorConfigContext.tsx +0 -1
  22. package/src/hooks/useSearch.ts +12 -2
  23. package/src/hooks/useSearchPagination.ts +4 -0
  24. package/src/messages/en-GB.json +5 -3
  25. package/src/pages/processes/WfoStartProcessPage.tsx +5 -107
  26. package/src/rtk/endpoints/index.ts +0 -2
  27. package/src/rtk/endpoints/search.ts +13 -4
  28. package/src/types/index.ts +0 -1
  29. package/src/types/search.ts +7 -0
  30. package/src/types/types.ts +0 -1
  31. package/src/components/WfoForms/AutoFieldLoader.tsx +0 -118
  32. package/src/components/WfoForms/AutoFields.tsx +0 -49
  33. package/src/components/WfoForms/CreateForm.tsx +0 -75
  34. package/src/components/WfoForms/UserInputForm.tsx +0 -697
  35. package/src/components/WfoForms/UserInputFormStyling.ts +0 -80
  36. package/src/components/WfoForms/UserInputFormWizard.tsx +0 -127
  37. package/src/components/WfoForms/formFields/AcceptField.tsx +0 -243
  38. package/src/components/WfoForms/formFields/AcceptFieldStyling.ts +0 -35
  39. package/src/components/WfoForms/formFields/BoolField.tsx +0 -77
  40. package/src/components/WfoForms/formFields/BoolFieldStyling.ts +0 -64
  41. package/src/components/WfoForms/formFields/ConnectedSelectField.tsx +0 -19
  42. package/src/components/WfoForms/formFields/CustomerField.tsx +0 -77
  43. package/src/components/WfoForms/formFields/DateField.tsx +0 -72
  44. package/src/components/WfoForms/formFields/DividerField.tsx +0 -29
  45. package/src/components/WfoForms/formFields/ErrorField.tsx +0 -40
  46. package/src/components/WfoForms/formFields/ErrorsField.tsx +0 -34
  47. package/src/components/WfoForms/formFields/LabelField.tsx +0 -43
  48. package/src/components/WfoForms/formFields/ListAddField.tsx +0 -95
  49. package/src/components/WfoForms/formFields/ListDelField.tsx +0 -95
  50. package/src/components/WfoForms/formFields/ListField.tsx +0 -117
  51. package/src/components/WfoForms/formFields/ListItemField.tsx +0 -40
  52. package/src/components/WfoForms/formFields/ListSelectField.tsx +0 -95
  53. package/src/components/WfoForms/formFields/LocationCodeField.tsx +0 -60
  54. package/src/components/WfoForms/formFields/LongTextField.tsx +0 -68
  55. package/src/components/WfoForms/formFields/NestField.tsx +0 -107
  56. package/src/components/WfoForms/formFields/NumField.tsx +0 -85
  57. package/src/components/WfoForms/formFields/OptGroupField.tsx +0 -74
  58. package/src/components/WfoForms/formFields/RadioField.tsx +0 -87
  59. package/src/components/WfoForms/formFields/SelectField/SelectField.tsx +0 -177
  60. package/src/components/WfoForms/formFields/SelectField/index.ts +0 -1
  61. package/src/components/WfoForms/formFields/SelectField/styles.ts +0 -52
  62. package/src/components/WfoForms/formFields/SubmitField.tsx +0 -50
  63. package/src/components/WfoForms/formFields/SubscriptionSummaryField.tsx +0 -74
  64. package/src/components/WfoForms/formFields/SummaryField.tsx +0 -104
  65. package/src/components/WfoForms/formFields/SummaryFieldStyling.ts +0 -44
  66. package/src/components/WfoForms/formFields/TextField.tsx +0 -81
  67. package/src/components/WfoForms/formFields/commonStyles.ts +0 -32
  68. package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocomplete.tsx +0 -99
  69. package/src/components/WfoForms/formFields/deprecated/ContactPersonAutocompleteStyles.ts +0 -41
  70. package/src/components/WfoForms/formFields/deprecated/ContactPersonNameField.tsx +0 -263
  71. package/src/components/WfoForms/formFields/deprecated/FileUploadField.tsx +0 -151
  72. package/src/components/WfoForms/formFields/deprecated/ImsNodeIdField.tsx +0 -109
  73. package/src/components/WfoForms/formFields/deprecated/ImsPortIdField.tsx +0 -233
  74. package/src/components/WfoForms/formFields/deprecated/ImsPortIdFieldStyling.ts +0 -17
  75. package/src/components/WfoForms/formFields/deprecated/IpNetworkField.tsx +0 -105
  76. package/src/components/WfoForms/formFields/deprecated/IpPrefixTableField.tsx +0 -390
  77. package/src/components/WfoForms/formFields/deprecated/IpPrefixTableFieldStyling.ts +0 -117
  78. package/src/components/WfoForms/formFields/deprecated/SplitPrefix.tsx +0 -138
  79. package/src/components/WfoForms/formFields/deprecated/SplitPrefixStyling.ts +0 -11
  80. package/src/components/WfoForms/formFields/deprecated/SubscriptionField.tsx +0 -263
  81. package/src/components/WfoForms/formFields/deprecated/SubscriptionFieldStyling.ts +0 -33
  82. package/src/components/WfoForms/formFields/deprecated/TimestampField.tsx +0 -110
  83. package/src/components/WfoForms/formFields/deprecated/VlanField.tsx +0 -300
  84. package/src/components/WfoForms/formFields/deprecated/index.ts +0 -15
  85. package/src/components/WfoForms/formFields/deprecated/types.ts +0 -74
  86. package/src/components/WfoForms/formFields/deprecated/utils.ts +0 -1
  87. package/src/components/WfoForms/formFields/index.ts +0 -30
  88. package/src/components/WfoForms/formFields/listFieldStyling.ts +0 -86
  89. package/src/components/WfoForms/formFields/types.ts +0 -41
  90. package/src/components/WfoForms/formFields/utils.spec.ts +0 -296
  91. package/src/components/WfoForms/formFields/utils.ts +0 -69
  92. package/src/components/WfoForms/index.ts +0 -5
  93. package/src/components/WfoWorkflowSteps/WfoStep/WfoStepFormOld.tsx +0 -67
  94. package/src/hooks/deprecated/useGetSurfSubcriptionDropdownOptions.ts +0 -37
  95. package/src/hooks/deprecated/useIsTaggedPort.ts +0 -25
  96. package/src/rtk/endpoints/deprecated/index.ts +0 -1
  97. package/src/rtk/endpoints/deprecated/surfSubscriptionDropdownOptions.ts +0 -53
  98. package/src/rtk/endpoints/formFields.ts +0 -131
  99. package/src/rtk/endpoints/ipam.ts +0 -54
  100. package/src/types/deprecated/SurfSubscriptionDropdownOptionsFilterParams.ts +0 -10
  101. 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';