Skip to content

Commit 7246e0d

Browse files
TD-5568 Add 'Last accessed date' to 'sort' filter on 'Tracking system - Delegates' screen
1 parent 9c52e49 commit 7246e0d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

DigitalLearningSolutions.Data/DataServices/UserDataService/DelegateUserCardDataService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ public List<DelegateUserCard> GetDelegateUserCardsForExportByCentreId(String sea
352352

353353
if (sortBy == "SearchableName")
354354
orderBy = " ORDER BY LTRIM(LastName) " + sortDirection + ", LTRIM(FirstName) ";
355+
else if(sortBy == "LastAccessed")
356+
orderBy = " ORDER BY LastAccessed " + sortDirection;
355357
else
356358
orderBy = " ORDER BY DateRegistered " + sortDirection;
357359

DigitalLearningSolutions.Data/Helpers/GenericSortingHelper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ public static class DelegateSortByOptions
250250
public static readonly (string DisplayText, string PropertyName) Name =
251251
("Name", nameof(DelegateUserCard.SearchableName));
252252

253+
public static readonly (string DisplayText, string PropertyName) LastAccessed =
254+
("Last Accessed Date", nameof(DelegateUserCard.LastAccessed));
255+
253256
public static readonly (string DisplayText, string PropertyName) RegistrationDate =
254257
("Registration Date", nameof(DelegateUserCard.DateRegistered));
255258
}

DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Delegates/AllDelegates/AllDelegatesViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ IEnumerable<FilterModel> availableFilters
4444
public override IEnumerable<(string, string)> SortOptions { get; } = new[]
4545
{
4646
DelegateSortByOptions.Name,
47+
DelegateSortByOptions.LastAccessed,
4748
DelegateSortByOptions.RegistrationDate,
4849
};
4950

0 commit comments

Comments
 (0)