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

Remove unused single country variant from phone input component #11260

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

aduth
Copy link
Member

@aduth aduth commented Sep 18, 2024

🎫 Ticket

Supports LG-14382

🛠 Summary of changes

Updates PhoneInputComponent to remove special consideration for a case where only a single country is supported, which would avoid rendering country list as a dropdown selector.

This was originally added in #5619, specifically for IdV phone verification step. At the time, we only accepted U.S. phone numbers for phone verification. This has since been expanded to support U.S. territories. Therefore, we don't currently use this functionality at all in the application.

These changes facilitate the work being done in #11257, where the single country variant does not work as expected after the upgrade.

Easier to review with whitespace changes hidden: https://github.com/18F/identity-idp/pull/11260/files?w=1

📜 Testing Plan

  1. Go to http://localhost:3000/components/inspect/phone_input/workbench
  2. Observe no regressions in the behavior of phone input component
  3. Go to http://localhost:3000/components/inspect/phone_input/workbench?allowed_countries=US
  4. Observe that the phone input component still works even if we only had one option, it just isn't an especially optimized experience

changelog: Internal, Code Quality, Remove unused variant for phone input component
@aduth aduth requested a review from a team September 18, 2024 19:40
@@ -148,32 +142,29 @@ export class PhoneInputElement extends HTMLElement {
localizedCountries: countryCodePairs,
onlyCountries: supportedCountryCodes,
autoPlaceholder: 'off',
allowDropdown: this.hasDropdown,
Copy link
Member Author

Choose a reason for hiding this comment

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

@aduth aduth merged commit 9cb0e01 into main Sep 18, 2024
2 checks passed
@aduth aduth deleted the aduth-rm-single-country-phone-input branch September 18, 2024 19:54
AShukla-GSA pushed a commit that referenced this pull request Sep 30, 2024
changelog: Internal, Code Quality, Remove unused variant for phone input component
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.

2 participants