@integry/sdk 4.5.43 → 4.5.46

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.43",
3
+ "version": "4.5.46",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -21,11 +21,12 @@ interface ObjectFieldProps {
21
21
  parentFieldId?: string,
22
22
  index?: number,
23
23
  ) => void;
24
- onChangeInFlow?: (val: string) => void;
24
+ onChangeInFlow?: (val: any) => void;
25
25
  apiHandler: any;
26
26
  isArray?: boolean; // New prop to check if the input is an array
27
27
  activityOutputData: any;
28
28
  activityOutputDataRaw: any;
29
+ objectValue?: any;
29
30
  }
30
31
 
31
32
  type Option = {
@@ -37,6 +38,7 @@ interface FieldDetails {
37
38
  title: string;
38
39
  description_for_users: string;
39
40
  is_required: boolean;
41
+ machine_name?: string;
40
42
  ui: {
41
43
  placeholder: string;
42
44
  regex?: string;
@@ -67,6 +69,7 @@ const transformTemplateFieldsToProperties = (templateFields: any[]) => {
67
69
  title: tf.title,
68
70
  description_for_users: tf.description,
69
71
  is_required: tf.is_required,
72
+ machine_name: tf?.activity_field?.machine_name || '',
70
73
  ui: {
71
74
  placeholder: tf.placeholder,
72
75
  regex: tf.regex || '',
@@ -101,6 +104,7 @@ const ObjectField = (props: ObjectFieldProps) => {
101
104
  isArray = false, // Default to false
102
105
  activityOutputData,
103
106
  activityOutputDataRaw,
107
+ objectValue,
104
108
  } = props;
105
109
  const [objectArray, setObjectArray] = useState<FieldObject[]>([{}]); // Start with one empty object in the array
106
110
  const [showAddMoreOption, setShowAddMoreOption] = useState(true);
@@ -143,18 +147,20 @@ const ObjectField = (props: ObjectFieldProps) => {
143
147
  fieldId: string,
144
148
  value: any,
145
149
  dataType: string,
150
+ machine_name?: string,
146
151
  ) => {
147
152
  const updatedObjectArray = [...objectArray];
148
- updatedObjectArray[index][fieldId] = value;
153
+ const isFlow = !field.properties && !!field.template_fields;
154
+ const updatedObjectArrayKey = (isFlow && machine_name) || fieldId;
155
+ updatedObjectArray[index][updatedObjectArrayKey] = value;
149
156
 
150
157
  // Update the state with the modified object array
151
158
  setObjectArray(updatedObjectArray);
152
159
 
153
160
  // Optionally trigger the parent change handler
154
- const isFlow = !field.properties && !!field.template_fields;
155
161
  if (isArray) {
156
162
  if (isFlow && onChangeInFlow) {
157
- onChangeInFlow(value);
163
+ onChangeInFlow(updatedObjectArray);
158
164
  } else {
159
165
  onChange(
160
166
  fieldId,
@@ -249,6 +255,7 @@ const ObjectField = (props: ObjectFieldProps) => {
249
255
  fieldName,
250
256
  valueReceived,
251
257
  fieldDetails.meta.ui.ui_field?.type || 'TEXTFIELD',
258
+ fieldDetails.meta.machine_name,
252
259
  );
253
260
  }}
254
261
  regex=${fieldDetails.meta.ui.regex || getRegex(fieldDetails)}
@@ -278,6 +285,7 @@ const ObjectField = (props: ObjectFieldProps) => {
278
285
  fieldName,
279
286
  val,
280
287
  fieldDetails.meta.ui.ui_field?.type || 'TEXTAREA',
288
+ fieldDetails.meta.machine_name,
281
289
  )}
282
290
  placeholder="${placeholder}"
283
291
  isRequired="${fieldDetails.meta.is_required}"
@@ -290,6 +298,7 @@ const ObjectField = (props: ObjectFieldProps) => {
290
298
  isMappable=${activityOutputDataRaw &&
291
299
  Object.entries(activityOutputDataRaw).length > 0}
292
300
  allowTagsInText=${activityOutputDataRaw}
301
+ value=${objectValue}
293
302
  ><//>
294
303
  `}
295
304
  ${fieldType === 'CHECKBOX' &&
@@ -304,6 +313,7 @@ const ObjectField = (props: ObjectFieldProps) => {
304
313
  fieldName,
305
314
  val,
306
315
  fieldDetails.meta.ui.ui_field?.type || 'CHECKBOX',
316
+ fieldDetails.meta.machine_name,
307
317
  )}
308
318
  />
309
319
  `}
@@ -326,6 +336,7 @@ const ObjectField = (props: ObjectFieldProps) => {
326
336
  fieldName,
327
337
  val,
328
338
  fieldDetails.meta.ui.ui_field?.type || 'DYNAMIC_DROPDOWN',
339
+ fieldDetails.meta.machine_name,
329
340
  )}
330
341
  />
331
342
  `}
@@ -1581,6 +1581,16 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1581
1581
  activityOutputDataRaw=${
1582
1582
  this.props.activityOutputData
1583
1583
  }
1584
+ objectValue=${
1585
+ (selectedStepData &&
1586
+ selectedStepData[el.id] &&
1587
+ selectedStepData[el.id].value &&
1588
+ selectedStepData[el.id].value !==
1589
+ 'x-integry-skipped-field' &&
1590
+ selectedStepData[el.id].value) ||
1591
+ el.default_value ||
1592
+ ''
1593
+ }
1584
1594
  />
1585
1595
  </${ConfigureFieldWrapper}>
1586
1596
  </div>