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

fix(web/react-native/ui): use translated strings and censorContactMethod for VerifyUser screen #5034

Merged
merged 17 commits into from
Feb 28, 2024

Conversation

hbuchel
Copy link
Contributor

@hbuchel hbuchel commented Feb 27, 2024

Description of changes

Fixes an issue on the VerifyUser screen in Vue where the verification options were not getting properly translated and displayed. I copied the same method from our React library. I moved the censorContactInformation utility to the ui package and updates usage across Angular, Vue, React and React Native.

React

No visual change, just refactored to use the censorContactInformation that is now exported from ui package
After
react-no-change

Angular

Angular's translations weren't broken, but it wasn't showing the censored contact information like in React.

Before After
angular-broken angular-fixed

Vue

Vue was not showing the correct translations, nor the censored contact info. Additionally, the radio was rendering after the text and there was a repeated id on the inputs and wrapping label elements. Since ids must be unique and we're not relying on them (and any customer relying on them would likely have encountered unexpected/broken results), I removed them.

Before After
Screenshot 2024-02-27 at 12 19 53 PM vue-fixed

React Native

No visual change, verified via VerifyUser snapshot test.

Left some comments inline.

Issue #, if available

Fixes #4986

Description of how you validated changes

Tested in vue example app using my own aws-exports for a email/phone sign in. Then I manually unverified my user's email/phone and attempted to login to view the verification screen (screenshots above).

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • Relevant documentation is changed or added (and PR referenced)
  • yarn test passes and tests are updated/added
  • No side effects or sideEffects field updated

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

changeset-bot bot commented Feb 27, 2024

🦋 Changeset detected

Latest commit: d6f1adc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@aws-amplify/ui Patch
@aws-amplify/ui-angular Patch
@aws-amplify/ui-react Patch
@aws-amplify/ui-react-native Patch
@aws-amplify/ui-vue Patch
@aws-amplify/ui-react-auth Patch
@aws-amplify/ui-react-core-auth Patch
@aws-amplify/ui-react-core-notifications Patch
@aws-amplify/ui-react-core Patch
@aws-amplify/ui-react-liveness Patch
@aws-amplify/ui-react-native-auth Patch
@aws-amplify/ui-react-notifications Patch
@aws-amplify/ui-react-storage Patch
@aws-amplify/ui-react-geo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

class="amplify-flex amplify-radio"
data-amplify-verify-label
id="verify"
<template
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like "value" could potentially be undefined based on the type, so I wrapped the radio options in a <template v-if>. Not sure if this is the best fix for that?

Additionally, I re-ordered the elements because the radio circle was showing after the label text and removed the duplicated "verify" id

@hbuchel hbuchel marked this pull request as ready for review February 27, 2024 17:35
@hbuchel hbuchel requested a review from a team as a code owner February 27, 2024 17:35
@hbuchel hbuchel changed the title fix(vue): use translated strings for VerifyUser screen fix(web/react-native/ui): use translated strings and censorContactInformation for VerifyUser screen Feb 27, 2024
packages/vue/jest.config.ts Outdated Show resolved Hide resolved
@hbuchel hbuchel changed the title fix(web/react-native/ui): use translated strings and censorContactInformation for VerifyUser screen fix(web/react-native/ui): use translated strings and censorContactMethod for VerifyUser screen Feb 28, 2024
esauerbo
esauerbo previously approved these changes Feb 28, 2024
Copy link
Contributor

@esauerbo esauerbo left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

🚢

@hbuchel hbuchel merged commit 1d9c5c8 into main Feb 28, 2024
33 checks passed
@hbuchel hbuchel deleted the FixVueI18N branch February 28, 2024 21:43
@github-actions github-actions bot mentioned this pull request Feb 28, 2024
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.

Missing translation for specific texts in the Amplify UI Authenticator (Vue)
4 participants