Skip to content
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

USWDS-Site - Banner: Fix component code ID’s #2312

Merged
merged 3 commits into from
Nov 30, 2023
Merged

Conversation

mahoneycm
Copy link
Contributor

@mahoneycm mahoneycm commented Oct 20, 2023

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-banner with the variant ID, gov-banner-default for example. Since we didn’t remove this replacement, it would replace gov-banner while leaving the existing suffix, resulting in results like gov-banner-default-default or gov-banner-mil-spanish-dot-mil-lang-es

Solution

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

  1. Inspect component code preview
  2. Compare the banner variants ID’s to those found in packages/usa-banner/src/content json files
  3. Confirm that they match
  4. Run pa11y tests and/or axe devtools accessibility scan on this page
  5. Confirm no errors

Testing checklist

  • Example banner ID’s match those found in USWDS repo
  • Confirm they are displaying correctly on Site
  • Confirm there are no accessibility errors as a result of this change (such as duplicate IDs)
  • Approve new changelog entry

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Added note for updating two changelog fields.

Confirming

  • IDs are accurate
  • Banners work
  • No new a11y issues (scanned via axe)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo

Update date and versionUswds fields.

@mejiaj mejiaj merged commit ac19d0a into main Nov 30, 2023
11 checks passed
@mejiaj mejiaj deleted the cm-banner-id-fix branch November 30, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USWDS-Site - Bug: Banner ID's are incorrect
2 participants