-
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
New Contact methods page linked from Profile page #15039
Conversation
@Santhosh-Sellavel @aldo-expensify 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] |
I was optimistic this would be ready to review by end of my day, but looks like there's some errors I'll have to debug :D So don't worry about reviewing today @aldo-expensify @Santhosh-Sellavel 🙏 |
Actually I figured out the error so this can be tested :D I just haven't taken any screenshots yet, so I'll get to that Monday 👍 |
PR Author checklist filled 👍 Ready for review! (Please slightly prioritize if y'all can, since this is the first part of multiple upcoming "Contact method" updates coming very soon 🙏 ) |
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.
NAB: Considering that email in "Contact Methods" is not clickeable, I don't think we are using the right cursor when hovering it:
Screen.Recording.2023-02-14.at.1.45.06.PM.mov
NAB: The next is probably unrelated to your PR, but 10. Verify it was added successfully (unverified of course)
doesn't pass:
Adding my phone throws the error: An error occurred using the phone number provided, please use your email address instead.
if I try again, it get a different error: The new phone number you are trying to add is already a secondary login of your account.
If I reload the page, the phone has been added, so it did work the first time 🤷
Screen.Recording.2023-02-14.at.1.59.05.PM.mov
NAB: If I try to create an account with a phone number, I get the same error:
NAB: When you add a new contact method, if you click "Resend", you can click again the button when it is a check mark and it will still perform the action:
UPDATE: leaving all this as NAB because I think it is not related to your PR moving stuff to a new page. I think we should create new GH issues to improve these, but leaving them here meanwhile.
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.
Commented some stuff in the backend that was giving me error for my phone number and I was able to test.
The original functionality seems to be working fine. I left some comments mainly related to refactoring the component ContactMethodsPage
which uses a state that seems unnecessary. I know you didn't write the code in the PR from scratch, but since you are moving it, it may be a good time to improve it?
Offline behaviour: doesn't seem to be implemented? clicking "Send validation" when adding a new email doesn't do anything, no feedback. Is this in the scope of this PR?
Another NAB: the form for adding a new phone/emails seems to be inconsistently clearing something and sometimes not when I navigate back. Captured in the video below when it cleaned, but I saw it not cleaning a few times too. It seems to depend on whether the component AddSecondaryLoginPage
gets unmounted or not which I guess is up to the react navigation stuff 🤷
Screen.Recording.2023-02-14.at.4.47.25.PM.mov
return; | ||
} | ||
|
||
// eslint-disable-next-line react/no-did-update-set-state |
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 wonder if we should be act on this warning instead of just disable it. I see that we have disable it in other places.
According to the rule documentation, we should do these setStates
wrapped in a function:
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.onUpdate(function callback(newName) {
🤢 I feel ya... If we end up getting rid of logins
stored in state, we don't have to think about this so I'm going to do nothing for now as we discuss further :D
this.state = { | ||
logins: this.getLogins(), | ||
}; |
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.
Do you know why we copy this to a state instead of just directly calling this.getLogins()
on render and use what we get there? synchronizing the prop with the state adds more complexity and in this case doesn't seem to serve any purpose.
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.
Def agreed - i have no idea why we did this in the first place, and if we want to take the time to refactor I def agree it makes sense to just directly use what we get from props and not deal with syncing it with state in componentDidUpdate
👍
logins: this.getLogins(), | ||
}; | ||
|
||
this.getLogins = this.getLogins.bind(this); |
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.
Unnecessary bindings
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 a this.props.loginList
in getLogins
- we don't need to bind for that?
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.
We don't need to bind here, we need to bind only if we pass a method as the prop to other components.
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.
@Beamanator bump!
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.
Since this is just a copy paste and the component will get redone eventually (taken from here), maybe we don't care about this type of polishing. What do you think @Santhosh-Sellavel ?
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.
All right then!
If you just remove the synchronized state, all my comments related to that can be ignored :P |
Oh shoot I don't think I mentioned i had to change
I love your ideas for refactoring... Maybe it's worth it to do this... BUT I 1000% plan to cut a lot of the existing weird I'd love your professional opinion if it's worth it to do the refactoring at this point. In my opinion no it's not, since in a few very soon follow-up PRs we're going to gut all the old code (including the
Mentioned in my previous comment - we're going to be creating a new API command for "Send validation" soon, but not in this PR - so I think we should save that for when we implement it in the upcoming brand new "contact details" page
This is quite interesting and will be good for us to keep in mind as we move forward with the new "Add contact method" page - but for now on the same line of thinking as my previous comments, I thinkkkkk we should just :donothing: on that page since it's going to be gutted very soon. Again, I'm quite interested in hearing your opinions on my plan, let me know what you think 👍 |
Ahh, that context is good to know :) The proposed refactor is pretty trivial in my opinion, but considering that we will throw away and redo a lot of the code anyway, I agree with that it is very fine to leave things as there are and not waste time on it! |
@Santhosh-Sellavel can you please review today or tomorrow? And if not please let us know :) |
On it now! |
Reviewer Checklist
Screenshots/VideosWeb & DesktopScreen.Recording.2023-02-16.at.4.13.31.AM.movMobile Web - Chromemweb_android.mp4Mobile Web - Safari & iOSUploading Simulator Screen Recording - iPhone 14 - 2023-02-16 at 04.34.47.mp4… AndroidScreen_Recording_20230216_044744_New.Expensify.mp4 |
I am unable to test any success case for mobile. I don't have many numbers to test, I tried online free numbers does not work. I tried to log in with one of my mobile accounts which I created earlier but was unsuccessful because I forgot the password and I'm not receiving a magic link to reset my password. |
@Santhosh-Sellavel one tip for testing phone numbers - if you already linked a phone number to another account, you can remove it via OldDot (our old website) - in the near future we'll allow users to also remove secondary logins via NewDot, but we gotta get this out first 😅 @aldo-expensify Since Santhosh is having some trouble testing the "Phone number only" flow, would you mind helping with that? 🙏 |
@Beamanator Got conflicts :( |
ok! |
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.
Just waiting for the conflicts to be reviewed!
Huh I pulled |
Ya seems like it auto-merged fine 🤷 Requesting another, hopefully final review @aldo-expensify ! 🙏 |
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
Merging since I got enough approvals and I'm trying to move quickly 👍 👍 |
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.2.75-0 🚀
|
🚀 Deployed to production by https://github.com/melvin-bot[bot] in version: 1.2.75-0 🚀
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Don't mind meeeeeee!!!! I got my PRs mixed up... No regression here!! |
cc @cristipaval since you're helping with the Account Settings implementation a lot
Details
We're moving
LoginField
to the Contact methods page so we can do bite-sized changes instead of making & implementing ALL of the new contact method pages at the same timeNote: The "Add secondary login" flow currently only works with passwords, but we're going to update that very soon in a future PR 👍
Fixed Issues
$ #15038
Tests
Offline tests
QA Steps
Same as above
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.Screenshots/Videos
Web
Screen.Recording.2023-02-14.at.2.32.48.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-02-14.at.2.49.05.PM.mov
Mobile Web - Safari
Screen.Recording.2023-02-14.at.2.55.43.PM.mov
Desktop
Screen.Recording.2023-02-14.at.2.36.48.PM.mov
iOS
Screen.Recording.2023-02-14.at.2.54.10.PM.mov
Android
Screen.Recording.2023-02-14.at.2.44.18.PM.mov