Skip to content

Keep commit comments on second edit

What does this MR do and why?

Fix editing the same comment twice on Commit/Snippet pages.

When editing it moves the form element around the page, and revertNoteEditForm was trying to add it to .diffs, which isn't on the commit or snippets page. Added a placeholder element alongside the form so we always have somewhere to return the form to.

I didn't add tests because the entire deprecated_notes_spec.js is quarantined.. I could probably try but it would probably be faster to move it to use a less deprecated notes.js

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
2020-11-04_11.29.01 edit

How to set up and validate locally

  1. View a single commit (Code > Commits > choose one)
  2. Leave a comment
  3. Edit the comment, save
  4. Edit the comment again
  5. Save it again
  6. Keep going

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #23007 (closed)

Edited by Simon Knox

Merge request reports