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 eligibility policies #2689

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

angela-tran
Copy link
Member

Closes #2632

WIP

@angela-tran angela-tran self-assigned this Feb 13, 2025
@github-actions github-actions bot added deployment-dev [auto] Changes that will trigger a deploy if merged to dev migrations [auto] Review for potential model changes/needed data migrations updates back-end Django views, sessions, middleware, models, migrations etc. front-end HTML/CSS/JavaScript and Django templates and removed migrations [auto] Review for potential model changes/needed data migrations updates labels Feb 13, 2025
Copy link

github-actions bot commented Feb 13, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits/core
  context.py
  benefits/core/admin
  enrollment.py
  benefits/core/models
  enrollment.py
  benefits/in_person
  context.py 11
  forms.py 54, 69
Project Total  

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

@@ -10,6 +10,8 @@
from .common import PemData, SecretNameField, template_path
from .claims import ClaimsProvider
from .transit import TransitAgency
from benefits.core.context import SystemName
from benefits.in_person.context import eligibility
Copy link
Member Author

Choose a reason for hiding this comment

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

I know we're wanting to discuss the naming for this copy context stuff. For now, I am just following the existing naming pattern but am aware that we don't necessarily like it.

@angela-tran angela-tran force-pushed the feat/in-person-policies branch from dd9ccea to e0a9209 Compare February 13, 2025 17:25
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.
@angela-tran angela-tran force-pushed the feat/in-person-policies branch from e0a9209 to 90fdd12 Compare February 13, 2025 22:36
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.
@angela-tran angela-tran force-pushed the feat/in-person-policies branch from 90fdd12 to 9582a61 Compare February 13, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc. deployment-dev [auto] Changes that will trigger a deploy if merged to dev front-end HTML/CSS/JavaScript and Django templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin: In-Person - View policy
1 participant