@integry/sdk 4.6.41 → 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/dist/esm/index.csm.js +1 -1
- package/dist/umd/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/form/FunctionField/index.ts +6 -4
- package/src/components/form/FunctionField/styles.module.scss +13 -11
- package/src/features/common/ActionForm/index.ts +3 -0
- package/src/features/common/FunctionForm/index.ts +18 -33
package/package.json
CHANGED
|
@@ -22,10 +22,11 @@ type FunctionFieldProps = {
|
|
|
22
22
|
field: Record<string, any>;
|
|
23
23
|
apiHandler?: any;
|
|
24
24
|
isArray?: boolean; // New prop for array support
|
|
25
|
+
tagsTree?: any;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const FunctionField = (props: FunctionFieldProps) => {
|
|
28
|
-
const { value, label, description, field, isArray = false } = props;
|
|
29
|
+
const { value, label, description, field, isArray = false, tagsTree } = props;
|
|
29
30
|
const [isOpen, setIsOpen] = useState(false);
|
|
30
31
|
const [editingIndex, setEditingIndex] = useState<number | null>(null);
|
|
31
32
|
const [selectedFunction, setSelectedFunction] = useState<string>('');
|
|
@@ -100,9 +101,7 @@ const FunctionField = (props: FunctionFieldProps) => {
|
|
|
100
101
|
const response: any[] = [];
|
|
101
102
|
|
|
102
103
|
Object.entries(properties).forEach(([key, property]) => {
|
|
103
|
-
|
|
104
|
-
response.push({ key, ...property });
|
|
105
|
-
}
|
|
104
|
+
response.push({ key, ...property });
|
|
106
105
|
});
|
|
107
106
|
|
|
108
107
|
return response;
|
|
@@ -674,6 +673,9 @@ const FunctionField = (props: FunctionFieldProps) => {
|
|
|
674
673
|
functionArguments=${userFilledData}
|
|
675
674
|
connectedAccountId=${connectedAccountId}
|
|
676
675
|
customSaveCallback=${handleCustomaSave}
|
|
676
|
+
variables=${tagsTree}
|
|
677
|
+
showMappingMenu=${true}
|
|
678
|
+
forceShowAllFields=${true}
|
|
677
679
|
/>
|
|
678
680
|
</div>
|
|
679
681
|
`
|
|
@@ -13,15 +13,16 @@
|
|
|
13
13
|
.functionFieldAddBtn {
|
|
14
14
|
padding: 5px 10px;
|
|
15
15
|
background-color: white;
|
|
16
|
-
border: 1px solid #
|
|
17
|
-
border-radius:
|
|
18
|
-
font-size: 0.
|
|
16
|
+
border: 1px solid #4250f0;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
font-size: 0.675rem;
|
|
19
19
|
font-weight: 500;
|
|
20
|
-
color: #
|
|
20
|
+
color: #4250f0;
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
|
|
23
23
|
&:hover {
|
|
24
|
-
background-color: #
|
|
24
|
+
background-color: #4250f0;
|
|
25
|
+
color: white;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
cursor: pointer;
|
|
51
52
|
font-size: 0.875rem;
|
|
52
53
|
padding: 0.25rem 0.5rem;
|
|
53
|
-
border-radius:
|
|
54
|
+
border-radius: 4px;
|
|
54
55
|
|
|
55
56
|
&:hover {
|
|
56
57
|
background-color: #e5e7eb;
|
|
@@ -244,15 +245,15 @@
|
|
|
244
245
|
.functionFieldCancelBtn {
|
|
245
246
|
padding: 0.5rem 1rem;
|
|
246
247
|
background-color: white;
|
|
247
|
-
border:
|
|
248
|
-
border-radius: 0.375rem;
|
|
248
|
+
border-radius: 4px;
|
|
249
249
|
font-size: 0.875rem;
|
|
250
250
|
font-weight: 500;
|
|
251
251
|
color: #374151;
|
|
252
252
|
cursor: pointer;
|
|
253
|
+
border: none;
|
|
253
254
|
|
|
254
255
|
&:hover {
|
|
255
|
-
background-color: #
|
|
256
|
+
background-color: #f4f4f5;
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
|
|
@@ -260,11 +261,12 @@
|
|
|
260
261
|
padding: 0.5rem 1rem;
|
|
261
262
|
background-color: #4250f0;
|
|
262
263
|
border: 1px solid transparent;
|
|
263
|
-
border-radius:
|
|
264
|
+
border-radius: 4px;
|
|
264
265
|
font-size: 0.875rem;
|
|
265
266
|
font-weight: 500;
|
|
266
267
|
color: white;
|
|
267
268
|
cursor: pointer;
|
|
269
|
+
width: 80px;
|
|
268
270
|
|
|
269
271
|
&:hover {
|
|
270
272
|
background-color: #2563eb;
|
|
@@ -445,7 +447,7 @@
|
|
|
445
447
|
cursor: pointer;
|
|
446
448
|
font-size: 0.75rem;
|
|
447
449
|
padding: 0.3rem 0.75rem;
|
|
448
|
-
border-radius:
|
|
450
|
+
border-radius: 4px;
|
|
449
451
|
font-weight: 500;
|
|
450
452
|
|
|
451
453
|
&:hover {
|
|
@@ -2158,6 +2158,9 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
|
|
|
2158
2158
|
this.props.verifyStepValidity(step.id);
|
|
2159
2159
|
}
|
|
2160
2160
|
}}
|
|
2161
|
+
tagsTree=${this.props.showMappingMenu
|
|
2162
|
+
? this.props.tagsTree
|
|
2163
|
+
: null}
|
|
2161
2164
|
/>
|
|
2162
2165
|
`;
|
|
2163
2166
|
|
|
@@ -31,6 +31,8 @@ interface FunctionFormPropsType extends StoreType {
|
|
|
31
31
|
onClose: (response: any) => void;
|
|
32
32
|
apiHandler: any;
|
|
33
33
|
customSaveCallback?: (response: any) => void; // Optional callback: Helps the implementor to implement their own save button
|
|
34
|
+
showMappingMenu?: boolean; // Optional prop to show mapping menu
|
|
35
|
+
forceShowAllFields?: boolean; // Optional prop to show all fields including hidden fields
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
interface ActionFormStateType {
|
|
@@ -329,9 +331,11 @@ class FunctionForm extends Component<
|
|
|
329
331
|
}
|
|
330
332
|
|
|
331
333
|
if (this.props.customSaveCallback) {
|
|
334
|
+
const currentDataState = this.onSubmit({}, true);
|
|
335
|
+
const updatedDataState = { ...currentDataState, [fieldId]: value };
|
|
332
336
|
this.props.customSaveCallback({
|
|
333
337
|
hasInvalidFields,
|
|
334
|
-
data:
|
|
338
|
+
data: updatedDataState,
|
|
335
339
|
});
|
|
336
340
|
}
|
|
337
341
|
};
|
|
@@ -509,7 +513,7 @@ class FunctionForm extends Component<
|
|
|
509
513
|
value: option.value,
|
|
510
514
|
}));
|
|
511
515
|
|
|
512
|
-
if (!field.isVisible) {
|
|
516
|
+
if (!field.isVisible && !this.props.forceShowAllFields) {
|
|
513
517
|
return null;
|
|
514
518
|
}
|
|
515
519
|
|
|
@@ -551,6 +555,9 @@ class FunctionForm extends Component<
|
|
|
551
555
|
allowTagsInText=${this.props.variables}
|
|
552
556
|
fieldId=${field.id}
|
|
553
557
|
isArray=${field.dataType === 'array'}
|
|
558
|
+
tagsTree=${this.props.showMappingMenu
|
|
559
|
+
? this.props.variables
|
|
560
|
+
: null}
|
|
554
561
|
><//>
|
|
555
562
|
<//>
|
|
556
563
|
</div>
|
|
@@ -591,6 +598,9 @@ class FunctionForm extends Component<
|
|
|
591
598
|
isMappable=${this.props.variables &&
|
|
592
599
|
Object.entries(this.props.variables).length > 0}
|
|
593
600
|
allowTagsInText=${this.props.variables}
|
|
601
|
+
tagsTree=${this.props.showMappingMenu
|
|
602
|
+
? this.props.variables
|
|
603
|
+
: null}
|
|
594
604
|
><//>
|
|
595
605
|
<//>
|
|
596
606
|
</div>
|
|
@@ -598,6 +608,7 @@ class FunctionForm extends Component<
|
|
|
598
608
|
break;
|
|
599
609
|
case 'DYNAMIC_DROPDOWN':
|
|
600
610
|
case 'STATIC_DROPDOWN':
|
|
611
|
+
case 'CHECKBOX':
|
|
601
612
|
isDynamic = field.type === 'DYNAMIC_DROPDOWN';
|
|
602
613
|
fieldElement = html`
|
|
603
614
|
<div class="${styles.functionFieldWrap} integry-action-field-wrap">
|
|
@@ -626,6 +637,8 @@ class FunctionForm extends Component<
|
|
|
626
637
|
type=${`${fieldType}`}
|
|
627
638
|
isEditable=${field.type === 'DYNAMIC_DROPDOWN'}
|
|
628
639
|
isSearchable=${true}
|
|
640
|
+
isMappable=${this.props.showMappingMenu &&
|
|
641
|
+
field.type !== 'DYNAMIC_DROPDOWN'}
|
|
629
642
|
appName=${`${appName}`}
|
|
630
643
|
isMultiSelect=${field.isMultiSelect}
|
|
631
644
|
onChange=${(val: any, stopChangePropagation = false) => {
|
|
@@ -644,43 +657,15 @@ class FunctionForm extends Component<
|
|
|
644
657
|
this.state.dynamicFieldDataState,
|
|
645
658
|
)}
|
|
646
659
|
selectedAuthId=${`${connectedAccount}`}
|
|
660
|
+
tagsTree=${this.props.showMappingMenu
|
|
661
|
+
? this.props.variables
|
|
662
|
+
: null}
|
|
647
663
|
><//>
|
|
648
664
|
<//>
|
|
649
665
|
</div>
|
|
650
666
|
`;
|
|
651
667
|
break;
|
|
652
|
-
case 'CHECKBOX':
|
|
653
|
-
fieldElement = html`
|
|
654
|
-
<div class="${styles.functionFieldWrap} integry-action-field-wrap">
|
|
655
|
-
<${ConfigureFieldWrapper} field=${field}>
|
|
656
|
-
<${CheckboxGroup}
|
|
657
|
-
fieldId=${field.id}
|
|
658
|
-
title=${field.title}
|
|
659
|
-
description=${field.description}
|
|
660
|
-
placeholder=${field.placeholder}
|
|
661
|
-
value=${this.state.dynamicFieldDataState[field.id]}
|
|
662
|
-
isRequired=${field.is_required}
|
|
663
|
-
dataSrcEndpoint=${null}
|
|
664
|
-
isDynamic=${false}
|
|
665
|
-
initialOptions=${options.filter(
|
|
666
|
-
(option: Option) => option.id === '1',
|
|
667
|
-
)}
|
|
668
|
-
onChange=${(val: any) => {
|
|
669
|
-
this.onFieldChange(
|
|
670
|
-
field.id,
|
|
671
|
-
val,
|
|
672
|
-
field.dataType,
|
|
673
|
-
false,
|
|
674
|
-
parentFieldId,
|
|
675
|
-
);
|
|
676
|
-
}}
|
|
677
|
-
>
|
|
678
|
-
<//>
|
|
679
|
-
<//>
|
|
680
|
-
</div>
|
|
681
|
-
`;
|
|
682
668
|
|
|
683
|
-
break;
|
|
684
669
|
case 'CUSTOM_FIELDS':
|
|
685
670
|
if (!field.endpointURL) {
|
|
686
671
|
break;
|