@integry/sdk 4.5.47 → 4.5.49

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.47",
3
+ "version": "4.5.49",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -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,6 +142,9 @@ const ObjectField = (props: ObjectFieldProps) => {
141
142
  : {}),
142
143
  };
143
144
 
145
+ setObjectHasFields(!!Object.keys(normalizedField.template_fields).length);
146
+ setShowAddMoreOption(!!Object.keys(normalizedField.template_fields).length);
147
+
144
148
  // Method to handle field changes for each object in the array
145
149
  const handleFieldChange = (
146
150
  index: number,
@@ -160,7 +164,11 @@ const ObjectField = (props: ObjectFieldProps) => {
160
164
  // Optionally trigger the parent change handler
161
165
  if (isArray) {
162
166
  if (isFlow && onChangeInFlow) {
163
- onChangeInFlow(JSON.stringify(updatedObjectArray));
167
+ if (normalizedField.template_fields?.length > 0) {
168
+ onChangeInFlow(JSON.stringify(updatedObjectArray));
169
+ } else {
170
+ onChangeInFlow(value);
171
+ }
164
172
  } else {
165
173
  onChange(
166
174
  fieldId,
@@ -172,7 +180,15 @@ const ObjectField = (props: ObjectFieldProps) => {
172
180
  );
173
181
  }
174
182
  } else if (isFlow && onChangeInFlow) {
175
- onChangeInFlow(value);
183
+ if (normalizedField.template_fields?.length > 0) {
184
+ onChangeInFlow(
185
+ JSON.stringify({
186
+ [machine_name || '']: value,
187
+ }),
188
+ );
189
+ } else {
190
+ onChangeInFlow(value);
191
+ }
176
192
  } else {
177
193
  onChange(fieldId, value, dataType, field.is_required, field.id);
178
194
  }