@integry/sdk 4.5.49 → 4.5.50

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.50",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -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