Skip to content

Fix preview markdown for group level work items

Mario Celi requested to merge 435902-quickatcions-followup into master

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

  1. Enable the namespace_level_work_items feature flag in the Rails console Feature.enable(:namespace_level_work_items)
  2. Go to a group level work item list http://gdk.test:3000/groups/flightjs/-/work_items
  3. Create a new Epic
  4. Click on the new epic and it will take you to the detail view
  5. Open the explorer dev inspector to look at requests
  6. 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
  7. The copied URL will look like http://gdk.test:3000/flightjs/preview_markdown?target_type=WorkItem&target_id=47, but before making the request with curl, you need to change the url to http://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

Merge request reports

Loading