Port survey banner component
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:
- 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). - 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 |
---|---|
![]() |
![]() |
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/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md and check out this branch -
Update dependencies: make setup
-
Run the dev server: make view
-
Edit data/banner.yaml
and setshow_banner
totrue
. 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. -
Use the x
to close the banner and browse to another page. The banner should not appear. -
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German