digitalgov.gov icon indicating copy to clipboard operation
digitalgov.gov copied to clipboard

Fix glossary header bug

Open nick-mon1 opened this issue 11 months ago • 2 comments

Summary

Guide pages that display a summary-box component also display the Glossary h2 when it should not be visible. glossary.html is unnecessarily rendered on guide pages that don't use a glossary.

See guides/dap/common-questions-about-dap Screen Shot 2024-03-01 at 2 08 39 PM

Preview

Link to Preview

Solution

  1. Add a conditional check to display glossary.html when .Parent.Params.glossary is true.
  2. If the summary-box component is used on a page with a glossary component enabled, then don't display the Glossary h2.
  3. Hide the Glossary h2 in summary-box.js

How To Test

  1. Visit guide page and should not see glossary header in summary box when glossary is not enabled.
  2. Visit guide page and should not see glossary header in summary box when glossary is enabled.
    • set summary_box: true on content/guides/hcd/discovery-concepts/present.md on your local machine
  3. Visit guide landing page and should not see glossary header in summary box when glossary is enabled.
    • set summary_box: true on content/guides/hcd/introduction/_index.md on your local machine

What To Test

  1. glossary.html is not rendered when glossary field is not set
    • dg-glossary__container is not present in markup
  2. summary-box component does not display Glossary h2 when glossary field is not set (Step 2 above)
  3. summary-box component does not display Glossary h2 when glossary field is set (Step 3 above)

Dev Checklist

  • [x] PR has correct labels
  • [x] A11y testing (voice over testing, meets WCAG, run axe tools)
  • [x] Code is formatted properly

nick-mon1 avatar Mar 01 '24 15:03 nick-mon1

@nick-mon1 removed trello link.

nick-mon1 avatar Mar 01 '24 19:03 nick-mon1