Fix deletion of deprecated notes
What does this MR do and why?
Notes in Snippets / Commits are deleted from the DOM even before the
user confirmed the deletion. With bootstrap_confirmation_modals
enabled this actually caused a bug, because the element is
progamatically clicked after confirmation. But as the element is removed
from the DOM already, Rails/UJS didn't intercept the click properly.
If we switch from a click handler to an ajax:success handler and remove the note from the DOM after a successful deletion, this problem is resolved.
Closes #355095 (closed)
Screenshots or screen recordings
What | Video |
---|---|
Before w/o bootstrap_confirmation_modals
|
before-no-ff |
Before w/ bootstrap_confirmation_modals
|
before-ff |
After | after |
How to set up and validate locally
- (Doesn't matter whether
Feature.enable(:bootstrap_confirmation_modals)
is enabled or not). - Visit a commit
- Leave a comment
- Refresh the page
- Try deleting the comment
- Comment is now only removed from page after you confirmed the deletion.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Lukas Eipert