@integry/sdk 4.6.42 → 4.6.43
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
|
@@ -101,9 +101,7 @@ const FunctionField = (props: FunctionFieldProps) => {
|
|
|
101
101
|
const response: any[] = [];
|
|
102
102
|
|
|
103
103
|
Object.entries(properties).forEach(([key, property]) => {
|
|
104
|
-
|
|
105
|
-
response.push({ key, ...property });
|
|
106
|
-
}
|
|
104
|
+
response.push({ key, ...property });
|
|
107
105
|
});
|
|
108
106
|
|
|
109
107
|
return response;
|
|
@@ -677,6 +675,7 @@ const FunctionField = (props: FunctionFieldProps) => {
|
|
|
677
675
|
customSaveCallback=${handleCustomaSave}
|
|
678
676
|
variables=${tagsTree}
|
|
679
677
|
showMappingMenu=${true}
|
|
678
|
+
forceShowAllFields=${true}
|
|
680
679
|
/>
|
|
681
680
|
</div>
|
|
682
681
|
`
|
|
@@ -32,6 +32,7 @@ interface FunctionFormPropsType extends StoreType {
|
|
|
32
32
|
apiHandler: any;
|
|
33
33
|
customSaveCallback?: (response: any) => void; // Optional callback: Helps the implementor to implement their own save button
|
|
34
34
|
showMappingMenu?: boolean; // Optional prop to show mapping menu
|
|
35
|
+
forceShowAllFields?: boolean; // Optional prop to show all fields including hidden fields
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
interface ActionFormStateType {
|
|
@@ -330,9 +331,11 @@ class FunctionForm extends Component<
|
|
|
330
331
|
}
|
|
331
332
|
|
|
332
333
|
if (this.props.customSaveCallback) {
|
|
334
|
+
const currentDataState = this.onSubmit({}, true);
|
|
335
|
+
const updatedDataState = { ...currentDataState, [fieldId]: value };
|
|
333
336
|
this.props.customSaveCallback({
|
|
334
337
|
hasInvalidFields,
|
|
335
|
-
data:
|
|
338
|
+
data: updatedDataState,
|
|
336
339
|
});
|
|
337
340
|
}
|
|
338
341
|
};
|
|
@@ -510,7 +513,7 @@ class FunctionForm extends Component<
|
|
|
510
513
|
value: option.value,
|
|
511
514
|
}));
|
|
512
515
|
|
|
513
|
-
if (!field.isVisible) {
|
|
516
|
+
if (!field.isVisible && !this.props.forceShowAllFields) {
|
|
514
517
|
return null;
|
|
515
518
|
}
|
|
516
519
|
|
|
@@ -605,6 +608,7 @@ class FunctionForm extends Component<
|
|
|
605
608
|
break;
|
|
606
609
|
case 'DYNAMIC_DROPDOWN':
|
|
607
610
|
case 'STATIC_DROPDOWN':
|
|
611
|
+
case 'CHECKBOX':
|
|
608
612
|
isDynamic = field.type === 'DYNAMIC_DROPDOWN';
|
|
609
613
|
fieldElement = html`
|
|
610
614
|
<div class="${styles.functionFieldWrap} integry-action-field-wrap">
|
|
@@ -633,6 +637,8 @@ class FunctionForm extends Component<
|
|
|
633
637
|
type=${`${fieldType}`}
|
|
634
638
|
isEditable=${field.type === 'DYNAMIC_DROPDOWN'}
|
|
635
639
|
isSearchable=${true}
|
|
640
|
+
isMappable=${this.props.showMappingMenu &&
|
|
641
|
+
field.type !== 'DYNAMIC_DROPDOWN'}
|
|
636
642
|
appName=${`${appName}`}
|
|
637
643
|
isMultiSelect=${field.isMultiSelect}
|
|
638
644
|
onChange=${(val: any, stopChangePropagation = false) => {
|
|
@@ -659,38 +665,7 @@ class FunctionForm extends Component<
|
|
|
659
665
|
</div>
|
|
660
666
|
`;
|
|
661
667
|
break;
|
|
662
|
-
case 'CHECKBOX':
|
|
663
|
-
fieldElement = html`
|
|
664
|
-
<div class="${styles.functionFieldWrap} integry-action-field-wrap">
|
|
665
|
-
<${ConfigureFieldWrapper} field=${field}>
|
|
666
|
-
<${CheckboxGroup}
|
|
667
|
-
fieldId=${field.id}
|
|
668
|
-
title=${field.title}
|
|
669
|
-
description=${field.description}
|
|
670
|
-
placeholder=${field.placeholder}
|
|
671
|
-
value=${this.state.dynamicFieldDataState[field.id]}
|
|
672
|
-
isRequired=${field.is_required}
|
|
673
|
-
dataSrcEndpoint=${null}
|
|
674
|
-
isDynamic=${false}
|
|
675
|
-
initialOptions=${options.filter(
|
|
676
|
-
(option: Option) => option.id === '1',
|
|
677
|
-
)}
|
|
678
|
-
onChange=${(val: any) => {
|
|
679
|
-
this.onFieldChange(
|
|
680
|
-
field.id,
|
|
681
|
-
val,
|
|
682
|
-
field.dataType,
|
|
683
|
-
false,
|
|
684
|
-
parentFieldId,
|
|
685
|
-
);
|
|
686
|
-
}}
|
|
687
|
-
>
|
|
688
|
-
<//>
|
|
689
|
-
<//>
|
|
690
|
-
</div>
|
|
691
|
-
`;
|
|
692
668
|
|
|
693
|
-
break;
|
|
694
669
|
case 'CUSTOM_FIELDS':
|
|
695
670
|
if (!field.endpointURL) {
|
|
696
671
|
break;
|