Skip to content

Commit

Permalink
Merge "[INTERNAL][FIX] sap.ui.rta: Page variant is not properly applied"
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zadikowitsch authored and Gerrit Code Review committed Sep 3, 2024
2 parents 4c310ae + 4fc5e14 commit 1993bac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/sap.ui.fl/src/sap/ui/fl/variants/VariantModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,10 @@ sap.ui.define([
return mCurrentVariant.controlChanges;
})
.flat();
const oLiveDependencyMap = FlexObjectState.getLiveDependencyMap(this.sFlexReference);
aVariantDependentControlChanges.forEach((oChange) => {
this.oChangePersistence.removeChange(oChange);
DependencyHandler.removeChangeFromMap(oLiveDependencyMap, oChange.getId());
DependencyHandler.removeChangeFromDependencies(oLiveDependencyMap, oChange.getId());
});

this.oDataSelector.removeUpdateListener(this.fnUpdateListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2433,9 +2433,10 @@ sap.ui.define([
});
FlexObjectManager.addDirtyFlexObjects(this.oModel.sFlexReference, [oUIChange]);
this.oModel.destroy();
const oFlexObjects = FlexState.getFlexObjectsDataSelector().get({ reference: sReference });
assert.strictEqual(oFlexObjects[0].getId(), "newUIChange", "then the change was not removed from the flex state");
assert.strictEqual(oAddRuntimeOnlySpy.callCount, 1, "then the fake Standard variant is added to the runtimeOnlyData");

stubFlexObjectsSelector([oUIChange]);
this.oModel = new VariantModel({}, {
flexController: this.oFlexController,
appComponent: this.oComponent
Expand Down

0 comments on commit 1993bac

Please sign in to comment.