@integry/sdk 4.5.39 → 4.5.40
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
|
@@ -100,6 +100,9 @@ const ObjectField = (props: ObjectFieldProps) => {
|
|
|
100
100
|
activityOutputData,
|
|
101
101
|
activityOutputDataRaw,
|
|
102
102
|
} = props;
|
|
103
|
+
const [objectArray, setObjectArray] = useState<FieldObject[]>([{}]); // Start with one empty object in the array
|
|
104
|
+
const [showAddMoreOption, setShowAddMoreOption] = useState(true);
|
|
105
|
+
|
|
103
106
|
let templateFields = [];
|
|
104
107
|
|
|
105
108
|
if (Array.isArray(field.template_fields)) {
|
|
@@ -108,6 +111,12 @@ const ObjectField = (props: ObjectFieldProps) => {
|
|
|
108
111
|
} else if (field.type === 'TEXTAREA') {
|
|
109
112
|
templateFields = [field];
|
|
110
113
|
}
|
|
114
|
+
} else if (field.properties && Object.keys(field.properties).length === 0) {
|
|
115
|
+
field.type = 'TEXTAREA';
|
|
116
|
+
field.template_fields = [];
|
|
117
|
+
field.properties = null;
|
|
118
|
+
templateFields = [field];
|
|
119
|
+
setShowAddMoreOption(false);
|
|
111
120
|
}
|
|
112
121
|
const normalizedField = {
|
|
113
122
|
...field,
|
|
@@ -118,8 +127,6 @@ const ObjectField = (props: ObjectFieldProps) => {
|
|
|
118
127
|
: {}),
|
|
119
128
|
};
|
|
120
129
|
|
|
121
|
-
const [objectArray, setObjectArray] = useState<FieldObject[]>([{}]); // Start with one empty object in the array
|
|
122
|
-
|
|
123
130
|
// Method to handle field changes for each object in the array
|
|
124
131
|
const handleFieldChange = (
|
|
125
132
|
index: number,
|
|
@@ -365,6 +372,7 @@ const ObjectField = (props: ObjectFieldProps) => {
|
|
|
365
372
|
`,
|
|
366
373
|
)}
|
|
367
374
|
${isArray &&
|
|
375
|
+
showAddMoreOption &&
|
|
368
376
|
html` <a onClick=${handleAddMore}>+ Add another ${field.title}</a> `}
|
|
369
377
|
</div>
|
|
370
378
|
`;
|