@integry/sdk 4.6.67 → 4.6.68

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integry/sdk",
3
- "version": "4.6.67",
3
+ "version": "4.6.68",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -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>(objectValue);
62
+ const [customFieldsData, setCustomFieldsData] = useState<any>(
63
+ objectValue && objectValue !== '' ? JSON.parse(objectValue) : {},
64
+ );
63
65
  const [
64
66
  isErrorOnLoadingCustomFields,
65
67
  setIsErrorOnLoadingCustomFields,
@@ -161,7 +163,7 @@ const DynamicFields = (props: DynamicFieldsProps) => {
161
163
  };
162
164
  setCustomFieldsData(data);
163
165
 
164
- onChangeCallback(data);
166
+ onChangeCallback(JSON.stringify(data));
165
167
  } else {
166
168
  props.setStepMappingData({
167
169
  stepId,
@@ -186,9 +188,9 @@ const DynamicFields = (props: DynamicFieldsProps) => {
186
188
  ? props.stepDataMapping[stepId][dynamicField.id]
187
189
  : ({} as { objectValue: Record<string, string | number> });
188
190
  let fieldVal = '';
189
- const parsedVal =
190
- objectValue ||
191
- (ele.objectValue as Record<string, string | number>);
191
+ const parsedVal = objectValue
192
+ ? customFieldsData
193
+ : (ele.objectValue as Record<string, string | number>);
192
194
  if (parsedVal && parsedVal[el.id]) {
193
195
  fieldVal = `${parsedVal[el.id]}`;
194
196
  }