mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add addedDate to details
This commit is contained in:
parent
7189f2ead0
commit
74eabf7db4
4 changed files with 16 additions and 4 deletions
|
|
@ -75,7 +75,7 @@ await DbContext.Snapshots.AsNoTracking()
|
|||
.CountAsync();
|
||||
}
|
||||
|
||||
private async Task<DateTime?> GetUpdatedDate(ListDetailsDto details)
|
||||
private async Task<DateTime> GetUpdatedDate(ListDetailsDto details)
|
||||
{
|
||||
return await DbContext.Snapshots.AsNoTracking()
|
||||
.Where(s => s.FilterListId == details.Id && s.IsCompleted &&
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ namespace FilterLists.Services.FilterList
|
|||
public class ListDetailsDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime AddedDate { get; set; }
|
||||
public string ChatUrl { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string DescriptionSourceUrl { get; set; }
|
||||
|
|
@ -26,7 +27,7 @@ public class ListDetailsDto
|
|||
public int RuleCount { get; set; }
|
||||
public string SubmissionUrl { get; set; }
|
||||
public ListSyntaxDto Syntax { get; set; }
|
||||
public DateTime? UpdatedDate { get; set; }
|
||||
public DateTime UpdatedDate { get; set; }
|
||||
public string ViewUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,8 @@ public MappingProfiles()
|
|||
conf => conf.MapFrom(list => list.FilterListLanguages.Select(listLangs => listLangs.Language.Name)))
|
||||
.ForMember(dto => dto.Maintainers,
|
||||
conf => conf.MapFrom(list =>
|
||||
list.FilterListMaintainers.Select(listMaints => listMaints.Maintainer)));
|
||||
list.FilterListMaintainers.Select(listMaints => listMaints.Maintainer)))
|
||||
.ForMember(dto => dto.AddedDate, conf => conf.MapFrom(list => list.CreatedDateUtc));
|
||||
CreateMap<Maintainer, ListMaintainerDto>()
|
||||
.ForMember(dto => dto.AdditionalLists,
|
||||
conf => conf.MapFrom(maint =>
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ function ListInfo(props: any) {
|
|||
<RuleCount count={props.details.ruleCount}/>
|
||||
<DiscontinuedDate date={props.details.discontinuedDate}/>
|
||||
<UpdatedDate date={props.details.updatedDate}/>
|
||||
<AddedDate date={props.details.addedDate}/>
|
||||
<PublishedDate date={props.details.publishedDate}/>
|
||||
<License license={props.details.license}/>
|
||||
</ul>
|
||||
|
|
@ -122,7 +123,15 @@ function DiscontinuedDate(props: any) {
|
|||
function UpdatedDate(props: any) {
|
||||
return props.date
|
||||
? <li className="list-group-item">
|
||||
<p>Updated: {moment(props.date).format("MMM D, Y")}</p>
|
||||
<p>Last Updated: {moment(props.date).format("MMM D, Y")}</p>
|
||||
</li>
|
||||
: null;
|
||||
}
|
||||
|
||||
function AddedDate(props: any) {
|
||||
return props.date
|
||||
? <li className="list-group-item">
|
||||
<p>Added to FilterLists: {moment(props.date).format("MMM D, Y")}</p>
|
||||
</li>
|
||||
: null;
|
||||
}
|
||||
|
|
@ -301,6 +310,7 @@ function MaintainerUrls(props: any) {
|
|||
}
|
||||
|
||||
interface IFilterListDetailsDto {
|
||||
addedDate: string;
|
||||
chatUrl: string;
|
||||
description: string;
|
||||
descriptionSourceUrl: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue