-
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
Create currency modal with react-native-permissions and geolocation #2194
Create currency modal with react-native-permissions and geolocation #2194
Conversation
Hi @rameshhpathak, thanks for raising the PR. I'm afraid I didn't get around to testing this today. Will do a full review after the easter bank holiday weekend (Tuesday) |
ios/ExpensifyCash-Bridging-Header.h
Outdated
@@ -0,0 +1,4 @@ | |||
// | |||
// Use this file to import your target's public headers that you would like to expose to Swift. |
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.
Is this file required it seems blank?
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.
+1
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.
What was the resolution here? I see these files were removed but there's still a BridgingFile.swift
committed. Is that file necessary?
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.
Left a few comments, also looks like there are a few merge conflicts that need to be resolved. Thanks!
Hey @jasperhuangg @AndrewGable thank you for your reviews, I will resolve the issues in line with the comments you have sent |
@rameshhpathak - Can you fix the failing test? Thanks! |
I would also love to see some updated screenshots. From what I can tell, some of the spacing looks off. You should be able to use the "New Group" flow in Expensify.cash to see exactly what the spacing should look like in terms of an existing piece of UI where we have a text input, then rows of information, with a floating button at the bottom. |
src/libs/OptionsListUtils.js
Outdated
@@ -432,11 +432,37 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma | |||
return ''; | |||
} | |||
|
|||
/** | |||
* Returns the personal details for an array of logins |
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.
This comment isn't correct
src/libs/OptionsListUtils.js
Outdated
isSearchStringMatch(searchValue, currencyOption.searchText))); | ||
|
||
return { | ||
// currency options holds a section for those currencies which are not selected |
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'm not sure what this comment means, could you please clarify?
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.
Sorry @Julesssss I think this was missed while I was staging changes. I will change it.
* | ||
* @param {Object} details | ||
*/ | ||
function setCurrencyPreferences() { |
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.
Perhaps this should be called fetchCurrencyPreferences
to match the other functions called on app start.
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.
Sure!
const {currencyOptions} = getCurrencyListForSections(this.props.currencyList, | ||
''); |
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.
Why the newline?
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.
Noticed a few things in my first review:
- The Currency Modal is supposed to be separate from the IOUModal, rather than a step within the flow. It should open on top of the current modal and then close to reveal the IOU Modal again.
- At the main page after logging in on web I was asked for location permission, we want to avoid this and only ask if the user changes their currency. We don't want to ask this on every refresh. Only if previously enabled should we make the check on app start.
- I'm unable to build to iOS or Android, can you confirm you haven't faced the same problem?
I will make the necessary changes and solve the build problems in my next commit. I have added comments to your review as well. Thanks! |
@Julesssss Sorry, I just switched it back, so we ask it every time user tries to change the currency through the modal. |
Sorry @rameshhpathak that's not quite right. Can you revert the last commit and we'll worry about this permission prompt later? Thanks 👍 |
There are two very last issues to do with prop type validation, after that I think we're good to merge: Opening the CurrencyModal A
Opening the CurrencyModal B
|
Hi @Julesssss Done :) |
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.
Okay, thanks for the changes! Looking good.
To unblock other IOU issues we'll create a separate issue to A) Modify the prompt logic to occur after a new currency is selected, and B) use the location permission prompt for mobile.
@rameshhpathak -- could you just run |
Hey @rameshhpathak, just bumping again in the hope you see this today. We'll likely have more conflicts to solve again tomorrow else 🙁 |
Hi @Julesssss sorry for late reply. I did push it, please take a look |
Fantastic, thanks again @rameshhpathak. I think we'll have some much smaller follow-up issues here if that's something you're interested in. |
@Julesssss Of course! I will be in the look out for it! Thank you for your help! |
Not sure if this PR covers the following issue so please let me know if I should open it separately Currency in LHN does not match the requested currencyExpected ResultContact will have a badge indicating there is money requested with the correct currency. Actual ResultBadge is there, but currency does not match. It always displays $ Action Performed
PlatformIssue is reproduced in? Web ✔️ Notes/Images/Video |
That's known and is going to be fixed here |
Great! Will check the PR off then, Thanks 🙇 |
Thanks @marcaaron, good points. @rameshhpathak would you mind following up with these changes? |
Hi @Julesssss, sure! Will send a PR later tonight. |
Hi @rameshhpathak, have you been able to take a look at this? |
<If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit.>
Details
I used react-native-geolocation-service because the original library itself suggests to use it based on it's use of Google Services in Android.
From the library itself:
Fixed Issues
Fixes #1970Tests
QA Steps
Same as tests
Tested On
Screenshots