Skip to content

Commit

Permalink
Merge pull request #10290 from DFE-Digital/561-one-login-update-sign-…
Browse files Browse the repository at this point in the history
…in-service-banners-content-upon-release

Implement post-release one login banner for sign in page
  • Loading branch information
elceebee authored Jan 21, 2025
2 parents f051ef7 + 0aba405 commit 1d91511
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%= govuk_notification_banner(title_text: t('.title')) do |banner| %>
<% banner.with_heading(text: t('.heading')) %>
<%= t('.text_html') %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CandidateInterface
class OneLoginPostReleaseSignInBannerComponent < ViewComponent::Base
def render?
FeatureFlag.active?(:one_login_candidate_sign_in)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render CandidateInterface::OneLoginPreReleaseSignInBannerComponent.new %>
<%= render CandidateInterface::OneLoginPostReleaseSignInBannerComponent.new %>

<% if FeatureFlag.active?(:one_login_candidate_sign_in) %>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
en:
candidate_interface:
one_login_post_release_sign_in_banner_component:
title: Important
heading: How you sign in has changed
text_html:
<p class="govuk-body">Sign in using your GOV.UK One Login. If you do not have one you can create one.</p>
<p class="govuk-body">If you have signed in to Apply for teacher training before, you should use the same email address to create your GOV.UK One Login.</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'rails_helper'

RSpec.describe CandidateInterface::OneLoginPostReleaseSignInBannerComponent do
context 'One login is deactivated' do
before do
FeatureFlag.deactivate(:one_login_candidate_sign_in)
end

it 'does not renders the component' do
result = render_inline(described_class.new)
expect(result.content).to be_empty
end
end

context 'One login is activated' do
before do
FeatureFlag.activate(:one_login_candidate_sign_in)
end

it 'does render the component' do
result = render_inline(described_class.new)
expect(result).to have_content 'How you sign in has changed'
expect(result).to have_content 'Sign in using your GOV.UK One Login. If you do not have one you can create one.'
expect(result).to have_content 'If you have signed in to Apply for teacher training before, you should use the same email address to create your GOV.UK One Login.'
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ def one_login_pre_release_logged_in_banner_component
def one_login_pre_release_sign_in_banner_component
render(CandidateInterface::OneLoginPreReleaseSignInBannerComponent.new)
end

def one_login_post_release_sign_in_banner_component
render CandidateInterface::OneLoginPostReleaseSignInBannerComponent.new
end
end
end

0 comments on commit 1d91511

Please sign in to comment.