USWDS-Site - Banner: Fix component code ID’s #2312
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixed a bug causing component code example ID’s and relevant aria attributes to display incorrectly. Now, example ID’s match what’s found in the USWDS repo and are more succinct.
Breaking change
This is potentially a breaking change
Related issue
Closes #2307
Preview link
Banner component page →
Problem statement
During the switch to Storybook, we changed the way Banner variant data is stored and provided their ID’s in their relevant JSON files. On site, the code capture for banner was not update to reflect this new structure.
During the code capture, it was set to replace
gov-bannerwith the variant ID,gov-banner-defaultfor example. Since we didn’t remove this replacement, it would replacegov-bannerwhile leaving the existing suffix, resulting in results likegov-banner-default-defaultorgov-banner-mil-spanish-dot-mil-lang-esSolution
Remove the now unnecessary string replacement form component code capture.
Major changes
Code preview IDs now match what we have in the USWDS repo.
Testing and review
pa11ytests and/or axe devtools accessibility scan on this pageTesting checklist