Skip to content

Refactor the archives banner to use versions.json and GitLab UI

Sarah German requested to merge sarahg/archives-banner-refactor into main

What does this MR do and why?

Refactors the Archives banner component to address a few issues:

  1. 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.
  2. 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
image image
image image

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.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Open lib/helpers/versions.rb and adjust the show_version_banner? method to just return true, like this:
    def show_version_banner?
      true
    end
  1. 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.

Merge request reports