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

[MBL-1355] Move Login/Signup Logic To Confirm Pledge Details #2029

Merged
merged 12 commits into from Apr 9, 2024

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Apr 8, 2024

πŸ“² What

Addresses MBL-1347 issue by moving login/signup logic from PostCampaignCheckoutViewController to ConfirmDetailsViewController

πŸ€” Why

By gating the checkout screen and checkout id creation behind login/signup, we can keep UX much simpler and more straightforward for users and code perspective.

πŸ›  How

  1. Remove login logic from PostCampaignCheckoutViewController
  2. Add the same login logic to ConfirmDetailsViewController but attach to continue button tap.
  3. Call .createCheckout only if the user is logged in. The same goes for navigating to checkout. Users should never reach that screen if they aren't logged in.
  4. Navigating back to Confirm, from Checkout, should create a new checkout ID and should all for successful late pledging.

πŸ‘€ See

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-04-08.at.12.06.42.mp4

βœ… Acceptance criteria

Original test scenarios that were failing

  • Login is presented after tapping continue on ConfirmDetails Screen if logged out
  • Users can not reach the Checkout screen if logged out
  • if logged in users can confirm pledge details and complete late pledge flow successfully. This is true even if users navigate back and forth around the late pledge flow.

@scottkicks scottkicks marked this pull request as ready for review April 8, 2024 17:44
Comment on lines +322 to +326
let loginSignupViewController = LoginToutViewController.configuredWith(
loginIntent: intent,
project: project,
reward: reward
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At first glance, it looks like LoginToutViewController doesn't actually use the project or reward being passed in, but I found that they're specifically for analytics.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've noticed this in quite a few places - a a view model requiring way more information than seems initially necessary, because it gets passed through to analytics. This is something we might consider for future refactoring. The way we pass around "contexts" in some places feels like a better model for this.

Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

Code looks good! I still think we should fix the "user needs to tap continue twice" to log in and proceed to the checkout page, but I'll let you decide if that's something you have time to do in this pr or not, since it's release-blocking.

@scottkicks scottkicks merged commit d44f316 into main Apr 9, 2024
5 checks passed
@scottkicks scottkicks deleted the feat/scott/mbl-1355/move-login-flow branch April 9, 2024 20:21
PledgeViewCTAContainerViewData(
isLoggedIn: isLoggedIn,
isLoggedIn: true, // Users should always be logged in when they get to the Checkout screen.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It would be good to throw an assertion in this view model to this effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants