Skip to content

Port survey banner component

Sarah German requested to merge 18-survey-banner into main

What does this MR do and why?

  • Ports over the Survey Banner component
  • Adds utilities for running Jest tests

Closes #18 (closed) (see this issue for the expected behavior for the banner)

This is mostly a copy of the Nanoc version of this component, with a few intentional differences:

  1. The Nanoc DocsBanner component also provides the "archived version" banner, which is a future issue for this project. TBD on if we'll keep these as a single component with config like we did before, vs separate components (leaning towards the latter, though).
  2. This MR does not include logic for not rendering the banner in an archived version (like we do in Nanoc here), as we don't have logic in place in Hugo to detect versioning yet. Version-related template functions will be addressed in #57.

Screenshots, screen recordings, or links to review app

Before After
image image

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/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md and check out this branch
  2. Update dependencies: make setup
  3. Run the dev server: make view
  4. Edit data/banner.yaml and set show_banner to true. Try adding different description text and/or links in markdown format. The Hugo site should now show the banner on interior content pages, and not on the homepage.
  5. Use the x to close the banner and browse to another page. The banner should not appear.
  6. Clear your cookies (or look in an incognito window) and refresh the page. The banner should appear again.

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.

Edited by Sarah German

Merge request reports