-
Notifications
You must be signed in to change notification settings - Fork 9
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: Elig Index, Elig Confirm - Add reCAPTCHA text, hide flag #2586
base: refactor/recaptcha-copy
Are you sure you want to change the base?
reCAPTCHA: Elig Index, Elig Confirm - Add reCAPTCHA text, hide flag #2586
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
|
||
{% block call-to-action %} | ||
{% endblock call-to-action %} |
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.
Why is this here?
It's here to ensure that more spacing is not created. If this is not here, then the base.html
will put this HTML on the page, which includes pt-8
-- which we do not want:
<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 %}
</div>
</div>
There's an alternate way to achieve this. I could have put this code on both eligibility/confirm.html
and eligibility/index.html
:
{% block call-to-action-button %}
{% include "core/includes/recaptcha-text.html" %}
{% endblock call-to-action-button %}
But it felt semantically incorrect to put text into code that was meant to be for a button only. And I didn't want to come up with a more generic name to rename call-to-action-button
or rename all those on the other templates... So I went with this method instead.
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.
This sounds reasonable 👍 I think a comment above the empty block in this file just indicating that it is there for a reason (maybe a link to this thread here?) would be helpful for the future.
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.
Added comments in both templates to clarify what is going on there
benefits/static/css/variables.css
Outdated
--bs-font-sans-serif: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif, | ||
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | ||
--bs-font-sans-serif: Roboto, system-ui, -apple-system, "Segoe UI", | ||
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", | ||
"Noto Color Emoji"; |
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.
Wait why does pre-commit
do this to me T_T
dee6b3f
to
303a5b1
Compare
@@ -556,7 +564,7 @@ footer .footer-links li a.footer-link:visited { | |||
.form-text { | |||
font-size: var(--font-size-14px); | |||
line-height: var(--form-field-text-line-height); | |||
letter-spacing: var(--letter-spacing-5); | |||
letter-spacing: calc(var(--font-size-14px) * var(--letter-spacing-5)); |
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.
The way this is calculated: In Figma, click on the text. In the Dev resources sidebar, ensure Properties is enabled (instead of Code). Look for the letter spacing percentage:
Multiply the percentage with the font size.
benefits/static/css/styles.css
Outdated
@@ -517,26 +533,18 @@ footer .footer-links li a.footer-link:visited { | |||
} | |||
|
|||
/* Forms: Text Inputs */ | |||
/* Form Container: Must use .form-container parent to use these styles */ | |||
/* Form Field Container: Must use .form-container parent to use these styles */ |
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.
<div class="row form-container justify-content-center"> | ||
<div class="{{ form.classes }}"> | ||
{% for field in form %} | ||
<div class="row form-group mb-0"> | ||
<div class="col-12"> | ||
{# djlint:off #} | ||
{% if field.label %} | ||
<label for="{{ field.id_for_label }}" class="form-control-label">{{ field.label }}{% if field.field.required %}<span class="required-label text-body">*</span>{% endif %} | ||
</label> | ||
{% endif %} | ||
{# djlint:on #} | ||
|
||
{{ field }} | ||
|
||
{% if field.help_text %}<small class="d-block mt-2 pt-1 form-text text-body">{{ field.help_text }}</small>{% endif %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> |
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.
All of these row justify-content-center
, row
, col-12
are unnecessary.
<div class="row d-flex justify-content-center pt-8"> | ||
<div class="col-lg-6"> |
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.
Now longer needed.
f19ba58
to
36b9a3b
Compare
benefits/static/css/styles.css
Outdated
.eligibility-confirm footer { | ||
margin-top: 24px; | ||
} | ||
|
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.
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 narrowed down the issue I mentioned in #2586 (comment) for confirm.html
to this style... somehow this is causing the footer to have spacing on the bottom?
@@ -517,26 +533,18 @@ footer .footer-links li a.footer-link:visited { | |||
} | |||
|
|||
/* Forms: Text Inputs */ | |||
/* Form Container: Must use .form-container parent to use these styles */ | |||
/* Form Field Container: Must use .form-field-container parent to use these styles */ |
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.
Renamed this b/c this div is a container around one form field, rather than the entire form.
benefits/static/css/styles.css
Outdated
:root { | ||
--form-input-gap: calc(24rem / 16); | ||
} | ||
|
||
.form-container .form-group:not(:first-child) { | ||
padding-top: var(--form-input-gap); | ||
} |
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.
Use the d-flex flex-column gap-4
CSS class to achieve this instead.
This is ready for review. |
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.
Looking really good. Just a couple of questions.
How to test reCAPTCHA locally: #1071 I added the test reCAPTCHA keys to the Benefits reCAPTCHA file in the Compiler Engineering LastPass shared doc. |
…er text for elig-confirm
9cefd75
to
9cfd2c6
Compare
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.
Changes are looking good. I noticed an odd CSS issue though with how we're trying to override the 64px top spacing for the footer with 24px.
benefits/static/css/styles.css
Outdated
.eligibility-confirm footer { | ||
margin-top: 24px; | ||
} | ||
|
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 narrowed down the issue I mentioned in #2586 (comment) for confirm.html
to this style... somehow this is causing the footer to have spacing on the bottom?
@machikoyasuda can you check on this alignment issue on Enrollment Index? I see it only in this branch. edit: maybe you've fixed it in #2588? I haven't checked yet |
@angela-tran Oh wow I don't know how those non-fixes on in there. For now, I just added those good ole divs on divs back again. But they'll all be removed in #2588 |
{% csrf_token %} | ||
|
||
<div class="row form-container justify-content-center"> | ||
<div class="{{ form.classes }}"> |
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 think there's a regression in Benefits Admin coming from this change.
We have some styles in admin/styles.css
so that descendant checkboxes will be on the left side:
benefits/benefits/static/css/admin/styles.css
Lines 88 to 103 in dce769c
/* Eligibility Page */ | |
.checkbox-parent .form-group:last-of-type .col-12 { | |
display: flex; | |
flex-direction: row-reverse; | |
justify-content: start; | |
column-gap: 0.5rem; | |
margin-top: 2rem; | |
} | |
.checkbox-parent, | |
.checkbox-parent .form-group .col-12, | |
.checkbox-parent .form-group .col-12 #id_flow { | |
display: flex; | |
flex-direction: column; | |
row-gap: 1rem; | |
} |
InPersonEligibilityForm
has checkbox-parent
in its classes
, which would end up on this line, but now it's on the <form>
element.
main | this branch (with #2555 merged in locally... *) |
---|---|
Not sure if we should put this <div>
back or try to tweak the CSS?
(*When we're back in the new year, it'd be good to get all this reCAPTCHA work caught up with the fixes that are in main.)
closes #2541
What this PR does
This ticket actually adds the reCAPTCHA text to 2 forms (Eligibility Confirm, Eligibility Index) and hides the badge.
recaptcha-text
includes with the English and Spanish textrecaptcha-text
inform.html
within theif request.recaptcha
block, so that it shows up automatically on where recaptcha is usedform-text
class to fix the form field helper letter-spacing, and use that same class for the recaptcha text, adds styling so that the external link icon is smaller for the smaller textTesting notes
dev
, we can first test that the reCAPTCHA message does not show up. It should not show up b/c reCAPTCHA is not enabled. Once we do turn reCAPTCHA on, then we can test that the reCAPTCHA text turns on and the feature is enabled.Screenshots