From a87f8fbb4a83c7fd05c5490a74104482eadd4611 Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Wed, 11 Dec 2024 16:28:33 +0000 Subject: [PATCH 1/2] TD-4199: DIG1801: There are some problems with the consistency and operation of components --- LearningHub.Nhs.WebUI/Controllers/AccountController.cs | 5 +++-- .../Views/Account/CreateAccountCurrentRole.cshtml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index 1281d1d18..ceb738db6 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -648,15 +648,16 @@ public async Task CreateAccountCurrentRole(AccountCreationViewMod public async Task CreateAccountProfessionalRegNumber(AccountCreationViewModel accountCreationViewModel) { var roleCheck = int.TryParse(accountCreationViewModel.CurrentRole, out int roleId); + var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData); + if (string.IsNullOrWhiteSpace(accountCreationViewModel.CurrentRole) || !roleCheck) { this.ModelState.AddModelError("CurrentRole", CommonValidationErrorMessages.RoleRequired); var jobroles = await this.jobRoleService.GetPagedFilteredAsync(accountCreationViewModel.FilterText, 1, UserRegistrationContentPageSize); - return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); + return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryId = accountCreation.CountryId, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); } var jobrole = await this.jobRoleService.GetByIdAsync(roleId); - var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData); accountCreation.CurrentRole = jobrole.Id.ToString(); accountCreation.CurrentRoleName = jobrole.Name; accountCreation.MedicalCouncilId = jobrole.MedicalCouncilId; diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml index 1281e8120..f772e88bf 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml @@ -22,7 +22,7 @@
@if (!returnToConfirmation) { - if (Model.CountryId == "1" || errorHasOccurred) + if (Model.CountryId == "1") //|| errorHasOccurred { From 77954ef990ce091313dee394c0dfe73702dfdb2a Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Wed, 11 Dec 2024 16:40:31 +0000 Subject: [PATCH 2/2] fixed the space issues --- LearningHub.Nhs.WebUI/Controllers/AccountController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index ceb738db6..068e81cdf 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -654,7 +654,7 @@ public async Task CreateAccountProfessionalRegNumber(AccountCreat { this.ModelState.AddModelError("CurrentRole", CommonValidationErrorMessages.RoleRequired); var jobroles = await this.jobRoleService.GetPagedFilteredAsync(accountCreationViewModel.FilterText, 1, UserRegistrationContentPageSize); - return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryId = accountCreation.CountryId, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); + return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryId = accountCreation.CountryId, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); } var jobrole = await this.jobRoleService.GetByIdAsync(roleId);