-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING AbstractDetail never merge mutation results into form #9844
In a typical mutation, we want to fetch `name`, to keep Apollo cache up to date and to show the new `name` as page header and page title. But if we do that, and AbstractDetail auto-merge `name` into the form, then we might override the form field that is currently being edited by the human. And that is the exact bug we were trying to avoid with all the recent changes. So AbstractDetail does not merge mutation results back into the form anymore. And it is up to the consuming component to reproduce it, if needed, possibly on a field-by-field basis, according to its specific needs. The simplest way to re-introduce previous behavior is the following, but it would be more robust to merge only specifics fields known to be mergeable safely: ```ts protected override postUpdate(model): void { this.form.patchValue(model); } ```
- Loading branch information
Showing
2 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters