mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
dd0542d468
commit
d937bd0fd8
4 changed files with 39 additions and 21 deletions
|
|
@ -23,7 +23,16 @@ public ListDetailsDtoMappingProfile() =>
|
|||
.SnapshotRules
|
||||
.Count
|
||||
: 0))
|
||||
.ForMember(d => d.UpdatedDate, o => o.MapFrom(l => l.ModifiedDateUtc))
|
||||
.ForMember(d => d.UpdatedDate,
|
||||
o => o.MapFrom(l =>
|
||||
l.Snapshots
|
||||
.Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2
|
||||
? l.Snapshots
|
||||
.Where(s => s.WasSuccessful && s.Md5Checksum != null)
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(c => c)
|
||||
.FirstOrDefault()
|
||||
: null))
|
||||
.ForMember(d => d.ViewUrl,
|
||||
o => o.MapFrom(l =>
|
||||
l.Snapshots
|
||||
|
|
|
|||
|
|
@ -12,7 +12,16 @@ public ListSummaryDtoMappingProfile() =>
|
|||
CreateMap<Data.Entities.FilterList, ListSummaryDto>()
|
||||
.ForMember(d => d.Languages, o => o.MapFrom(l => l.FilterListLanguages.Select(la => la.Language)))
|
||||
.ForMember(d => d.Tags, o => o.MapFrom(l => l.FilterListTags.Select(m => m.Tag)))
|
||||
.ForMember(d => d.UpdatedDate, o => o.MapFrom(l => l.ModifiedDateUtc))
|
||||
.ForMember(d => d.UpdatedDate,
|
||||
o => o.MapFrom(l =>
|
||||
l.Snapshots
|
||||
.Count(s => s.WasSuccessful && s.Md5Checksum != null) >= 2
|
||||
? l.Snapshots
|
||||
.Where(s => s.WasSuccessful && s.Md5Checksum != null)
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(c => c)
|
||||
.FirstOrDefault()
|
||||
: null))
|
||||
.ForMember(d => d.ViewUrl,
|
||||
o => o.MapFrom(l =>
|
||||
l.Snapshots
|
||||
|
|
|
|||
|
|
@ -122,22 +122,22 @@ export class Home extends React.Component<RouteComponentProps<{}>, IHomeState> {
|
|||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block"
|
||||
},
|
||||
//{
|
||||
// Header: "Updated",
|
||||
// accessor: "updatedDate",
|
||||
// filterable: true,
|
||||
// filterMethod: (filter: any, row: any) => row[filter.id].includes(filter.value),
|
||||
// sortMethod: (a: any, b: any) => moment(a).isValid()
|
||||
// ? (moment(b).isValid() ? (moment(a).isBefore(b) ? -1 : 1) : 1)
|
||||
// : -1,
|
||||
// Cell: (cell: any) => <div>{moment(cell.value).isValid()
|
||||
// ? moment(cell.value).format("l")
|
||||
// : "N/A"}</div>,
|
||||
// style: { whiteSpace: "inherit" },
|
||||
// width: 100,
|
||||
// headerClassName: "d-none d-md-block",
|
||||
// className: "d-none d-md-block"
|
||||
//},
|
||||
{
|
||||
Header: "Updated",
|
||||
accessor: "updatedDate",
|
||||
filterable: true,
|
||||
filterMethod: (filter: any, row: any) => row[filter.id].includes(filter.value),
|
||||
sortMethod: (a: any, b: any) => moment(a).isValid()
|
||||
? (moment(b).isValid() ? (moment(a).isBefore(b) ? -1 : 1) : 1)
|
||||
: -1,
|
||||
Cell: (cell: any) => <div>{moment(cell.value).isValid()
|
||||
? moment(cell.value).fromNow()
|
||||
: "N/A"}</div>,
|
||||
style: { whiteSpace: "inherit" },
|
||||
width: 100,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block"
|
||||
},
|
||||
{
|
||||
Header: "Details",
|
||||
accessor: "id",
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ function ListInfo(props: any) {
|
|||
<Languages languages={props.details.languages}/>
|
||||
<RuleCount count={props.details.ruleCount}/>
|
||||
<DiscontinuedDate date={props.details.discontinuedDate}/>
|
||||
{ /* <UpdatedDate date={props.details.updatedDate}/>--> */ }
|
||||
<UpdatedDate date={props.details.updatedDate}/>
|
||||
<PublishedDate date={props.details.publishedDate}/>
|
||||
<License license={props.details.license}/>
|
||||
</ul>
|
||||
|
|
@ -141,8 +141,8 @@ function DiscontinuedDate(props: any) {
|
|||
|
||||
function UpdatedDate(props: any) {
|
||||
return props.date
|
||||
? <li className="list-group-item">
|
||||
<p>Last Updated by Maintainer: {moment(props.date).format("l")}</p>
|
||||
? <li className="d-md-none list-group-item">
|
||||
<p>Last Updated: {moment(props.date).isValid() ? moment(props.date).fromNow() : "N/A"}</p>
|
||||
</li>
|
||||
: null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue