diff --git a/.rubocop.yml b/.rubocop.yml index c04b6c3133b..d5ac161138f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -74,7 +74,6 @@ IdentityIdp/ImageSizeLinter: - app/views/shared/_nav_branded.html.erb - app/views/sign_up/completions/show.html.erb - app/views/users/two_factor_authentication_setup/index.html.erb - - app/views/users/webauthn_setup/new.html.erb IdentityIdp/RedirectBackLinter: Enabled: true diff --git a/app/assets/images/mfa-options/security_key.svg b/app/assets/images/mfa-options/security_key.svg new file mode 100644 index 00000000000..25e8722f75d --- /dev/null +++ b/app/assets/images/mfa-options/security_key.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/mfa-options/security_key_mobile.svg b/app/assets/images/mfa-options/security_key_mobile.svg new file mode 100644 index 00000000000..7433b38df38 --- /dev/null +++ b/app/assets/images/mfa-options/security_key_mobile.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/security-key.svg b/app/assets/images/security-key.svg deleted file mode 100644 index 9d305f7f6d0..00000000000 --- a/app/assets/images/security-key.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/controllers/users/webauthn_setup_controller.rb b/app/controllers/users/webauthn_setup_controller.rb index 31ccc66063b..4f633ead285 100644 --- a/app/controllers/users/webauthn_setup_controller.rb +++ b/app/controllers/users/webauthn_setup_controller.rb @@ -15,6 +15,7 @@ class WebauthnSetupController < ApplicationController before_action :validate_existing_platform_authenticator helper_method :in_multi_mfa_selection_flow? + helper_method :mobile? def new form = WebauthnVisitForm.new( diff --git a/app/presenters/webauthn_setup_presenter.rb b/app/presenters/webauthn_setup_presenter.rb index 7fbcc3810d0..eba26a0ffc9 100644 --- a/app/presenters/webauthn_setup_presenter.rb +++ b/app/presenters/webauthn_setup_presenter.rb @@ -4,6 +4,7 @@ class WebauthnSetupPresenter < SetupPresenter include Rails.application.routes.url_helpers include ActionView::Helpers::UrlHelper include ActionView::Helpers::TranslationHelper + include LinkHelper attr_reader :url_options @@ -26,11 +27,18 @@ def initialize( @url_options = url_options end - def image_path - if @platform_authenticator - 'platform-authenticator.svg' - else - 'security-key.svg' + def learn_more_html + if !@platform_authenticator + new_tab_link_to( + t('forms.webauthn_setup.learn_more'), + help_center_redirect_path( + category: 'get-started', + article: 'authentication-options', + article_anchor: 'security-key', + flow: :two_factor_authentication, + step: :security_key_setup, + ), + ) end end @@ -71,7 +79,7 @@ def intro_html ), ) else - t('forms.webauthn_setup.intro_html') + t('forms.webauthn_setup.intro', app_name: APP_NAME) end end @@ -87,7 +95,7 @@ def button_text if @platform_authenticator t('forms.webauthn_platform_setup.continue') else - t('forms.webauthn_setup.continue') + t('forms.webauthn_setup.set_up') end end end diff --git a/app/views/users/webauthn_setup/new.html.erb b/app/views/users/webauthn_setup/new.html.erb index f0eee7961fc..90cb3d3c4f7 100644 --- a/app/views/users/webauthn_setup/new.html.erb +++ b/app/views/users/webauthn_setup/new.html.erb @@ -1,6 +1,8 @@ <% self.title = @presenter.page_title %> -<%= image_tag asset_url(@presenter.image_path), alt: '', width: '90', class: 'margin-left-1 margin-bottom-2', role: 'img' %> +<% if @platform_authenticator %> + <%= image_tag asset_url('platform-authenticator.svg'), alt: '', width: 84, height: 95, class: 'margin-left-1 margin-bottom-2', role: 'img' %> +<% end %> <%= render PageHeadingComponent.new.with_content(@presenter.heading) %> @@ -10,7 +12,10 @@ <% end %> <% end %> -<%= @presenter.intro_html %> + + <%= @presenter.intro_html %> + +<%= @presenter.learn_more_html unless @platform_authenticator %> <%= simple_form_for( '', @@ -33,20 +38,38 @@ <%= hidden_field_tag :platform_authenticator, @platform_authenticator, id: 'platform_authenticator' %> <% if !@platform_authenticator %> - - <%= render ValidatedFieldComponent.new( - form: f, - name: :name, - required: true, - label: @presenter.nickname_label, - hint: @presenter.device_nickname_hint, - input_html: { - id: 'nickname', - class: 'font-family-mono', - size: 16, - maxlength: 20, - }, - ) %> +
+ <%= render ProcessListComponent.new(connected: true) do |c| %> + <%= c.with_item(heading: t('forms.webauthn_setup.step_1'), heading_id: 'step-1-label') do %> +

<%= t('forms.webauthn_setup.step_1a') %>

+ <%= render ValidatedFieldComponent.new( + form: f, + name: :name, + required: true, + label: false, + hint: @presenter.device_nickname_hint, + wrapper_html: { class: 'margin-bottom-0' }, + input_html: { + aria: { labelledby: 'step-1-label' }, + id: 'nickname', + class: 'font-family-mono', + size: 16, + maxlength: 20, + }, + ) %> + <% end %> + <%= c.with_item(heading: t('forms.webauthn_setup.step_2')) do %> + <% if mobile? %> + <%= image_tag asset_url('mfa-options/security_key_mobile.svg'), width: 420, height: 193, class: 'height-auto', alt: t('forms.webauthn_setup.step_2_image_mobile_alt'), role: 'img' %> + <% else %> + <%= image_tag asset_url('mfa-options/security_key.svg'), width: 420, height: 193, class: 'height-auto', alt: t('forms.webauthn_setup.step_2_image_alt'), role: 'img' %> + <% end %> + <% end %> + <%= c.with_item(heading: t('forms.webauthn_setup.step_3')) do %> +

<%= t('forms.webauthn_setup.step_3a') %>

+ <% end %> + <% end %> +
<% end %>