-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create One Login bridging page #968
Changes from 19 commits
5af4ec3
0c96676
adaa702
226345e
8410f8f
b7a8ff5
385e30a
2cf7064
784f116
7b776be
9765caf
6d74e30
65a4a22
f262a40
e17b30e
391c35b
2b4f1a5
208c212
3b7ba6a
b556ac3
0c6fa46
93923c3
948fa98
932ba80
9c8bdda
a21cd78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
class GovOneController < ApplicationController | ||
def info; end | ||
layout 'hero' | ||
|
||
def info | ||
redirect_to my_modules_path if current_user | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,6 @@ def login_button | |
govuk_button_link_to t('gov_one_info.sign_in_button'), login_uri.to_s | ||
end | ||
|
||
# @return [String] | ||
def logout_button | ||
govuk_button_link_to t('gov_one_info.sign_out_button'), logout_uri.to_s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we also removing the locale/resource? Again, if there are multiple button keys, we can nest them (flips how you read it). |
||
end | ||
|
||
private | ||
|
||
# @param endpoint [Symbol] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
= render 'learning/cms_debug' | ||
|
||
- content_for :page_title do | ||
= html_title t('gov_one_info.title') | ||
= html_title t('home.title') | ||
|
||
- content_for :hero do | ||
.govuk-grid-row class='govuk-!-padding-top-9' | ||
.govuk-grid-column-three-quarters | ||
h1.dfe-heading-xl class='govuk-!-margin-bottom-4' | ||
= t('gov_one_info.hero_header') | ||
p.govuk-body-l = t('gov_one_info.hero_body') | ||
|
||
|
||
.govuk-grid-row | ||
.govuk-grid-column-full | ||
. class='govuk-!-margin-bottom-5' | ||
= m('gov_one_info.body') | ||
hr | ||
|
||
= login_button | ||
|
||
.govuk-grid-row | ||
.govuk-grid-column-one-half | ||
= m('gov_one_info.body') | ||
|
||
- if current_user | ||
= logout_button | ||
- else | ||
= login_button | ||
|
||
.govuk-grid-column-full class='govuk-!-margin-top-4 govuk-!-margin-bottom-9' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the containing class to three-quarters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
details.govuk-details data-module='govuk-details' | ||
summary.govuk-details__summary | ||
span.govuk-details__summary-text | ||
= t('gov_one_info.details_summary') | ||
.govuk-details__text | ||
= t('gov_one_info.details_text') | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
svg.govuk-button__start-icon xmlns='http://www.w3.org/2000/svg' width='17.5' height='19' viewBox='0 0 33 40' aria-hidden='true' focusable='false' | ||
path fill='currentColor' d='M0 0h13l20 20-20 20H0l20-20z' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,17 @@ | |
.govuk-grid-column-one-half | ||
= m('home.about', headings_start_with: 'xl') | ||
|
||
- unless current_user | ||
.govuk-grid-column-one-half | ||
.light-grey-box.enrol-box | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, deleted now |
||
= m('home.login', headings_start_with: 'xl') | ||
|
||
.govuk-button-group | ||
= govuk_button_link_to 'Sign in', new_user_session_path | ||
.white-space-pre-wrap= ' or ' | ||
= govuk_link_to 'create an account', new_user_registration_path | ||
|
||
.prompt.prompt-home | ||
.govuk-grid-row | ||
.govuk-grid-column-one-quarter | ||
i.fa-2x.fa-solid.fa-circle-info aria-describedby='info icon' | ||
|
||
.govuk-grid-column-three-quarters | ||
= m('home.prompt', headings_start_with: 'xl') | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure of the syntax here but your HTML contains an empty div that is adding spacing. For cleanliness it needs removing - The button at the bottom should be in the grid as follows: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, thanks there was a div left over from the old design that I hadn't deleted |
||
- unless current_user | ||
.govuk-grid-row class="govuk-!-margin-top-9" | ||
.govuk-grid-column-full | ||
= govuk_button_link_to gov_one_info_path, class: "govuk-button--start" do | ||
| #{t('home.gov_one_button')} | ||
= render 'chevron' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -508,6 +508,8 @@ en: | |
home: | ||
title: Home page | ||
hero: | | ||
# %{service_name} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haven't checked but I think this needs to be removed. |
||
|
||
This free, online training provides an overview of child development and gives practical advice for supporting the development of children in your early years setting. | ||
thumb: | | ||
![A practitioner smiling as they do an activity with children in an early years setting](//images.ctfassets.net/dvmeh832nmjc/2VRBZCHJYLeKx0a2CIcJzE/687fb0d28c71104820cd42f131d7dfe2/_assets_thumb-1161068272-320x240.jpg?fit=scale&w=380) | ||
|
@@ -532,6 +534,7 @@ en: | |
## Return to your training | ||
|
||
Sign in to continue learning, see your progress and download certificates. | ||
gov_one_button: Start your training now | ||
|
||
# /about-training | ||
about: | ||
|
@@ -575,9 +578,12 @@ en: | |
# /gov-one/info | ||
gov_one_info: | ||
title: Gov One Info | ||
body: This is some information about Gov One Login. | ||
hero_header: How to access this training course | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I18n has |
||
hero_body: This service uses GOV.UK One Login which is managed by the Government Digital Service. | ||
body: You will be asked to sign in to your account, or create a One Login account, in this service | ||
sign_in_button: Continue to GOV.UK One Login | ||
sign_out_button: Sign out of Gov One Login | ||
details_summary: How to access an existing training account | ||
details_text: If you have an existing early years child development training account but you do not yet have a GOV.UK One Login, you must use the same email address for both accounts. This will ensure that any progress you have made through the training is retained. | ||
|
||
# /settings/cookie-policy | ||
cookie_policy: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Gov One Info' do | ||
context 'with an unauthenticated visitor' do | ||
before do | ||
visit '/gov-one/info' | ||
end | ||
|
||
it 'displays the correct content' do | ||
expect(page).to have_css('h1', text: 'How to access this training course') | ||
expect(page).to have_css('p', text: 'This service uses GOV.UK One Login which is managed by the Government Digital Service.') | ||
expect(page).to have_css('p', text: 'You will be asked to sign in to your account, or create a One Login account, in this service') | ||
expect(page).to have_css('a', text: 'Continue to GOV.UK One Login') | ||
end | ||
|
||
it 'has the correct login link' do | ||
link = find_link('Continue to GOV.UK One Login') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this complex link is asserted elsewhere I'd favour a simpler, more readable, spec. |
||
expect(link[:href]).to start_with('https://oidc.test.account.gov.uk/authorize?redirect_uri=http%3A%2F%2Frecovery.app%2Fusers%2Fauth%2Fopenid_connect%2Fcallback&client_id=some_client_id&response_type=code&scope=email+openid&nonce=') | ||
end | ||
end | ||
|
||
context 'with an authenticated user' do | ||
include_context 'with user' | ||
|
||
it 'redirects to the my modules page' do | ||
visit '/gov-one/info' | ||
expect(page).to have_current_path('/my-modules') | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,18 +20,20 @@ | |
end | ||
|
||
describe 'with subsequent logins' do | ||
before do | ||
click_on 'sign-out-desktop' | ||
skip 'wip' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is skipping necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed 948fa98 |
||
before do | ||
click_on 'sign-out-desktop' | ||
|
||
visit '/users/sign-in' | ||
fill_in 'Email address', with: user.email | ||
fill_in 'Password', with: user.password | ||
click_button 'Sign in' | ||
end | ||
visit '/users/sign-in' | ||
fill_in 'Email address', with: user.email | ||
fill_in 'Password', with: user.password | ||
click_button 'Sign in' | ||
end | ||
|
||
it 'does not appear' do | ||
expect(page).not_to have_current_path '/whats-new' | ||
expect(page).to have_current_path '/my-modules' | ||
it 'does not appear' do | ||
expect(page).not_to have_current_path '/whats-new' | ||
expect(page).to have_current_path '/my-modules' | ||
end | ||
end | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it is possible to stick to RESTful CRUD actions in this controller at this point in time?