-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
405 additions
and
104 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -2,14 +2,13 @@ | |
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.Filters; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using TeachingRecordSystem.Core.Dqt; | ||
using TeachingRecordSystem.WebCommon.FormFlow; | ||
using EmailAddress = TeachingRecordSystem.AuthorizeAccess.DataAnnotations.EmailAddressAttribute; | ||
|
||
namespace TeachingRecordSystem.AuthorizeAccess.Pages.RequestTrn; | ||
|
||
[Journey(RequestTrnJourneyState.JourneyName), RequireJourneyInstance] | ||
public class PersonalEmailModel(AuthorizeAccessLinkGenerator linkGenerator, ICrmQueryDispatcher crmQueryDispatcher) : PageModel | ||
public class PersonalEmailModel(AuthorizeAccessLinkGenerator linkGenerator) : PageModel | ||
{ | ||
public JourneyInstance<RequestTrnJourneyState>? JourneyInstance { get; set; } | ||
|
||
|
@@ -18,7 +17,7 @@ public class PersonalEmailModel(AuthorizeAccessLinkGenerator linkGenerator, ICrm | |
|
||
[BindProperty] | ||
[Display(Name = "What is your personal email address?", Description = "We need this to send you your TRN if you’re eligible for one. Do not use your work email address.")] | ||
[Required(ErrorMessage = "Enter your email address")] | ||
[Required(ErrorMessage = "Enter your personal email address")] | ||
[@EmailAddress(ErrorMessage = "Enter an email address in the correct format, like [email protected]")] | ||
public string? PersonalEmail { get; set; } | ||
|
||
|
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
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
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
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
namespace TeachingRecordSystem.AuthorizeAccess.Pages.RequestTrn; | ||
|
||
[Journey(RequestTrnJourneyState.JourneyName), RequireJourneyInstance] | ||
public class EmailModel(AuthorizeAccessLinkGenerator linkGenerator, ICrmQueryDispatcher crmQueryDispatcher) : PageModel | ||
public class WorkEmailModel(AuthorizeAccessLinkGenerator linkGenerator, ICrmQueryDispatcher crmQueryDispatcher) : PageModel | ||
{ | ||
public JourneyInstance<RequestTrnJourneyState>? JourneyInstance { get; set; } | ||
|
||
|
@@ -21,11 +21,11 @@ public class EmailModel(AuthorizeAccessLinkGenerator linkGenerator, ICrmQueryDis | |
[Display(Name = "What is your work email address?", Description = "We’ll use this to check if you need a TRN.")] | ||
[Required(ErrorMessage = "Enter your work email address")] | ||
[@EmailAddress(ErrorMessage = "Enter an email address in the correct format, like [email protected]")] | ||
public string? Email { get; set; } | ||
public string? WorkEmail { get; set; } | ||
|
||
public void OnGet() | ||
{ | ||
Email = JourneyInstance!.State.Email; | ||
WorkEmail = JourneyInstance!.State.WorkEmail; | ||
} | ||
|
||
public async Task<IActionResult> OnPostAsync() | ||
|
@@ -35,10 +35,10 @@ public async Task<IActionResult> OnPostAsync() | |
return this.PageWithErrors(); | ||
} | ||
|
||
await JourneyInstance!.UpdateStateAsync(state => state.Email = Email); | ||
await JourneyInstance!.UpdateStateAsync(state => state.WorkEmail = WorkEmail); | ||
|
||
var openTasks = await crmQueryDispatcher.ExecuteQueryAsync( | ||
new GetOpenTasksForEmailAddressQuery(EmailAddress: JourneyInstance!.State.Email!)); | ||
new GetOpenTasksForEmailAddressQuery(EmailAddress: JourneyInstance!.State.WorkEmail!)); | ||
|
||
if (openTasks.Any()) | ||
{ | ||
|
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
Oops, something went wrong.