-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add unlink secondary login flow #15811
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
add more copy
…indicators for success and failure messages
@mananjadhav @MonilBhavsar 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] |
@NikkiWines Is this ready for review because the title says |
Ah, yeah @mananjadhav you won't be able to review this yet because it's dependent on an internal PR that's in review. I can unassign you for now and re-assign once this isn't on hold any more if you'd like! |
I think you can keep me assigned and I can get to it once the internal PR is through. I just clarified because the title said HOLD. |
Internal PR is on prod! Taking this off hold 🎊 |
Sorry @mananjadhav I got pulled into some other work today and didn't have a chance to take a further look into this. Will prioritize this tomorrow |
Ok, still unable to reproduce but @mananjadhav I pushed a small change that I suspect might resolve the issue. Could you retry your steps once more to see if you still encounter the error? Thank you 🙌 |
Thanks @NikkiWines I think the last change worked. I was able to successfully test this on Web. I am now going to test this on other platforms. |
Reviewer Checklist
Screenshots/VideosMobile Web - Chromemweb-chrome-unlink-secondary-link.movMobile Web - Safarimweb-safari-unlink-secondary-link.movDesktopdesktop-unlink-secondary-link.moviOSios-unlink-secondary-link.movAndroidandroid-unlink-secondary-link.movThanks for the patience here @NikkiWines @MonilBhavsar. As I mentioned, I was finally able to test without issues. @MonilBhavsar All yours. |
🎯 @mananjadhav, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #18445. |
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.
Some NAB's, else looks good 👍
src/libs/actions/Session/index.js
Outdated
@@ -187,6 +187,8 @@ function beginSignIn(login) { | |||
value: { | |||
...CONST.DEFAULT_ACCOUNT_DATA, | |||
isLoading: true, | |||
errors: null, |
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.
Hmm, errors
is already null in the default data, may be we just need message
field
src/pages/UnlinkLoginPage.js
Outdated
const propTypes = { | ||
/** The accountID and validateCode are passed via the URL */ | ||
route: validateLinkPropTypes, | ||
|
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, empty line
@@ -28,6 +29,9 @@ const propTypes = { | |||
|
|||
/** Whether the account is validated */ | |||
validated: PropTypes.bool, | |||
|
|||
/** The primaryLogin associated with the account */ | |||
primaryLogin: PropTypes.string, |
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.
Yeah, I think there was a lint rule that required default props or the prop to be required. Looks like it is not working lately.
woo thank you @MonilBhavsar and @mananjadhav 🙌 updated once 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.
Thanks! Looks good
✋ 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 staging by https://github.com/MonilBhavsar in version: 1.3.11-0 🚀
|
*/ | ||
function requestUnlinkValidationLink() { | ||
const optimisticData = [{ | ||
onyxMethod: CONST.ONYX.METHOD.MERGE, |
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.
FYI this just got removed! And it was replaced with Onyx.METHOD.MERGE
, where Onyx
is imported from react-native-onyx
.
I can spin up a fix for this real quick
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.
Oh I guess this was found in this bug report: #18526
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
@@ -143,6 +164,7 @@ class SignInPage extends Component { | |||
<PasswordForm isVisible={showPasswordForm} /> | |||
)} | |||
{showResendValidationForm && <ResendValidationForm />} | |||
{showUnlinkLoginForm && <UnlinkLoginForm />} |
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 line caused console error as showUnlinkLoginForm
can be string value. More details - #19202 (comment)
New checklist item added to prevent such bugs:
- I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g.
myBool && <MyComponent />
.
key: ONYXKEYS.ACCOUNT, | ||
value: { | ||
isLoading: false, | ||
message: Localize.translateLocal('unlinkLoginForm.linkSent'), |
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.
Because this will return a static value, it will not translate on runtime when the use changes the language after the message is shown to the user which caused #18827
key: ONYXKEYS.ACCOUNT, | ||
value: { | ||
isLoading: false, | ||
message: Localize.translateLocal('unlinkLoginForm.succesfullyUnlinkedLogin'), |
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.
Hi ✋ Coming from #22934
We should return the message as the phrase key instead to get the dynamic message based on the language.
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.
thanks for highlighting this.
Details
Adds the ability to unlink claimed but unvalidated secondary logins, inline with what we do on oldDot
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/268314
Tests
Unlink
button that you can press to unlink the two logins.Unlink
and confirm that you see the textLink sent!
appear on the pageunlink
page because we'll have stored the credentials and know which view to display. If you open the link in a new session (i.e. in an incognito window) the error message will display on the main sign in view because we won't have the login stored.Unlink
again to get a new linkOffline tests
While online
Unlink
button, but that it is disabled and you cannot press itQA Steps
Unlink
button that you can press to unlink the two logins.Unlink
and confirm that you see the textLink sent!
appear on the pageunlink
page because we'll have stored the credentials and know which view to display. If you open the link in a new session (i.e. in an incognito window) the error message will display on the main sign in view because we won't have the login stored.Unlink
again to get a new linkPR 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
web.mov
Mobile Web - Chrome
Screen.Recording.2023-04-21.at.14.52.44.mov
Mobile Web - Safari
mweb-safari.mp4
Desktop
desktop.mov
iOS
(unable to test link redirecting but can show the updated UI)ios.mp4
Android
(unable to test link redirecting but can show the updated UI)