-
Notifications
You must be signed in to change notification settings - Fork 112
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Makes sense!
else | ||
t('idv.buttons.continue_plain') | ||
end | ||
t('idv.cancel.actions.exit', app_name: APP_NAME) | ||
end |
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.
(Context: We settled on the button always having the same text, but keeping the destination dynamic.)
end | ||
|
||
def button_destination | ||
if sp | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good catch! I will update #11351 to do the same.
<%= link_to( | ||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR in question: #11351, and more specifically in the ERB template.
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.
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.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
def contains_html?(value) | |
Array(value).flatten.compact.any? do |str| | |
html_tags?(str) || html_entities?(str) || likely_html_interpolation?(str) | |
end | |
end |
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.
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
_html
suffix - Including an interpolation ending in
_html
causes the linter to not object to the translation not directly including HTML
@@ -1,7 +1,7 @@ | |||
require 'rails_helper' | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe update this it
here since it's no longer a "return to account" button
* LG-14651 | Update "letter on the way" screen changelog: User-Facing Improvements, GPO flow, UI tweaks
🎫 Ticket
Link to the relevant ticket:
LG-14641
🛠 Summary of changes
UI improvements, including translations.