-
Notifications
You must be signed in to change notification settings - Fork 10
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 eligibility policies #2689
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
18443be
to
0ec5b92
Compare
1f8f25e
to
d27a53e
Compare
Ready for review again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through the code and tested locally and everything looked good, this is a really nice new feature! 👍
This is only a note, that Nevada County Connects is set up in test
with 2 in-person flows (disability
and youth
) with no policy_details
yet. Seems like the migration in this PR will reset these to digital
so we just need to remember to reconfigure these 2 flows and add policy_details
to them after we do an rc
release. If this makes sense, I can create a ticket for this chore.
@lalver1 Quick note: we don't have |
the mocked agency used by the test did not have any flows, and the test was passing as a false positive. use the `mocked_session_flow` fixture so that the agency has a flow. this is similar to the fix in 3bf128c.
change the form to have a checkbox for each flow. when the user selects the radio button for a flow, the corresponding checkbox is shown, and the other checkboxes are hidden. implement a template specifically for this form.
also fix spelling typo on copy for checkboxes.
previously we could rely on Django's default handling of the single `BooleanField`, but since we have multiple checkboxes now, and we don't want to require all of them, we need to implement our own logic to require that the checkbox that matches the selected flow was checked. also added Javascript to the template to show the checkbox for the case where the form didn't pass back-end validation and therefore we show the form again with what the user had selected.
consumer is responsible for handling any error that might occur from the key not being found.
data migration handles removing "in_person" from flows that do not have a policy in the `in_person.context.eligibility_index` dict. `EnrollmentFlow.clean` handles enforcing this rule going forward when creating or editing flows.
5a78acc
to
147e258
Compare
After rebasing onto |
The migration only removes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change: the local_fixtures.json
should be updated so that when starting from scratch (e.g. no database, like a fresh local environment), we don't load flows marked for in-person that aren't in the context.
This happens after the database migration here, so they are loaded in an invalid state.
a flow that does not have an in-person policy (as mapped by `in_person.context.eligibility_index`) is not allowed to support the `in_person` enrollment method.
Thanks for catching that! Updated them in 98ef80a |
NP. Forget it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🪪 🔍
✅
Closes #2632
This PR implements the functionality where, when verifying eligibility in-person, the user must agree they have used the specific eligibility criteria that is shown.
Screen recordings of behavior
(GIFs play only once. You can refresh the page to replay I think.)
User-facing behavior (for transit agency staff user)
Checkbox changes based on selected flow
Checkbox resets if user changes selected flow
Browser validation messages
User-facing behavior (for superusers and Cal-ITP staff users)
In-person
enrollment will be automatically updated to have that option unchecked.In-person
as a supported enrollment method, that will only work for the three flows mentioned above. For any other flows, an error message will be shown:Error message when attempting to add `In-person` to a flow without a policy
Testing locally
Data migration
main
branch, load sample fixtures with./bin/reset_db.sh
/admin
, and log in ascst-user
. At/in_person/eligibility
, you'll see the 5 in-person flows for CST.EnrollmentFlow
s and notice theIn-person
checkbox is checked.git checkout feat/in-person-policies
) and run the migration with./bin/init.sh
/admin
, and log in ascst-user
. At/in_person/eligibility
, you'll see only "Older Adult" and "Medicare Cardholder".EnrollmentFlow
s, only the "Older Adult" and "Medicare Cardholder" flows haveIn-person
checked.EnrollmentFlow
validation enforces that in-person flows have a policyIn-person
for a flow and save it. If it is not one of the flows with an in-person eligibility policy, you will get an error message.a11y
I tested going through the form with only keyboard interaction, and the tab order / interactions worked as I expected.
I also inspected the accessibility tree and observed that when the checkboxes go from hidden to shown, the accessibility tree makes sense, i.e. it only shows the checkbox that is currently displayed.