Skip to content

Commit

Permalink
Merge pull request #3098 from DFE-Digital/one-login-flow-copy
Browse files Browse the repository at this point in the history
[LUPEYALPHA-594] Update One Login flow copy
  • Loading branch information
asmega authored Aug 15, 2024
2 parents 2fb2af1 + 4c4c95a commit 043f4d2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 41 deletions.
41 changes: 3 additions & 38 deletions app/views/claims/_sign_in.html.erb
Original file line number Diff line number Diff line change
@@ -1,42 +1,7 @@
<h1 class="govuk-heading-l">
<% if @journey_session.answers.identity_confirmed_with_onelogin? %>
You've successfully proved your identity with GOV.UK One Login
<%= render "sign_in_3_identified" %>
<% elsif @journey_session.answers.logged_in_with_onelogin? %>
You've successfully signed in to GOV.UK One Login
<%= render "sign_in_2_authed" %>
<% else %>
You're now going to GOV.UK One Login
<%= render "sign_in_1_start" %>
<% end %>
</h1>

<% if @journey_session.answers.identity_confirmed_with_onelogin? %>
<p>
You can now continue your application
</p>
<% elsif @journey_session.answers.logged_in_with_onelogin? %>
<p>
Before you can continue your application, you'll need to prove your identity through GOV.UK One Login.
</p>
<p>
When you've proved your identity through GOV.UK One Login, you'll return to this service to complete your applciation.
</p>
<% else %>
<p>
To continue your application, you'll need to create a GOV.UK One Login or sign in.
</p>
<p>
When you've signed in through GOV.UK One Login, your progress will be saved
and you'll be able to return to complete your application.
</p>
<% end %>

<div class="govuk-button-group">
<% if @journey_session.answers.identity_confirmed_with_onelogin? %>
<%= form_for @form, url: claim_path(current_journey_routing_name) do |f| %>
<%= f.submit "Continue", class: "govuk-button", data: {module: "govuk-button"} %>
<% end %>
<% elsif @journey_session.answers.logged_in_with_onelogin? %>
<%= button_to "Continue", "/auth/onelogin_identity", class: "govuk-button", method: :post %>
<% else %>
<%= button_to "Continue", "/auth/onelogin", class: "govuk-button", method: :post %>
<% end %>
</div>
22 changes: 22 additions & 0 deletions app/views/claims/_sign_in_1_start.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<h1 class="govuk-heading-l">
Sign in with GOV.UK One Login
</h1>

<p class="govuk-body">
You will need to sign in to your GOV.UK One Login account to apply. If you don’t have an account yet, we will help you create one. 
</p>

<p class="govuk-body">
To create a GOV.UK One Login account, you will need: 
</p>

<%= govuk_list [
"an email address",
"a way to get security codes - this can be a mobile phone number or an authenticator app"
], type: :bullet %>

<p class="govuk-body">
When you have signed in to GOV.UK One Login, you will return to this service to complete your application. 
</p>

<%= govuk_button_to "Continue", "/auth/onelogin" %>
13 changes: 13 additions & 0 deletions app/views/claims/_sign_in_2_authed.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<h1 class="govuk-heading-l">
You have successfully signed in to GOV.UK One Login
</h1>

<p class="govuk-body">
Before you can continue your application, you will need to prove your identity through GOV.UK One Login.
</p>

<p class="govuk-body">
Once you have proven your identity through GOV.UK One Login, you will return to this service to complete your application.
</p>

<%= govuk_button_to "Continue", "/auth/onelogin_identity" %>
11 changes: 11 additions & 0 deletions app/views/claims/_sign_in_3_identified.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<h1 class="govuk-heading-l">
You have successfully proved your identity with GOV.UK One Login
</h1>

<p class="govuk-body">
You can now continue with your application.
</p>

<%= form_with model: @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_submit "Continue" %>
<% end %>
6 changes: 3 additions & 3 deletions spec/support/feature_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def set_slug_sequence_in_session(journey_session:, slug:)
end

def sign_in_with_one_login
expect(page).to have_content("You're now going to GOV.UK One Login")
expect(page).to have_content("Sign in with GOV.UK One Login")
click_button "Continue"

expect(page).to have_content("You've successfully signed in to GOV.UK One Login")
expect(page).to have_content("You have successfully signed in to GOV.UK One Login")
click_button "Continue"

expect(page).to have_content("You've successfully proved your identity with GOV.UK One Login")
expect(page).to have_content("You have successfully proved your identity with GOV.UK One Login")
click_button "Continue"
end
end

0 comments on commit 043f4d2

Please sign in to comment.