Skip to content

Commit c611e00

Browse files
TD-4471 Issues with 'Search' functionality when JS turned off on 'Tracking system - Centre administrators' screen
1 parent 97783c5 commit c611e00

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

DigitalLearningSolutions.Data/Helpers/NameQueryHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ public static string GetSortableFullName(string? firstName, string lastName)
66
{
77
return string.IsNullOrWhiteSpace(firstName) ? lastName : $"{lastName}, {firstName}";
88
}
9+
10+
public static string GetSortableFullName(string? firstName, string lastName, string? primaryEmail, string? centreEmail)
11+
{
12+
var name = string.IsNullOrWhiteSpace(firstName) ? lastName : $"{lastName}, {firstName}";
13+
var email = CentreEmailHelper.GetEmailForCentreNotifications( primaryEmail!, centreEmail );
14+
return $"{name} ({email})";
15+
}
916
}
1017
}

DigitalLearningSolutions.Data/Models/User/AdminEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public AdminEntity(
4848
public override string SearchableName
4949
{
5050
get => SearchableNameOverrideForFuzzySharp ??
51-
NameQueryHelper.GetSortableFullName(UserAccount.FirstName, UserAccount.LastName);
51+
NameQueryHelper.GetSortableFullName(UserAccount.FirstName, UserAccount.LastName, UserAccount.PrimaryEmail, UserCentreDetails?.Email);
5252
set => SearchableNameOverrideForFuzzySharp = value;
5353
}
5454

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Centre/Administrator/AdministratorController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public IActionResult Index(
6868
Request,
6969
AdminFilterCookieName
7070
);
71-
71+
searchString = searchString == null ? null : searchString.Trim();
7272
var centreId = User.GetCentreIdKnownNotNull();
7373
var adminsAtCentre = userService.GetAdminsByCentreId(centreId);
7474
var categories = courseCategoriesService.GetCategoriesForCentreAndCentrallyManagedCourses(centreId);

0 commit comments

Comments
 (0)