@integry/sdk 4.5.49 → 4.5.51

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": "@integry/sdk",
3
- "version": "4.5.49",
3
+ "version": "4.5.51",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -67,6 +67,7 @@ interface ListBoxProps {
67
67
  optionKeyPath?: string;
68
68
  valueKeyPath?: string;
69
69
  dataSourceBody?: any;
70
+ parentFieldChanged?: boolean;
70
71
  }
71
72
 
72
73
  const ListBox = (props: ListBoxProps) => {
@@ -108,6 +109,7 @@ const ListBox = (props: ListBoxProps) => {
108
109
  disabled = false,
109
110
  isMultiSelect = false,
110
111
  dataSourceBody = {},
112
+ parentFieldChanged = false,
111
113
  } = props;
112
114
 
113
115
  const [query, setQuery] = useState<string>('');
@@ -350,7 +352,13 @@ const ListBox = (props: ListBoxProps) => {
350
352
  setItems(responseMapper(checkboxItems));
351
353
  setLoading(false);
352
354
  }
353
- }, [endpointData, skipOptionFetch, endpointUrl, selectedAuthId]);
355
+ }, [
356
+ endpointData,
357
+ skipOptionFetch,
358
+ endpointUrl,
359
+ selectedAuthId,
360
+ parentFieldChanged,
361
+ ]);
354
362
 
355
363
  const handleKeyDown = (event: KeyboardEvent) => {
356
364
  if (event.key === 'Tab') {
@@ -105,7 +105,7 @@ const MultipurposeField = (props: MultipurposeFieldProps) => {
105
105
  };
106
106
 
107
107
  const getFieldValFromActivityOutputRaw = (array: any, val: any) => {
108
- const valueToUse = Array.isArray(val) ? val[val.length - 1] : val;
108
+ const valueToUse = (Array.isArray(val) ? val[val.length - 1] : val) || '';
109
109
  const results = valueToUse.toString().match(/{([^}]+)}/g);
110
110
  let valSubstituded = valueToUse;
111
111
  (results || []).forEach((tag: string) => {
@@ -142,8 +142,21 @@ const ObjectField = (props: ObjectFieldProps) => {
142
142
  : {}),
143
143
  };
144
144
 
145
- setObjectHasFields(!!Object.keys(normalizedField.template_fields).length);
146
- setShowAddMoreOption(!!Object.keys(normalizedField.template_fields).length);
145
+ const isFlow = !field.properties && !!field.template_fields;
146
+
147
+ if (isFlow) {
148
+ setObjectHasFields(
149
+ !!Object.keys(normalizedField?.template_fields || []).length,
150
+ );
151
+ setShowAddMoreOption(
152
+ !!Object.keys(normalizedField?.template_fields || []).length,
153
+ );
154
+ } else {
155
+ setObjectHasFields(!!Object.keys(normalizedField?.properties || []).length);
156
+ setShowAddMoreOption(
157
+ !!Object.keys(normalizedField?.properties || []).length,
158
+ );
159
+ }
147
160
 
148
161
  // Method to handle field changes for each object in the array
149
162
  const handleFieldChange = (
@@ -154,7 +167,6 @@ const ObjectField = (props: ObjectFieldProps) => {
154
167
  machine_name?: string,
155
168
  ) => {
156
169
  const updatedObjectArray = [...objectArray];
157
- const isFlow = !field.properties && !!field.template_fields;
158
170
  const updatedObjectArrayKey = (isFlow && machine_name) || fieldId;
159
171
  updatedObjectArray[index][updatedObjectArrayKey] = value;
160
172
 
@@ -1347,6 +1347,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1347
1347
  this.props.stepMapping[this.props.step.id]
1348
1348
  ?.selectedAuthId,
1349
1349
  ...this.fieldDynamicData(el),
1350
+ ...this.state.dynamicFieldsData,
1350
1351
  })}
1351
1352
  isReadOnly=${isReadOnly}
1352
1353
  isChanged=${
@@ -1387,6 +1388,9 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1387
1388
  )}
1388
1389
  optionKeyPath=${uiField?.value_key_path || ''}
1389
1390
  valueKeyPath=${uiField?.option_key_path || ''}
1391
+ parentFieldChanged=${
1392
+ this.state.parentFieldChanged
1393
+ }
1390
1394
  ><//>
1391
1395
  </${ConfigureFieldWrapper}>
1392
1396
  </div>`;