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

Feat: in-person enrollment view #2340

Merged
merged 11 commits into from
Sep 16, 2024
Merged

Conversation

angela-tran
Copy link
Member

@angela-tran angela-tran commented Sep 6, 2024

Part of #2244

This PR implements the enrollment view:

  • front-end template which shows the transit processor's enrollment form as an iframe
  • back-end handling of GET and POST requests to /in_person/enrollment

The templates which this view redirects to are all blank. A separate PR will implement in_person/enrollment/success.html, and #2345 will implement the error templates.

This PR also does not include sending analytic events since #2245 will do that.

Testing locally

  • Make your Google account be seen as a "transit agency staff user" - i.e. not put into the "Cal-ITP" group but still marked as is_staff:
    • Set your GOOGLE_SSO_STAFF_LIST environment variable to *
    • Make sure your GOOGLE_SSO_ALLOWABLE_DOMAINS environment variable is compiler.la
  • Launch the app and go to /admin
  • Log in
  • Click "New enrollment"
  • Fill out the eligibility form
  • Go through enrollment

Note: there is currently an issue in the Littlepay QA environment preventing us from finishing enrollment - see #2365. But if it were working, you would successfully enroll and be redirected to a blank success template.

Screenshots

Expand
Description Screenshot
Waiting for transit processor form to load image
Transit processor form ready image
After entering card credentials image

@angela-tran angela-tran self-assigned this Sep 6, 2024
@github-actions github-actions bot added tests Related to automated testing (unit, UI, integration, etc.) back-end Django views, sessions, middleware, models, migrations etc. front-end HTML/CSS/JavaScript and Django templates and removed tests Related to automated testing (unit, UI, integration, etc.) back-end Django views, sessions, middleware, models, migrations etc. labels Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits
  routes.py
  settings.py
  benefits/in_person
  forms.py
  views.py
Project Total  

This report was generated by python-coverage-comment-action

@angela-tran angela-tran force-pushed the feat/in-person-enrollment-view branch 2 times, most recently from 52c6ef4 to 8294377 Compare September 6, 2024 21:16
Base automatically changed from refactor/enrollment-module to main September 10, 2024 18:49
@angela-tran angela-tran force-pushed the feat/in-person-enrollment-view branch 5 times, most recently from c55d54b to b06ea93 Compare September 12, 2024 21:14
rather than ones from the enrollment app
this is needed so in_person can show its own error templates and because
in_person shouldn't necessarily be bound by the same middleware that
the eligibility app's /token endpoint is bound by.
the card tokenization flow listens for the `element`'s click event
before it will set the iframe `src`.

use a Promise to wait for the card tokenization function to finish and
then programmatically click the button which is not displayed to the
user.
@angela-tran angela-tran force-pushed the feat/in-person-enrollment-view branch from b06ea93 to a1929af Compare September 12, 2024 21:26
@angela-tran angela-tran marked this pull request as ready for review September 12, 2024 21:27
@angela-tran angela-tran requested a review from a team as a code owner September 12, 2024 21:27
@machikoyasuda
Copy link
Member

Getting a front-end error in Firefox:

I was able to load the eligibility form, and then I clicked continue to http://localhost:11369/in_person/enrollment/

image

@angela-tran
Copy link
Member Author

angela-tran commented Sep 13, 2024

@machikoyasuda It looks like your transit processor is configured with sample values (http://server:8000 as the API base URL and tokenize.js as the card tokenize function). You'll want to use real config values for the QA Littlepay environment to see the form.

Copy link
Member

@lalver1 lalver1 left a comment

Choose a reason for hiding this comment

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

Nice work @angela-tran! I tested locally and everything worked as expected up until the Littlepay issue.

@machikoyasuda
Copy link
Member

@angela-tran oooh, of course, thank you! will review again.

@machikoyasuda machikoyasuda self-requested a review September 16, 2024 19:11
@angela-tran angela-tran merged commit 1499da3 into main Sep 16, 2024
15 checks passed
@angela-tran angela-tran deleted the feat/in-person-enrollment-view branch September 16, 2024 19:13
@angela-tran angela-tran linked an issue Sep 16, 2024 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end HTML/CSS/JavaScript and Django templates tests Related to automated testing (unit, UI, integration, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement enrollment view and template
3 participants