@integry/sdk 4.6.67 → 4.6.69
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
|
@@ -55,11 +55,13 @@ const DynamicFields = (props: DynamicFieldsProps) => {
|
|
|
55
55
|
refreshRootStepData,
|
|
56
56
|
parentFieldChanged = false,
|
|
57
57
|
onChangeCallback = () => null,
|
|
58
|
-
objectValue =
|
|
58
|
+
objectValue = null,
|
|
59
59
|
} = props;
|
|
60
60
|
const [dynamicItems, setDynamicItems] = useState<DynamicDataItem[]>([]);
|
|
61
61
|
const [loading, setLoading] = useState<boolean>(true);
|
|
62
|
-
const [customFieldsData, setCustomFieldsData] = useState<any>(
|
|
62
|
+
const [customFieldsData, setCustomFieldsData] = useState<any>(
|
|
63
|
+
objectValue && objectValue !== '' ? JSON.parse(objectValue) : {},
|
|
64
|
+
);
|
|
63
65
|
const [
|
|
64
66
|
isErrorOnLoadingCustomFields,
|
|
65
67
|
setIsErrorOnLoadingCustomFields,
|
|
@@ -83,6 +85,7 @@ const DynamicFields = (props: DynamicFieldsProps) => {
|
|
|
83
85
|
.then((res) => {
|
|
84
86
|
if (res) {
|
|
85
87
|
if (res) {
|
|
88
|
+
setIsErrorOnLoadingCustomFields(false);
|
|
86
89
|
if (Array.isArray(res)) {
|
|
87
90
|
setDynamicItems(res);
|
|
88
91
|
} else {
|
|
@@ -112,6 +115,7 @@ const DynamicFields = (props: DynamicFieldsProps) => {
|
|
|
112
115
|
)
|
|
113
116
|
.then((res) => {
|
|
114
117
|
if (res) {
|
|
118
|
+
setIsErrorOnLoadingCustomFields(false);
|
|
115
119
|
if (Array.isArray(res)) {
|
|
116
120
|
setDynamicItems(res);
|
|
117
121
|
} else {
|
|
@@ -161,7 +165,7 @@ const DynamicFields = (props: DynamicFieldsProps) => {
|
|
|
161
165
|
};
|
|
162
166
|
setCustomFieldsData(data);
|
|
163
167
|
|
|
164
|
-
onChangeCallback(data);
|
|
168
|
+
onChangeCallback(JSON.stringify(data));
|
|
165
169
|
} else {
|
|
166
170
|
props.setStepMappingData({
|
|
167
171
|
stepId,
|
|
@@ -186,9 +190,9 @@ const DynamicFields = (props: DynamicFieldsProps) => {
|
|
|
186
190
|
? props.stepDataMapping[stepId][dynamicField.id]
|
|
187
191
|
: ({} as { objectValue: Record<string, string | number> });
|
|
188
192
|
let fieldVal = '';
|
|
189
|
-
const parsedVal =
|
|
190
|
-
|
|
191
|
-
(ele.objectValue as Record<string, string | number>);
|
|
193
|
+
const parsedVal = objectValue
|
|
194
|
+
? customFieldsData
|
|
195
|
+
: (ele.objectValue as Record<string, string | number>);
|
|
192
196
|
if (parsedVal && parsedVal[el.id]) {
|
|
193
197
|
fieldVal = `${parsedVal[el.id]}`;
|
|
194
198
|
}
|