Display slash commands outcome when previewing Markdown
What does this MR do?
This continues the work started in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7497.
- Remove slash commands from Markdown preview and display their outcome next to the text field.
- Introduce new "explanation" block to our slash commands DSL.
- Introduce optional "parse_params" block to slash commands DSL that allows to process a parameter before it is passed to "explanation" or "command" blocks.
- Pass path for previewing Markdown as "data" attribute instead of setting a variable on "window".
Are there points in the code the reviewer needs to double check?
I didn't use shared_examples
for testing InterpretService#explain
, because I don't think that testing the same stuff for Issue
and MergeRequest
makes sense. Instead I'm testing Issue
in roughly half of the specs and MergeRequest
in the rest.
Why was this MR needed?
We don't display slash commands after issue / merge requests / comment is submitted. Hence, we should also remove them from Markdown preview. Having their outcome displayed as well is helpful.
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated [ ] API support added- Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes #21531 (closed)
EE MR https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1707