Skip to content

Fix Live Markdown Preview in personal and subgroup projects

What does this MR do?

This MR addresses #339117 (closed) by fixing how we get the preview markdown path in the FE. Instead of building this URL in the FE, we get it from the BE now 🎉

As a side-effect, we also fix the feature when GitLab installed under a relative URL root

Screenshots or Screencasts (strongly suggested)

Description Screenshot
Single File Editor - Personal Project Screen_Shot_2021-08-23_at_3.15.34_PM
Single File Editor - Subgroup Screen_Shot_2021-08-23_at_3.18.18_PM
Web IDE Screen_Shot_2021-08-23_at_3.18.50_PM

How to setup and validate locally (strongly suggested)

To test in the Single File editor:

  1. Go to a project that has a Markdown file (with personal namespace or subgroup namespace)
  2. Click the Markdown file to view it
  3. Click "Edit"
  4. Right click in the editor and hit "Preview Markdown"

To test in the Web IDE:

  1. Go to a project that has a Markdown file (with personal namespace or subgroup namespace)
  2. Click the Markdown file to view it
  3. Click "Edit in Web IDE"
  4. Right click in the editor and hit "Preview Markdown"

To test in a relative URL root:

  1. Change your local GDK's gdk.yml to have a non-empty value under relative_url_root (see docs)
  2. Run gdk stop && gdk reconfigure
  3. Run gdk start and visit your GitLab instance under the new relative URL

Expected:

  • No errors in console
  • The markdown preview should be loaded next to the editor

Please note:

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #339117 (closed)

Edited by Paul Slaughter

Merge request reports