From adec87d83ebfea34d019eb4f4c939e99b4a9cea8 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Fri, 24 Aug 2018 13:41:22 -0500 Subject: [PATCH] re-enable rule count --- .../MappingProfiles/ListDetailsDtoMappingProfile.cs | 7 ++++++- .../MappingProfiles/ListSummaryDtoMappingProfile.cs | 4 +--- src/FilterLists.Web/ClientApp/components/ListDetails.tsx | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs index 145ca8bd6..9cfe4d92e 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/ListDetailsDtoMappingProfile.cs @@ -15,7 +15,12 @@ public ListDetailsDtoMappingProfile() => .ForMember(d => d.Maintainers, c => c.MapFrom(l => l.FilterListMaintainers.Select(m => m.Maintainer))) .ForMember(d => d.Tags, c => c.MapFrom(l => l.FilterListTags.Select(m => m.Tag))) .ForMember(d => d.RuleCount, - c => c.MapFrom(l => 0)) + c => c.MapFrom(l => + l.Snapshots + .OrderByDescending(s => s.CreatedDateUtc) + .FirstOrDefault() + .SnapshotRules + .Count)) .ForMember(d => d.UpdatedDate, c => c.MapFrom(l => l.ModifiedDateUtc)); diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs index 888b0f527..3a4274cbe 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/ListSummaryDtoMappingProfile.cs @@ -13,8 +13,6 @@ public ListSummaryDtoMappingProfile() => CreateMap() .ForMember(d => d.Languages, c => c.MapFrom(l => l.FilterListLanguages.Select(la => la.Language))) .ForMember(d => d.Tags, c => c.MapFrom(l => l.FilterListTags.Select(m => m.Tag))) - .ForMember(d => d.UpdatedDate, - c => c.MapFrom(l => - l.ModifiedDateUtc)); + .ForMember(d => d.UpdatedDate, c => c.MapFrom(l => l.ModifiedDateUtc)); } } \ No newline at end of file diff --git a/src/FilterLists.Web/ClientApp/components/ListDetails.tsx b/src/FilterLists.Web/ClientApp/components/ListDetails.tsx index 54fdcc2de..98c219792 100644 --- a/src/FilterLists.Web/ClientApp/components/ListDetails.tsx +++ b/src/FilterLists.Web/ClientApp/components/ListDetails.tsx @@ -54,9 +54,9 @@ function ListInfo(props: any) {
    - {/* */} + - {/* --> */} + { /* --> */ }