-
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
[HOLD for payment 2023-10-16] [HOLD for payment 2023-10-10] [$500] Web - City field is not clear when select another country #28007
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01e5128ed81517974f |
Triggered auto assignment to @michaelhaxhiu ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @zanyrenney ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
Proposal by: @DylanDylann ProposalPlease re-state the problem that we are trying to solve in this issue.City field is not clear when select another country What is the root cause of that problem?We only use useState for country and state fields because we need to re-set 2 fields when changing country App/src/pages/settings/Profile/PersonalDetails/AddressPage.js Lines 119 to 129 in 70e9fa0
I think the city field also should be clear after changing country like state field. What changes do you think we should make in order to solve the problem?Firstly, we need to use useState for city field
When country change we need to re-set city to empty like this
and then in here
we should use value instead of default value
|
ProposalPlease re-state the problem that we are trying to solve in this issue.City field isn't clear when selecting another country What is the root cause of that problem?The city is not cleared on changing the country which is handled in App/src/pages/settings/Profile/PersonalDetails/AddressPage.js Lines 119 to 129 in 65fd435
What changes do you think we should make in order to solve the problem?add another state for the city and also the zip code as it make sense to clear the zip code as well on changing the country const [city, setCity] = useState(address.city);
const [zipCode, setZipCode] = useState(address.zip); const handleAddressChange = (value, key) => {
switch (key) {
case 'country':
setCurrentCountry(value);
setState('');
setCity('');
setZipCode('');
break;
case 'state':
setState(value);
break;
case 'city':
setCity(value);
break;
case 'zipPostCode':
setZipCode(value);
break;
default:
break;
}
}; and also change the defaultValue property to value and add onChange handle for both the city and the zipcode components:
to value={city || ''}
onValueChange={handleAddressChange} With this change we have to consider two points
const handleAddressLineChange = (value, key) => {
switch (key) {
case 'country':
setCurrentCountry(value);
break;
case 'state':
setState(value);
break;
case 'city':
setCity(value);
break;
case 'zipPostCode':
setZipCode(value);
break;
default:
break;
}
}; And change the onValueChange={handleAddressChange}
useEffect(() => {
setState(address.state)
setCity(address.city);
setZipCode(address.zip);
setCurrentCountry(address.country)
}, [address]); again it's your choice to add a state for the zip code as well or not .. but it would be useful to reset the zip code as well in case you change the country POCScreen.Recording.2023-09-23.at.3.56.44.AM.mov |
ProposalPlease re-state the problem that we are trying to solve in this issueCity field doesn't clear when select another country What is the root cause of that problem?We do not clear the field after changing the country What changes do you think we should make in order to solve the problem?we have input which needs to be added the ability to change values externally like changing state or country using App/src/pages/settings/Profile/PersonalDetails/AddressPage.js Lines 206 to 214 in 70e9fa0
But instead of creating a new useState, it would be nice to create one useState for all inputs like
And update this function like
App/src/pages/settings/Profile/PersonalDetails/AddressPage.js Lines 119 to 129 in 70e9fa0
This approach allows us to save from unnecessary rerenders and new useStates. What alternative solutions did you explore? (Optional)NA |
@DylanDylann's proposal looks good to me. |
Triggered auto assignment to @AndrewGable, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Just to bring your attention @Ollyws, this approach will bring a breaking change that has to be fixed, which is mentioned in my proposal. you can have a look at it. |
dupe assignment, so unassigning myself as i am the second assignee for @michaelhaxhiu to manage. |
@abzokhattab This is another bug and I also suggest fixing it in my original proposal for both issues here |
@AndrewGable Could you give some of your opinion on this issue when you have a chance? |
📣 @Ollyws 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@DylanDylann, this bug wasn't present when #28404 was merged Screen.Recording.2023-10-04.at.18.33.23.mov |
@DylanDylann @AndrewGable How does a situation like this usually work, If a merge conflict resolution causes a regression? |
@Ollyws No problem, The PR is ready @AndrewGable Just a note. In this issue #27814, I proposed a solution to fix both bugs #28007 and #27814 (even though the regression #27814 (comment) ). But It is not selected because the C+ contributor doesn't think #28007 is a bug. And then when #28007 is accepted as a bug, I mentioned that we also need to fix the same case with the city field in here because It is same bug with OP but there is no response. I tried to give more value and collaborate to have good work. |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
@zanyrenney - Let's just pay this out with the 50% bonus as noted here the regression was out of our control and fixed quickly. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-16. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
4 more days before we can pay this out! |
@AndrewGable, @Ollyws, @zanyrenney, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
BugZero Checklist: |
I agree @Ollyws thanks! |
summary of payments |
all payments are now complete via upwork, closing! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
City field should be clear when select another country
Actual Result:
City field is not clear when select another country
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.72.8
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-09-20.at.15.04.01.mov
Recording.4674.mp4
Expensify/Expensify Issue URL:
Issue reported by: @DylanDylann
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695197139968609
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: