@orchestrator-ui/orchestrator-ui-components 0.5.1 → 0.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 +4 -4
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +8 -8
- package/CHANGELOG.md +15 -0
- package/dist/index.d.ts +16 -16
- package/dist/index.js +395 -407
- package/package.json +1 -1
- package/src/components/WfoForms/AutoFieldLoader.tsx +3 -3
- package/src/components/WfoForms/UserInputForm.tsx +5 -5
- package/src/components/WfoForms/formFields/ContactPersonNameField.tsx +21 -23
- package/src/components/WfoForms/formFields/{OrganisationField.tsx → CustomerField.tsx} +5 -5
- package/src/components/WfoForms/formFields/SubscriptionField.tsx +15 -15
- package/src/components/WfoForms/formFields/SummaryField.tsx +1 -2
- package/src/components/WfoForms/formFields/index.ts +1 -1
- package/src/components/WfoProcessList/WfoProcessesList.tsx +7 -3
- package/src/components/WfoSubscription/subscriptionDetailTabs.tsx +6 -6
- package/src/graphqlQueries/processDetailQuery.ts +1 -8
- package/src/messages/en-GB.json +3 -3
- package/src/messages/nl-NL.json +3 -3
- package/src/pages/tasks/WfoTasksListPage.tsx +28 -13
- package/src/rtk/endpoints/customers.ts +2 -2
- package/src/rtk/storeProvider.tsx +4 -8
- package/src/components/WfoPageHeader/WfoPageHeader.tsx +0 -25
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
AcceptField,
|
|
6
6
|
BoolField,
|
|
7
7
|
ContactPersonNameField,
|
|
8
|
+
CustomerField,
|
|
8
9
|
DateField,
|
|
9
10
|
DividerField,
|
|
10
11
|
ImsNodeIdField,
|
|
@@ -17,7 +18,6 @@ import {
|
|
|
17
18
|
NestField,
|
|
18
19
|
NumField,
|
|
19
20
|
OptGroupField,
|
|
20
|
-
OrganisationField,
|
|
21
21
|
ProductField,
|
|
22
22
|
RadioField,
|
|
23
23
|
SelectField,
|
|
@@ -74,8 +74,8 @@ export function autoFieldFunction(
|
|
|
74
74
|
return SummaryField;
|
|
75
75
|
case 'subscription':
|
|
76
76
|
return SubscriptionSummaryField;
|
|
77
|
-
case '
|
|
78
|
-
return
|
|
77
|
+
case 'customerId':
|
|
78
|
+
return CustomerField;
|
|
79
79
|
case 'locationCode':
|
|
80
80
|
return LocationCodeField;
|
|
81
81
|
case 'contactPersonName': // Surf specific
|
|
@@ -361,14 +361,14 @@ function fillPreselection(form: JSONSchema6, router: NextRouter) {
|
|
|
361
361
|
if (form && form.properties) {
|
|
362
362
|
Object.keys(queryParams).forEach((param) => {
|
|
363
363
|
if (form && form.properties && form.properties[param]) {
|
|
364
|
-
const
|
|
364
|
+
const customerInput = form.properties[
|
|
365
365
|
param
|
|
366
366
|
] as UniformJSONSchemaProperty;
|
|
367
|
-
if (!
|
|
368
|
-
|
|
367
|
+
if (!customerInput.uniforms) {
|
|
368
|
+
customerInput.uniforms = {};
|
|
369
369
|
}
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
customerInput.uniforms.disabled = true;
|
|
371
|
+
customerInput.default = queryParams[param];
|
|
372
372
|
}
|
|
373
373
|
});
|
|
374
374
|
|
|
@@ -40,16 +40,19 @@ export function stop(e: React.SyntheticEvent) {
|
|
|
40
40
|
|
|
41
41
|
export type ContactPersonNameFieldProps = FieldProps<
|
|
42
42
|
string,
|
|
43
|
-
{
|
|
43
|
+
{
|
|
44
|
+
customerId?: string;
|
|
45
|
+
customerKey?: string;
|
|
46
|
+
}
|
|
44
47
|
>;
|
|
45
48
|
|
|
46
49
|
declare module 'uniforms' {
|
|
47
50
|
interface FilterDOMProps {
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
customerId: never;
|
|
52
|
+
customerKey: never;
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
filterDOMProps.register('
|
|
55
|
+
filterDOMProps.register('customerId', 'customerKey');
|
|
53
56
|
|
|
54
57
|
function ContactPersonName({
|
|
55
58
|
disabled,
|
|
@@ -65,8 +68,8 @@ function ContactPersonName({
|
|
|
65
68
|
error,
|
|
66
69
|
showInlineError,
|
|
67
70
|
errorMessage,
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
customerId,
|
|
72
|
+
customerKey,
|
|
70
73
|
...props
|
|
71
74
|
}: ContactPersonNameFieldProps) {
|
|
72
75
|
const axiosApiClient = useAxiosApiClient();
|
|
@@ -86,26 +89,21 @@ function ContactPersonName({
|
|
|
86
89
|
: name;
|
|
87
90
|
const contactsField = useField(useFieldName, {}, { absoluteName: true })[0];
|
|
88
91
|
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
contactsField.field.organisationKey ||
|
|
92
|
-
'organisation';
|
|
92
|
+
const customerIdFieldName =
|
|
93
|
+
customerKey || contactsField.field.customerKey || 'customer_id';
|
|
93
94
|
|
|
94
95
|
// Get initial value for org field if it exists (we cant really test)
|
|
95
|
-
let
|
|
96
|
+
let customerInitialValue;
|
|
96
97
|
try {
|
|
97
|
-
|
|
98
|
-
organisationFieldName,
|
|
99
|
-
{},
|
|
100
|
-
);
|
|
98
|
+
customerInitialValue = schema.getInitialValue(customerIdFieldName, {});
|
|
101
99
|
} catch {
|
|
102
|
-
|
|
100
|
+
customerInitialValue = '';
|
|
103
101
|
}
|
|
104
102
|
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
contactsField.field.
|
|
108
|
-
get(model,
|
|
103
|
+
const customerIdValue =
|
|
104
|
+
customerId ||
|
|
105
|
+
contactsField.field.customerId ||
|
|
106
|
+
get(model, customerIdFieldName, customerInitialValue);
|
|
109
107
|
|
|
110
108
|
const [displayAutocomplete, setDisplayAutocomplete] = useState(false);
|
|
111
109
|
const [contactPersons, setContactPersons] = useState<ContactPerson[]>([]);
|
|
@@ -126,10 +124,10 @@ function ContactPersonName({
|
|
|
126
124
|
: [];
|
|
127
125
|
|
|
128
126
|
useEffect(() => {
|
|
129
|
-
if (
|
|
127
|
+
if (customerIdValue) {
|
|
130
128
|
axiosApiClient
|
|
131
129
|
.axiosFetch<ContactPerson[]>(
|
|
132
|
-
`/surf/crm/contacts/${
|
|
130
|
+
`/surf/crm/contacts/${customerIdValue}`,
|
|
133
131
|
{},
|
|
134
132
|
{},
|
|
135
133
|
false,
|
|
@@ -143,7 +141,7 @@ function ContactPersonName({
|
|
|
143
141
|
setContactPersons([]);
|
|
144
142
|
});
|
|
145
143
|
}
|
|
146
|
-
}, [
|
|
144
|
+
}, [customerIdValue, axiosApiClient]);
|
|
147
145
|
|
|
148
146
|
useEffect(() => {
|
|
149
147
|
// Set focus to the last name component to be created
|
|
@@ -21,12 +21,12 @@ import { useGetCustomersQuery } from '@/rtk/endpoints';
|
|
|
21
21
|
|
|
22
22
|
import { SelectField, SelectFieldProps } from './SelectField';
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type CustomerFieldProps = Omit<
|
|
25
25
|
SelectFieldProps,
|
|
26
26
|
'placeholder' | 'transform' | 'allowedValues'
|
|
27
27
|
>;
|
|
28
28
|
|
|
29
|
-
function
|
|
29
|
+
function Customer({ ...props }: CustomerFieldProps) {
|
|
30
30
|
const t = useTranslations('pydanticForms');
|
|
31
31
|
|
|
32
32
|
const { data: customers, isLoading } = useGetCustomersQuery();
|
|
@@ -47,11 +47,11 @@ function Organisation({ ...props }: OrganisationFieldProps) {
|
|
|
47
47
|
disabled={isLoading}
|
|
48
48
|
placeholder={
|
|
49
49
|
!isLoading
|
|
50
|
-
? t('widgets.
|
|
51
|
-
: t('widgets.
|
|
50
|
+
? t('widgets.customer.placeholder')
|
|
51
|
+
: t('widgets.customer.loading')
|
|
52
52
|
}
|
|
53
53
|
/>
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export const
|
|
57
|
+
export const CustomerField = connectField(Customer, { kind: 'leaf' });
|
|
@@ -45,8 +45,8 @@ import { getPortMode } from './utils';
|
|
|
45
45
|
declare module 'uniforms' {
|
|
46
46
|
interface FilterDOMProps {
|
|
47
47
|
excludedSubscriptionIds: never;
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
customerId: never;
|
|
49
|
+
customerKey: never;
|
|
50
50
|
visiblePortMode: never;
|
|
51
51
|
bandwidth: never;
|
|
52
52
|
bandwidthKey: never;
|
|
@@ -57,8 +57,8 @@ declare module 'uniforms' {
|
|
|
57
57
|
filterDOMProps.register(
|
|
58
58
|
'productIds',
|
|
59
59
|
'excludedSubscriptionIds',
|
|
60
|
-
'
|
|
61
|
-
'
|
|
60
|
+
'customerId',
|
|
61
|
+
'customerKey',
|
|
62
62
|
'visiblePortMode',
|
|
63
63
|
'bandwidth',
|
|
64
64
|
'bandwidthKey',
|
|
@@ -71,8 +71,8 @@ export type SubscriptionFieldProps = FieldProps<
|
|
|
71
71
|
{
|
|
72
72
|
productIds?: string[];
|
|
73
73
|
excludedSubscriptionIds?: string[];
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
customerId?: string;
|
|
75
|
+
customerKey?: string;
|
|
76
76
|
visiblePortMode?: string;
|
|
77
77
|
bandwidth?: number;
|
|
78
78
|
bandwidthKey?: string;
|
|
@@ -96,8 +96,8 @@ function SubscriptionFieldDefinition({
|
|
|
96
96
|
className = '',
|
|
97
97
|
productIds = [],
|
|
98
98
|
excludedSubscriptionIds = [],
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
customerId,
|
|
100
|
+
customerKey,
|
|
101
101
|
visiblePortMode = 'all',
|
|
102
102
|
bandwidth,
|
|
103
103
|
bandwidthKey,
|
|
@@ -132,10 +132,10 @@ function SubscriptionFieldDefinition({
|
|
|
132
132
|
|
|
133
133
|
const usedBandwidth = bandwidth || bandWithFromField;
|
|
134
134
|
|
|
135
|
-
// Get value from org field if
|
|
136
|
-
const
|
|
137
|
-
? get(model,
|
|
138
|
-
:
|
|
135
|
+
// Get value from org field if customerKey is set.
|
|
136
|
+
const usedCustomerId = customerKey
|
|
137
|
+
? get(model, customerKey, 'nonExistingOrgToFilterEverything')
|
|
138
|
+
: customerId;
|
|
139
139
|
|
|
140
140
|
const makeLabel = (subscription: SubscriptionDropdownOption) => {
|
|
141
141
|
const description =
|
|
@@ -243,10 +243,10 @@ function SubscriptionFieldDefinition({
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
// If a customer
|
|
246
|
+
// If a customer filter is applied we need to filter on that
|
|
247
247
|
if (
|
|
248
|
-
|
|
249
|
-
subscription.customer?.customerId !==
|
|
248
|
+
usedCustomerId &&
|
|
249
|
+
subscription.customer?.customerId !== usedCustomerId
|
|
250
250
|
) {
|
|
251
251
|
return false;
|
|
252
252
|
}
|
|
@@ -46,12 +46,11 @@ function Summary({
|
|
|
46
46
|
const { headers, labels, columns } = data;
|
|
47
47
|
|
|
48
48
|
const extraColumnsData = columns.filter((_, index) => index !== 0);
|
|
49
|
-
|
|
50
49
|
const rows = columns[0].map((row, index) => (
|
|
51
50
|
<tr key={index}>
|
|
52
51
|
{labels && <td className={`label`}>{labels[index]}</td>}
|
|
53
52
|
<td className={`value`}>
|
|
54
|
-
{row.includes('<!doctype html>') ? (
|
|
53
|
+
{typeof row === 'string' && row.includes('<!doctype html>') ? (
|
|
55
54
|
<div
|
|
56
55
|
className="emailMessage"
|
|
57
56
|
dangerouslySetInnerHTML={{ __html: row }}
|
|
@@ -18,7 +18,6 @@ export * from './SubscriptionSummaryField';
|
|
|
18
18
|
export * from './TextField';
|
|
19
19
|
export * from './DateField';
|
|
20
20
|
export * from './TimestampField';
|
|
21
|
-
export * from './OrganisationField';
|
|
22
21
|
export * from './ContactPersonNameField';
|
|
23
22
|
export * from './ImsNodeIdField';
|
|
24
23
|
export * from './ImsPortIdField';
|
|
@@ -29,3 +28,4 @@ export * from './OptGroupField';
|
|
|
29
28
|
export * from './SubscriptionField';
|
|
30
29
|
export * from './IpNetworkField';
|
|
31
30
|
export * from './SummaryField';
|
|
31
|
+
export * from './CustomerField';
|
|
@@ -236,9 +236,13 @@ export const WfoProcessesList = ({
|
|
|
236
236
|
return (
|
|
237
237
|
<WfoTableWithFilter<ProcessListItem>
|
|
238
238
|
queryString={queryString}
|
|
239
|
-
data={
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
data={
|
|
240
|
+
!isFetching
|
|
241
|
+
? mapGraphQlProcessListResultToProcessListItems(
|
|
242
|
+
processes || [],
|
|
243
|
+
)
|
|
244
|
+
: []
|
|
245
|
+
}
|
|
242
246
|
tableColumns={mapSortableAndFilterableValuesToTableColumnConfig(
|
|
243
247
|
tableColumns,
|
|
244
248
|
pageInfo?.sortFields,
|
|
@@ -9,23 +9,23 @@ import { SubscriptionDetailTab } from './utils';
|
|
|
9
9
|
|
|
10
10
|
export const subscriptionDetailTabs: WfoFilterTab<SubscriptionDetailTab>[] = [
|
|
11
11
|
{
|
|
12
|
-
id: SubscriptionDetailTab.
|
|
13
|
-
translationKey: '
|
|
12
|
+
id: SubscriptionDetailTab.SERVICE_CONFIGURATION_TAB,
|
|
13
|
+
translationKey: 'serviceConfiguration',
|
|
14
14
|
prepend: (
|
|
15
15
|
<EuiFlexGroup justifyContent={'center'}>
|
|
16
16
|
<EuiFlexItem>
|
|
17
|
-
<
|
|
17
|
+
<WfoCogFill width="16" height="16" color="currentColor" />
|
|
18
18
|
</EuiFlexItem>
|
|
19
19
|
</EuiFlexGroup>
|
|
20
20
|
),
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
id: SubscriptionDetailTab.
|
|
24
|
-
translationKey: '
|
|
23
|
+
id: SubscriptionDetailTab.GENERAL_TAB,
|
|
24
|
+
translationKey: 'general',
|
|
25
25
|
prepend: (
|
|
26
26
|
<EuiFlexGroup justifyContent={'center'}>
|
|
27
27
|
<EuiFlexItem>
|
|
28
|
-
<
|
|
28
|
+
<WfoCubeSolid width="18" height="18" color="currentColor" />
|
|
29
29
|
</EuiFlexItem>
|
|
30
30
|
</EuiFlexGroup>
|
|
31
31
|
),
|
package/src/messages/en-GB.json
CHANGED
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"inputFieldsHaveValidationErrors": "{nrOfValidationErrors} input field(s) have validation errors"
|
|
63
63
|
},
|
|
64
64
|
"widgets": {
|
|
65
|
-
"
|
|
66
|
-
"placeholder": "
|
|
67
|
-
"loading": "Loading
|
|
65
|
+
"customer": {
|
|
66
|
+
"placeholder": "Customer placeholder",
|
|
67
|
+
"loading": "Loading customers..."
|
|
68
68
|
},
|
|
69
69
|
"contactPersonName": {
|
|
70
70
|
"placeholder": "Name placeholder"
|
package/src/messages/nl-NL.json
CHANGED
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"inputFieldsHaveValidationErrors": "{nrOfValidationErrors} input veldn(en) hebben validatie errors"
|
|
63
63
|
},
|
|
64
64
|
"widgets": {
|
|
65
|
-
"
|
|
66
|
-
"placeholder": "
|
|
67
|
-
"loading": "
|
|
65
|
+
"customer": {
|
|
66
|
+
"placeholder": "Klant placeholder",
|
|
67
|
+
"loading": "Klanten laden..."
|
|
68
68
|
},
|
|
69
69
|
"contactPersonName": {
|
|
70
70
|
"placeholder": "Naam placeholder"
|
|
@@ -5,7 +5,13 @@ import Link from 'next/link';
|
|
|
5
5
|
import { useRouter } from 'next/router';
|
|
6
6
|
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
EuiButton,
|
|
10
|
+
EuiFlexGroup,
|
|
11
|
+
EuiFlexItem,
|
|
12
|
+
EuiPageHeader,
|
|
13
|
+
EuiSpacer,
|
|
14
|
+
} from '@elastic/eui';
|
|
9
15
|
|
|
10
16
|
import {
|
|
11
17
|
ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY,
|
|
@@ -17,7 +23,6 @@ import {
|
|
|
17
23
|
WfoTableColumns,
|
|
18
24
|
} from '@/components';
|
|
19
25
|
import { PATH_TASKS } from '@/components';
|
|
20
|
-
import { WfoPageHeader } from '@/components/WfoPageHeader/WfoPageHeader';
|
|
21
26
|
import {
|
|
22
27
|
ProcessListItem,
|
|
23
28
|
WfoProcessesList,
|
|
@@ -137,17 +142,27 @@ export const WfoTasksListPage = () => {
|
|
|
137
142
|
<>
|
|
138
143
|
<EuiSpacer />
|
|
139
144
|
|
|
140
|
-
<
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
145
|
+
<EuiFlexGroup>
|
|
146
|
+
<EuiFlexItem>
|
|
147
|
+
<EuiPageHeader pageTitle="Tasks"></EuiPageHeader>
|
|
148
|
+
</EuiFlexItem>
|
|
149
|
+
|
|
150
|
+
<EuiFlexItem>
|
|
151
|
+
<EuiFlexGroup justifyContent="flexEnd">
|
|
152
|
+
{' '}
|
|
153
|
+
<EuiButton
|
|
154
|
+
onClick={handleRerunAllButtonClick}
|
|
155
|
+
iconType={() => (
|
|
156
|
+
<WfoRefresh color={theme.colors.primaryText} />
|
|
157
|
+
)}
|
|
158
|
+
>
|
|
159
|
+
{t('rerunAll')}
|
|
160
|
+
</EuiButton>
|
|
161
|
+
<WfoStartTaskButtonComboBox />
|
|
162
|
+
</EuiFlexGroup>
|
|
163
|
+
</EuiFlexItem>
|
|
164
|
+
</EuiFlexGroup>
|
|
165
|
+
|
|
151
166
|
<WfoFilterTabs
|
|
152
167
|
tabs={defaultTasksListTabs}
|
|
153
168
|
translationNamespace="tasks.tabs"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
|
|
5
|
-
import { useOrchestratorConfig } from '@/hooks';
|
|
6
5
|
import type { OrchestratorConfig } from '@/types';
|
|
7
6
|
|
|
8
7
|
import { getOrchestratorStore } from './store';
|
|
@@ -16,11 +15,8 @@ export const StoreProvider = ({
|
|
|
16
15
|
initialOrchestratorConfig,
|
|
17
16
|
children,
|
|
18
17
|
}: StoreProviderProps) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
);
|
|
18
|
+
const store = getOrchestratorStore(initialOrchestratorConfig);
|
|
19
|
+
const [orchestratorStore] = useState(store);
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return <Provider store={store}>{children}</Provider>;
|
|
21
|
+
return <Provider store={orchestratorStore}>{children}</Provider>;
|
|
26
22
|
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { FC, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { EuiFlexGroup, EuiFlexItem, EuiPageHeader } from '@elastic/eui';
|
|
4
|
-
|
|
5
|
-
export type WfoPageHeaderProps = {
|
|
6
|
-
pageTitle: string;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const WfoPageHeader: FC<WfoPageHeaderProps> = ({
|
|
11
|
-
pageTitle,
|
|
12
|
-
children,
|
|
13
|
-
}) => (
|
|
14
|
-
<EuiFlexGroup>
|
|
15
|
-
<EuiFlexItem>
|
|
16
|
-
<EuiPageHeader pageTitle={pageTitle}></EuiPageHeader>
|
|
17
|
-
</EuiFlexItem>
|
|
18
|
-
|
|
19
|
-
{children && (
|
|
20
|
-
<EuiFlexItem>
|
|
21
|
-
<EuiFlexGroup justifyContent="flexEnd">{children}</EuiFlexGroup>
|
|
22
|
-
</EuiFlexItem>
|
|
23
|
-
)}
|
|
24
|
-
</EuiFlexGroup>
|
|
25
|
-
);
|