Merge pull request #7971 from ToolJet/appdef-fix/table-crash

[appdef] fixes: table crash due to columnDeletionHistory saved as an object instead of an array
This commit is contained in:
Arpit 2023-10-20 11:13:58 +05:30 committed by GitHub
commit 4194ca7c32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,11 +112,26 @@ export const computeComponentPropertyDiff = (appDiff, definition, opts) => {
if (!opts?.isParamFromTableColumn) {
return appDiff;
}
const path = generatePath(appDiff, 'columns') || generatePath(appDiff, 'actions');
const columnsPath = generatePath(appDiff, 'columns');
const actionsPath = generatePath(appDiff, 'actions');
const deletionHistoryPath = generatePath(appDiff, 'columnDeletionHistory');
const value2 = getValueFromJson(definition, path);
let _diff = _.cloneDeep(appDiff);
const _diff = updateValueInJson(_.cloneDeep(appDiff), path, value2);
if (columnsPath) {
const columnsValue = getValueFromJson(definition, columnsPath);
_diff = updateValueInJson(_diff, columnsPath, columnsValue);
}
if (actionsPath) {
const actionsValue = getValueFromJson(definition, actionsPath);
_diff = updateValueInJson(_diff, actionsPath, actionsValue);
}
if (deletionHistoryPath) {
const deletionHistoryValue = getValueFromJson(definition, deletionHistoryPath);
_diff = updateValueInJson(_diff, deletionHistoryPath, deletionHistoryValue);
}
return _diff;
};