Skip to content

Conversation

@ctarda
Copy link
Contributor

@ctarda ctarda commented Dec 4, 2020

Closes #3146

⚠️ Please note this PR is not against develop, but against the feature branch for UL&S 🙇

Light Dark
Error screen
Error screen + alert

And a gif showing the interactions:

I am not sure if the actual link that can be opened in a web view from the alert is correct. Changing that takes 30 seconds.

Changes

  • Pointed WPAuthenticator to the branch that provides support for short-circuiting the navigation flow provided by WPAuthenticator, and allows us to block the account creation flow.
  • A new implementation of the ULErrorViewModel that provides support for this new error screen.
  • A couple of minor touches to the constraints in the actual UI, so that the button that is styled as a link can stretch horizontally to occupy all the available space.

Testing

  • Checkout the branch. Run bundle exec pod install
  • Log out if necessary
  • Select Continue With WordPress.com
  • Enter an email address that does not match a WP.com account.
  • You should see the custom error UI instead of the flow that allows creating a new WP.com account

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@ctarda ctarda added the feature: login Related to any part of the log in or sign in flow, or authentication. label Dec 4, 2020
@ctarda ctarda added this to the 5.7 milestone Dec 4, 2020
@ctarda ctarda requested review from a team December 4, 2020 05:14
@ctarda ctarda self-assigned this Dec 4, 2020
Copy link

@Garance91540 Garance91540 left a comment

Choose a reason for hiding this comment

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

👏👏👏 The only thing I mentioned on slack is that the link "need help finding your email" should open the Help center

@peril-woocommerce
Copy link

peril-woocommerce bot commented Dec 7, 2020

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-woocommerce
Copy link

peril-woocommerce bot commented Dec 7, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@ctarda
Copy link
Contributor Author

ctarda commented Dec 7, 2020

Thanks for the review @Garance91540

I just pushed an update to:

  • Point WPAuthenticator to the latest beta
  • Present the Help when tapping "need more help" in the alert:

I guess this is ready for a close look at the code 😊

@jaclync jaclync self-assigned this Dec 7, 2020
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Looks good!

Code: ✅
Testing: ✅ (all CTAs work as expected on the error screen!)

I noticed a non-blocking UI issue in landscape:


/// Maps error codes emitted by WPAuthenticator to a domain error object
enum AuthenticationError: Int, Error {
case emailDoesNotMatchWPAcount = 7
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
case emailDoesNotMatchWPAcount = 7
case emailDoesNotMatchWPAccount = 7


func isSupportedError(_ error: Error) -> Bool {
let wooAuthError = AuthenticationError.make(with: error)
return wooAuthError == .emailDoesNotMatchWPAcount || wooAuthError == .notWPSite
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: how about just checking if the error is not unknown, since we handle all the known cases?

Suggested change
return wooAuthError == .emailDoesNotMatchWPAcount || wooAuthError == .notWPSite
return wooAuthError != .unknown

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with the long form because it seemed more explicit to me, but will update, thanks!

// MARK: - Data and configuration
let image: UIImage = .loginNoWordPressError

let text: NSAttributedString = NSMutableAttributedString(string: Localization.errorMessage)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: any reasons for using the mutable version?

Suggested change
let text: NSAttributedString = NSMutableAttributedString(string: Localization.errorMessage)
let text: NSAttributedString = .init(string: Localization.errorMessage)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, good point, thanks!

@ctarda
Copy link
Contributor Author

ctarda commented Dec 7, 2020

Thanks for the review @jaclync 🙇

I pushed an update to incorporate your feedback.

This is blocking progress a little bit, so I will defer the layout bug on landscape to a separate issue that I will attack later this week: #3300

@ctarda ctarda merged commit 2f2e34e into feat/unified-login Dec 7, 2020
@ctarda ctarda deleted the issue/3146-no-signup branch December 7, 2020 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: login Related to any part of the log in or sign in flow, or authentication.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants