Skip to content
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

Align Teacher Auth journey with designs round 2 #1289

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,32 @@
}

@section BeforeContent {
<govuk-back-link href="@LinkGenerator.Trn(Model.JourneyInstance!.InstanceId)" />
<govuk-back-link href="@LinkGenerator.NotFound(Model.JourneyInstance!.InstanceId)" />
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<form action="@LinkGenerator.CheckAnswers(Model.JourneyInstance!.InstanceId)" method="post">
<h1 class="govuk-heading-l">@ViewBag.Title</h1>

<p class="govuk-body">Your GOV.UK One Login could not be connected to your teaching record.</p>
<h2 class="govuk-heading-m">GOV.UK One Login</h2>

<p class="govuk-body">Check your answers and try again.</p>
<govuk-summary-list>
<govuk-summary-list-row>
<govuk-summary-list-row-key>Email</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@Model.Email</govuk-summary-list-row-value>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>Name</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@Model.Name</govuk-summary-list-row-value>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>Date of birth</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@Model.DateOfBirth.ToString("d MMMM yyyy")</govuk-summary-list-row-value>
</govuk-summary-list-row>
</govuk-summary-list>

<h2 class="govuk-heading-m">Additional details</h2>

<govuk-summary-list>
<govuk-summary-list-row>
Expand All @@ -42,7 +57,7 @@
</govuk-summary-list-row>
</govuk-summary-list>

<govuk-button type="submit">Continue</govuk-button>
<govuk-button type="submit">Submit support request</govuk-button>
</form>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.RazorPages;
Expand All @@ -10,6 +11,12 @@ public class CheckAnswersModel(SignInJourneyHelper helper) : PageModel
{
public JourneyInstance<SignInJourneyState>? JourneyInstance { get; set; }

public string? Email { get; set; }

public string? Name { get; set; }

public DateOnly DateOfBirth { get; set; }

public string? NationalInsuranceNumber => JourneyInstance!.State.NationalInsuranceNumber;

public string? Trn => JourneyInstance!.State.Trn;
Expand All @@ -18,7 +25,7 @@ public void OnGet()
{
}

public IActionResult OnPost() => Redirect(helper.LinkGenerator.NotFound(JourneyInstance!.InstanceId));
public IActionResult OnPost() => throw new NotImplementedException();

public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
{
Expand All @@ -44,5 +51,12 @@ public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
// Not answered the TRN question
context.Result = Redirect(helper.LinkGenerator.Trn(JourneyInstance.InstanceId));
}

if (context.Result is null)
{
Email = state.OneLoginAuthenticationTicket!.Principal.FindFirstValue("email")!;
Name = string.Join(" ", state.VerifiedNames!.First());
DateOfBirth = state.VerifiedDatesOfBirth!.First();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
@page "/connect"
@model TeachingRecordSystem.AuthorizeAccess.Pages.ConnectModel
@{
ViewBag.Title = "Connect your GOV.UK One Login to your teaching record";
ViewBag.Title = "Find your teaching record";
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="govuk-panel govuk-panel--interruption">
<form action="@LinkGenerator.Connect(Model.JourneyInstance!.InstanceId)" method="post">
<h1 class="govuk-panel__title">@ViewBag.Title</h1>
<form action="@LinkGenerator.Connect(Model.JourneyInstance!.InstanceId)" method="post">
<div class="govuk-panel govuk-panel--interruption">
<h1 class="govuk-panel__title">@ViewBag.Title</h1>

<div class="govuk-panel__body">
<p class="govuk-body-l">
You’ve verified your identity for your GOV.UK One Login.
</p>
<div class="govuk-panel__body">
<div class="trs-two-thirds">
<p class="govuk-body">
You’ve signed in to GOV.UK One Login and verified your identity.
</p>

<p class="govuk-body-l">
You now need to connect it to your teaching record. You’ll be asked for your:
<ul class="govuk-list govuk-list--bullet govuk-body-l">
<li>National Insurance number</li>
<li>teacher reference number</li>
</ul>
</p>
<p class="govuk-body">
We’ll ask for your National Insurance number or teacher reference number (TRN) so we can find your teaching record.
</p>

<govuk-button class="govuk-!-margin-bottom-0">Connect to your teaching record</govuk-button>
</div>
</form>
<p class="govuk-body">
You won’t need to do this again.
</p>

<govuk-button class="govuk-!-margin-bottom-0">Find your teaching record</govuk-button>
</div>
</div>
</div>
</div>
</form>
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
@page "/found"
@model TeachingRecordSystem.AuthorizeAccess.Pages.FoundModel
@{
ViewBag.Title = "We’ve found your teaching record";
ViewBag.Title = "Your GOV.UK One Login is connected to your teaching record";
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<form action="@LinkGenerator.Found(Model.JourneyInstance!.InstanceId)" method="post">
<govuk-panel class="trs-panel--left">
<govuk-panel-title>
Your GOV.UK One Login is connected to your teaching record
</govuk-panel-title>
<govuk-panel-body>
<p class="govuk-body-l">
You won’t need to do this again.
</p>
<form action="@LinkGenerator.Found(Model.JourneyInstance!.InstanceId)" method="post">
<govuk-panel class="trs-panel--left">
<govuk-panel-title>
@ViewBag.Title
</govuk-panel-title>
<govuk-panel-body>
<p class="govuk-body">
You won’t need to do this again.
</p>

<govuk-button type="submit" class="govuk-!-margin-bottom-0">Access your teaching record</govuk-button>
</govuk-panel-body>
</govuk-panel>
</form>
</div>
</div>
<govuk-button type="submit" class="govuk-!-margin-bottom-0">Access your teaching record</govuk-button>
</govuk-panel-body>
</govuk-panel>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<form action="@LinkGenerator.NationalInsuranceNumber(Model.JourneyInstance!.InstanceId, Model.FromCheckAnswers)" method="post">
<h1 class="govuk-heading-l">@ViewBag.Title</h1>

<govuk-radios asp-for="HaveNationalInsuranceNumber">
<govuk-radios-fieldset>
<govuk-radios-fieldset-legend class="govuk-fieldset__legend--l" />
<govuk-radios-fieldset-legend />
<govuk-radios-item value="@true">
Yes
<govuk-radios-item-conditional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class NationalInsuranceNumberModel(SignInJourneyHelper helper) : PageMode
public bool? FromCheckAnswers { get; set; }

[BindProperty]
[Display(Name = "Do you have a National Insurance number?", Description = "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.")]
[Display(Name = "Do you have a National Insurance number?")]
[Required(ErrorMessage = "Select yes if you have a National Insurance number")]
public bool? HaveNationalInsuranceNumber { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,31 @@
}

@section BeforeContent {
<govuk-back-link href="@LinkGenerator.CheckAnswers(Model.JourneyInstance!.InstanceId)" />
<govuk-back-link href="@LinkGenerator.Trn(Model.JourneyInstance!.InstanceId)" />
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="govuk-panel govuk-panel--interruption">
<h1 class="govuk-panel__title">Your GOV.UK One Login could not be connected to your teaching record</h1>
<form action="@LinkGenerator.NotFound(Model.JourneyInstance!.InstanceId)" method="post">
<div class="govuk-panel govuk-panel--interruption">
<h1 class="govuk-panel__title">@ViewBag.Title</h1>

<div class="govuk-panel__body">
<p class="govuk-body-l">
You need to get support to access your teaching qualifications.
<div class="govuk-panel__body">
<div class="trs-two-thirds">
<p class="govuk-body govuk-!-margin-bottom-0">
We’ve been unable to match your answers to a teaching record.
</p>

<p class="govuk-body-l">
Your details will be sent to the Teaching Regulation Agency support team.
<h2 class="govuk-heading-l">Get support</h2>

<p class="govuk-body">
Check your answers. If they’re correct, you can get support with accessing your teaching qualifications.
</p>

<p class="govuk-body">
We’ll check your details and contact you if we need any more information.
</p>

<govuk-button class="govuk-!-margin-bottom-0">Get support</govuk-button>
<govuk-button class="govuk-!-margin-bottom-0">Check your answers</govuk-button>
</div>
</div>
</div>
</div>
</form>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.RazorPages;
using TeachingRecordSystem.FormFlow;
Expand All @@ -13,6 +14,8 @@ public void OnGet()
{
}

public IActionResult OnPost() => Redirect(helper.LinkGenerator.CheckAnswers(JourneyInstance!.InstanceId));

public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
{
var state = JourneyInstance!.State;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/trn"
@model TeachingRecordSystem.AuthorizeAccess.Pages.TrnModel
@{
ViewBag.Title = "What is your teacher reference number (TRN)?";
ViewBag.Title = "Teacher reference number (TRN)";
}

@section BeforeContent {
Expand All @@ -11,9 +11,33 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<form action="@LinkGenerator.Trn(Model.JourneyInstance!.InstanceId, Model.FromCheckAnswers)" method="post">
<h1 class="govuk-heading-l">@ViewBag.Title</h1>

<govuk-details>
<govuk-details-summary>About teacher reference numbers</govuk-details-summary>
<govuk-details-text>
<p class="govuk-body">
You’ll have a TRN if you:
<ul class="govuk-list govuk-list--bullet">
<li>hold qualified teacher status (QTS) in England or Wales</li>
<li>hold early years teacher status (EYTS) in England</li>
<li>already hold a national professional qualification (NPQ)</li>
<li>are working towards QTS or a EYTS</li>
</ul>
</p>
<p class="govuk-body">
<a href="https://www.gov.uk/guidance/teacher-reference-number-trn" rel="noreferrer" target="_blank">Learn about TRNs</a> including how to request one, or
<a href="https://find-a-lost-trn.education.gov.uk/" rel="noreferrer" target="_blank">find a lost TRN</a>.
</p>
<p class="govuk-body">
You may not have one yet in you work in early years, further education or qualified as a teacher outside of England.
</p>
</govuk-details-text>
</govuk-details>

<govuk-radios asp-for="HaveTrn">
<govuk-radios-fieldset>
<govuk-radios-fieldset-legend class="govuk-fieldset__legend--l" />
<govuk-radios-fieldset-legend />
<govuk-radios-item value="@true">
Yes
<govuk-radios-item-conditional>
Expand All @@ -24,26 +48,6 @@
</govuk-radios-fieldset>
</govuk-radios>

<govuk-details>
<govuk-details-summary>About TRNs</govuk-details-summary>
<govuk-details-text>
<p class="govuk-body">You’ll have a TRN if you:</p>
<ul class="govuk-list govuk-list--bullet">
<li>hold qualified teacher status (QTS) in England or Wales</li>
<li>hold early years teacher status (EYTS) in England</li>
<li>already hold a national professional qualification (NPQ)</li>
<li>are working towards QTS or a EYTS</li>
</ul>
<p class="govuk-body">
<a href="https://www.gov.uk/guidance/teacher-reference-number-trn#request-a-trn-if-youre-an-early-years-professional-or-mentor-for-an-early-career-teacher" class="govuk-link">Learn about TRNs</a> including how to request one, or <a href="https://find-a-lost-trn.education.gov.uk/start" class="govuk-link">find a lost TRN</a>.
</p>
<p class="govuk-body">
You may not have one yet if you work in early years, further education or qualified as a teacher outside of
England.
</p>
</govuk-details-text>
</govuk-details>

<govuk-button type="submit">Continue</govuk-button>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public class TrnModel(SignInJourneyHelper helper) : PageModel
public bool? FromCheckAnswers { get; set; }

[BindProperty]
[Display(Name = "Do you have a teacher reference number (TRN)?")]
[Required(ErrorMessage = "Select yes if you have a TRN")]
[Display(Name = "Do you have a teacher reference number?")]
[Required(ErrorMessage = "Select yes if you have a teacher reference number")]
public bool? HaveTrn { get; set; }

[BindProperty]
[Display(Name = "TRN")]
[Required(ErrorMessage = "Enter your TRN")]
[RegularExpression(@"\A\D*(\d{1}\D*){7}\D*\Z", ErrorMessage = "Your TRN should contain 7 digits")]
[Display(Name = "Teacher reference number")]
[Required(ErrorMessage = "Enter your teacher reference number")]
[RegularExpression(@"\A\D*(\d{1}\D*){7}\D*\Z", ErrorMessage = "Your teacher reference number should contain 7 digits")]
public string? Trn { get; set; }

public void OnGet()
Expand All @@ -46,7 +46,7 @@ public async Task<IActionResult> OnPost()
await JourneyInstance!.UpdateStateAsync(state => state.SetTrn(HaveTrn!.Value, Trn));

return await helper.TryMatchToTeachingRecord(JourneyInstance!) ? Redirect(helper.LinkGenerator.Found(JourneyInstance.InstanceId)) :
Redirect(helper.LinkGenerator.CheckAnswers(JourneyInstance.InstanceId));
Redirect(helper.LinkGenerator.NotFound(JourneyInstance.InstanceId));
}

public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
background-color: govuk-colour("light-grey");
}
}

.trs-two-thirds {
width: 66.6666666667%;
}
Loading
Loading