@openg2p/registry-widgets 1.1.6-dev.2 → 1.1.6-dev.3
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/components/SectionRenderer/hooks/useCrViewData.d.ts.map +1 -1
- package/dist/components/SectionsContainer.d.ts +1 -0
- package/dist/components/SectionsContainer.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +9 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3051,11 +3051,15 @@ const useCrViewData = (mode, currentSchemaData, storeValues) => React.useMemo(()
|
|
|
3051
3051
|
return null;
|
|
3052
3052
|
const dataSource = { ...storeValues, ...currentSchemaData };
|
|
3053
3053
|
const recordPath = Object.keys(dataSource)[0];
|
|
3054
|
+
const records = dataSource[recordPath]?.records;
|
|
3055
|
+
const auditPath = Array.isArray(records) && records.length > 0
|
|
3056
|
+
? `${recordPath}.records.${records.length - 1}`
|
|
3057
|
+
: recordPath;
|
|
3054
3058
|
return {
|
|
3055
|
-
createdBy: getValueByPath(dataSource, `${
|
|
3056
|
-
createdDate: getValueByPath(dataSource, `${
|
|
3057
|
-
approvedBy: getValueByPath(dataSource, `${
|
|
3058
|
-
approvedDate: getValueByPath(dataSource, `${
|
|
3059
|
+
createdBy: getValueByPath(dataSource, `${auditPath}.created_by`),
|
|
3060
|
+
createdDate: getValueByPath(dataSource, `${auditPath}.created_at`),
|
|
3061
|
+
approvedBy: getValueByPath(dataSource, `${auditPath}.last_approved_by`),
|
|
3062
|
+
approvedDate: getValueByPath(dataSource, `${auditPath}.last_approved_at`),
|
|
3059
3063
|
};
|
|
3060
3064
|
}, [mode, currentSchemaData, storeValues]);
|
|
3061
3065
|
|
|
@@ -4273,6 +4277,7 @@ const SectionsContainer = ({ sections, dataSourceRequestHandler: propDataSourceR
|
|
|
4273
4277
|
}
|
|
4274
4278
|
return results;
|
|
4275
4279
|
},
|
|
4280
|
+
hasUnsavedChanges: () => Object.values(sectionDirtyMapRef.current).some(Boolean),
|
|
4276
4281
|
};
|
|
4277
4282
|
}, [store, dispatch, safeSections]);
|
|
4278
4283
|
React.useEffect(() => {
|