Skip to content
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

My Account Sign In. #2590

Merged
merged 26 commits into from Aug 13, 2020
Merged

My Account Sign In. #2590

merged 26 commits into from Aug 13, 2020

Conversation

revanth0212
Copy link
Contributor

@revanth0212 revanth0212 commented Jul 30, 2020

Description

Added singin section to the new My account trigger in the header section.

Related Issue

Closes PWA-625

Verification Stakeholders

@soumya-ashok
@schensley
@jimbo

Verification Steps

  1. Go to the deployed app and click on the Sign In trigger in the header.
  2. Sign in should work as expected.

Screenshots / Screen Captures (if appropriate)

image

image

image

image

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have updated the documentation accordingly, if necessary.

@revanth0212 revanth0212 added the version: Minor This changeset includes functionality added in a backwards compatible manner. label Jul 30, 2020
@m2-community-project m2-community-project bot added this to Ready for Review in Pull Request Progress Jul 30, 2020
@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Jul 30, 2020

Messages
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Associated JIRA tickets: PWA-625.

Generated by 🚫 dangerJS against 30c8295

@devops-pwa-codebuild
Copy link
Collaborator

devops-pwa-codebuild commented Jul 30, 2020

Performance Test Results

The following fails have been reported by WebpageTest. These numbers indicates a possible performance issue with the PR which requires further manual testing to validate.

https://pr-2590.pwa-venia.com : LH Performance Expected 0.85 Actual 0.34, LH Accessibility Expected 1 Actual 0.97, LH Best Practices Expected 1 Actual 0.93, WPT Cache Expected 90 Actual 32
https://pr-2590.pwa-venia.com/venia-tops.html : LH Performance Expected 0.75 Actual 0.39, LH Best Practices Expected 1 Actual 0.93
https://pr-2590.pwa-venia.com/valeria-two-layer-tank.html : LH Performance Expected 0.8 Actual 0.56, LH Accessibility Expected 0.9 Actual 0.89, LH Best Practices Expected 1 Actual 0.93, WPT Cache Expected 65 Actual 44

@revanth0212 revanth0212 marked this pull request as ready for review July 31, 2020 21:02
@schensley
Copy link

@revanth0212 this looks really good. UX approved.

@m2-community-project m2-community-project bot moved this from Ready for Review to Review in Progress in Pull Request Progress Aug 5, 2020
packages/peregrine/lib/talons/AuthModal/useAuthModal.js Outdated Show resolved Hide resolved
packages/peregrine/lib/talons/SignIn/useSignIn.js Outdated Show resolved Hide resolved
packages/peregrine/lib/talons/Header/useAccountTrigger.js Outdated Show resolved Hide resolved
packages/peregrine/lib/talons/Header/useAccountTrigger.js Outdated Show resolved Hide resolved
packages/peregrine/lib/talons/Header/useAccountTrigger.js Outdated Show resolved Hide resolved
* signed in.
*/
if (!isUserSignedIn) {
setView(VIEWS.SIGNIN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if I'm creating an account, get an error, and then accidentally close the dropdown by clicking outside of it? When I go to re-open the form through the account trigger all of my input values will be gone! I think this needs some re-thinking. Since state is persistent we could keep whatever was previously opened as the rendered child and provide navigation buttons similar to how the left drawer nav works with account chip.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a UX requirement to reset the view when the dropdown is closed. The point you raised it reasonable. @schensley any thoughts on this?

packages/peregrine/lib/talons/SignIn/useSignIn.js Outdated Show resolved Hide resolved
packages/venia-ui/lib/components/AuthModal/authModal.js Outdated Show resolved Hide resolved
Co-authored-by: Stephen <sirugh@users.noreply.github.com>
@revanth0212 revanth0212 force-pushed the revanth/my_account_singin_trigger branch from b471bbc to 5954897 Compare August 5, 2020 22:03
} else {
setView('SIGNIN');
}
if (isUserSignedIn) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of writing 2 if cases, 1 for accountMenuIsOpen is true and 1 for false, i took the approach of adding accountMenuIsOpen to dependency array even though it is not used in the effect. This works but a new approach we haven't seen before in our code base. Let me know what you guys think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do this in the affect immediately above this with location.pathname. And you've already left a comment to that affect above here so I'm fine with it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the technique is fine. Good idea.

Not sure I would have chosen to reset the view to Sign In when the menu opens or closes—I might have preferred to leave it on the current view—but if that's what UX wants I'm not going to push to change it here.

packages/peregrine/lib/talons/Header/useAccountMenu.js Outdated Show resolved Hide resolved
packages/venia-ui/lib/components/SignIn/signIn.js Outdated Show resolved Hide resolved
} else {
setView('SIGNIN');
}
if (isUserSignedIn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do this in the affect immediately above this with location.pathname. And you've already left a comment to that affect above here so I'm fine with it.

packages/peregrine/lib/talons/Header/useAccountMenu.js Outdated Show resolved Hide resolved
packages/peregrine/lib/talons/Header/useAccountTrigger.js Outdated Show resolved Hide resolved
@schensley
Copy link

@sirugh I take your point generally speaking for clearing a form isn't always ideal (actually it depends on the expectations of the user), in this case account sign-in needs only a few bits of information, and the shopper is not required to do so to use the site. Persisting the error once the module is closed and re-opened seems to give the impression that either the shopper has been locked out or sign-in is broken. I think adding navigation elements to the module would introduce clutter and confusion to an otherwise simple and straightforward interaction.

@revanth0212 revanth0212 mentioned this pull request Aug 10, 2020
1 task
sirugh
sirugh previously approved these changes Aug 12, 2020
Copy link
Contributor

@sirugh sirugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving! There are some spelling corrects to make, but besides that, good job! Thanks for the perseverance here, I know I sent you back and forth with the error handling stuff.

Co-authored-by: Stephen <sirugh@users.noreply.github.com>
sirugh
sirugh previously approved these changes Aug 12, 2020
Copy link
Contributor

@jimbo jimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good now. 👍


exports[`it renders SignIn component when the view is SIGNIN 1`] = `
<aside>
<Singin Component />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot probably needs to be updated.

} else {
setView('SIGNIN');
}
if (isUserSignedIn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the technique is fine. Good idea.

Not sure I would have chosen to reset the view to Sign In when the menu opens or closes—I might have preferred to leave it on the current view—but if that's what UX wants I'm not going to push to change it here.

"<Link>Communications</Link>",
"<Link>Account Information</Link>",
<div>
&lt;Link&gt;Order History&lt;/Link&gt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here? 🤔

@dpatil-magento
Copy link
Contributor

@revanth0212 Resolve the conflicts pls.

@revanth0212
Copy link
Contributor Author

@revanth0212 Resolve the conflicts pls.

Done dude.

@dpatil-magento dpatil-magento merged commit 38b6c67 into develop Aug 13, 2020
@dpatil-magento dpatil-magento deleted the revanth/my_account_singin_trigger branch August 13, 2020 20:50
@m2-community-project m2-community-project bot moved this from Review in Progress to Done in Pull Request Progress Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine pkg:venia-ui version: Minor This changeset includes functionality added in a backwards compatible manner.
Development

Successfully merging this pull request may close these issues.

None yet

7 participants