Skip to content

Separate wiki page title and path fields

Himanshu Kapoor requested to merge himkp-wiki-page-url into master

What does this MR do and why?

Related to Wiki URL changes when title changes (#30758 - closed)

By separting the wiki title and path fields, we allow people to change the title of a wiki page without changing the path. However people can still change the path of the wiki page if they choose to do so.

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.

Screenshots or screen recordings

Scenario Description Screenshot
Creating a new page
  1. "Generate page path from title" checkbox is checked by default.
  2. Unchecking it allows you to define a path that is different from the title.
  3. Behind the scenes, when the checkbox is unchecked, the title is saved in front matter.
  4. We would never show front matter to people editing the page, but we will persist it behind the scenes for users who use front matter for other purposes.

image.png

Editing a page
  1. "Generate page path from title" checkbox is unchecked by default.
  2. Changing the title while the checkbox is unchecked will not change the path.
  3. Path is saved in front matter again as the case above. And we wouldn't show front matter to users editing the page.

image.png

Changing the URL of a page

When you change the path of a page, a redirect is automatically set up from the old path to the new path. This is tracked in #257892 (closed) and was delivered in !150727 (merged) and !153289 (merged).

Notes:

  1. The title saved in front matter is visible on the page itself. It is not visible in the sidebar, list of all pages and in wiki pages autocomplete dropdown. This will be done in a follow-up.

How to set up and validate locally

  1. Enable feature flags. Open rails c and run:

    Feature.enable(:wiki_front_matter)
    Feature.enable(:wiki_front_matter_title)
  2. Edit a page. See description in the screenshot section for further steps.

Edited by Himanshu Kapoor

Merge request reports