@integry/sdk 4.6.44 → 4.6.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.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /* eslint-disable no-nested-ternary */
2
4
  import { html, Component } from 'htm/preact';
3
5
  import { connect } from 'unistore/preact';
@@ -6,11 +8,10 @@ import { useContext } from 'preact/hooks';
6
8
  import { ListBox } from '@/components/MultipurposeField/Dropdown';
7
9
  import { actionFunctions } from '@/store';
8
10
  import { Button } from '@/components/Button';
9
- import { StoreType } from '@/types/store';
11
+ import type { StoreType } from '@/types/store';
10
12
  import { MultipurposeField } from '@/components/MultipurposeField';
11
13
  import DynamicTypedField from '@/features/common/DynamicTypedField';
12
14
  import ConfigureFieldWrapper from '@/components/ConfigureFieldWrapper';
13
- import { CheckboxGroup } from '@/components/CheckboxGroup';
14
15
  import AppContext from '@/contexts/AppContext';
15
16
  import { ObjectField } from '@/components/form/ObjectField';
16
17
  import { LargeLoader } from '@/components/LargeLoader';
@@ -33,6 +34,13 @@ interface FunctionFormPropsType extends StoreType {
33
34
  customSaveCallback?: (response: any) => void; // Optional callback: Helps the implementor to implement their own save button
34
35
  showMappingMenu?: boolean; // Optional prop to show mapping menu
35
36
  forceShowAllFields?: boolean; // Optional prop to show all fields including hidden fields
37
+ enableAIAssist?: boolean; // New prop for enabling AI assist feature
38
+ defaultAIAssistedFields?: string[]; // New prop for field IDs that should have AI assist enabled by default
39
+ onAIAssistToggle?: (
40
+ fieldId: string,
41
+ enabled: boolean,
42
+ allAIAssistedFields: string[],
43
+ ) => void; // Callback when AI assist toggle changes
36
44
  }
37
45
 
38
46
  interface ActionFormStateType {
@@ -43,6 +51,7 @@ interface ActionFormStateType {
43
51
  invalidFields: any;
44
52
  parentFields: any;
45
53
  parentFieldsChanged: boolean;
54
+ aiAssistedFields: string[]; // New state to track fields with AI assist enabled
46
55
  }
47
56
 
48
57
  interface StepDataMapping {
@@ -68,6 +77,7 @@ class FunctionForm extends Component<
68
77
  invalidFields: [],
69
78
  parentFields: [],
70
79
  parentFieldsChanged: false,
80
+ aiAssistedFields: [], // Initialize empty array for AI assisted fields
71
81
  };
72
82
  }
73
83
 
@@ -103,6 +113,7 @@ class FunctionForm extends Component<
103
113
  argumentsData[key].meta.ui.default_value ||
104
114
  '';
105
115
 
116
+ // Only add to invalidFields if not AI assisted
106
117
  if (argumentsData[key].meta.is_required && !args[key]) {
107
118
  this.setState((prevState) => ({
108
119
  invalidFields: prevState.invalidFields.includes(key)
@@ -139,6 +150,57 @@ class FunctionForm extends Component<
139
150
  dynamicFieldDataState: args,
140
151
  });
141
152
 
153
+ // Enable AI assist for default fields if provided
154
+ if (
155
+ this.props.enableAIAssist &&
156
+ this.props.defaultAIAssistedFields &&
157
+ this.props.defaultAIAssistedFields.length > 0
158
+ ) {
159
+ const validFieldIds = Object.keys(response.parameters.properties);
160
+ const defaultAIFields = this.props.defaultAIAssistedFields.filter(
161
+ (fieldId) => validFieldIds.includes(fieldId),
162
+ );
163
+
164
+ if (defaultAIFields.length > 0) {
165
+ this.setState((prevState) => {
166
+ // Create new arrays to avoid mutating state directly
167
+ const newAIAssistedFields = [
168
+ ...prevState.aiAssistedFields,
169
+ ...defaultAIFields,
170
+ ];
171
+ const newInvalidFields = prevState.invalidFields.filter(
172
+ (fieldId: string) => !defaultAIFields.includes(fieldId),
173
+ );
174
+
175
+ // Notify parent component about the default AI assisted fields
176
+ if (this.props.onAIAssistToggle && defaultAIFields.length > 0) {
177
+ // Call once for each field to ensure proper tracking
178
+ defaultAIFields.forEach((fieldId) => {
179
+ this.props.onAIAssistToggle!(
180
+ fieldId,
181
+ true,
182
+ newAIAssistedFields,
183
+ );
184
+ });
185
+ }
186
+
187
+ // If we have a custom save callback, notify it about the changes
188
+ if (this.props.customSaveCallback) {
189
+ // Get current data state but exclude AI assisted fields
190
+ this.props.customSaveCallback({
191
+ hasInvalidFields: newInvalidFields.length > 0,
192
+ data: args,
193
+ });
194
+ }
195
+
196
+ return {
197
+ aiAssistedFields: newAIAssistedFields,
198
+ invalidFields: newInvalidFields,
199
+ };
200
+ });
201
+ }
202
+ }
203
+
142
204
  this.setState({ loading: false });
143
205
  });
144
206
  }
@@ -153,17 +215,26 @@ class FunctionForm extends Component<
153
215
  return arr;
154
216
  };
155
217
 
156
- private onSubmit = (event: any, returnResponse = false) => {
218
+ private onSubmit = (
219
+ event: any,
220
+ returnResponse = false,
221
+ AIAssistFieldId = '',
222
+ ) => {
157
223
  this.setState({ isSubmitting: true });
158
224
  const { functionName } = this.props;
159
225
  const { functionDetails } = this.state;
160
226
  const args: { [key: string]: any } = {};
161
- const { dynamicFieldDataState } = this.state;
227
+ const { dynamicFieldDataState, aiAssistedFields } = this.state;
162
228
 
163
229
  Object.keys(dynamicFieldDataState).forEach((key: string) => {
164
230
  const fieldDetails = functionDetails.parameters.properties[key];
165
231
  let value = dynamicFieldDataState[key] || '';
166
232
 
233
+ // If field is AI assisted, mark it in the submission
234
+ if (aiAssistedFields.includes(key) || key === AIAssistFieldId) {
235
+ return; // Skip further processing for this field
236
+ }
237
+
167
238
  // Check for field type and cast value
168
239
  if (fieldDetails) {
169
240
  switch (fieldDetails.type) {
@@ -305,9 +376,17 @@ class FunctionForm extends Component<
305
376
  };
306
377
  });
307
378
 
379
+ // Skip validation for AI assisted fields
380
+ if (this.state.aiAssistedFields.includes(fieldId)) {
381
+ return;
382
+ }
383
+
308
384
  const isValid = true;
309
385
  let hasInvalidFields = Object.keys(this.state.dynamicFieldDataState).some(
310
- (key) => key !== fieldId && this.state.invalidFields.includes(key),
386
+ (key) =>
387
+ key !== fieldId &&
388
+ this.state.invalidFields.includes(key) &&
389
+ !this.state.aiAssistedFields.includes(key),
311
390
  );
312
391
 
313
392
  if (value && isValid) {
@@ -340,6 +419,63 @@ class FunctionForm extends Component<
340
419
  }
341
420
  };
342
421
 
422
+ // New method to toggle AI assist for a field
423
+ toggleAIAssist = (fieldId: string, enabled: boolean) => {
424
+ this.setState((prevState) => {
425
+ let newAIAssistedFields = [...prevState.aiAssistedFields];
426
+ let newInvalidFields = [...prevState.invalidFields];
427
+
428
+ if (enabled) {
429
+ // Add to AI assisted fields if not already there
430
+ if (!newAIAssistedFields.includes(fieldId)) {
431
+ newAIAssistedFields.push(fieldId);
432
+ }
433
+ // Remove from invalid fields if it was there
434
+ newInvalidFields = newInvalidFields.filter(
435
+ (field) => field !== fieldId,
436
+ );
437
+ } else {
438
+ // Remove from AI assisted fields
439
+ newAIAssistedFields = newAIAssistedFields.filter(
440
+ (field) => field !== fieldId,
441
+ );
442
+
443
+ // Check if field should be marked as invalid
444
+ const fieldDetails =
445
+ prevState.functionDetails.parameters?.properties[fieldId];
446
+ const fieldValue = prevState.dynamicFieldDataState[fieldId];
447
+
448
+ if (
449
+ fieldDetails?.meta.is_required &&
450
+ (!fieldValue || fieldValue === '')
451
+ ) {
452
+ if (!newInvalidFields.includes(fieldId)) {
453
+ newInvalidFields.push(fieldId);
454
+ }
455
+ }
456
+ }
457
+
458
+ // Call the onAIAssistToggle callback if provided
459
+ if (this.props.onAIAssistToggle) {
460
+ this.props.onAIAssistToggle(fieldId, enabled, newAIAssistedFields);
461
+ }
462
+
463
+ if (this.props.customSaveCallback) {
464
+ // we have communciate back to the custom save callback with the updated state
465
+ const currentDataState = this.onSubmit({}, true, fieldId);
466
+ this.props.customSaveCallback({
467
+ hasInvalidFields: newInvalidFields.length > 0,
468
+ data: currentDataState,
469
+ });
470
+ }
471
+
472
+ return {
473
+ aiAssistedFields: newAIAssistedFields,
474
+ invalidFields: newInvalidFields,
475
+ };
476
+ });
477
+ };
478
+
343
479
  replacePlaceholders = (
344
480
  templateObj: { [key: string]: any },
345
481
  dictionary: { [key: string]: any },
@@ -424,6 +560,37 @@ class FunctionForm extends Component<
424
560
  return data;
425
561
  };
426
562
 
563
+ // Custom wrapper for ConfigureFieldWrapper to add AI assist toggle
564
+ renderFieldWrapper = (field: any, children: any) => {
565
+ const { enableAIAssist } = this.props;
566
+ const isAIAssisted = this.state.aiAssistedFields.includes(field.id);
567
+
568
+ if (!enableAIAssist) {
569
+ return html`<${ConfigureFieldWrapper} field=${field}>${children}<//>`;
570
+ }
571
+
572
+ // Add AI assist toggle to the field wrapper
573
+ return html`
574
+ <${ConfigureFieldWrapper} field=${field}>
575
+ <div class="${styles.fieldWrapperWithAIAssist}">
576
+ <div class="${styles.aiAssistToggleContainer}">
577
+ <label class="${styles.aiAssistToggleLabel}">
578
+ <span>AI assist</span>
579
+ <input
580
+ type="checkbox"
581
+ class="${styles.aiAssistToggle}"
582
+ checked=${isAIAssisted}
583
+ onChange=${(e: any) =>
584
+ this.toggleAIAssist(field.id, e.target.checked)}
585
+ />
586
+ </label>
587
+ </div>
588
+ ${children}
589
+ </div>
590
+ <//>
591
+ `;
592
+ };
593
+
427
594
  renderFields = (
428
595
  properties: any,
429
596
  functionArguments: any,
@@ -517,92 +684,107 @@ class FunctionForm extends Component<
517
684
  return null;
518
685
  }
519
686
 
687
+ // Check if field has AI assist enabled
688
+ const isAIAssisted = this.state.aiAssistedFields.includes(field.id);
689
+ // Set placeholder text for AI assisted fields
690
+ const aiPlaceholder = isAIAssisted
691
+ ? field.placeholder
692
+ : field.placeholder;
693
+
520
694
  switch (field.type) {
521
695
  case 'TEXTFIELD':
522
696
  fieldElement = html`
523
697
  <div class="${styles.functionFieldWrap} integry-action-field-wrap">
524
- <${ConfigureFieldWrapper} field=${field}>
525
- <${MultipurposeField}
526
- id="${field.id}"
527
- title="${field.title}"
528
- activityOutputData=${arrayToNestedJSONWithFirstValue(
529
- JSONToActivityOutputData(this.props.variables || {}),
530
- JSONToDynamicFieldData(this.props.variables || {}),
531
- )}
532
- activityOutputDataRaw=${JSONToActivityOutputData(
533
- this.props.variables || {},
534
- )}
535
- description="${field.description}"
536
- value=${this.state.dynamicFieldDataState[field.id]}
537
- placeholder="${field.placeholder}"
538
- regex=${field.regex}
539
- regexErrorMessage=${field.regexErrorMessage}
540
- isRequired="${field.is_required}"
541
- onChange=${(val: any) => {
542
- this.onFieldChange(
543
- field.id,
544
- val,
545
- field.dataType,
546
- field.is_required,
547
- parentFieldId,
548
- );
549
- }}
550
- type=${fieldType}
551
- isMappable=${this.props.variables &&
552
- Object.entries(this.props.variables).length > 0 &&
553
- field.dataType !== 'array'}
554
- isEditable=${true}
555
- allowTagsInText=${this.props.variables}
556
- fieldId=${field.id}
557
- isArray=${field.dataType === 'array'}
558
- tagsTree=${this.props.showMappingMenu
559
- ? this.props.variables
560
- : null}
561
- ><//>
562
- <//>
698
+ ${this.renderFieldWrapper(
699
+ field,
700
+ html`
701
+ <${MultipurposeField}
702
+ id="${field.id}"
703
+ title="${field.title}"
704
+ activityOutputData=${arrayToNestedJSONWithFirstValue(
705
+ JSONToActivityOutputData(this.props.variables || {}),
706
+ JSONToDynamicFieldData(this.props.variables || {}),
707
+ )}
708
+ activityOutputDataRaw=${JSONToActivityOutputData(
709
+ this.props.variables || {},
710
+ )}
711
+ description="${field.description}"
712
+ value=${this.state.dynamicFieldDataState[field.id]}
713
+ placeholder="${aiPlaceholder}"
714
+ regex=${field.regex}
715
+ regexErrorMessage=${field.regexErrorMessage}
716
+ isRequired="${field.is_required}"
717
+ onChange=${(val: any) => {
718
+ this.onFieldChange(
719
+ field.id,
720
+ val,
721
+ field.dataType,
722
+ field.is_required,
723
+ parentFieldId,
724
+ );
725
+ }}
726
+ type=${fieldType}
727
+ isMappable=${this.props.variables &&
728
+ Object.entries(this.props.variables).length > 0 &&
729
+ field.dataType !== 'array'}
730
+ isEditable=${true}
731
+ isDisabled=${isAIAssisted}
732
+ allowTagsInText=${this.props.variables}
733
+ fieldId=${field.id}
734
+ isArray=${field.dataType === 'array'}
735
+ tagsTree=${this.props.showMappingMenu
736
+ ? this.props.variables
737
+ : null}
738
+ ><//>
739
+ `,
740
+ )}
563
741
  </div>
564
742
  `;
565
743
  break;
566
744
  case 'TEXTAREA':
567
745
  fieldElement = html`
568
746
  <div class="${styles.functionFieldWrap} integry-action-field-wrap">
569
- <${ConfigureFieldWrapper} field=${field}>
570
- <${MultipurposeField}
571
- id="${field.id}"
572
- title="${field.title}"
573
- activityOutputData=${arrayToNestedJSONWithFirstValue(
574
- JSONToActivityOutputData(this.props.variables || {}),
575
- JSONToDynamicFieldData(this.props.variables || {}),
576
- )}
577
- activityOutputDataRaw=${JSONToActivityOutputData(
578
- this.props.variables || {},
579
- )}
580
- description="${field.description}"
581
- value=${this.state.dynamicFieldDataState[field.id]}
582
- placeholder="${field.placeholder}"
583
- isRequired=${field.is_required}
584
- isEditable="${field.is_editable}"
585
- fieldId=${field.id}
586
- onChange=${(val: any) => {
587
- this.onFieldChange(
588
- field.id,
589
- val,
590
- field.dataType,
591
- field.is_required,
592
- parentFieldId,
593
- );
594
- }}
595
- regex=${field.regex}
596
- regexErrorMessage=${field.regexErrorMessage}
597
- type=${fieldType}
598
- isMappable=${this.props.variables &&
599
- Object.entries(this.props.variables).length > 0}
600
- allowTagsInText=${this.props.variables}
601
- tagsTree=${this.props.showMappingMenu
602
- ? this.props.variables
603
- : null}
604
- ><//>
605
- <//>
747
+ ${this.renderFieldWrapper(
748
+ field,
749
+ html`
750
+ <${MultipurposeField}
751
+ id="${field.id}"
752
+ title="${field.title}"
753
+ activityOutputData=${arrayToNestedJSONWithFirstValue(
754
+ JSONToActivityOutputData(this.props.variables || {}),
755
+ JSONToDynamicFieldData(this.props.variables || {}),
756
+ )}
757
+ activityOutputDataRaw=${JSONToActivityOutputData(
758
+ this.props.variables || {},
759
+ )}
760
+ description="${field.description}"
761
+ value=${this.state.dynamicFieldDataState[field.id]}
762
+ placeholder="${aiPlaceholder}"
763
+ isRequired=${field.is_required}
764
+ isDisabled="${isAIAssisted}"
765
+ isEditable="${field.is_editable}"
766
+ fieldId=${field.id}
767
+ onChange=${(val: any) => {
768
+ this.onFieldChange(
769
+ field.id,
770
+ val,
771
+ field.dataType,
772
+ field.is_required,
773
+ parentFieldId,
774
+ );
775
+ }}
776
+ regex=${field.regex}
777
+ regexErrorMessage=${field.regexErrorMessage}
778
+ type=${fieldType}
779
+ isMappable=${this.props.variables &&
780
+ Object.entries(this.props.variables).length > 0}
781
+ allowTagsInText=${this.props.variables}
782
+ tagsTree=${this.props.showMappingMenu
783
+ ? this.props.variables
784
+ : null}
785
+ ><//>
786
+ `,
787
+ )}
606
788
  </div>
607
789
  `;
608
790
  break;
@@ -612,56 +794,61 @@ class FunctionForm extends Component<
612
794
  isDynamic = field.type === 'DYNAMIC_DROPDOWN';
613
795
  fieldElement = html`
614
796
  <div class="${styles.functionFieldWrap} integry-action-field-wrap">
615
- <${ConfigureFieldWrapper} field=${field}>
616
- <${ListBox}
617
- key=${field.id}
618
- fieldId=${field.id}
619
- apiHandler=${this.props.apiHandler}
620
- title=${field.title}
621
- description=${field.description}
622
- placeholder=${field.placeholder}
623
- isRequired=${field.is_required}
624
- value=${this.state.dynamicFieldDataState[field.id]}
625
- endpointUrl=${isDynamic
626
- ? field.endpointURL
627
- : JSON.stringify(options)}
628
- isDynamic=${isDynamic}
629
- optionKeyPath=${field.valueKeyPath}
630
- valueKeyPath=${field.optionKeyPath}
631
- endpointData=${field.dependsOn.length > 0
632
- ? JSON.stringify({
633
- authorization_id: `${connectedAccount}`,
634
- ...this.fetchDynamicData(field),
635
- })
636
- : null}
637
- type=${`${fieldType}`}
638
- isEditable=${field.type === 'DYNAMIC_DROPDOWN'}
639
- isSearchable=${true}
640
- isMappable=${this.props.showMappingMenu &&
641
- field.type !== 'DYNAMIC_DROPDOWN'}
642
- appName=${`${appName}`}
643
- isMultiSelect=${field.isMultiSelect}
644
- onChange=${(val: any, stopChangePropagation = false) => {
645
- this.onFieldChange(
646
- field.id,
647
- val,
648
- field.dataType,
649
- field.is_required,
650
- parentFieldId,
651
- -1,
652
- stopChangePropagation,
653
- );
654
- }}
655
- dataSourceBody=${this.replacePlaceholders(
656
- field.dataSourceBody,
657
- this.state.dynamicFieldDataState,
658
- )}
659
- selectedAuthId=${`${connectedAccount}`}
660
- tagsTree=${this.props.showMappingMenu
661
- ? this.props.variables
662
- : null}
663
- ><//>
664
- <//>
797
+ ${this.renderFieldWrapper(
798
+ field,
799
+ html`
800
+ <${ListBox}
801
+ key=${field.id}
802
+ fieldId=${field.id}
803
+ apiHandler=${this.props.apiHandler}
804
+ title=${field.title}
805
+ description=${field.description}
806
+ placeholder=${aiPlaceholder}
807
+ isRequired=${field.is_required}
808
+ value=${this.state.dynamicFieldDataState[field.id]}
809
+ endpointUrl=${isDynamic
810
+ ? field.endpointURL
811
+ : JSON.stringify(options)}
812
+ isDynamic=${isDynamic}
813
+ optionKeyPath=${field.valueKeyPath}
814
+ valueKeyPath=${field.optionKeyPath}
815
+ endpointData=${field.dependsOn.length > 0
816
+ ? JSON.stringify({
817
+ authorization_id: `${connectedAccount}`,
818
+ ...this.fetchDynamicData(field),
819
+ })
820
+ : null}
821
+ type=${`${fieldType}`}
822
+ isDisabled="${isAIAssisted}"
823
+ isEditable=${field.type === 'DYNAMIC_DROPDOWN'}
824
+ isSearchable=${true}
825
+ isMappable=${this.props.showMappingMenu &&
826
+ field.type !== 'DYNAMIC_DROPDOWN'}
827
+ appName=${`${appName}`}
828
+ isMultiSelect=${field.isMultiSelect}
829
+ onChange=${(val: any, stopChangePropagation = false) => {
830
+ this.onFieldChange(
831
+ field.id,
832
+ val,
833
+ field.dataType,
834
+ field.is_required,
835
+ parentFieldId,
836
+ -1,
837
+ stopChangePropagation,
838
+ );
839
+ }}
840
+ dataSourceBody=${this.replacePlaceholders(
841
+ field.dataSourceBody,
842
+ this.state.dynamicFieldDataState,
843
+ )}
844
+ selectedAuthId=${`${connectedAccount}`}
845
+ tagsTree=${this.props.showMappingMenu
846
+ ? this.props.variables
847
+ : null}
848
+ isReadOnly=${isAIAssisted}
849
+ ><//>
850
+ `,
851
+ )}
665
852
  </div>
666
853
  `;
667
854
  break;
@@ -675,40 +862,46 @@ class FunctionForm extends Component<
675
862
  key=${field.id}
676
863
  class=${`${styles.actionStepFieldWrap} integry-action-field-wrap`}
677
864
  >
678
- <${DynamicTypedField}
679
- dynamicField=${field}
680
- endpointData=${JSON.stringify({
681
- authorization_id: `${connectedAccount}`,
682
- })}
683
- placeHolder=${field.placeholder}
684
- appName=${`${appName}`}
685
- selectedAuthId=${`${connectedAccount}`}
686
- sourceFlowIntegrataionInvocationUrl=${field.endpointURL}
687
- isMappable=${Object.entries(this.props.variables || {}).length >
688
- 0}
689
- isEditable=${false}
690
- allowTagsInText=${true}
691
- apiHandler=${this.props.apiHandler}
692
- idKeyPath=${field.idKeyPath}
693
- typeKeyPath=${field.typeKeyPath}
694
- titleKeyPath=${field.titleKeyPath}
695
- onChange=${(val: any) => {
696
- this.onFieldChange(field.id, val, field.dataType, false);
697
- }}
698
- dataSourceBody=${this.replacePlaceholders(
699
- field.dataSourceBody,
700
- this.state.dynamicFieldDataState,
701
- )}
702
- parentFieldsChanged=${this.state.parentFieldsChanged}
703
- activityOutputData=${arrayToNestedJSONWithFirstValue(
704
- JSONToActivityOutputData(this.props.variables || {}),
705
- JSONToDynamicFieldData(this.props.variables || {}),
706
- )}
707
- activityOutputDataRaw=${JSONToActivityOutputData(
708
- this.props.variables || {},
709
- )}
710
- value=${this.state.dynamicFieldDataState[field.id] || {}}
711
- />
865
+ ${this.renderFieldWrapper(
866
+ field,
867
+ html`
868
+ <${DynamicTypedField}
869
+ dynamicField=${field}
870
+ endpointData=${JSON.stringify({
871
+ authorization_id: `${connectedAccount}`,
872
+ })}
873
+ placeHolder=${aiPlaceholder}
874
+ appName=${`${appName}`}
875
+ selectedAuthId=${`${connectedAccount}`}
876
+ sourceFlowIntegrataionInvocationUrl=${field.endpointURL}
877
+ isMappable=${Object.entries(this.props.variables || {})
878
+ .length > 0}
879
+ isDisabled=${isAIAssisted}
880
+ isEditable=${false}
881
+ allowTagsInText=${true}
882
+ apiHandler=${this.props.apiHandler}
883
+ idKeyPath=${field.idKeyPath}
884
+ typeKeyPath=${field.typeKeyPath}
885
+ titleKeyPath=${field.titleKeyPath}
886
+ onChange=${(val: any) => {
887
+ this.onFieldChange(field.id, val, field.dataType, false);
888
+ }}
889
+ dataSourceBody=${this.replacePlaceholders(
890
+ field.dataSourceBody,
891
+ this.state.dynamicFieldDataState,
892
+ )}
893
+ parentFieldsChanged=${this.state.parentFieldsChanged}
894
+ activityOutputData=${arrayToNestedJSONWithFirstValue(
895
+ JSONToActivityOutputData(this.props.variables || {}),
896
+ JSONToDynamicFieldData(this.props.variables || {}),
897
+ )}
898
+ activityOutputDataRaw=${JSONToActivityOutputData(
899
+ this.props.variables || {},
900
+ )}
901
+ value=${this.state.dynamicFieldDataState[field.id] || {}}
902
+ />
903
+ `,
904
+ )}
712
905
  </div>
713
906
  `;
714
907
 
@@ -720,22 +913,27 @@ class FunctionForm extends Component<
720
913
  <div
721
914
  class="${styles.functionFieldWrap} integry-action-field-wrap"
722
915
  >
723
- <${ObjectField}
724
- field=${field}
725
- functionArguments=${functionArguments}
726
- connectedAccount=${connectedAccount}
727
- appName=${appName}
728
- onChange=${this.onFieldChange}
729
- apiHandler=${this.props.apiHandler}
730
- isArray=${field.dataType === 'array'}
731
- activityOutputData=${arrayToNestedJSONWithFirstValue(
732
- JSONToActivityOutputData(this.props.variables || {}),
733
- JSONToDynamicFieldData(this.props.variables || {}),
734
- )}
735
- activityOutputDataRaw=${JSONToActivityOutputData(
736
- this.props.variables || {},
737
- )}
738
- />
916
+ ${this.renderFieldWrapper(
917
+ field,
918
+ html`
919
+ <${ObjectField}
920
+ field=${field}
921
+ functionArguments=${functionArguments}
922
+ connectedAccount=${connectedAccount}
923
+ appName=${appName}
924
+ onChange=${this.onFieldChange}
925
+ apiHandler=${this.props.apiHandler}
926
+ isArray=${field.dataType === 'array'}
927
+ activityOutputData=${arrayToNestedJSONWithFirstValue(
928
+ JSONToActivityOutputData(this.props.variables || {}),
929
+ JSONToDynamicFieldData(this.props.variables || {}),
930
+ )}
931
+ activityOutputDataRaw=${JSONToActivityOutputData(
932
+ this.props.variables || {},
933
+ )}
934
+ />
935
+ `,
936
+ )}
739
937
  </div>
740
938
  `;
741
939
  }
@@ -748,7 +946,7 @@ class FunctionForm extends Component<
748
946
 
749
947
  return html`
750
948
  <div class="${styles.functionFieldWrap} integry-action-field-wrap">
751
- <${ConfigureFieldWrapper} field=${field}> ${fieldElement} <//>
949
+ ${fieldElement}
752
950
  </div>
753
951
  `;
754
952
  });