@orchestrator-ui/orchestrator-ui-components 0.8.1 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -19,7 +19,7 @@
19
19
  "axios": "^1.6.5",
20
20
  "graphql-request": "^6.1.0",
21
21
  "invariant": "^2.2.4",
22
- "moment": "2.29.4",
22
+ "moment": "^2.29.4",
23
23
  "moment-timezone": "^0.5.43",
24
24
  "next-auth": "^4.23.1",
25
25
  "next-intl": "^3.4.1",
@@ -55,20 +55,20 @@
55
55
  "@types/jest": "^29.5.8",
56
56
  "@types/object-hash": "^3.0.6",
57
57
  "@types/scroll-into-view": "^1.16.3",
58
- "esbuild": "^0.19.9",
58
+ "esbuild": "^0.20.0",
59
59
  "esbuild-jest": "^0.5.0",
60
60
  "jest": "^29.7.0",
61
61
  "jest-environment-jsdom": "^29.7.0",
62
62
  "jest-watch-typeahead": "^2.2.2",
63
63
  "react": "^18.2.0",
64
64
  "react-dom": "^18.2.0",
65
- "storybook": "^7.2.1",
65
+ "storybook": "^7.6.15",
66
66
  "tsup": "^8.0.1",
67
- "uniforms-bridge-simple-schema-2": "^3.8.1",
68
- "typescript": "^5.3.2"
67
+ "typescript": "^5.3.2",
68
+ "uniforms-bridge-simple-schema-2": "^3.8.1"
69
69
  },
70
70
  "peerDependencies": {
71
- "@elastic/eui": "^92.1.0",
71
+ "@elastic/eui": "^93.1.1",
72
72
  "next": "^14.0.4",
73
73
  "react": "^18.2.0",
74
74
  "react-dom": "^18.2.0",
@@ -4,6 +4,7 @@ import { AutoField } from 'uniforms-unstyled';
4
4
  import {
5
5
  AcceptField,
6
6
  BoolField,
7
+ ConnectedSelectField,
7
8
  ContactPersonNameField,
8
9
  CustomerField,
9
10
  DateField,
@@ -20,7 +21,6 @@ import {
20
21
  OptGroupField,
21
22
  ProductField,
22
23
  RadioField,
23
- SelectField,
24
24
  SubscriptionField,
25
25
  SubscriptionSummaryField,
26
26
  SummaryField,
@@ -91,7 +91,9 @@ export function autoFieldFunction(
91
91
  }
92
92
 
93
93
  if (allowedValues && format !== 'accept') {
94
- return checkboxes && fieldType !== Array ? RadioField : SelectField;
94
+ return checkboxes && fieldType !== Array
95
+ ? RadioField
96
+ : ConnectedSelectField;
95
97
  } else {
96
98
  switch (fieldType) {
97
99
  case Array:
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ import { connectField } from 'uniforms';
4
+
5
+ import type { SelectFieldProps } from './SelectField';
6
+ import { UnconnectedSelectField } from './SelectField';
7
+
8
+ /*
9
+ The selectField has a connected and unconnected version. When a SelectField is called from another field that
10
+ is connected it can cause errors as described here: https://github.com/workfloworchestrator/orchestrator-ui-library/issues/681
11
+ When called directly it will still need the props that the connectField function provides so it has a connected version as well.
12
+ */
13
+ const ConnectedSelect = (props: SelectFieldProps) => {
14
+ return <UnconnectedSelectField {...props} />;
15
+ };
16
+
17
+ export const ConnectedSelectField = connectField(ConnectedSelect, {
18
+ kind: 'leaf',
19
+ });
@@ -50,9 +50,16 @@ declare module 'uniforms' {
50
50
  interface FilterDOMProps {
51
51
  customerId: never;
52
52
  customerKey: never;
53
+ organisationKey: never;
54
+ organisationId: never;
53
55
  }
54
56
  }
55
- filterDOMProps.register('customerId', 'customerKey');
57
+ filterDOMProps.register(
58
+ 'customerId',
59
+ 'customerKey',
60
+ 'organisationKey',
61
+ 'organisationId',
62
+ );
56
63
 
57
64
  function ContactPersonName({
58
65
  disabled,
@@ -19,7 +19,7 @@ import { connectField } from 'uniforms';
19
19
 
20
20
  import { useGetCustomersQuery } from '@/rtk/endpoints';
21
21
 
22
- import { SelectField, SelectFieldProps } from './SelectField';
22
+ import { SelectFieldProps, UnconnectedSelectField } from './SelectField';
23
23
 
24
24
  export type CustomerFieldProps = Omit<
25
25
  SelectFieldProps,
@@ -40,7 +40,7 @@ function Customer({ ...props }: CustomerFieldProps) {
40
40
  }
41
41
 
42
42
  return (
43
- <SelectField
43
+ <UnconnectedSelectField
44
44
  {...props}
45
45
  allowedValues={Array.from(uuidCustomerNameMap.keys())}
46
46
  transform={(uuid: string) => uuidCustomerNameMap.get(uuid) || uuid}
@@ -19,7 +19,7 @@ import { useTranslations } from 'next-intl';
19
19
  import { connectField, filterDOMProps } from 'uniforms';
20
20
 
21
21
  import { useAxiosApiClient } from '../useAxiosApiClient';
22
- import { SelectField, SelectFieldProps } from './SelectField';
22
+ import { SelectFieldProps, UnconnectedSelectField } from './SelectField';
23
23
  import { ImsNode } from './surf/types';
24
24
 
25
25
  export type ImsNodeIdFieldProps = {
@@ -91,7 +91,7 @@ function ImsNodeId({
91
91
  }, {}) ?? {};
92
92
 
93
93
  return (
94
- <SelectField
94
+ <UnconnectedSelectField
95
95
  name=""
96
96
  {...props}
97
97
  allowedValues={Object.keys(imsNodeIdLabelLookup)}
@@ -20,12 +20,12 @@ that seems to be impossible with the new webpack.
20
20
  import React from 'react';
21
21
 
22
22
  import { get } from 'lodash';
23
- import { connectField, joinName, useField, useForm } from 'uniforms';
23
+ import { joinName, useField, useForm } from 'uniforms';
24
24
 
25
25
  import { ListField, ListFieldProps } from './ListField';
26
26
  import { ListItemField } from './ListItemField';
27
27
  // Avoid circular deps
28
- import { SelectField } from './SelectField';
28
+ import { UnconnectedSelectField } from './SelectField';
29
29
  import { FieldProps } from './types';
30
30
 
31
31
  export type ListSelectFieldProps = FieldProps<
@@ -33,11 +33,12 @@ export type ListSelectFieldProps = FieldProps<
33
33
  { allowedValues?: string[]; transform?(value: string): string }
34
34
  >;
35
35
 
36
- function ListSelect({
36
+ export function ListSelectField({
37
37
  allowedValues = [],
38
38
  fieldType,
39
39
  name,
40
40
  transform,
41
+ ...props
41
42
  }: ListSelectFieldProps) {
42
43
  const nameArray = joinName(null, name);
43
44
  let parentName = joinName(nameArray.slice(0, -1));
@@ -70,23 +71,25 @@ function ListSelect({
70
71
  return (
71
72
  <ListField name={name}>
72
73
  <ListItemField name="$">
73
- <SelectField
74
+ <UnconnectedSelectField
74
75
  name=""
75
76
  transform={transform}
76
77
  allowedValues={allowedValues}
78
+ fieldType={fieldType}
79
+ {...props}
77
80
  />
78
81
  </ListItemField>
79
82
  </ListField>
80
83
  );
81
84
  } else {
82
85
  return (
83
- <SelectField
86
+ <UnconnectedSelectField
84
87
  name=""
85
88
  transform={transform}
86
89
  allowedValues={allowedValues}
90
+ fieldType={fieldType}
91
+ {...props}
87
92
  />
88
93
  );
89
94
  }
90
95
  }
91
-
92
- export const ListSelectField = connectField(ListSelect, { kind: 'leaf' });
@@ -18,7 +18,7 @@ import { useTranslations } from 'next-intl';
18
18
  import { connectField, filterDOMProps } from 'uniforms';
19
19
 
20
20
  import { useAxiosApiClient } from '../useAxiosApiClient';
21
- import { SelectField, SelectFieldProps } from './SelectField';
21
+ import { SelectFieldProps, UnconnectedSelectField } from './SelectField';
22
22
 
23
23
  export type LocationCodeFieldProps = { locationCodes?: string[] } & Omit<
24
24
  SelectFieldProps,
@@ -55,7 +55,7 @@ function LocationCode({ locationCodes, ...props }: LocationCodeFieldProps) {
55
55
  }, [axiosApiClient]);
56
56
 
57
57
  return (
58
- <SelectField
58
+ <UnconnectedSelectField
59
59
  {...props}
60
60
  allowedValues={codes}
61
61
  placeholder={t('widgets.locationCode.placeholder')}
@@ -21,7 +21,7 @@ import { connectField, filterDOMProps } from 'uniforms';
21
21
 
22
22
  import { ProductDefinition } from '../../../types';
23
23
  import { useAxiosApiClient } from '../useAxiosApiClient';
24
- import { SelectField, SelectFieldProps } from './SelectField';
24
+ import { SelectFieldProps, UnconnectedSelectField } from './SelectField';
25
25
 
26
26
  export type ProductFieldProps = { productIds?: string[] } & Omit<
27
27
  SelectFieldProps,
@@ -65,7 +65,7 @@ function Product({ name, productIds, ...props }: ProductFieldProps) {
65
65
  }, {}) ?? {};
66
66
 
67
67
  return (
68
- <SelectField
68
+ <UnconnectedSelectField
69
69
  name={name}
70
70
  {...props}
71
71
  allowedValues={Object.keys(productLabelLookup)}
@@ -17,13 +17,7 @@ import ReactSelect from 'react-select';
17
17
 
18
18
  import { get } from 'lodash';
19
19
  import { useTranslations } from 'next-intl';
20
- import {
21
- connectField,
22
- filterDOMProps,
23
- joinName,
24
- useField,
25
- useForm,
26
- } from 'uniforms';
20
+ import { joinName, useField, useForm } from 'uniforms';
27
21
 
28
22
  import { EuiFormRow, EuiText } from '@elastic/eui';
29
23
 
@@ -39,7 +33,10 @@ export type SelectFieldProps = FieldProps<
39
33
  { allowedValues?: string[]; transform?(value: string): string }
40
34
  >;
41
35
 
42
- function Select({
36
+ /*
37
+
38
+ */
39
+ export function UnconnectedSelectField({
43
40
  allowedValues = [],
44
41
  disabled,
45
42
  fieldType,
@@ -106,16 +103,35 @@ function Select({
106
103
  <ListField name={name}>
107
104
  <ListItemField name="$">
108
105
  <ListSelectField
106
+ {...{
107
+ allowedValues,
108
+ disabled,
109
+ fieldType,
110
+ id,
111
+ label,
112
+ description,
113
+ name,
114
+ onChange,
115
+ placeholder,
116
+ readOnly,
117
+ transform,
118
+ value,
119
+ error,
120
+ showInlineError,
121
+ errorMessage,
122
+ }}
123
+ fieldType={fieldType}
109
124
  name=""
110
125
  transform={transform}
111
126
  allowedValues={allowedValues}
127
+ {...props}
112
128
  />
113
129
  </ListItemField>
114
130
  </ListField>
115
131
  );
116
132
  } else {
117
133
  return (
118
- <section {...filterDOMProps(props)}>
134
+ <section>
119
135
  <EuiFormRow
120
136
  label={label}
121
137
  labelAppend={<EuiText size="m">{description}</EuiText>}
@@ -148,5 +164,3 @@ function Select({
148
164
  );
149
165
  }
150
166
  }
151
-
152
- export const SelectField = connectField(Select);
@@ -29,3 +29,4 @@ export * from './SubscriptionField';
29
29
  export * from './IpNetworkField';
30
30
  export * from './SummaryField';
31
31
  export * from './CustomerField';
32
+ export * from './ConnectedSelectField';
@@ -69,6 +69,9 @@
69
69
  "contactPersonName": {
70
70
  "placeholder": "Name placeholder"
71
71
  },
72
+ "ipvAnyNetworkField": {
73
+ "manuallySelectedPrefix": "Manually selected prefix"
74
+ },
72
75
  "node_select": {
73
76
  "nodes_loading": "Nodes loading",
74
77
  "select_node": "Select node",
@@ -258,14 +261,14 @@
258
261
  "no_modify_workflow": "This subscription can not be modified as the product has no modify workflows.",
259
262
  "no_termination_workflow": "This subscription can not be terminated as the product has no termination workflows.",
260
263
  "no_validate_workflow": "This subscription can not be validated as the product has no validate workflows.",
261
- "not_in_sync": "This subscription can not be modified because it is not in sync. This means there is some error in the registration of the subscription or that it is being modified by another workflow.",
262
- "relations_not_in_sync": "This subscription can not be modified because some related subscriptions are not insync. Locked subscriptions: {locked_relations}",
264
+ "not_in_sync": "This subscription can not be modified because it is not in-sync. This means there is some error in the registration of the subscription or that it is being modified by another workflow.",
265
+ "relations_not_in_sync": "This subscription can not be modified because some related subscriptions are not in-sync. Locked subscriptions: {locked_relations}",
263
266
  "no_modify_subscription_in_use_by_others": "This subscription can not be modified because it is in use by one or more other subscriptions: {unterminated_parents}"
264
267
  }
265
268
  },
266
269
  "subscriptionInstanceId": "Instance ID",
267
270
  "ownerSubscriptionId": "Owner subscription ID",
268
- "inUseByRelations": "In use by relation",
271
+ "inUseByRelations": "In-use by subscription(s)",
269
272
  "showDetails": "Show details",
270
273
  "self": "Current subscription",
271
274
  "hideDetails": "Hide details",
@@ -69,6 +69,9 @@
69
69
  "contactPersonName": {
70
70
  "placeholder": "Naam placeholder"
71
71
  },
72
+ "ipvAnyNetworkField": {
73
+ "manuallySelectedPrefix": "Manually selected prefix"
74
+ },
72
75
  "node_select": {
73
76
  "nodes_loading": "Nodes laden...",
74
77
  "select_node": "Selecteer node",
@@ -163,10 +166,10 @@
163
166
  "customer": "Klant",
164
167
  "customerAbbreviation": "Klantafkorting",
165
168
  "subscriptions": "Subscriptions",
166
- "createdBy": "Gecreëerd door",
169
+ "createdBy": "Aangemaakt door",
167
170
  "assignee": "Assignee",
168
171
  "processId": "Proces ID",
169
- "started": "Gestart",
172
+ "started": "Starttijd",
170
173
  "lastModified": "Aangepast op",
171
174
  "workflowTarget": "Target",
172
175
  "productTag": "Product tag"
@@ -251,20 +254,20 @@
251
254
  "terminate": "Terminate workflow",
252
255
  "actions": "Acties",
253
256
  "subscription": {
254
- "no_modify_deleted_related_objects": "This subscription can not be modified because it contains references to other systems that are deleted.",
255
- "no_modify_in_use_by_subscription": "This subscription can not be {action} as it is used in other subscriptions: {unterminated_in_use_by_subscriptions}",
256
- "no_modify_invalid_status": "This subscription can not be modified because of the status: {status}. Only subscriptions with status {usable_when} can be {action}.",
257
- "no_modify_workflow": "This subscription can not be modified as the product has no modify workflows.",
258
- "no_termination_workflow": "This subscription can not be terminated as the product has no termination workflows.",
259
- "no_validate_workflow": "This subscription can not be validated as the product has no validate workflows.",
260
- "not_in_sync": "This subscription can not be modified because it is not in sync. This means there is some error in the registration of the subscription or that it is being modified by another workflow.",
261
- "relations_not_in_sync": "This subscription can not be modified because some related subscriptions are not insync. Locked subscriptions: {locked_relations}",
262
- "no_modify_subscription_in_use_by_others": "This subscription can not be modified because it is in use by one or more other subscriptions: {unterminated_parents}"
257
+ "no_modify_deleted_related_objects": "Deze subscription kan niet worden gewijzigd omdat het verwijzingen bevat naar andere systemen die zijn verwijderd.",
258
+ "no_modify_in_use_by_subscription": "Deze subscription kan niet worden {gewijzigd} omdat het wordt gebruikt in andere subscriptions: {unterminated_in_use_by_subscriptions}",
259
+ "no_modify_invalid_status": "Deze subscription kan niet worden gewijzigd vanwege de status: {status}. Alleen abonnementen met de status {usable_when} kunnen worden {action}.",
260
+ "no_modify_workflow": "Deze subscription kan niet worden gewijzigd omdat het product geen modify workflows heeft.",
261
+ "no_termination_workflow": "Deze subscription kan niet worden beëindigd omdat het product geen termination workflows heeft.",
262
+ "no_validate_workflow": "Deze subscription kan niet worden gevalideerd omdat het product geen validate workflows heeft.",
263
+ "not_in_sync": "Deze subscription kan niet worden gewijzigd omdat het niet in-sync is. Dit betekent dat er een fout zit in de registratie van de subscription of dat het wordt gewijzigd door een andere workflow.",
264
+ "relations_not_in_sync": "Deze subscription kan niet worden gewijzigd omdat sommige gerelateerde subscriptions niet in-sync zijn. Geblokkeerde subscriptions: {locked_relations}",
265
+ "no_modify_subscription_in_use_by_others": "Deze subscription kan niet worden gewijzigd omdat het in gebruik is door een of meer andere subscriptions: {unterminated_parents}"
263
266
  }
264
267
  },
265
268
  "subscriptionInstanceId": "Instance ID",
266
269
  "ownerSubscriptionId": "Owner subscription ID",
267
- "inUseByRelations": "In use by relation",
270
+ "inUseByRelations": "In gebruik door subscription(s)",
268
271
  "showDetails": "Toon details",
269
272
  "hideDetails": "Verberg details",
270
273
  "self": "Huidige subscription",
@@ -272,11 +275,11 @@
272
275
  "productName": "Produkt",
273
276
  "fixedInputs": "Fixed inputs",
274
277
  "productInfo": "Product info",
275
- "noProductBlockSelected": "No product block selected",
278
+ "noProductBlockSelected": "Geen product block geselecteerd",
276
279
  "productBlocks": "Product blocks",
277
- "ctaSelectProductBlock": "Select one or more product blocks to view their details",
278
- "startedBy": "Started by",
279
- "startedAt": "Started at",
280
+ "ctaSelectProductBlock": "Selecteer één of meer product blocks om de details te bekijken",
281
+ "startedBy": "Aangemaakt door",
282
+ "startedAt": "Starttijd",
280
283
  "status": "Status",
281
284
  "id": "ID",
282
285
  "blockTitleSubscriptionDetails": "Subscription details",
package/tsconfig.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "outDir": "./dist",
7
7
  "baseUrl": ".",
8
8
  "paths": {
9
- "@/*": ["./src/*"],
10
- },
9
+ "@/*": ["./src/*"]
10
+ }
11
11
  },
12
12
  "include": ["./src/**/*.ts", "./src/**/*.tsx"],
13
13
  "exclude": [
@@ -15,6 +15,6 @@
15
15
  "**/*.stories.ts",
16
16
  "**/*.stories.js",
17
17
  "**/*.stories.jsx",
18
- "**/*.stories.tsx",
19
- ],
18
+ "**/*.stories.tsx"
19
+ ]
20
20
  }