@orchestrator-ui/orchestrator-ui-components 7.7.0 → 8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "7.7.0",
3
+ "version": "8.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Library of UI Components used to display the workflow orchestrator frontend",
6
6
  "author": {
@@ -54,7 +54,7 @@
54
54
  "next-query-params": "^5.0.0",
55
55
  "object-hash": "^3.0.0",
56
56
  "prism-themes": "^1.9.0",
57
- "pydantic-forms": "^1.0.7",
57
+ "pydantic-forms": "^2.0.0",
58
58
  "react-diff-view": "^3.2.0",
59
59
  "react-draggable": "^4.4.6",
60
60
  "react-redux": "^9.1.2",
@@ -81,7 +81,7 @@ export const WfoArrayField = ({ pydanticFormField }: PydanticFormElementProps) =
81
81
 
82
82
  if (!arrayItem) return null;
83
83
 
84
- const component = fieldToComponentMatcher(arrayItem, config?.componentMatcherExtender);
84
+ const component = fieldToComponentMatcher(arrayItem, config?.componentMatcher);
85
85
 
86
86
  const renderField = (field: Record<'id', string>, index: number) => {
87
87
  const itemizedField = itemizeArrayItem(index, arrayItem, arrayName);
@@ -31,20 +31,22 @@ export const WfoInteger: PydanticFormControlledElement = ({ pydanticFormField, o
31
31
  // this is imposed by react-hook-form. We try to detect this and extract the actual value
32
32
  const fieldName = getFormFieldIdWithPath(pydanticFormField.id);
33
33
  const fieldValue = _.isObject(value) && _.has(value, fieldName) ? _.get(value, fieldName) : value;
34
- const [userInput, setUserInput] = React.useState<string>();
34
+ const [userInput, setUserInput] = React.useState<string>('');
35
35
 
36
36
  useEffect(() => {
37
37
  if (fieldValue !== undefined && fieldValue !== null) {
38
38
  setUserInput(fieldValue);
39
- } else {
40
- setUserInput('');
41
39
  }
42
40
  }, [fieldValue, value]);
43
41
 
44
42
  const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => {
45
- const newValue = event.target.value;
46
- if (value === null && newValue !== value) {
47
- onChange(parseInt(newValue));
43
+ const newValue = event.target.value || '';
44
+ if (value === null || newValue !== value) {
45
+ if (!isNaN(parseInt(newValue))) {
46
+ onChange(parseInt(newValue));
47
+ } else {
48
+ onChange('');
49
+ }
48
50
  }
49
51
  setUserInput(newValue);
50
52
  };
@@ -16,7 +16,7 @@ export const WfoObjectField = ({ pydanticFormField }: PydanticFormElementProps)
16
16
  const config = useGetConfig();
17
17
  const disabled = pydanticFormField.attributes?.disabled || false;
18
18
  const { wfoObjectFieldStyles } = getWfoObjectFieldStyles();
19
- const components = getPydanticFormComponents(pydanticFormField.properties || {}, config?.componentMatcherExtender);
19
+ const components = getPydanticFormComponents(pydanticFormField.properties || {}, config?.componentMatcher);
20
20
 
21
21
  // We have decided - for now - on the convention that all descendants of disabled fields will be disabled as well
22
22
  // so we will not displaying any interactive elements inside a disabled element
@@ -1 +1 @@
1
- export const ORCHESTRATOR_UI_LIBRARY_VERSION = '7.7.0';
1
+ export const ORCHESTRATOR_UI_LIBRARY_VERSION = '8.0.0';