|
@ -23,16 +23,25 @@ |
|
|
let ideaProjects: ProjectResult[]; |
|
|
let ideaProjects: ProjectResult[]; |
|
|
let project: ProjectResult = null; |
|
|
let project: ProjectResult = null; |
|
|
|
|
|
|
|
|
|
|
|
function sortProjects(a: ProjectResult, b: ProjectResult) { |
|
|
|
|
|
const aName = `${a.tags.slice(0, 1).map(t => t+":").join("")} ${a.name}`.trim(); |
|
|
|
|
|
const bName = `${b.tags.slice(0, 1).map(t => t+":").join("")} ${b.name}`.trim(); |
|
|
|
|
|
|
|
|
|
|
|
console.log(aName, bName) |
|
|
|
|
|
|
|
|
|
|
|
return aName.localeCompare(bName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$: project = $selectionStore.hash.startsWith("P") ? projects.find(p => p.id === $selectionStore.hash) : null; |
|
|
$: project = $selectionStore.hash.startsWith("P") ? projects.find(p => p.id === $selectionStore.hash) : null; |
|
|
$: expiringProjects = projects.filter(p => p.active && p.endTime).sort((a,b) => Date.parse(a.endTime) - Date.parse(b.endTime)); |
|
|
$: expiringProjects = projects.filter(p => p.active && p.endTime).sort((a,b) => Date.parse(a.endTime) - Date.parse(b.endTime)); |
|
|
$: activeProjects = projects.filter(p => p.active && !p.endTime).sort((a,b) => a.name.localeCompare(b.name)); |
|
|
|
|
|
$: inactiveProjects = projects.filter(p => !p.active).sort((a,b) => a.name.localeCompare(b.name)); |
|
|
|
|
|
|
|
|
$: activeProjects = projects.filter(p => p.active && !p.endTime).sort(sortProjects); |
|
|
|
|
|
$: inactiveProjects = projects.filter(p => !p.active).sort(sortProjects); |
|
|
$: completedProjects = inactiveProjects.filter(p => p.statusTag === "completed" || p.statusTag == null); |
|
|
$: completedProjects = inactiveProjects.filter(p => p.statusTag === "completed" || p.statusTag == null); |
|
|
$: failedProjects = inactiveProjects.filter(p => p.statusTag === "failed" || p.statusTag === "declined"); |
|
|
$: failedProjects = inactiveProjects.filter(p => p.statusTag === "failed" || p.statusTag === "declined"); |
|
|
$: onholdProjects = inactiveProjects.filter(p => p.statusTag === "on hold" || p.statusTag === "onhold"); |
|
|
|
|
|
$: ideaProjects = inactiveProjects.filter(p => p.statusTag === "to do" || p.statusTag === "idea"); |
|
|
|
|
|
$: backgroundProjects = inactiveProjects.filter(p => p.statusTag === "background"); |
|
|
|
|
|
$: progressProjects = inactiveProjects.filter(p => p.statusTag === "progress"); |
|
|
|
|
|
|
|
|
$: onholdProjects = inactiveProjects.filter(p => p.statusTag === "on hold" || p.statusTag === "onhold").sort(sortProjects); |
|
|
|
|
|
$: ideaProjects = inactiveProjects.filter(p => p.statusTag === "to do" || p.statusTag === "idea").sort(sortProjects); |
|
|
|
|
|
$: backgroundProjects = inactiveProjects.filter(p => p.statusTag === "background").sort(sortProjects); |
|
|
|
|
|
$: progressProjects = inactiveProjects.filter(p => p.statusTag === "progress").sort(sortProjects); |
|
|
|
|
|
|
|
|
$: { |
|
|
$: { |
|
|
if (project === null && projects.length > 0) { |
|
|
if (project === null && projects.length > 0) { |
|
|