internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: cal-itp/benefits

Issue:
Update copy / content blocks on verifier selection page
## Acceptance Criteria
- [x] Verifier selection page has latest copy

## Additional context
Don't worry about alignment for text or buttons for this ticket. Just update copy.



Discussion:

Resolving patch:
diff --git a/benefits/core/migrations/0002_sample_data.py b/benefits/core/migrations/0002_sample_data.py
--- a/benefits/core/migrations/0002_sample_data.py
+++ b/benefits/core/migrations/0002_sample_data.py
@@ -106,7 +106,7 @@ def load_sample_data(app, *args, **kwargs):
         jws_signing_alg="RS256",
         auth_provider=auth_provider,
         selection_label=_("eligibility.pages.index.sample.label"),
-        selection_label_description=None,
+        selection_label_description=_("eligibility.pages.index.sample.description"),
         start_headline=_("eligibility.pages.start.sample.title"),
         start_sub_headline=_("eligibility.pages.start.sample.content_title"),
         start_item_name=_("eligibility.pages.start.sample.items[0].title"),
diff --git a/benefits/eligibility/forms.py b/benefits/eligibility/forms.py
--- a/benefits/eligibility/forms.py
+++ b/benefits/eligibility/forms.py
@@ -18,9 +18,9 @@ class EligibilityVerifierSelectionForm(forms.Form):
     action_url = "eligibility:index"
     method = "POST"
 
-    verifier = forms.ChoiceField(label="", widget=widgets.RadioSelect)
+    verifier = forms.ChoiceField(label=_("eligibility.pages.index.label"), widget=widgets.RadioSelect)
 
-    submit_value = _("eligibility.buttons.continue")
+    submit_value = _("eligibility.buttons.choose")
 
     def __init__(self, agency: models.TransitAgency, *args, **kwargs):
         super().__init__(*args, **kwargs)
diff --git a/benefits/eligibility/views.py b/benefits/eligibility/views.py
--- a/benefits/eligibility/views.py
+++ b/benefits/eligibility/views.py
@@ -6,6 +6,7 @@
 from django.template.response import TemplateResponse
 from django.urls import reverse
 from django.utils.decorators import decorator_from_middleware
+from django.utils.html import format_html
 from django.utils.translation import pgettext, gettext as _
 
 from benefits.core import recaptcha, session, viewmodels
@@ -35,9 +36,14 @@ def index(request):
 
     eligibility_start = reverse(ROUTE_START)
 
+    help_page = reverse(ROUTE_HELP)
+
     page = viewmodels.Page(
         title=_("eligibility.pages.index.title"),
         content_title=_("eligibility.pages.index.content_title"),
+        paragraphs=[
+            format_html(_("eligibility.pages.index.p[0]%(info_link)s") % {"info_link": f"{help_page}#what-is-cal-itp"})
+        ],
         forms=forms.EligibilityVerifierSelectionForm(agency=agency),
     )
 


Test patch:
Repository: cal-itp/benefits

Issue:
Remove DMV language file entries
Part of #776

## Expected behavior

The language files and sample migrations do not contain any references to the DMV.


Discussion:

Resolving patch:
diff --git a/benefits/core/migrations/0002_sample_data.py b/benefits/core/migrations/0002_sample_data.py
--- a/benefits/core/migrations/0002_sample_data.py
+++ b/benefits/core/migrations/0002_sample_data.py
@@ -105,25 +105,25 @@ def load_sample_data(app, *args, **kwargs):
         jwe_encryption_alg="RSA-OAEP",
         jws_signing_alg="RS256",
         auth_provider=auth_provider,
-        selection_label=_("eligibility.pages.index.dmv.label"),
+        selection_label=_("eligibility.pages.index.sample.label"),
         selection_label_description=None,
-        start_headline=_("eligibility.pages.start.dmv.title"),
-        start_sub_headline=_("eligibility.pages.start.dmv.content_title"),
-        start_item_name=_("eligibility.pages.start.dmv.items[0].title"),
-        start_item_description=_("eligibility.pages.start.dmv.items[0].text"),
-        start_blurb=_("eligibility.pages.start.dmv.p[0]"),
-        form_title=_("eligibility.pages.confirm.dmv.title"),
-        form_content_title=_("eligibility.pages.confirm.dmv.content_title"),
-        form_blurb=_("eligibility.pages.confirm.dmv.p[0]"),
-        form_sub_label=_("eligibility.forms.confirm.dmv.fields.sub"),
+        start_headline=_("eligibility.pages.start.sample.title"),
+        start_sub_headline=_("eligibility.pages.start.sample.content_title"),
+        start_item_name=_("eligibility.pages.start.sample.items[0].title"),
+        start_item_description=_("eligibility.pages.start.sample.items[0].text"),
+        start_blurb=_("eligibility.pages.start.sample.p[0]"),
+        form_title=_("eligibility.pages.confirm.sample.title"),
+        form_content_title=_("eligibility.pages.confirm.sample.content_title"),
+        form_blurb=_("eligibility.pages.confirm.sample.p[0]"),
+        form_sub_label=_("eligibility.forms.confirm.sample.fields.sub"),
         form_sub_placeholder="A1234567",
         form_sub_pattern=".+",
-        form_name_label=_("eligibility.forms.confirm.dmv.fields.name"),
+        form_name_label=_("eligibility.forms.confirm.sample.fields.name"),
         form_name_placeholder="Rodriguez",
         form_name_max_length=255,
-        unverified_title=_("eligibility.pages.unverified.dmv.title"),
-        unverified_content_title=_("eligibility.pages.unverified.dmv.content_title"),
-        unverified_blurb=_("eligibility.pages.unverified.dmv.p[0]"),
+        unverified_title=_("eligibility.pages.unverified.sample.title"),
+        unverified_content_title=_("eligibility.pages.unverified.sample.content_title"),
+        unverified_blurb=_("eligibility.pages.unverified.sample.p[0]"),
     )
 
     verifier2 = EligibilityVerifier.objects.create(


Test patch:
Repository: cal-itp/benefits

Issue:
CSS: Create CSS Variables for colors, fonts
A clear and concise description of the task.

## Acceptance Criteria

<!-- Remember to consider edge cases -->

- [ ] Variable-ize all colors. Use color names from Figma.
- [ ] Variable-ize font sizes, letter-spacing, line-spacing, font weights

Example:

$primary-color: #046B99;
$white-color: #fffffff;

$header-background: $primary-color;
$button-text-color: $white-color;

$h1-font-size: 18px;

$h3-font-weight: 700;


## Additional context

<!-- Add any other context about the task here -->



Discussion:

Resolving patch:
diff --git a/benefits/eligibility/views.py b/benefits/eligibility/views.py
--- a/benefits/eligibility/views.py
+++ b/benefits/eligibility/views.py
@@ -164,7 +164,6 @@ def confirm(request):
         headline=_(verifier.form_headline),
         paragraphs=[_(verifier.form_blurb)],
         form=forms.EligibilityVerificationForm(auto_id=True, label_suffix="", verifier=verifier),
-        classes="text-lg-center",
     )
 
     # GET from an unverified user, present the form
diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py
--- a/benefits/enrollment/views.py
+++ b/benefits/enrollment/views.py
@@ -79,7 +79,6 @@ def index(request):
             headline=_("enrollment.pages.index.headline"),
             icon=viewmodels.Icon("idcardcheck", pgettext("image alt text", "core.icons.idcardcheck")),
             paragraphs=[_("enrollment.pages.index.p[0]"), _("enrollment.pages.index.p[1]"), _("enrollment.pages.index.p[2]")],
-            classes="text-lg-center no-image-mobile",
             forms=[tokenize_retry_form, tokenize_success_form],
             buttons=[
                 viewmodels.Button.primary(


Test patch:
Repository: cal-itp/benefits

Issue:
Remove agency index pass-through
With the new Courtesy Card designs, we have a better context-setting Agency Index (homepage). Let's remove the auto-pass-through that currently sends the user straight to Eligibility Start.

## Acceptance Criteria

<!-- Remember to consider edge cases -->

- [ ] A user lands on the Agency Index page when viewing the Benefits app
- [ ] The Agency Index continue button takes the user to the Eligibility Index page

## Additional context

Work on the new homepage is happening in #937


Discussion:

Resolving patch:
diff --git a/benefits/core/views.py b/benefits/core/views.py
--- a/benefits/core/views.py
+++ b/benefits/core/views.py
@@ -52,9 +52,6 @@ def agency_index(request, agency):
     session.reset(request)
     session.update(request, agency=agency, origin=agency.index_url)
 
-    if len(agency.eligibility_verifiers.all()) == 1:
-        return redirect(reverse(ROUTE_ELIGIBILITY))
-
     button = viewmodels.Button.primary(text=_("core.pages.index.continue"), url=reverse(ROUTE_ELIGIBILITY))
 
     page = viewmodels.Page(


Test patch:
diff --git a/tests/pytest/core/test_views.py b/tests/pytest/core/test_views.py
--- a/tests/pytest/core/test_views.py
+++ b/tests/pytest/core/test_views.py
@@ -4,7 +4,7 @@
 
 from benefits.core.models import EligibilityVerifier, TransitAgency
 import benefits.core.session
-from benefits.core.views import ROUTE_ELIGIBILITY, ROUTE_INDEX, ROUTE_HELP, TEMPLATE_AGENCY, bad_request, csrf_failure
+from benefits.core.views import ROUTE_INDEX, ROUTE_HELP, TEMPLATE_AGENCY, bad_request, csrf_failure
 
 
 ROUTE_AGENCY = "core:agency_index"
@@ -60,8 +60,8 @@ def test_agency_index_single_verifier(mocker, model_TransitAgency, client, sessi
     session_reset_spy.assert_called_once()
     mocked_session_update.assert_called_once()
 
-    assert response.status_code == 302
-    assert response.url == reverse(ROUTE_ELIGIBILITY)
+    assert response.status_code == 200
+    assert response.template_name == TEMPLATE_AGENCY
 
 
 @pytest.mark.django_db
Repository: cal-itp/benefits

Issue:
Bug: Error page bug - Log out button too low
A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior:

1. Go through the Login.gov IAL2 flow with a user who is under age 65
2. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots

Tablet/Mobile widths are off:
<img width="485" alt="image" src="https://user-images.githubusercontent.com/3673236/190286767-dc5e2f26-3a48-44e7-a480-9751726938ea.png">
<img width="457" alt="image" src="https://user-images.githubusercontent.com/3673236/190287117-4c1072cb-271d-4b1a-b0c8-00f7dd958302.png">

Desktop is good:
<img width="1440" alt="image" src="https://user-images.githubusercontent.com/3673236/190287052-4c8a778a-7ccf-42dd-8042-c59a0b350308.png">


## Desktop (please complete the following information)

- OS: [e.g. iOS]

## Smartphone (please complete the following information)

- Device: [e.g. iPhone6]

## Additional context

Add any other context about the problem here.



Discussion:

Resolving patch:
diff --git a/benefits/enrollment/views.py b/benefits/enrollment/views.py
--- a/benefits/enrollment/views.py
+++ b/benefits/enrollment/views.py
@@ -140,7 +140,6 @@ def retry(request):
         if form.is_valid():
             agency = session.agency(request)
             page = viewmodels.Page(
-                classes="no-image-mobile",
                 title=_("enrollment.pages.retry.title"),
                 icon=viewmodels.Icon("bankcardquestion", pgettext("image alt text", "core.icons.bankcardquestion")),
                 headline=_("enrollment.pages.retry.title"),


Test patch:
Repository: cal-itp/benefits

Issue:
Refactor "Agency links" include, page template
In #480 we introduced some new rendering for "Agency links" - the contact info phone number / website that shows up most notably on the Help page, but also when the user fails to verify their eligibility.

As a follow-up we should clean up the Page and Help templates so we aren't trying to do too much where it isn't needed.

## Tasks

* [x] The Back button should not be rendered in an include with agency links
* [x] The Page template should not render anything related to agency links
* [x] Create new template(s) for pages that do need to render agency links, using the include


Discussion:
Blocked until #816 is merged
> Blocked until #816 is merged

Merged. Resuming work on this.

Resolving patch:
diff --git a/benefits/eligibility/views.py b/benefits/eligibility/views.py
--- a/benefits/eligibility/views.py
+++ b/benefits/eligibility/views.py
@@ -235,7 +235,6 @@ def unverified(request):
 
     page = viewmodels.Page(
         title=_(verifier.unverified_title),
-        classes="with-agency-links",
         headline=_(verifier.unverified_headline),
         icon=viewmodels.Icon("idcardquestion", pgettext("image alt text", "core.icons.idcardquestion")),
         paragraphs=[_(verifier.unverified_blurb)],


Test patch:
Repository: cal-itp/benefits

Issue:
Desktop: Previous Page Button hover color
A clear and concise description of the task.

## Acceptance Criteria

<!-- Remember to consider edge cases -->

- [ ] Hover color is blue, look at Figma

## Additional context

<!-- Add any other context about the task here -->



Discussion:
<img width="527" alt="image" src="https://user-images.githubusercontent.com/3673236/195392484-bb97ef9c-6f35-457e-b7a2-145c8eb7328c.png">

@srhhnry Are there Desktop designs for this button?

<img width="530" alt="image" src="https://user-images.githubusercontent.com/3673236/195392565-3fc0b483-da69-4ca5-82e1-9027eac11a18.png">

Nothing other than what is in the components library 

<img width="289" alt="image" src="https://user-images.githubusercontent.com/5394204/195401547-5a8aab7b-52ed-4b0d-a8ec-f9a301bbed1f.png">

This design is from the old designs/old version of the app. I didn't see any apparent reason to update the desktop version, but will include in testing in the future.


Resolving patch:
diff --git a/benefits/core/viewmodels.py b/benefits/core/viewmodels.py
--- a/benefits/core/viewmodels.py
+++ b/benefits/core/viewmodels.py
@@ -93,10 +93,7 @@ def logout(**kwargs):
 
     @staticmethod
     def previous_page(url):
-        kwargs = {"id": "previous-page-button", "text": _("core.buttons.previous_page"), "url": url}
-        btn = Button(**kwargs)
-        btn.classes.append("btn-outline-dark")
-        return btn
+        return Button(text=_("core.buttons.previous_page"), url=url)
 
 
 class Icon:


Test patch:
Repository: cal-itp/benefits

Issue:
Enrollment Success page: Final touches
Make the page look like the Figma mocks. 

1. Desktop: Design the last line to this. It's a 10-column wide large div that is left-aligned.

<img width="837" alt="image" src="https://user-images.githubusercontent.com/3673236/195391617-3f48afbb-9b1a-4500-b727-087a43e5865a.png">



<img width="1512" alt="image" src="https://user-images.githubusercontent.com/3673236/195273016-ca031b6e-673f-4bf1-943e-2fdd8f085255.png">

2. Mobile: Design this last line. This mobile alignment is trickier. Might have to write CSS to add a margin-left and then calculate exactly how much the amount would be, based on what is the diameter of the icon plus the margin.

<img width="209" alt="image" src="https://user-images.githubusercontent.com/3673236/195392741-aba35117-a63f-457e-a8ec-3687b5ef7f30.png">
<img width="1512" alt="image" src="https://user-images.githubusercontent.com/3673236/195273060-2df3fad3-045e-48ad-af27-8c4f9abb75b7.png">


3. Enrollment Success post-log out:
<img width="193" alt="image" src="https://user-images.githubusercontent.com/3673236/195393285-3eb7e077-b56d-4d11-9e2c-9d2a8858ad8d.png">
<img width="636" alt="image" src="https://user-images.githubusercontent.com/3673236/195393331-387c207b-c988-471a-9eca-ae31356ab360.png">


<img width="1512" alt="image" src="https://user-images.githubusercontent.com/3673236/195273236-40fe1650-f74c-4126-8559-d86bdb7811da.png">



Discussion:
@angela-tran I just noticed the Enrollment Success page still inherits from `page`. Could you change it to inherit from `base` in your PR too?

One thing I noticed immediately is that on Mobile, the text is not aligned left to the container width (b/c it's using the `page.html`'s `container content`):
<img width="613" alt="image" src="https://user-images.githubusercontent.com/3673236/195456687-04cdb57a-6513-4a92-9973-ea7daa3d4305.png">

@machikoyasuda Yep, will be making it extend `base.html`

Resolving patch:
diff --git a/benefits/core/views.py b/benefits/core/views.py
--- a/benefits/core/views.py
+++ b/benefits/core/views.py
@@ -19,6 +19,7 @@
 TEMPLATE_PAGE = "core/page.html"
 TEMPLATE_AGENCY = "core/agency_index.html"
 TEMPLATE_HELP = "core/help.html"
+TEMPLATE_LOGGED_OUT = "core/logged_out.html"
 
 
 @pageview_decorator
@@ -158,8 +159,7 @@ def logged_out(request):
     """View handler for the final log out confirmation message."""
     page = viewmodels.Page(
         title=_("core.pages.logged_out.title"),
-        headline=_("core.pages.logged_out.headline"),
         icon=viewmodels.Icon("happybus", pgettext("image alt text", "core.icons.happybus")),
     )
 
-    return TemplateResponse(request, TEMPLATE_PAGE, page.context_dict())
+    return TemplateResponse(request, TEMPLATE_LOGGED_OUT, page.context_dict())


Test patch:
Repository: cal-itp/benefits

Issue:
Content Security Policy frame-src should not extend "none"
The default CSP `frame-src` setting [we configure is `["'none'"]`](https://github.com/cal-itp/benefits/blob/dev/benefits/settings.py#L275).

Then we `.extend()` that list with any additional allowed frame sources. But this is not correct in CSP, either `'none'` or a list of domains should be provided, not both.

We saw this with reCAPTCHA complaining in the console in `dev`:

![image](https://user-images.githubusercontent.com/1783439/195720177-9e2ad036-aaea-4256-8da2-e1d47565f67f.png)

## To Reproduce

Steps to reproduce the behavior:

1. Go to `dev`
2. Get to the Benefits selection page
3. Open the browser console
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Additional context

This _may_ be causing an issue where reCAPTCHA is allowing the form to submit even when required fields are not provided:

![no-field-validation](https://user-images.githubusercontent.com/1783439/195720727-33bbcfa8-f371-4f9b-9acf-f91f0c0eee7f.gif)



Discussion:

Resolving patch:
diff --git a/benefits/settings.py b/benefits/settings.py
--- a/benefits/settings.py
+++ b/benefits/settings.py
@@ -274,10 +274,10 @@ def _filter_empty(ls):
 
 CSP_FRAME_SRC = ["'none'"]
 env_frame_src = _filter_empty(os.environ.get("DJANGO_CSP_FRAME_SRC", "").split(","))
-CSP_FRAME_SRC.extend(env_frame_src)
 if RECAPTCHA_ENABLED:
-    CSP_FRAME_SRC.append("https://www.google.com")
-
+    env_frame_src.append("https://www.google.com")
+if len(env_frame_src) > 0:
+    CSP_FRAME_SRC = env_frame_src
 
 CSP_SCRIPT_SRC = [
     "'unsafe-inline'",


Test patch:
Repository: cal-itp/benefits

Issue:
Investigate console errors from CA State Template
We get a ton of Javascript console errors coming from the CA State Template. Why? Can we avoid and/or fix some of them?

## To Reproduce

Steps to reproduce the behavior:

1. Go to the dev site
2. Open the browser console / dev tools with `F12`
3. Scroll on the page, view another page, etc.
4. See all kinds of console errors originating from `cagov.core.min.js`

## Expected behavior

We shouldn't have any console errors, especially for features we are not using.

## Screenshots

![image](https://user-images.githubusercontent.com/1783439/199357804-a55abe3d-ee12-4ea4-9596-804d0d4c73cb.png)

## Additional context

We upgraded the State Template in #952


Discussion:
It's coming on every scroll up, scroll down, because the CA Web State Template expects every page to have certain specific elements/classes. But we are not using them. I am not sure if there is a way to opt-out of JS features we don't want from CA Web State Template.
This `searchTop()` function <img width="893" alt="image" src="https://user-images.githubusercontent.com/3673236/199361018-12a061dc-c712-41a4-855b-a6f4c70a2f41.png">
gets called on every scroll <img width="416" alt="image" src="https://user-images.githubusercontent.com/3673236/199361076-4f2584a8-b43f-4558-9164-ce3e96c1a9d4.png">


Resolving patch:
diff --git a/benefits/settings.py b/benefits/settings.py
--- a/benefits/settings.py
+++ b/benefits/settings.py
@@ -281,9 +281,8 @@ def _filter_empty(ls):
 
 CSP_SCRIPT_SRC = [
     "'unsafe-inline'",
-    "https://california.azureedge.net/",
     "https://cdn.amplitude.com/libs/",
-    "https://code.jquery.com/",
+    "https://cdn.jsdelivr.net/",
     "*.littlepay.com",
 ]
 env_script_src = _filter_empty(os.environ.get("DJANGO_CSP_SCRIPT_SRC", "").split(","))


Test patch:
Repository: cal-itp/benefits

Issue:
Remove auto-forward for single-verifier agencies
In #337 we introduced handling for an eligibility verifier selection form, which supports choosing between e.g. verifying eligibility with Login.gov or with a Courtesy Card. We also added [a shortcut](https://github.com/cal-itp/benefits/blob/dev/benefits/eligibility/views.py#L77) for when an agency has only a single verifier -- to bypass this form and go straight to the next step in the flow.

We want to have a consistent user experience regardless of the number of verifiers, and so it's time to remove this shortcut and always show the verifier selection page, even with only 1 option.

## Acceptance Criteria

<!-- Remember to consider edge cases -->

- [ ] The user must always choose a verifier on `/eligibility`, regardless of the number of verifiers there are to choose from

## Additional context

Design sign-off on this approach: https://cal-itp.slack.com/archives/C013W8RUAMU/p1673542656882989



Discussion:

Resolving patch:
diff --git a/benefits/eligibility/views.py b/benefits/eligibility/views.py
--- a/benefits/eligibility/views.py
+++ b/benefits/eligibility/views.py
@@ -74,12 +74,7 @@ def index(request):
             page.forms = [form]
             response = TemplateResponse(request, TEMPLATE_INDEX, ctx)
     else:
-        if agency.eligibility_verifiers.count() == 1:
-            verifier = agency.eligibility_verifiers.first()
-            session.update(request, verifier=verifier)
-            response = redirect(eligibility_start)
-        else:
-            response = TemplateResponse(request, TEMPLATE_INDEX, ctx)
+        response = TemplateResponse(request, TEMPLATE_INDEX, ctx)
 
     return response
 


Test patch:
diff --git a/tests/pytest/eligibility/test_views.py b/tests/pytest/eligibility/test_views.py
--- a/tests/pytest/eligibility/test_views.py
+++ b/tests/pytest/eligibility/test_views.py
@@ -92,8 +92,11 @@ def test_index_get_agency_single_verifier(
     path = reverse(ROUTE_INDEX)
     response = client.get(path)
 
-    assert response.status_code == 302
-    assert response.url == reverse(ROUTE_START)
+    assert response.status_code == 200
+    assert response.template_name == TEMPLATE_INDEX
+    assert "page" in response.context_data
+    assert len(response.context_data["page"].forms) > 0
+    assert isinstance(response.context_data["page"].forms[0], EligibilityVerifierSelectionForm)
 
 
 @pytest.mark.django_db