-
Notifications
You must be signed in to change notification settings - Fork 1.1k
USWDS - Header: Consistent nav data is passed in Header #5311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The megamenu boolean is set inside of nav data object. This updates the stories and templates to keep it consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
- Confirmed missing
usa-megamenuclass on component markup - Confirmed no visual regression on fix
- Confirmed class present after
npm run build:html - Installed branch on site and confirmed code markup updated correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Confirm that the
usa-megamenuclass appears in the HTML of both megamenu templates when runningbuild:html - Confirm no visual regressions in headers in Storybook
- Confirmed that
megamenuis consistently included as a child ofnav
|
Issues affected all variants. Updated testing instructions. Missing logo prefixThe logo prefix was being passed in Storybook, but not on compile. Primary nav hrefSetting a default value via twig filter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving my notes here to keep track of them.
We briefly discussed removing the usa-logo ID because it seemed to be unnecessary. If we keep it, we should discuss changing the prefix to basic- (what it is currently on site) or keeping the updated ID's for each variant from this PR.
- Confirmed no visual regression across variants
- Confirmed markup is correct
-
usa-megamenuclass present on submenu items - usa-logo ID matches what is in JSON data
- Nav link
href's are not empty
-
|
@mejiaj @mahoneycm Opened #5319 to:
Let me know if you have any questions! |
Summary
Fixed an issue with inconsistent megamenu data being passed to navigation component. This was causing issues on compiling templates with
npm run build:htmland the markup in Site's code examples.Breaking change
This is not a breaking change.
Related issue
Closes #5305.
Related pull requests
Changelog entry PR - uswds/uswds-site#2111.
Preview link
Preview link:
Problem statement
The
megamenuboolean was sometimes passed as top-level setting and other times nested innavobject. This was displaying properly in StorybookJS, but broke onnpm run build:htmlbecause storybook functionality is separate from twig compile for site.Solution
The
megamenusetting is now nested innavobject consistently. Any overrides to toggle will need to be done inside ofnavobject.Major changes
Megamenu is no longer a top-level setting for header (this can be changed, but most templates already had nested setting).
Testing and review
npm run build:htmland ensure the rendered markup is correct. For example,usa-header--extended-megamenu.htmlsubmenu's should have these classesusa-nav__submenu usa-megamenu.href's aren't empty.