diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index 068e81cdf..476569313 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -476,6 +476,7 @@ public async Task CreateAccountRegionSelection(AccountCreationVie if (accountCreation.CountryId == "1") { + await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData); var regionData = await this.regionService.GetAllPagedAsync(accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize); return this.View(new AccountCreationListViewModel { Region = regionData.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = regionData.Item1, PageSize = UserRegistrationContentPageSize, HasItems = regionData.Item1 > 0, CurrentPage = accountCreationViewModel.CurrentPageIndex }, RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); } @@ -537,7 +538,7 @@ public async Task CreateAccountSubmitRegionSelection(AccountCreat if (string.IsNullOrWhiteSpace(accountCreationViewModel.RegionId)) { - if (accountCreation.CountryId == "1") + if (accountCreation.CountryId == "1" || accountCreation.CountryId == null) { this.ModelState.AddModelError("RegionId", CommonValidationErrorMessages.RegionRequired); var region = await this.regionService.GetAllPagedAsync(1, UserRegistrationContentPageSize); @@ -748,7 +749,7 @@ public async Task CreateAccountPrimarySpecialty(AccountCreationVi if (string.IsNullOrWhiteSpace(accountCreationViewModel.GradeId) || !gradeCheck) { int gradePageSize = UserRegistrationContentPageSize + 5; - this.ModelState.AddModelError(string.Empty, CommonValidationErrorMessages.GradeRequired); + this.ModelState.AddModelError("GradeId", CommonValidationErrorMessages.GradeRequired); var gradeLevel = await this.gradeService.GetPagedGradesForJobRoleAsync(int.Parse(accountCreation.CurrentRole), 1, gradePageSize); return this.View("CreateAccountGradeSelection", new AccountCreationListViewModel { GradeList = gradeLevel.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = gradeLevel.Item1, PageSize = gradePageSize, HasItems = gradeLevel.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); } diff --git a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj index 29542a834..5941936e3 100644 --- a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj +++ b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj @@ -128,7 +128,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCountrySelection.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCountrySelection.cshtml index ba55dec77..e2f5019ef 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCountrySelection.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCountrySelection.cshtml @@ -3,6 +3,7 @@ @{ ViewData["Title"] = "Select Country"; + ViewData["DisableValidation"] = true; var errorHasOccurred = !ViewData.ModelState.IsValid; bool returnToConfirmation = false; if (!string.IsNullOrWhiteSpace(Context.Request.Query["returnToConfirmation"])) @@ -25,7 +26,7 @@ @if (errorHasOccurred) { - + }

Search results for @Model.FilterText

diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml index f772e88bf..e0a371597 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml @@ -3,6 +3,7 @@ @{ ViewData["Title"] = "Current Role"; + ViewData["DisableValidation"] = true; var errorHasOccurred = !ViewData.ModelState.IsValid; bool returnToConfirmation = false; if (!string.IsNullOrWhiteSpace(Context.Request.Query["returnToConfirmation"])) diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml index b52b85569..06da30f1b 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml @@ -7,6 +7,7 @@ @{ ViewData["Title"] = "Email Verification"; + ViewData["DisableValidation"] = true; var errorHasOccurred = !ViewData.ModelState.IsValid; bool returnToConfirmation = false; if (!string.IsNullOrWhiteSpace(Context.Request.Query["returnToConfirmation"])) diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml index 25322f8ad..6a81474bc 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml @@ -3,6 +3,7 @@ @{ ViewData["Title"] = "Select Grade"; + ViewData["DisableValidation"] = true; string currentRole = !string.IsNullOrWhiteSpace(Context.Request.Query["CurrentRole"]) ? Context.Request.Query["CurrentRole"] : Model.CurrentRole; var routeData = new Dictionary { { "CurrentRole", currentRole }, { "ReturnToConfirmation", Context.Request.Query["returnToConfirmation"] } }; var errorHasOccurred = !ViewData.ModelState.IsValid; diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountPersonalDetails.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountPersonalDetails.cshtml index 0e289eb4e..95b5fee9d 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountPersonalDetails.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountPersonalDetails.cshtml @@ -6,6 +6,7 @@ @{ ViewData["Title"] = "Personal details"; + ViewData["DisableValidation"] = true; string email = ViewBag.ValidatedEmail; var errorHasOccurred = !ViewData.ModelState.IsValid; AccountCreationTypeEnum accountCreationType = ViewBag.AccountCreationType; @@ -49,7 +50,7 @@ @if (errorHasOccurred) { - + } { { "ReturnToConfirmation", Context.Request.Query["returnToConfirmation"] } }; } @@ -16,7 +17,7 @@ @if (errorHasOccurred) { - + } diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkPlace.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkPlace.cshtml index 0a014d5af..d95658d8f 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkPlace.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkPlace.cshtml @@ -4,6 +4,7 @@ @{ ViewData["Title"] = "Work Place"; + ViewData["DisableValidation"] = true; var errorHasOccurred = !ViewData.ModelState.IsValid; TextInfo textInfo = CultureInfo.CurrentCulture.TextInfo; bool returnToConfirmation = false; diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkStartDate.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkStartDate.cshtml index e62227e4b..456af11e3 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkStartDate.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountWorkStartDate.cshtml @@ -3,6 +3,7 @@ @{ ViewData["Title"] = "Start Date"; + ViewData["DisableValidation"] = true; var errorHasOccurred = !ViewData.ModelState.IsValid; var exampleDate = DateTime.Today; var hintTextLines = new List { $"Enter the date you started your current role, for example, 24 08 2021" }; diff --git a/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml index 31b0e07a5..647e5c3bf 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml @@ -116,8 +116,11 @@ - - + @if (!ViewData["DisableValidation"]?.Equals(true) ?? true) + { + + + } - - + + } diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml index 528616bed..c5c82e17c 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_ValidationScriptsPartial.cshtml @@ -1,5 +1,7 @@ - - +@if (!ViewData["DisableValidation"]?.Equals(true) ?? true) +{ + + @@ -16,6 +18,7 @@ integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY="> +}