@integry/sdk 4.5.48 → 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.48",
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) => {
@@ -69,7 +69,8 @@ const transformTemplateFieldsToProperties = (templateFields: any[]) => {
69
69
  title: tf.title,
70
70
  description_for_users: tf.description,
71
71
  is_required: tf.is_required,
72
- machine_name: tf?.activity_field?.machine_name || '',
72
+ machine_name:
73
+ tf?.activity_field?.machine_name || tf?.machine_name || '',
73
74
  ui: {
74
75
  placeholder: tf.placeholder,
75
76
  regex: tf.regex || '',
@@ -141,8 +142,21 @@ const ObjectField = (props: ObjectFieldProps) => {
141
142
  : {}),
142
143
  };
143
144
 
144
- setObjectHasFields(!!Object.keys(normalizedField.template_fields).length);
145
- 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
+ }
146
160
 
147
161
  // Method to handle field changes for each object in the array
148
162
  const handleFieldChange = (
@@ -153,7 +167,6 @@ const ObjectField = (props: ObjectFieldProps) => {
153
167
  machine_name?: string,
154
168
  ) => {
155
169
  const updatedObjectArray = [...objectArray];
156
- const isFlow = !field.properties && !!field.template_fields;
157
170
  const updatedObjectArrayKey = (isFlow && machine_name) || fieldId;
158
171
  updatedObjectArray[index][updatedObjectArrayKey] = value;
159
172