LG-14641 | Update "letter on the way" screen#11346
Conversation
changelog: User-Facing Improvements, GPO flow, UI tweaks
| redirect_to_and_log(MarketingSite.base_url) | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Part of the story here was that we want to redirect to straight "www.login.gov" if the user clicks "Exit Login.gov", and log an event. The most pragmatic way of doing this I saw was to just add a new controller, rather than weirdly cramming it into the HelpCenterController.
| t('idv.buttons.continue_plain') | ||
| end | ||
| t('idv.cancel.actions.exit', app_name: APP_NAME) | ||
| end |
There was a problem hiding this comment.
(Context: We settled on the button always having the same text, but keeping the destination dynamic.)
| return_to_sp_cancel_path(step: :verify_address, location: :come_back_later) | ||
| else | ||
| account_path | ||
| marketing_site_redirect_url |
There was a problem hiding this comment.
Taking the user to their account page when they clicked "Exit Login.gov" was very random.
(Arguably, so is taking them to the static site homepage, but it's less-inexplicable.)
There was a problem hiding this comment.
FWIW we have a big epic on the roadmap that is all about removing these if sp then x else y type constructions--in reality, every IdV attempt should be associated with an SP.
| <p class="margin-top-2"> | ||
| <%= t('idv.messages.come_back_later_no_sp_html') %> | ||
| </p> | ||
| <% end %> |
There was a problem hiding this comment.
And, context here: if there is no SP, we don't want to show the second bullet point telling them to contact nil, so we omit it. But a one-item bulleted list is silly, so we go for a paragraph tag instead.
There was a problem hiding this comment.
This is a good catch! I will update #11351 to do the same.
| @presenter.button_text, | ||
| @presenter.button_destination, | ||
| class: 'usa-button usa-button--big usa-button--wide', | ||
| class: 'usa-button usa-button--big usa-button--wide margin-top-2', |
There was a problem hiding this comment.
I am not a designer, but the button was otherwise awkwardly close to the text.
| <p class="padding-top-3 padding-bottom-3"> | ||
| <%= t('idv.messages.come_back_later_html') %> | ||
| </p> | ||
| <% if @presenter.has_sp? %> |
There was a problem hiding this comment.
I was working on a companion to this story with @lmgeorge. We came up with a @presenter.show_contact_sp_instructions? method which made things a little more self-documenting.
We also did not add a list to the YAML file. We had a descriptor for each one.
When we see that PR up we should work on squaring those up since they are essentially the same thing.
There was a problem hiding this comment.
PR in question: #11351, and more specifically in the ERB template.
There was a problem hiding this comment.
Thanks! I've matched this naming.
I had initially assumed these were using the same presenter, but they are not. I think I'm OK duplicating the pattern / 1-liner method rather than trying to extract stuff like this:
def sp_name
sp&.friendly_name
end
config/locales/en.yml
Outdated
| idv.messages.come_back_later_html: 'Letters take <strong>5 to 10 days</strong> to arrive. Sign back in to enter your verification code once you get your letter.' | ||
| idv.messages.come_back_later: Sign back in and enter the verification code when your letter arrives. | ||
| idv.messages.confirm: We secured your verified information | ||
| idv.messages.contact_sp_html: Contact %{sp_link} if you need to access their services before your letter arrives. |
There was a problem hiding this comment.
OK, so: the i18n linter yells at me because contact_sp_html is an _html string but doesn't contain any HTML. %{sp_link} is a hyperlink we interpolate. Taking the _html out causes raw HTML to be displayed.
I have put an otherwise-needless here to make things happy, but this is obviously a very gross approach. I am out tomorrow (Wednesday) if anyone wants to apply an obvious correction; otherwise, I'll pick this up Thursday morning.
There was a problem hiding this comment.
I think you can suffix the interpolated key as %{sp_link_html} for it to understand the HTML is in the interpolated value.
identity-idp/spec/i18n_spec.rb
Lines 387 to 391 in b77c611
There was a problem hiding this comment.
Ah-ha! Thanks for this pointer.
Since it still took me a little bit of trial-and-error, a pointer for the next person:
- The translation key should still keep the
_htmlsuffix - Including an interpolation ending in
_htmlcauses the linter to not object to the translation not directly including HTML
|
|
||
| RSpec.describe 'idv/by_mail/letter_enqueued/show.html.erb' do | ||
| let(:service_provider) { '🔒🌐💻' } | ||
| let(:service_provider) { create(:service_provider) } |
There was a problem hiding this comment.
AFAICT we were always expecting an instance of a ServiceProvider in the presenter, not a (emoji-filled) string, so I'm not sure how this ever passed.
There was a problem hiding this comment.
Yeah that's not ideal. It looks like this service_provider gets passed into the Idv::Session constructor which then gets read by the presenter in a basic if sp type thing. So any truthy value would pass here
Some day I will learn to always run this when working with translations. But today was not that day.
| @@ -53,8 +53,8 @@ | |||
|
|
|||
| it 'renders a return to account button' do | |||
There was a problem hiding this comment.
maybe update this it here since it's no longer a "return to account" button
🎫 Ticket
Link to the relevant ticket:
LG-14641
🛠 Summary of changes
UI improvements, including translations.