Skip to content

Remove unused single country variant from phone input component#11260

Merged
aduth merged 1 commit intomainfrom
aduth-rm-single-country-phone-input
Sep 18, 2024
Merged

Remove unused single country variant from phone input component#11260
aduth merged 1 commit intomainfrom
aduth-rm-single-country-phone-input

Conversation

@aduth
Copy link
Contributor

@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
localizedCountries: countryCodePairs,
onlyCountries: supportedCountryCodes,
autoPlaceholder: 'off',
allowDropdown: this.hasDropdown,
Copy link
Contributor 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
@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