Skip to content

LG-8543 Accepted ID Alert#7835

Merged
JackRyan1989 merged 10 commits intomainfrom
jryan/lg-8543-id-number-alert
Feb 16, 2023
Merged

LG-8543 Accepted ID Alert#7835
JackRyan1989 merged 10 commits intomainfrom
jryan/lg-8543-id-number-alert

Conversation

@JackRyan1989
Copy link
Contributor

🎫 Ticket

🛠 Summary of changes

  • Added new alert component to /verify/in_person/state_id page
  • Added relevant text to en, es and fr translation files
  • Added small styling change for
      tags within the usa-alert__body class

    📜 Testing Plan

    Provide a checklist of steps to confirm the changes.

    • Confirm that the alert appears on /verify/in_person/state_id page
    • Confirm that relevant text appears for each translation

    👀 Screenshots

    Quick run thru with a screen reader:

    After:
    alert_sc_runthru.mov

@JackRyan1989 JackRyan1989 requested review from a team, carmenrosalop and jess-fortier and removed request for a team February 15, 2023 15:24

.usa-alert__body {
ul {
margin-bottom: 0px;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what the standard pattern is but do we use these USWDS class for things like this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I'd personally prefer that we use a margin utility class on the rendered list rather than making this default styling for all alerts.

i.e. <ul class="margin-bottom-0">

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think I understand the rails component system enough but is this going to affect other usages of usa-alert__body elsewhere?

Copy link
Contributor

@aduth aduth Feb 15, 2023

Choose a reason for hiding this comment

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

Yes it would, since the stylesheets are loaded on every page.

A few thoughts:

  • Personally, I feel that alert content should be concise and we should try to avoid long text, particularly if it's going to be announced to assistive technology as status text. Regardless of whether we have the option here, my thinking is that we can disincentivize it by making it cumbersome to style long-form content 😅
  • There may be use-cases for lists followed by other content in an alert, where we would want the margin
  • Any additional styling to design system components beyond what's provided through the base design system could create confusion for developers who are familiar with USWDS styles but not our ad hoc extensions
  • Maybe it's reasonable to have a global styling to remove the margin from the last child in the alert body, broadly speaking? I might be more agreeable to something like that.

For example:

.usa-alert__body > :last-child {
  margin-bottom: 0;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment suggests the full design system might not be imported so that might be necessary (unless it's an outdated comment).

.usa-alert__body > :last-child {
  @include u-margin-bottom(0);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do. Let me play around and see if one can work. I think I'd have to add that class into the translation files though, and I'm not sure I want to do make that content even messier.

Copy link
Contributor

@aduth aduth Feb 15, 2023

Choose a reason for hiding this comment

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

This comment suggests the full design system might not be imported so that might be necessary (unless it's an outdated comment).

That stylesheet is only used for email messages.

<%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.state_id')) %>
<% end %>

<%= render AlertComponent.new(
Copy link
Contributor

Choose a reason for hiding this comment

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

question for my understanding - are we able to know if a user's id is expired or is this an alert that everyone sees when they arrive on this page?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe everyone sees it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@svalexander Great question! This alert is static. It's an attempt to help users understand what kinds of IDs are acceptable, so it should display regardless of the status of state id.

Copy link
Contributor

@allthesignals allthesignals left a comment

Choose a reason for hiding this comment

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

Just some minor questions


.usa-alert__body {
ul {
margin-bottom: 0px;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think I understand the rails component system enough but is this going to affect other usages of usa-alert__body elsewhere?

@JackRyan1989
Copy link
Contributor Author

Just some minor questions

So it will affect any usage of an unordered list element inside of an element with the `.usa-alert__body' class. Which I think is reasonably specific, but maybe not. Should I ping some other folks @allthesignals ?

@JackRyan1989
Copy link
Contributor Author

@allthesignals I opted to remove the change to the stylesheet to prevent changes elsewhere in the site. This did end up putting more info into the HTML in the translation files though.

@allthesignals
Copy link
Contributor

@allthesignals I opted to remove the change to the stylesheet to prevent changes elsewhere in the site. This did end up putting more info into the HTML in the translation files though.

Cool, I think that's fine. I think it's probably a "less surprising" approach: we use USWDS styling, that margin class is a well-documented thing, and no one will find this adhoc __body class used inline in translation files... did you visually confirm it worked? Wasn't sure based on that comment I linked above.

Thanks!!

@allthesignals
Copy link
Contributor

allthesignals commented Feb 15, 2023

Also, (sorry to belabor it) another approach might be to change AlertComponent to accept a block...

<% AlertComponent.new(**stuff).with_content(t('in_person_proofing.body.state_id.alert_message')) do %>
  <ul>
    <% t('in_person_proofing.body.state_id.alert.forms_of_id').each do |type_of_id| %>
      <li>
        <%= type_of_id %>
      </li>
    <% end %>
  </ul>
<% end %>

And forms_of_id could just be a list!

@JackRyan1989
Copy link
Contributor Author

Also, (sorry to belabor it) another approach might be to change AlertComponent to accept a block...

<% AlertComponent.new(**stuff).with_content(t('in_person_proofing.body.state_id.alert_message')) do %>
  <ul>
    <% t('in_person_proofing.body.state_id.alert.forms_of_id').each do |type_of_id| %>
      <li>
        <%= type_of_id %>
      </li>
    <% end %>
  </ul>
<% end %>

And forms_of_id could just be a list!

Beautious. This is better than including HTML in the translation files IMO. Thanks!

click_button t('idv.buttons.change_state_id_label')
expect(page).to have_content(t('in_person_proofing.headings.update_state_id'))
fill_in t('in_person_proofing.form.state_id.first_name'), with: 'bad first name'
binding.pry
Copy link
Contributor

@NavaTim NavaTim Feb 15, 2023

Choose a reason for hiding this comment

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

Remove this line.

Suggested change
binding.pry

de sécurité sociale.
state_id:
alert_message: Votre carte d’identité délivrée par l’État ne doit pas être
périmée. Les pièces d’identité acceptées sont

Choose a reason for hiding this comment

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

We might need to add a colon here after "sont" @JackRyan1989

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Screen Shot 2023-02-16 at 11 26 24 AM

verify_step_enter_pii: Enter your name, date of birth, state-issued ID number,
address and Social Security number.
state_id:
alert_message: 'Your state-issued ID must not be expired. Accepted forms of ID are:'

Choose a reason for hiding this comment

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

The alert shows below the hint text on the Figma file, but above the hint text on the content file. I would ask Allison which one is the correct placement @JackRyan1989

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Screen Shot 2023-02-16 at 11 26 35 AM

Choose a reason for hiding this comment

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

Looking good!

Copy link

@carmenrosalop carmenrosalop left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

verify_step_enter_pii: Enter your name, date of birth, state-issued ID number,
address and Social Security number.
state_id:
alert_message: 'Your state-issued ID must not be expired. Accepted forms of ID are:'

Choose a reason for hiding this comment

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

Looking good!

@JackRyan1989 JackRyan1989 merged commit 90ac7bb into main Feb 16, 2023
@JackRyan1989 JackRyan1989 deleted the jryan/lg-8543-id-number-alert branch February 16, 2023 18:59
@solipet solipet mentioned this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants