-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid showing deleted records in editor saving flow #36027
Avoid showing deleted records in editor saving flow #36027
Conversation
Size Change: -1 B (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
Do you think we can try this, I feel like it's a "purer" solution and a simple one as well. |
Yep, sure thing. |
@youknowriad It works, until you press 'undo' and then the removed edit is restored. Not sure what the right way to handle that would be. Should it also iterate through the undo stack and remove all edits associated with the deleted entity? I think this is where things get a bit weird when it comes to multi-entity editing. #36030 is the PR with the changes, and I've also updated #35981 to have that fix instead of this one. |
It seems there's an "undo" issue regardless of the approach, if the "delete" is effective on the backend, what does undo mean in this case? I guess we can't undo that change. So what solutions do we have there?
|
I feel like this might be better. Anywhere that references a deleted entity should be able to handle it, because it's possible to delete an entity outside of the editor anyway. The UI might just show it as deleted. It wouldn't be possible to undo changes for the deleted entity. But I think it is a bit weird for the user who possibly just perceives the editor as a single document rather than multiple interconnected documents. |
@talldan Sure that works for me, in all cases it's better than trunk where all of that is not handled anyway. |
@youknowriad Is it possible to merge this as a temporary fix? It seems harmless and can be reverted later on. #36030 is taking a bit longer, and I need to timebox my efforts on it. Unfortunately the entity panel bug is blocking an enhancement that I need to ship. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense to me as a temp measure.
Description
Fixes an issue I spotted when working on #35981.
If an entity is deleted in an editor, the entity saving panel tries to show it as an
undefined
thing that needs to be saved:Since a delete is immediate, that shouldn't be the case.
This filters the deleted records out of the
__experimentalGetDirtyEntityRecords
by checking if the entity exists usinggetEntityRecord
.But there might be a deeper issue. I noticed that the
deleteEntityRecords
doesn't removeedits
for an entity record. Should it? That's something I'm unsure of.How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).