Skip to content

Commit

Permalink
Merge pull request #1798 from 18F/update_verified_message
Browse files Browse the repository at this point in the history
Update message when user is verified
  • Loading branch information
nickbristow authored Nov 22, 2017
2 parents b7b8b34 + 66dbb01 commit 1fdf066
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
34 changes: 23 additions & 11 deletions app/view_models/sign_up_completions_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,28 @@ def initialize(loa3_requested:, decorated_session:, current_user:)

# rubocop:disable Rails/OutputSafety
def heading
safe_join([I18n.t(
'titles.sign_up.completion_html',
accent: content_tag(:strong, I18n.t("titles.sign_up.#{requested_loa}")),
app: APP_NAME
).html_safe])
if requested_loa == 'loa3'
content_tag(:strong, I18n.t('titles.sign_up.verified'))
else
safe_join([I18n.t(
'titles.sign_up.completion_html',
accent: content_tag(:strong, I18n.t('titles.sign_up.loa1')),
app: APP_NAME
).html_safe])
end
end
# rubocop:enable Rails/OutputSafety

def title
I18n.t(
'titles.sign_up.completion_html',
accent: I18n.t("titles.sign_up.#{requested_loa}"),
app: APP_NAME
)
if requested_loa == 'loa3'
I18n.t('titles.sign_up.verified')
else
I18n.t(
'titles.sign_up.completion_html',
accent: I18n.t('titles.sign_up.loa1'),
app: APP_NAME
)
end
end

def image_name
Expand Down Expand Up @@ -88,7 +96,11 @@ def requested_attributes
decorated_session.requested_attributes.map(&:to_sym)
end

def user_verified?
@current_user.decorate.identity_verified?
end

def requested_loa
loa3_requested ? 'loa3' : 'loa1'
user_verified? ? 'loa3' : 'loa1'
end
end
4 changes: 2 additions & 2 deletions app/views/sign_up/completions/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.clearfix
.col-10.sm-col-12.mx-auto
.center
= image_tag(asset_url(@view_model.image_name), width: 97, alt: '', class: 'mb2')
h1.h3.mb3.my0.regular = @view_model.heading
= image_tag(asset_url(@view_model.image_name), width: 140, alt: '', class: 'mb2')
h1.h3.mb3.my0.regular.center = @view_model.heading

= render @view_model.service_provider_partial

Expand Down
2 changes: 1 addition & 1 deletion config/locales/titles/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ en:
sign_up:
completion_html: You have %{accent} with %{app}
loa1: created your account
loa3: verified your identity
verified: You have verified your identity.
totp_setup:
new: Set up two-factor authentication
two_factor_setup: Two-factor authentication setup
Expand Down
2 changes: 1 addition & 1 deletion config/locales/titles/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ es:
sign_up:
completion_html: Tiene %{accent} con %{app}
loa1: creó su cuenta
loa3: verificó su identidad
verified: Tiene verificó su identidad.
totp_setup:
new: Configure la autenticación de dos factores
two_factor_setup: Configuración de autenticación de dos factores
Expand Down
2 changes: 1 addition & 1 deletion config/locales/titles/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fr:
sign_up:
completion_html: Vous avez %{accent} avec %{app}
loa1: créé votre compte
loa3: verifié votre identité
verified: Vous avez verifié votre identité.
totp_setup:
new: Configurer l'authentification à deux facteurs
two_factor_setup: Configuration de l'authentification à deux facteurs
Expand Down
4 changes: 1 addition & 3 deletions spec/support/idv_examples/account_creation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
click_acknowledge_personal_key

expect(page).to have_content t(
'titles.sign_up.completion_html',
accent: t('titles.sign_up.loa3'),
app: APP_NAME
'titles.sign_up.verified'
)
within('.requested-attributes') do
expect(page).to have_content t('help_text.requested_attributes.email')
Expand Down

0 comments on commit 1fdf066

Please sign in to comment.