Fix container widget dynamicBindingPathList correction (#3619)
This commit is contained in:
parent
a82c789c1a
commit
64116583e3
|
|
@ -365,7 +365,7 @@ function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) {
|
|||
if (error instanceof IncorrectBindingError) {
|
||||
const { isRetry } = action.payload;
|
||||
const incorrectBindingError = JSON.parse(error.message);
|
||||
const { widgetId, message } = incorrectBindingError;
|
||||
const { message } = incorrectBindingError;
|
||||
if (isRetry) {
|
||||
Sentry.captureException(new Error("Failed to correct binding paths"));
|
||||
yield put({
|
||||
|
|
@ -379,18 +379,23 @@ function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) {
|
|||
},
|
||||
});
|
||||
} else {
|
||||
const correctedWidget = migrateIncorrectDynamicBindingPathLists(
|
||||
widgets[widgetId],
|
||||
// Create a denormalized structure because the migration needs the children in the dsl form
|
||||
const denormalizedWidgets = CanvasWidgetsNormalizer.denormalize("0", {
|
||||
canvasWidgets: widgets,
|
||||
});
|
||||
const correctedWidgets = migrateIncorrectDynamicBindingPathLists(
|
||||
denormalizedWidgets,
|
||||
);
|
||||
// Normalize the widgets because the save page needs it in the flat structure
|
||||
const normalizedWidgets = CanvasWidgetsNormalizer.normalize(
|
||||
correctedWidgets,
|
||||
);
|
||||
AnalyticsUtil.logEvent("CORRECT_BAD_BINDING", {
|
||||
error: error.message,
|
||||
correctWidget: JSON.stringify(correctedWidget),
|
||||
correctWidget: JSON.stringify(normalizedWidgets),
|
||||
});
|
||||
yield put(
|
||||
updateAndSaveLayout(
|
||||
{ ...widgets, [widgetId]: correctedWidget },
|
||||
true,
|
||||
),
|
||||
updateAndSaveLayout(normalizedWidgets.entities.canvasWidgets, true),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user