Add WikiPage::Meta support for group wikis
What does this MR do and why?
Related to #468799 (closed) and #216904 (closed).
This adds backend support for WikiPage::Meta
for group-level wikis.
- Now every time a new wiki page for a group-level wiki is added, a corresponding
WikiPage::Meta
record is created, achieving parity with project-level wikis. - DB changes: A new
namespace_id
attribute has been added towiki_page_meta
to enable the records to belong to aNamespace
instead of aProject
andproject_id
is no longer required. A new record has to have at leastproject_id
ornamespace_id
present. - Generalized existing logic to support both
Project
andNamespace
as container entities for the meta records. -
Creating the-- this will be addressed in a follow-up MR.WikiPage::Meta
record has been moved toWikiPages::BaseService
for clarity and looser coupling.
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
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Create or visit an existing group-level wiki and add a new page.
- Check in Rails console that a new
WikiPage::Meta
record with the group'snamespace_id
and a newWikiPage::Slug
record were created. - Edit that page's title and slug.
- Check in Rails console that the
title
attribute in theWikiPage::Meta
record has changed and a newWikiPage::Slug
record was created.
Edited by Piotr Skorupa