Add support for content editor in comments
What does this MR do and why?
Adds support for content editor in issue and MR comments.
Note: The support is currently added only for the comment box at the bottom of the issue/MR page in this MR. Support for content editor in replies is added in !114557 (merged).
Screenshots or screen recordings
Before (or with FF disabled) | Current |
---|---|
Screen_Recording_2023-03-14_at_14.08.09 | Screen_Recording_2023-03-14_at_13.56.01 |
How to set up and validate locally
-
Enable feature flag
:content_editor_on_issues
:echo "Feature.enable(:content_editor_on_issues)" | rails c
-
Visit any issue or MR.
-
Notice that the comment box at the bottom of the page has a switcher reading "Viewing markdown" (bottom right corner) to switch between markdown/rich text.
-
Edit some text in each editor, switch back and forth and notice that the contents are preserved.
-
Refresh the page and notice that the contents are still preserved using a local storage draft.
-
Save or Cancel the form, it should work as expected.
If the feature flag is disabled, the switcher to switch between the editors is not visible.
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.
Related to #345072 (closed)