-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 hint inconsistent zipcode format #17144
Fix hint inconsistent zipcode format #17144
Conversation
…use custom formatter
@puneetlath @rushatgabhane One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWeb |
@@ -139,7 +139,7 @@ const AddressForm = props => ( | |||
onChangeText={value => props.onFieldChange({zipCode: value})} | |||
errorText={props.errors.zipCode ? props.translate('bankAccount.error.zipCode') : ''} | |||
maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.ZIP_CODE} | |||
hint={props.translate('common.zipCodeExample')} | |||
hint={props.translate('common.format', {zipSampleFormat: CONST.COUNTRY_ZIP_REGEX_DATA.US.samples})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@getusha should we use samples based on the country? (similar to AddressPage)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rushatgabhane i don't think i see country picker on these places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@@ -139,7 +139,7 @@ const AddressForm = props => ( | |||
onChangeText={value => props.onFieldChange({zipCode: value})} | |||
errorText={props.errors.zipCode ? props.translate('bankAccount.error.zipCode') : ''} | |||
maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.ZIP_CODE} | |||
hint={props.translate('common.zipCodeExample')} | |||
hint={props.translate('common.format', {zipSampleFormat: CONST.COUNTRY_ZIP_REGEX_DATA.US.samples})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rushatgabhane i can reproduce the same on prod. can you add more details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@rushatgabhane AddressForm doesn't have a place to pick/get a country it uses us as default, i am going to ask this on slack. |
@rushatgabhane Pushed changes! can you check it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@puneetlath LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a couple small comments.
const zipSampleFormat = lodashGet(CONST.COUNTRY_ZIP_REGEX_DATA, [currentCountry, 'samples'], ''); | ||
const currentCountry = lodashGet(this.props.privatePersonalDetails, 'address.country') || ''; | ||
const currentCountryISO = PersonalDetails.getCountryISO(currentCountry); | ||
const targetCountryISO = !_.isEmpty(currentCountryISO) ? currentCountryISO : CONST.COUNTRY.US; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we combine these two lines like so?
const targetCountryISO = !_.isEmpty(currentCountryISO) ? currentCountryISO : CONST.COUNTRY.US; | |
const currentCountryISO = PersonalDetails.getCountryISO(currentCountry) || CONST.COUNTRY.US; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we change to this it will show empty hint
- Open the Home Details page
- Pick a country
- Close the drawer
- and come back
because currentCountry will be defined in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Why is that?
@puneetlath's code suggestion is logically the same, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rushatgabhane i think i tested the wrong file, the issue is not appearing after applying the suggestion. is it? i will push the suggestion now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved can you check? @puneetlath
@puneetlath updated the generic name from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Before I merge - I just want to double-check that we've re-tested since updating?
☑️ Web Screen.Recording.2023-04-11.at.10.15.52.AM.mov☑️ Mobile Web - Safari Screen.Recording.2023-04-11.at.10.19.43.AM.mov☑️ Mobile Web - Chrome Screen.Recording.2023-04-11.at.10.26.57.AM.mov☑️ IOS Screen.Recording.2023-04-11.at.10.36.32.AM.movTested on different platforms and without any issue @puneetlath |
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.2.99-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.2.99-6 🚀
|
Details
Fixed Issues
$ #16912
PROPOSAL: #16912 (comment)
Tests
e.g.
and consistent across the pages.Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-04-07.at.10.50.57.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-04-07.at.10.50.57.AM.1.mov
Mobile Web - Safari
Screen.Recording.2023-04-07.at.11.18.44.AM.mov
Desktop
Screen.Recording.2023-04-07.at.11.28.08.AM.mov
iOS
Screen.Recording.2023-04-07.at.11.58.24.AM.mov
Android
Screen.Recording.2023-04-07.at.12.14.52.PM.mov