From 60801f968e71760db6d4f61796c550739da66bc5 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Wed, 16 Sep 2020 11:29:12 -0500 Subject: [PATCH 1/5] make sure nav is rendered in a valid place --- app/views/accounts/_nav_auth.html.erb | 4 ++++ app/views/layouts/account_side_nav.html.erb | 1 - spec/views/accounts/_nav_auth.html.erb_spec.rb | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/accounts/_nav_auth.html.erb b/app/views/accounts/_nav_auth.html.erb index 07368bb96f8..c8b43329621 100644 --- a/app/views/accounts/_nav_auth.html.erb +++ b/app/views/accounts/_nav_auth.html.erb @@ -30,3 +30,7 @@ + +<% if enable_mobile_nav %> + <%= render 'accounts/mobile_nav' %> +<% end %> diff --git a/app/views/layouts/account_side_nav.html.erb b/app/views/layouts/account_side_nav.html.erb index d6fdeb764e9..641d023952a 100644 --- a/app/views/layouts/account_side_nav.html.erb +++ b/app/views/layouts/account_side_nav.html.erb @@ -29,5 +29,4 @@ <% end %> -<%= render 'accounts/mobile_nav' %> <%= render template: 'layouts/base', locals: { disable_card: true } %> diff --git a/spec/views/accounts/_nav_auth.html.erb_spec.rb b/spec/views/accounts/_nav_auth.html.erb_spec.rb index 5a9b44adbd7..31b9900346e 100644 --- a/spec/views/accounts/_nav_auth.html.erb_spec.rb +++ b/spec/views/accounts/_nav_auth.html.erb_spec.rb @@ -1,9 +1,12 @@ require 'rails_helper' describe 'accounts/_nav_auth.html.erb' do + include Devise::Test::ControllerHelpers + before do - @user = build_stubbed(:user, :signed_up) + @user = build_stubbed(:user, :with_backup_code) allow(view).to receive(:greeting).and_return(@user.email) + allow(view).to receive(:current_user).and_return(@user) end context 'user is signed in' do From c82e3b30bac3adf58bcee5556c0c66c401ffe27f Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Wed, 16 Sep 2020 16:16:06 -0500 Subject: [PATCH 2/5] render mobile nav as child of body --- app/views/accounts/_nav_auth.html.erb | 4 ---- app/views/layouts/account_side_nav.html.erb | 4 ++++ app/views/layouts/base.html.erb | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/accounts/_nav_auth.html.erb b/app/views/accounts/_nav_auth.html.erb index c8b43329621..07368bb96f8 100644 --- a/app/views/accounts/_nav_auth.html.erb +++ b/app/views/accounts/_nav_auth.html.erb @@ -30,7 +30,3 @@ - -<% if enable_mobile_nav %> - <%= render 'accounts/mobile_nav' %> -<% end %> diff --git a/app/views/layouts/account_side_nav.html.erb b/app/views/layouts/account_side_nav.html.erb index 641d023952a..fa190914634 100644 --- a/app/views/layouts/account_side_nav.html.erb +++ b/app/views/layouts/account_side_nav.html.erb @@ -2,6 +2,10 @@ <%= render 'accounts/nav_auth', enable_mobile_nav: true, greeting: @view_model.header_personalization %> <% end %> +<% content_for(:mobile_nav) do %> + <%= render 'accounts/mobile_nav' %> +<% end %> + <% content_for :content do %>
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index e3dbbc06620..f415336fc03 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -54,6 +54,7 @@ + <%= content_for?(:mobile_nav) ? yield(:mobile_nav) : yield %>
<%= render 'shared/banner' %>
From 398e2ac952674671854af678b0f299bf49a2a370 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 17 Sep 2020 08:37:55 -0500 Subject: [PATCH 3/5] Update app/views/layouts/base.html.erb Co-authored-by: Andrew Duthie --- app/views/layouts/base.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index f415336fc03..622d848160e 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -54,7 +54,7 @@ - <%= content_for?(:mobile_nav) ? yield(:mobile_nav) : yield %> + <%= yield(:mobile_nav) if content_for?(:mobile_nav) %>
<%= render 'shared/banner' %>
From f361f984b0390f517217187476cc42246e1f4b42 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 17 Sep 2020 08:41:20 -0500 Subject: [PATCH 4/5] add usa-overlay div --- app/views/layouts/base.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 622d848160e..b6f3f8566b3 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -54,6 +54,7 @@ +
<%= yield(:mobile_nav) if content_for?(:mobile_nav) %>
<%= render 'shared/banner' %> From 5006dce6e3dcfbf9667de6c204ce5c2f7b74c1c5 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 17 Sep 2020 08:49:19 -0500 Subject: [PATCH 5/5] add title to new account pages --- app/views/accounts/connected_accounts/show.html.erb | 2 ++ app/views/accounts/history/show.html.erb | 2 ++ app/views/accounts/two_factor_authentication/show.html.erb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/views/accounts/connected_accounts/show.html.erb b/app/views/accounts/connected_accounts/show.html.erb index 51be9673146..88a96202814 100644 --- a/app/views/accounts/connected_accounts/show.html.erb +++ b/app/views/accounts/connected_accounts/show.html.erb @@ -1,3 +1,5 @@ +<% title t('account.navigation.connected_accounts') %> +

<%= t('headings.account.connected_accounts') %>

diff --git a/app/views/accounts/history/show.html.erb b/app/views/accounts/history/show.html.erb index 907c0034284..417dd771de4 100644 --- a/app/views/accounts/history/show.html.erb +++ b/app/views/accounts/history/show.html.erb @@ -1,3 +1,5 @@ +<% title t('account.navigation.history') %> +

<%= t('account.navigation.history') %>

diff --git a/app/views/accounts/two_factor_authentication/show.html.erb b/app/views/accounts/two_factor_authentication/show.html.erb index 3c0331d3163..e5619d0e7dd 100644 --- a/app/views/accounts/two_factor_authentication/show.html.erb +++ b/app/views/accounts/two_factor_authentication/show.html.erb @@ -1,3 +1,5 @@ +<% title t('account.navigation.two_factor_authentication') %> +

<%= t('headings.account.two_factor') %>