-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Refactor GetLocalCurrency #9607
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
Conversation
|
Looks like you modified Instead, all new API commands should use API.js, and follow our guidelines for writing new API commands. Unsure if your change is okay? Drop a note in #expensify-open-source! |
|
@luacmartins can I test this despite the last comment in here https://github.com/Expensify/Web-Expensify/pull/34151 and the fact it is on hold too? |
|
I'd wait since this PR might change a bit based on that comment. |
src/libs/actions/PersonalDetails.js
Outdated
| }) | ||
| .then(getCurrencyList) | ||
| .then(() => { | ||
| Onyx.merge(ONYXKEYS.MY_PERSONAL_DETAILS, {localCurrencyCode: currency}); |
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.
@luacmartins What I mentioned here, this is how we currently store and merge the data about localCurrencyCode
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.
Yea, I'm planning on changing this PR based on the changes here
fa575db to
1dac239
Compare
|
@mountiny @PauloGasparSv this is ready for review! We are still holding on Web-E hitting prod and the changes to the Onyx key. |
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.
In general, looks good to me, but there is one unit test, which was implemented for the currency list localization testing.
App/tests/unit/CurrencySymbolUtilsTest.js
Lines 4 to 8 in c93b4cb
| // This file can get outdated. In that case, you can follow these steps to update it: | |
| // - in src/libs/API.js | |
| // - call: GetCurrencyList().then(data => console.log(data.currencyList)); | |
| // - copy the json from console and format it to valid json using some external tool | |
| // - update currencyList.json |
The instruction on how to obtain new JSON of the currencies uses our API so we should find a way how to keep this possible to be completed.
I am not sure how though as if we remove the API method from App then they can call it as they need authToken even if we keep the MobileConstants endpoint in the backend (or I mean they could use curl, and add their authToken but that would be quite cumbersome.
The best might be to update the instructions so they ask in the expensify-open-source channel so someone internal helps them retrieve the JSON. What do you think? Or just keep that change internal 🤷
|
Thanks for the review @mountiny! I updated the instructions. I think contributors can get the updated list from the OpenApp command right? |
mountiny
left a comment
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.
@luacmartins Good call, yeah they should!
Thanks for the changes, just one typo.
mountiny
left a comment
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.
LGTM! Thanks for the changes!
|
Still have the same error! Can you help me on this @luacmartins? Screen.Recording.2022-07-13.at.17.28.58.mov |
|
@PauloGasparSv the problem is that #9560 is not merged yet. We set A side note is that this default prop is doing nothing since other keys in |
PauloGasparSv
left a comment
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 see! Nice : )
Approving it for now since everything LGTM!
But let's test it again when that P.R. is merged
|
#9560 merged! Retested and all is good. Removing hold and merging! |
|
@luacmartins looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
|
Tests passed! Removing |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to production by @luacmartins in version: 1.1.85-8 🚀
|

Details
fetchLocalCurrencyfrom App initgetCurrencyListsince we only want to fetch it on OpenAppHolding on #9560 and https://github.com/Expensify/Web-Expensify/pull/34151 hitting prod
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/213883
Tests
localCurrencyCodeandcurrencyListare returnedpersonalDetailsandcurrencyListkeys+ > Request moneyReconnectAppAPI request was triggered.PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)QA Steps
+ > Request moneyScreenshots
Web
web.mov
Mobile Web
mweb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov