From 3d1f479d5cbf9f47b64df86a84506ab1d8e48367 Mon Sep 17 00:00:00 2001 From: Jan Koehnlein Date: Wed, 6 Oct 2021 14:40:39 +0000 Subject: [PATCH] [dashboard] sort projects by activity --- components/dashboard/src/projects/Projects.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/dashboard/src/projects/Projects.tsx b/components/dashboard/src/projects/Projects.tsx index f70f59fd60ba7b..4649b7a0450e1e 100644 --- a/components/dashboard/src/projects/Projects.tsx +++ b/components/dashboard/src/projects/Projects.tsx @@ -73,6 +73,10 @@ export default function () { return true; } + function hasNewerPrebuild(p0: Project, p1: Project): number { + return moment(lastPrebuilds.get(p1.id)?.info?.startedAt || '1970-01-01').diff(moment(lastPrebuilds.get(p0.id)?.info?.startedAt || '1970-01-01')); + } + const teamOrUserSlug = !!team ? 't/'+team.slug : 'projects'; return <> @@ -105,7 +109,7 @@ export default function () {
- {projects.filter(filter).map(p => (
+ {projects.filter(filter).sort(hasNewerPrebuild).map(p => (