Skip to content

Feat/tie purchase flow #534

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

Merged

Conversation

ChiefStief
Copy link
Collaborator

@ChiefStief ChiefStief commented Feb 7, 2025

Requirements List

Description List

  • Refactored purchase flow to be in one page with subcomponents to support privilege purchase nav highlighting and most easily support total control of purchase flow and dynamic progress calculation
  • Renamed purchase flow pages to be more easily found: PrivilegePurchase*
  • Abstracted out purchase flow into PurchaseFlowState, PurchaseFlowStep and step level logic to better support step handling (find next step, clean state appropriately, redirect appropriately etc)
  • Added AcceptedAttestationToSend model
  • Made military affiliation attestation only show and send if user is military affiliated
  • Added sending of attestations accepted to purchase API call and relevant serializer
  • Improved test coverage
  • Added ProgressBar Component
  • Fixed safari display bug on SelectPrivileges screen

Testing List

  • yarn test:unit:all should run without errors or warnings
  • yarn serve should run without errors or warnings
  • yarn build should run without errors or warnings
  • Code review
  • Try going through the privilege purchase flow process and confirm that the happy path works
  • Now try navigating around the site, and with the back and cancel buttons and confirm that the form flow works as expected:
  1. Back should always return to the previous flow step
  2. Cancel should clear the flow entirely and bring the user to LicenseeDashboard screen
  3. Navigating out of the flow while still in the app will retain the users progress (including privilege purchase successful), coming back to the flow should bring them back to the screen they left off at
  4. Refreshing the page at any point or navigating with the url bar will clear the flow
  5. Clicking finish on the Successful screen will clear the privilege flow and re-fetch the users updated privileges

Closes #302

Note: The behavior above is what I decided to implement to avoid complexity surrounding auto filling potentially changed form fields due to the server attestations being updated on the server, complexity surrounding form race conditions and caching user responses vs updated attestations.

I also opted not to use localStorage to have this data persist across sessions. What I did do was set up the form flow so that any of these alterations can be made more easily if it turns out they are desired.

@ChiefStief ChiefStief marked this pull request as ready for review February 10, 2025 16:37
Copy link
Collaborator

@jsandoval81 jsandoval81 left a comment

Choose a reason for hiding this comment

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

This is excellent 🚀 I really like the purchase-flow-state mechanism.

Dana Stiefel added 2 commits February 11, 2025 14:12
@jsandoval81
Copy link
Collaborator

@jlkravitz This is ready for your review.

@ChiefStief ChiefStief mentioned this pull request Feb 12, 2025
15 tasks
Copy link
Collaborator

@jlkravitz jlkravitz 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! Few questions/comments.

@ChiefStief ChiefStief requested a review from jlkravitz February 13, 2025 16:55
@ChiefStief
Copy link
Collaborator Author

@jlkravitz Ready for re-review.

Copy link
Collaborator

@jlkravitz jlkravitz left a comment

Choose a reason for hiding this comment

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

Looks great! @isabeleliassen Good to merge.

@isabeleliassen isabeleliassen merged commit 661e84f into csg-org:development Feb 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

connect screens of privilege purchase workflow
4 participants