Skip to content

Commit 311bc2c

Browse files
committed
TD-5761: merging latest changes
1 parent 7a3409b commit 311bc2c

28 files changed

+866
-409
lines changed

LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs

Lines changed: 281 additions & 61 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
}

LearningHub.Nhs.WebUI/Helpers/SelectListHelper.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,16 @@ public static IEnumerable<SelectListItem> MapOptionsToSelectListItems(IEnumerabl
2020
{
2121
return options.Select(o => new SelectListItem(o.Name, o.Id.ToString(), o.Id == selectedId)).ToList();
2222
}
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+
}
2334
}
2435
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static IEnumerable<SideNavigationGroup> GetGroupedMenus()
2828
Text = "Personal details",
2929
Controller = "MyAccount",
3030
Action = "Index",
31-
IsActive = route => MatchRoute(route, "MyAccount", "PersonalDetails"),
31+
IsActive = route => MatchRoute(route, "MyAccount", "Index"),
3232
},
3333
new SideNavigationItem
3434
{

LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountLocationViewModel.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
{
33
using System.Collections.Generic;
44
using System.ComponentModel;
5-
using System.ComponentModel.DataAnnotations;
6-
using elfhHub.Nhs.Models.Common;
75
using Microsoft.AspNetCore.Mvc.Rendering;
86
using NHSUKViewComponents.Web.ViewModels;
97

@@ -15,14 +13,12 @@ public class MyAccountLocationViewModel
1513
/// <summary>
1614
/// Gets or sets the country id.
1715
/// </summary>
18-
[Required(ErrorMessage = "Select a country.")]
1916
[DisplayName("Country")]
2017
public int? SelectedCountryId { get; set; }
2118

2219
/// <summary>
2320
/// Gets or sets the region id.
2421
/// </summary>
25-
[Required(ErrorMessage = "Select a region.")]
2622
[DisplayName("Region")]
2723
public int? SelectedRegionId { get; set; }
2824

@@ -39,14 +35,17 @@ public class MyAccountLocationViewModel
3935
/// <summary>
4036
/// Gets or sets the country id.
4137
/// </summary>
42-
////[Required(ErrorMessage = "Select a country.")]
43-
////[DisplayName("Country")]
4438
public int? SelectedOtherCountryId { get; set; }
4539

4640
/// <summary>
4741
/// Gets or sets a value indicating whether SelectedOtherCountry.
4842
/// </summary>
49-
public bool SelectedOtherCountry { get; set; }
43+
public bool HasSelectedOtherCountry { get; set; }
44+
45+
/// <summary>
46+
/// Gets or sets a value indicating whether SelectedRegion.
47+
/// </summary>
48+
public bool HasSelectedRegion { get; set; }
5049

5150
/// <summary>
5251
/// Gets or sets the Country.

LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountPersonalDetailsViewModel.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.ComponentModel.DataAnnotations;
55
using LearningHub.Nhs.WebUI.Attributes;
66
using LearningHub.Nhs.WebUI.Helpers;
7+
using LearningHub.Nhs.WebUI.Validation;
78

89
/// <summary>
910
/// Defines the <see cref="MyAccountPersonalDetailsViewModel" />.
@@ -60,5 +61,15 @@ public class MyAccountPersonalDetailsViewModel
6061
/// Gets or sets the new primary email address.
6162
/// </summary>
6263
public string NewPrimaryEmailAddress { get; set; }
64+
65+
/// <summary>
66+
/// Gets or sets the SecondaryEmailAddress.
67+
/// </summary>
68+
[DataType(DataType.EmailAddress)]
69+
[NotEqual("PrimaryEmailAddress", ErrorMessage = CommonValidationErrorMessages.SecondaryEmailShouldNotBeSame)]
70+
[MaxLength(100, ErrorMessage = CommonValidationErrorMessages.TooLongEmail)]
71+
[EmailAddress(ErrorMessage = CommonValidationErrorMessages.InvalidEmail)]
72+
[NoWhitespace(ErrorMessage = CommonValidationErrorMessages.WhitespaceInEmail)]
73+
public string SecondaryEmailAddress { get; set; }
6374
}
6475
}

LearningHub.Nhs.WebUI/Models/UserProfile/MyAccountSecurityViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public class MyAccountSecurityViewModel
2727
/// </summary>
2828
public string SecuritySecondQuestion { get; set; }
2929

30-
/// <summary>
31-
/// Gets or sets the LastUpdated.
32-
/// </summary>
33-
public DateTimeOffset LastUpdated { get; set; }
30+
/////// <summary>
31+
/////// Gets or sets the LastUpdated.
32+
/////// </summary>
33+
////public DateTimeOffset LastUpdated { get; set; }
3434

3535
/// <summary>
3636
/// Gets or sets the PasswordHash.
@@ -40,6 +40,6 @@ public class MyAccountSecurityViewModel
4040
/// <summary>
4141
/// Gets or sets the SecurityQuestionLastUpdated.
4242
/// </summary>
43-
public DateTimeOffset? SecurityQuestionLastUpdated { get; set; }
43+
public string SecurityQuestionLastUpdated { get; set; }
4444
}
4545
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
namespace LearningHub.Nhs.WebUI.Models.UserProfile
2+
{
3+
using System.Collections.Generic;
4+
using System.ComponentModel.DataAnnotations;
5+
using elfhHub.Nhs.Models.Common;
6+
using Microsoft.AspNetCore.Mvc.Rendering;
7+
using NHSUKViewComponents.Web.ViewModels;
8+
9+
/// <summary>
10+
/// Defines the <see cref="MyAcountSecurityQuestionsViewModel" />.
11+
/// </summary>
12+
public class MyAcountSecurityQuestionsViewModel
13+
{
14+
/// <summary>
15+
/// Gets or sets selectedQuestion.
16+
/// </summary>
17+
public int SelectedFirstQuestionId { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets selectedQuestion.
21+
/// </summary>
22+
public int SelectedSecondQuestionId { get; set; }
23+
24+
/// <summary>
25+
/// Gets or sets the security question answer hash.
26+
/// </summary>
27+
public string SecurityFirstQuestionAnswerHash { get; set; }
28+
29+
/// <summary>
30+
/// Gets or sets the security question answer hash.
31+
/// </summary>
32+
public string SecuritySecondQuestionAnswerHash { get; set; }
33+
34+
/// <summary>
35+
/// Gets or sets the FirstSecurityQuestions.
36+
/// </summary>
37+
public IEnumerable<SelectListItem> FirstSecurityQuestions { get; set; }
38+
39+
/// <summary>
40+
/// Gets or sets the SecondSecurityQuestions.
41+
/// </summary>
42+
public IEnumerable<SelectListItem> SecondSecurityQuestions { get; set; }
43+
44+
/// <summary>
45+
/// Gets or sets the UserSecurityFirstQuestionId.
46+
/// </summary>
47+
public int UserSecurityFirstQuestionId { get; set; }
48+
49+
/// <summary>
50+
/// Gets or sets the UserSecurityFirstQuestionId.
51+
/// </summary>
52+
public int UserSecuritySecondQuestionId { get; set; }
53+
}
54+
}

LearningHub.Nhs.WebUI/Models/UserProfile/UserPrimarySpecialtyUpdateViewModel.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ public class UserPrimarySpecialtyUpdateViewModel : PagingViewModel
3636
/// </summary>
3737
public GenericListViewModel OptionalSpecialtyItem { get; set; }
3838

39+
/// <summary>
40+
/// Gets or sets the selected job role id.
41+
/// </summary>
42+
public int? SelectedJobRoleId { get; set; }
43+
44+
/// <summary>
45+
/// Gets or sets the selected grade id.
46+
/// </summary>
47+
public string SelectedGradeId { get; set; }
48+
49+
/// <summary>
50+
/// Gets or sets the selected medical council number.
51+
/// </summary>
52+
public string SelectedMedicalCouncilNo { get; set; }
53+
3954
/// <summary>
4055
/// sets the list of radio specialty.
4156
/// </summary>

LearningHub.Nhs.WebUI/Models/UserProfile/UserStartDateUpdateViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ public class UserStartDateUpdateViewModel : IValidatableObject
3030
/// </summary>
3131
public int? Year { get; set; }
3232

33+
/////// <summary>
34+
/////// Gets or sets filter text.
35+
/////// </summary>
36+
////public string FilterText { get; set; }
37+
38+
/// <summary>
39+
/// Gets or sets the selected primary specialty id.
40+
/// </summary>
41+
public int? SelectedPrimarySpecialtyId { get; set; }
42+
3343
/// <summary>
3444
/// Gets or sets the GetDate.
3545
/// </summary>

0 commit comments

Comments
 (0)