Skip to content

Commit e2f2749

Browse files
Merge pull request #1341 from TechnologyEnhancedLearning/Develop/Features/TD-5761-Revised-MyAccount-screen-implementation
TD-5761: Revised my account screen implementation
2 parents 4896c6a + 1f14f22 commit e2f2749

File tree

53 files changed

+1974
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1974
-497
lines changed

AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
8484
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.8.0" />
8585
<PackageReference Include="BuildWebCompiler" Version="1.12.405" />
86-
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.9" />
86+
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.11" />
8787
<PackageReference Include="FluentValidation" Version="11.11.0" />
8888
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
8989
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />

LearningHub.Nhs.WebUI.AutomatedUiTests/LearningHub.Nhs.WebUI.AutomatedUiTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14+
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.11" />
1415
<PackageReference Include="FluentAssertions" Version="6.12.0" />
1516
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.52" />
1617
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.13" />

LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs

Lines changed: 376 additions & 47 deletions
Large diffs are not rendered by default.

LearningHub.Nhs.WebUI/Helpers/CommonValidationErrorMessages.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,30 @@ public static class CommonValidationErrorMessages
229229
/// Message if the validation token expired.
230230
/// </summary>
231231
public const string EmailChangeValidationTokenInvalidMessage = "We cannot find the page you are looking for";
232+
233+
/// <summary>
234+
/// Message if the validation token expired.
235+
/// </summary>
236+
public const string InvalidSecurityQuestionAnswer = "Enter an answer";
237+
238+
/// <summary>
239+
/// Message if the validation token expired.
240+
/// </summary>
241+
public const string EmploymentDetailsUpdated = "Your employment details has been changed";
242+
243+
/// <summary>
244+
/// security question Success Message.
245+
/// </summary>
246+
public const string SecurityQuestionSuccessMessage = "Your security questions has been changed";
247+
248+
/// <summary>
249+
/// location Success Message.
250+
/// </summary>
251+
public const string LocationDetailsSuccessMessage = "Your location details has been changed";
252+
253+
/// <summary>
254+
/// location Success Message.
255+
/// </summary>
256+
public const string PersonalDetailsSuccessMessage = "Your personal details has been changed";
232257
}
233258
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
namespace LearningHub.Nhs.WebUI.Helpers
2+
{
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using elfhHub.Nhs.Models.Common;
6+
using Microsoft.AspNetCore.Mvc.Rendering;
7+
8+
/// <summary>
9+
/// SelectListHelper.
10+
/// </summary>
11+
public static class SelectListHelper
12+
{
13+
/// <summary>
14+
/// MapOptionsToSelectListItems.
15+
/// </summary>
16+
/// <param name="options">options.</param>
17+
/// <param name="selectedId">selectedId.</param>
18+
/// <returns>SelectListItem.</returns>
19+
public static IEnumerable<SelectListItem> MapOptionsToSelectListItems(IEnumerable<GenericListViewModel> options, int? selectedId = null)
20+
{
21+
return options.Select(o => new SelectListItem(o.Name, o.Id.ToString(), o.Id == selectedId)).ToList();
22+
}
23+
24+
/// <summary>
25+
/// MapSelectListWithSelection.
26+
/// </summary>
27+
/// <param name="options">options.</param>
28+
/// <param name="selectedId">selectedId.</param>
29+
/// <returns>SelectListItem.</returns>
30+
public static IEnumerable<SelectListItem> MapSelectListWithSelection(IEnumerable<SelectListItem> options, string selectedId = null)
31+
{
32+
return options.Select(o => new SelectListItem(o.Text, o.Value, o.Value == selectedId)).ToList();
33+
}
34+
}
35+
}

LearningHub.Nhs.WebUI/Interfaces/ICountryService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,17 @@ public interface ICountryService
2929
/// </summary>
3030
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
3131
Task<List<Country>> GetAllAsync();
32+
33+
/// <summary>
34+
/// The GetAllUKCountries.
35+
/// </summary>
36+
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
37+
Task<List<GenericListViewModel>> GetAllUKCountries();
38+
39+
/// <summary>
40+
/// The GetAllNonUKCountries.
41+
/// </summary>
42+
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
43+
Task<List<GenericListViewModel>> GetAllNonUKCountries();
3244
}
3345
}

LearningHub.Nhs.WebUI/Interfaces/IUserService.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,5 +478,45 @@ public interface IUserService
478478
/// <param name="szString">the string.</param>
479479
/// <returns>base64 string.</returns>
480480
string Base64MD5HashDigest(string szString);
481+
482+
/// <summary>
483+
/// The get current user profile for My account.
484+
/// </summary>
485+
/// <returns>The <see cref="Task{MyAccountPersonalDetailsViewModel}"/>.</returns>
486+
Task<MyAccountPersonalDetailsViewModel> GetMyAccountPersonalDetailsAsync();
487+
488+
/// <summary>
489+
/// Update MyAccount Personal Details Async.
490+
/// </summary>
491+
/// <param name="userId">userId.</param>
492+
/// <param name="model">MyAccountPersonalDetailsViewModel.</param>
493+
/// <returns>The <see cref="Task"/>.</returns>
494+
Task UpdateMyAccountPersonalDetailsAsync(int userId, MyAccountPersonalDetailsViewModel model);
495+
496+
/// <summary>
497+
/// Get MyEmployment Details Async.
498+
/// </summary>
499+
/// <returns>The <see cref="Task{MyAccountEmploymentDetailsViewModel}"/>.</returns>
500+
Task<MyAccountEmploymentDetailsViewModel> GetMyEmploymentDetailsAsync();
501+
502+
/// <summary>
503+
/// Get MyAccount Security Details Async.
504+
/// </summary>
505+
/// <returns>The <see cref="Task{MyAccountSecurityViewModel}"/>.</returns>
506+
Task<MyAccountSecurityViewModel> GetMyAccountSecurityDetailsAsync();
507+
508+
/// <summary>
509+
/// Get MyAccount Location Details Async.
510+
/// </summary>
511+
/// <returns>The <see cref="Task{MyAccountLocationViewModel}"/>.</returns>
512+
Task<MyAccountLocationViewModel> GetMyAccountLocationDetailsAsync();
513+
514+
/// <summary>
515+
/// Update MyAccount Location Details Async.
516+
/// </summary>
517+
/// <param name="userId">userId.</param>
518+
/// <param name="model">MyAccountLocationViewModel.</param>
519+
/// <returns>The <see cref="Task"/>.</returns>
520+
Task UpdateMyAccountLocationDetailsAsync(int userId, MyAccountLocationViewModel model);
481521
}
482522
}

LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
108108
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
109109
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
110-
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.9" />
110+
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.11" />
111111
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
112112
<PackageReference Include="GDS.MultiPageFormData" Version="1.0.6" />
113113
<PackageReference Include="HtmlAgilityPack" Version="1.11.72" />

LearningHub.Nhs.WebUI/Models/SideMenu/SideNavigationConfiguration.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,30 @@ public static IEnumerable<SideNavigationGroup> GetGroupedMenus()
2626
new SideNavigationItem
2727
{
2828
Text = "Personal details",
29-
Controller = "Account",
30-
Action = "PersonalDetails",
31-
IsActive = route => MatchRoute(route, "Account", "PersonalDetails"),
29+
Controller = "MyAccount",
30+
Action = "Index",
31+
IsActive = route => MatchRoute(route, "MyAccount", "Index"),
3232
},
3333
new SideNavigationItem
3434
{
3535
Text = "My employment",
36-
Controller = "Account",
37-
Action = "MyEmployment",
38-
IsActive = route => MatchRoute(route, "Account", "MyEmployment"),
36+
Controller = "MyAccount",
37+
Action = "MyEmploymentDetails",
38+
IsActive = route => MatchRoute(route, "MyAccount", "MyEmploymentDetails"),
3939
},
4040
new SideNavigationItem
4141
{
4242
Text = "Security",
43-
Controller = "Account",
44-
Action = "Security",
45-
IsActive = route => MatchRoute(route, "Account", "Security"),
43+
Controller = "MyAccount",
44+
Action = "MyAccountSecurity",
45+
IsActive = route => MatchRoute(route, "MyAccount", "MyAccountSecurity"),
4646
},
4747
new SideNavigationItem
4848
{
4949
Text = "Notification",
50-
Controller = "Account",
51-
Action = "Notification",
52-
IsActive = route => MatchRoute(route, "Account", "Notification"),
50+
Controller = "Notification",
51+
Action = "Index",
52+
IsActive = route => MatchRoute(route, "Notification", "Index"),
5353
},
5454
},
5555
},
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
namespace LearningHub.Nhs.WebUI.Models.UserProfile
2+
{
3+
using System;
4+
5+
/// <summary>
6+
/// Defines the <see cref="MyAccountEmploymentDetailsViewModel" />.
7+
/// </summary>
8+
public class MyAccountEmploymentDetailsViewModel
9+
{
10+
/// <summary>
11+
/// Gets or sets the Id.
12+
/// </summary>
13+
public int Id { get; set; }
14+
15+
/// <summary>
16+
/// Gets or sets the Country.
17+
/// </summary>
18+
public string Country { get; set; }
19+
20+
/// <summary>
21+
/// Gets or sets the Region.
22+
/// </summary>
23+
public string Region { get; set; }
24+
25+
/// <summary>
26+
/// Gets or sets the CountryName.
27+
/// </summary>
28+
public string CountryName { get; set; }
29+
30+
/// <summary>
31+
/// Gets or sets the RegionName.
32+
/// </summary>
33+
public string RegionName { get; set; }
34+
35+
/// <summary>
36+
/// Gets or sets the user employment id.
37+
/// </summary>
38+
public int EmploymentId { get; set; }
39+
40+
/// <summary>
41+
/// Gets or sets the job role id.
42+
/// </summary>
43+
public int? JobRoleId { get; set; }
44+
45+
/// <summary>
46+
/// Gets or sets the CurrentRole.
47+
/// </summary>
48+
public string JobRole { get; set; }
49+
50+
/// <summary>
51+
/// Gets or sets the medical council id.
52+
/// </summary>
53+
public int? MedicalCouncilId { get; set; }
54+
55+
/// <summary>
56+
/// Gets or sets the ProfessionalRegistrationNumber.
57+
/// </summary>
58+
public string MedicalCouncilNo { get; set; }
59+
60+
/// <summary>
61+
/// Gets or sets the grade id.
62+
/// </summary>
63+
public int? GradeId { get; set; }
64+
65+
/// <summary>
66+
/// Gets or sets the Grade.
67+
/// </summary>
68+
public string Grade { get; set; }
69+
70+
/// <summary>
71+
/// Gets or sets the specialty id.
72+
/// </summary>
73+
public int? SpecialtyId { get; set; }
74+
75+
/// <summary>
76+
/// Gets or sets the PrimarySpecialty.
77+
/// </summary>
78+
public string PrimarySpecialty { get; set; }
79+
80+
/// <summary>
81+
/// Gets or sets the StartDate.
82+
/// </summary>
83+
public DateTimeOffset? JobStartDate { get; set; }
84+
85+
/// <summary>
86+
/// Gets or sets the location id.
87+
/// </summary>
88+
public int LocationId { get; set; }
89+
90+
/// <summary>
91+
/// Gets or sets the PlaceOfWork.
92+
/// </summary>
93+
public string PlaceOfWork { get; set; }
94+
}
95+
}

0 commit comments

Comments
 (0)