diff --git a/app/assets/stylesheets/utilities/_typography.scss b/app/assets/stylesheets/utilities/_typography.scss index 476a2cddcf8..3b5b0307f32 100644 --- a/app/assets/stylesheets/utilities/_typography.scss +++ b/app/assets/stylesheets/utilities/_typography.scss @@ -102,7 +102,6 @@ h6, align-items: center; text-align: center; font-size: 1.125rem; - margin-top: 32px; margin-bottom: 16px; &::before, diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 6e34fe9d080..8f2b1061dd3 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -24,6 +24,7 @@ def new @ial = sp_session_ial @browser_is_ie11 = browser_is_ie11? + @is_on_home_page = true @sign_in_a_b_test_bucket = sign_in_a_b_test_bucket analytics.sign_in_page_visit( flash: flash[:alert], diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index fbea28aed76..94053d88938 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -10,7 +10,7 @@ <% if decorated_session.sp_name %> <%= render 'sign_up/registrations/sp_registration_heading' %> -<% elsif @sign_in_a_b_test_bucket == :default %> +<% elsif @sign_in_a_b_test_bucket != :tabbed %> <%= render PageHeadingComponent.new.with_content(decorated_session.new_session_heading) %> <% end %> @@ -50,16 +50,9 @@ ) %> <%= f.submit t('links.next'), full_width: true, wide: false %> <% if @sign_in_a_b_test_bucket == :default %> -

- <%= t('headings.create_account_with_sp.cta', app_name: APP_NAME) %> -

- <%= render ButtonComponent.new( - action: ->(**tag_options, &block) { link_to(sign_up_email_url(source: :sign_in), **tag_options, &block) }, - big: true, - outline: true, - full_width: true, - class: 'margin-bottom-105', - ).with_content(t('links.create_account')) %> +
+ <%= render 'shared/create_account_banner' %> +
<% end %> <% end %> <% if @ial && desktop_device? %> diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 36f0f9eb0f8..cdf71bb54c9 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -66,19 +66,23 @@
<%= yield(:mobile_nav) if content_for?(:mobile_nav) %> <%= render 'shared/banner' %> - <%= content_tag( local_assigns[:user_main_tag] == false ? 'div' : 'main', class: 'site-wrap bg-primary-lighter', id: local_assigns[:user_main_tag] == false ? nil : 'main-content', - ) do %> + ) do %> + <% if @is_on_home_page && @sign_in_a_b_test_bucket == :banner %> +
+ <%= render 'shared/create_account_banner' %> +
+ <% end %> +
<%= yield(:pre_flash_content) if content_for?(:pre_flash_content) %> <%= render FlashComponent.new(flash: flash) %> <%= content_for?(:content) ? yield(:content) : yield %>
<% end %> - <%= render 'shared/footer_lite' %> <% if current_user %> diff --git a/app/views/shared/_create_account_banner.html.erb b/app/views/shared/_create_account_banner.html.erb new file mode 100644 index 00000000000..2badae27fff --- /dev/null +++ b/app/views/shared/_create_account_banner.html.erb @@ -0,0 +1,10 @@ +

+ <%= t('headings.create_account_with_sp.cta', app_name: APP_NAME) %> +

+<%= render ButtonComponent.new( + action: ->(**tag_options, &block) { link_to(sign_up_email_url(source: :sign_in), **tag_options, &block) }, + big: true, + outline: true, + full_width: true, + class: 'margin-bottom-105', + ).with_content(t('links.create_account')) %> diff --git a/config/application.yml.default b/config/application.yml.default index 8ae93e01f47..3fb966a0dbe 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -304,7 +304,7 @@ session_total_duration_timeout_in_minutes: 720 ses_configuration_set_name: '' set_remember_device_session_expiration: false sign_up_mfa_selection_order_testing: '{ "default": 100, "authentication_app_priority": 0, "usability_priority": 0 }' -sign_in_a_b_testing: '{"default":100,"tabbed":0}' +sign_in_a_b_testing: '{ "default": 100,"tabbed" :0, "banner": 0 } ' sp_handoff_bounce_max_seconds: 2 show_user_attribute_deprecation_warnings: false otp_min_attempts_remaining_warning_count: 3 diff --git a/spec/views/devise/sessions/new.html.erb_spec.rb b/spec/views/devise/sessions/new.html.erb_spec.rb index e9f5c5c3854..d40a514afde 100644 --- a/spec/views/devise/sessions/new.html.erb_spec.rb +++ b/spec/views/devise/sessions/new.html.erb_spec.rb @@ -192,4 +192,14 @@ ) end end + + context 'with banner A/B test' do + let(:sign_in_a_b_test_bucket) { :banner } + + it 'has a localized page heading' do + render + + expect(rendered).to have_selector('h1', text: t('headings.sign_in_without_sp')) + end + end end