Refactor the archives banner to use versions.json and GitLab UI
What does this MR do and why?
Refactors the Archives banner component to address a few issues:
- Fixes archives banner styling. At full-width, the banner was off-center; at small-width, it was partially covered by the nav bar. This refactor removes CSS in favor of GitLab UI utility classes.
- Checks versions.json instead of versions.yaml to determine if we're running the latest version of the site. This is a step towards retiring versions.yaml and using versions.json as a single source of truth (which will remove a manual step from the release process).
Screenshots, screen recordings, or links to review app
Before | After |
---|---|
The banner is not viewable in the review app, but we can use the review app to verify these changes do not cause any issues when viewing the site without the banner.
To review the site with the banner enabled, see below to run this in your local environment.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Open lib/helpers/versions.rb
and adjust theshow_version_banner?
method to just return true, like this:
def show_version_banner?
true
end
-
Save the change and compile the site; interior pages should show the Archives banner.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.