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

reCAPTCHA: Enrollment index #2575

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

machikoyasuda
Copy link
Member

@machikoyasuda machikoyasuda commented Dec 6, 2024

closes #2546

What this PR does

  • Media Items: All media item CSS is now gone! See more details here: https://github.com/cal-itp/benefits/pull/2575/files#r1873914833
  • Media Items: Refactors the 2 items for Enrollment index (Contactless card item, CalFresh item) to not be a <ul>, just a regular headline and paragraph. Then, moves that code directly into the index template directly - removing the includes entirely.
  • Copy: The headlines previously had manual <br> in them. I removed it.

Test

  • Test the CalFresh flow
  • Test the other flows
image image image image

@github-actions github-actions bot added front-end HTML/CSS/JavaScript and Django templates i18n Copy: Language files or Django i18n framework and removed front-end HTML/CSS/JavaScript and Django templates labels Dec 6, 2024
@machikoyasuda machikoyasuda self-assigned this Dec 6, 2024
@machikoyasuda machikoyasuda linked an issue Dec 6, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Dec 6, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits/eligibility
  forms.py
Project Total  

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

Comment on lines 89 to 93
{% block call-to-action %}
<div class="row d-flex justify-content-lg-end pt-8">
<div class="col-lg-3 offset-2 offset-sm-2 offset-lg-0 col-sm-8 col-8">
<div class="row d-flex justify-content-center pt-8">
<div class="col-12 col-lg-6">
{% block call-to-action-button %}
{% endblock call-to-action-button %}
Copy link
Member Author

Choose a reason for hiding this comment

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

This block is only used by enrollment-index.

Copy link
Member Author

Choose a reason for hiding this comment

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

Note for #2540

Copy link
Member

Choose a reason for hiding this comment

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

Hmm interesting observation 👍 Sounds like you're leaving any potential clean-up on this to be done in #2540?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah and this is turning into a true PR rabbit hole, but in the next PR for Enrollment Success/Logged Out, https://github.com/cal-itp/benefits/pull/2579/files#r1876743474, I moved some code out of call-to-action to clean it up further. After https://github.com/cal-itp/benefits/pull/2579/files#r1876743474, in #2540 will be able to consolidate some of the blocks in base.

Comment on lines 21 to 25
<div class="col-12 col-lg-6">
{% block media-items %}
<ul class="d-flex list-unstyled ps-0 mb-0">
{% include "enrollment/includes/media-item--contactless-card--index.html" %}
</ul>
</div>
{% endblock media-items %}
{% block additional-info %}
{% endblock additional-info %}
{% endblock media-items %}
{% block additional-info %}
{% endblock additional-info %}
</div>
Copy link
Member Author

Choose a reason for hiding this comment

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

This eliminates some divitis:

image

Instead of having three <div class="row justify-content-center"><div class="col-lg-6"></div></div>, we just have 1.

Comment on lines -595 to -614
/* Media List */

:root {
--media-item-icon-size: calc(64rem / 16);
--media-item-icon-margin: calc(24rem / 16);
}

@media (min-width: 992px) {
:root {
--media-item-icon-size: calc(90rem / 16);
--media-item-icon-margin: calc(32rem / 16);
}
}

.media-list-icon-left-margin {
margin-left: calc(
var(--media-item-icon-size) + var(--media-item-icon-margin)
);
}

Copy link
Member Author

@machikoyasuda machikoyasuda Dec 6, 2024

Choose a reason for hiding this comment

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

There are officially zero Media Item classes now. It's just a single <ul> with some <li>s in them, where there's always a <h2> and some <p>s.

Media items are used on two pages:

  • Eligibility Start - There are 2 media items per flow. The content is semantically and stylistically a list. There is no "media" though, so it could be renamed to heading-list or something.
  • Enrollment Index - There is only 1 item, so it's not even really a list. On this page it really feels like a stretch to semantically even use a ul and li. Just look at it:
image

Should this PR refactor Enrollment Index so it doesn't use the media-item block and just has a <h2> and <p> in inner-content? @angela-tran

Copy link
Member Author

Choose a reason for hiding this comment

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

@thekaveman jinx!

Copy link
Member Author

Choose a reason for hiding this comment

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

Media item now removed from Enrollment Index.

Copy link
Member

Choose a reason for hiding this comment

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

Should this PR refactor Enrollment Index so it doesn't use the media-item block and just has a <h2> and <p> in inner-content? @angela-tran

(this question was essentially the same as the one in #2575 (comment))

Done by @machikoyasuda in 56b9322

Comment on lines 748 to 756

msgid "We found your record!<br>Now let’s enroll your contactless card."
msgid "We found your record! Now let’s enroll your contactless card."
msgstr ""

msgid "Eligibility confirmation"
msgstr ""

msgid "Your eligibility is confirmed!<br>You’re almost there."
msgid "Your eligibility is confirmed! You’re almost there."
msgstr ""
Copy link
Member Author

Choose a reason for hiding this comment

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

The copy is now free of any headlines with manual <br> breaks in them.

Comment on lines 4 to 7
{% block info %}
{% include "enrollment/includes/info--contactless-card--index--calfresh.html" %}
{% include "enrollment/includes/alert-box--warning--calfresh.html" %}
{% endblock info %}
Copy link
Member Author

@machikoyasuda machikoyasuda Dec 6, 2024

Choose a reason for hiding this comment

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

Taking suggestions for this naming. @thekaveman @angela-tran Really wasn't sure what to name the block (info) or the includes file name. I could even get rid of the includes and just copy/paste the h2/p/modal in directly. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I could even get rid of the includes and just copy/paste the h2/p/modal in directly.

I vote for this one

Copy link
Member

Choose a reason for hiding this comment

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

Done by @machikoyasuda in 56b9322

Base automatically changed from feat/2542-recaptcha-elig-start to refactor/recaptcha-copy December 9, 2024 18:50
@machikoyasuda machikoyasuda force-pushed the feat/2546-recaptcha-enrollment branch from c6d5503 to e187a60 Compare December 9, 2024 20:59
@machikoyasuda machikoyasuda force-pushed the feat/2546-recaptcha-enrollment branch from a744ac8 to 56b9322 Compare December 9, 2024 21:31
@machikoyasuda machikoyasuda marked this pull request as ready for review December 9, 2024 21:39
@machikoyasuda machikoyasuda requested a review from a team as a code owner December 9, 2024 21:39
@machikoyasuda
Copy link
Member Author

@angela-tran Now ready for review! Incorporated your feedback on the media item template.

Copy link
Member

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

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

These changes look good to me.

Idk if you want to do this in a separate PR or as a part of this one, but now that Enrollment Index doesn't use any templates that inherit from core/includes/media-item.html, I think we could rename all the media-item templates to say eligibility-item instead (since they're only used in Eligibility Start).

Comment on lines 89 to 93
{% block call-to-action %}
<div class="row d-flex justify-content-lg-end pt-8">
<div class="col-lg-3 offset-2 offset-sm-2 offset-lg-0 col-sm-8 col-8">
<div class="row d-flex justify-content-center pt-8">
<div class="col-12 col-lg-6">
{% block call-to-action-button %}
{% endblock call-to-action-button %}
Copy link
Member

Choose a reason for hiding this comment

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

Hmm interesting observation 👍 Sounds like you're leaving any potential clean-up on this to be done in #2540?

@machikoyasuda
Copy link
Member Author

@angela-tran Thank you Angela. I will do the renaming in #2540

@machikoyasuda machikoyasuda merged commit aab7c0c into refactor/recaptcha-copy Dec 10, 2024
8 checks passed
@machikoyasuda machikoyasuda deleted the feat/2546-recaptcha-enrollment branch December 10, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Copy: Language files or Django i18n framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reCAPTCHA: Enrollment index - Realign text, button
2 participants