From 5895a13caf0e7b78cf6b274781d7432a5c1a0bd1 Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Thu, 29 Feb 2024 17:15:43 -0500 Subject: [PATCH 1/6] Refactored template to hide header when summary box component is displayed --- .../layouts/partials/core/glossary.html | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/themes/digital.gov/layouts/partials/core/glossary.html b/themes/digital.gov/layouts/partials/core/glossary.html index cd1104d054..77d03e8bb2 100644 --- a/themes/digital.gov/layouts/partials/core/glossary.html +++ b/themes/digital.gov/layouts/partials/core/glossary.html @@ -1,27 +1,31 @@ - +{{ end }} From 24d20a49882b101bfcf96dba0829bcabfb8f197d Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Thu, 29 Feb 2024 17:45:29 -0500 Subject: [PATCH 2/6] Refactored conditional to check for nil --- themes/digital.gov/layouts/partials/core/glossary.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/digital.gov/layouts/partials/core/glossary.html b/themes/digital.gov/layouts/partials/core/glossary.html index 77d03e8bb2..6bc23ab63b 100644 --- a/themes/digital.gov/layouts/partials/core/glossary.html +++ b/themes/digital.gov/layouts/partials/core/glossary.html @@ -1,4 +1,4 @@ -{{ if isset .Params "glossary" }} +{{ if ne .Params.glossary nil }} diff --git a/themes/digital.gov/src/js/summary-box.js b/themes/digital.gov/src/js/summary-box.js index cf1a5b7b9d..2158cd8709 100644 --- a/themes/digital.gov/src/js/summary-box.js +++ b/themes/digital.gov/src/js/summary-box.js @@ -10,7 +10,7 @@ const guideSummaryList = guideSummary.querySelector(".usa-list"); const pageHeaders = document.querySelectorAll( - "h2:not(.usa-summary-box__heading, .dg-guide__content-header-title)" + "h2:not(.usa-summary-box__heading, .dg-guide__content-header-title, .dg-glossary__header)" ); function createSummaryBox() { From 6b3b25b7b6e258dc0fd11f0de63b57aa9949f5e7 Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Thu, 7 Mar 2024 14:13:09 -0500 Subject: [PATCH 4/6] Added jsdocs to document code --- .../layouts/partials/core/glossary.html | 5 +++++ themes/digital.gov/src/js/summary-box.js | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/themes/digital.gov/layouts/partials/core/glossary.html b/themes/digital.gov/layouts/partials/core/glossary.html index 6893034a04..2351492608 100644 --- a/themes/digital.gov/layouts/partials/core/glossary.html +++ b/themes/digital.gov/layouts/partials/core/glossary.html @@ -1,3 +1,8 @@ +{{/* Display a sidebar of glossary terms populated by a json file used on guide pages + See example here by clicking on glossary button https://digital.gov/guides/hcd/discovery-concepts/ +*/}} + +