-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement post-release one login banner for sign in page
Co-Authored-By: avinhurry <[email protected]>
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
app/components/candidate_interface/one_login_post_release_sign_in_banner_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %> |
7 changes: 7 additions & 0 deletions
7
app/components/candidate_interface/one_login_post_release_sign_in_banner_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ocales/components/candidate_interface/one_login_post_release_sign_in_banner_component.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
27 changes: 27 additions & 0 deletions
27
spec/components/candidate_interface/one_login_post_release_sign_in_banner_component_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters