Fix preview markdown for group level work items
What does this MR do and why?
PreviewMarkdown
controller concern needs to handle
both project and group level objects by using the
BaseContainerService
in PreviewMarkdownService
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
There's no easy way to test this one locally since the frontend needs to be updated in order to use this endpoint first, but you can use the explorer inspector to test
- Enable the
namespace_level_work_items
feature flag in the Rails consoleFeature.enable(:namespace_level_work_items)
- Go to a group level work item list http://gdk.test:3000/groups/flightjs/-/work_items
- Create a new Epic
- Click on the new epic and it will take you to the detail view
- Open the explorer dev inspector to look at requests
- Type a message to create a new comment and click on the preview button. This will trigger a request that will return a not found status, but you can copy that request as curl to be used in the terminal
- The copied URL will look like
http://gdk.test:3000/flightjs/preview_markdown?target_type=WorkItem&target_id=47
, but before making the request withcurl
, you need to change the url tohttp://gdk.test:3000/groups/flightjs/preview_markdown?target_type=WorkItem&target_id=47
and that request should work
Related to #435902 (closed)
Closes #439483 (closed)
Edited by Mario Celi