|
|
@ -4,7 +4,6 @@ |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import type { ProjectResult } from "../models/project"; |
|
|
|
import selectionStore from "../stores/selection"; |
|
|
|
import ProjectEntry from "./ProjectEntry.svelte"; |
|
|
|
import QlList from "./QLList.svelte"; |
|
|
|
import Boi from "../components/Boi.svelte"; |
|
|
@ -23,7 +22,7 @@ |
|
|
|
let mdGroupEdit: ModalData = {name: "projectgroup.edit", projectGroup: {} as ProjectGroup}; |
|
|
|
let mdGroupDelete: ModalData = {name: "projectgroup.delete", projectGroup: {} as ProjectGroup}; |
|
|
|
|
|
|
|
let projects: ProjectResult[] = []; |
|
|
|
let visibleProjects: ProjectResult[] = []; |
|
|
|
let expiringProjects: ProjectResult[]; |
|
|
|
let activeProjects: ProjectResult[]; |
|
|
|
let inactiveProjects: ProjectResult[]; |
|
|
@ -31,7 +30,7 @@ |
|
|
|
let failedProjects: ProjectResult[]; |
|
|
|
let onholdProjects: ProjectResult[]; |
|
|
|
let ideaProjects: ProjectResult[]; |
|
|
|
let project: ProjectResult = null; |
|
|
|
let selectedProject: ProjectResult = null; |
|
|
|
let selectedGroup: ProjectGroupResult | null = null; |
|
|
|
|
|
|
|
function sortProjects(a: ProjectResult, b: ProjectResult) { |
|
|
@ -49,24 +48,22 @@ |
|
|
|
} |
|
|
|
|
|
|
|
$: selectedGroup = groups.find(g => g.id === groupId) |
|
|
|
$: projects = selectedGroup?.projects || []; |
|
|
|
$: visibleProjects = selectedGroup?.projects || []; |
|
|
|
$: selectedProject = visibleProjects.find(p => p.id === projectId) || null; |
|
|
|
|
|
|
|
$: mdProjectAdd = { name: "project.add", groupId: groupId } |
|
|
|
$: mdGroupEdit = { name: "projectgroup.edit", projectGroup: selectedGroup } |
|
|
|
$: mdGroupDelete = { name: "projectgroup.delete", projectGroup: selectedGroup } |
|
|
|
|
|
|
|
$: 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)); |
|
|
|
$: activeProjects = projects.filter(p => p.active && !p.endTime).sort(sortProjects); |
|
|
|
$: inactiveProjects = projects.filter(p => !p.active).sort(sortProjects); |
|
|
|
$: expiringProjects = visibleProjects.filter(p => p.active && p.endTime).sort((a,b) => Date.parse(a.endTime) - Date.parse(b.endTime)); |
|
|
|
$: activeProjects = visibleProjects.filter(p => p.active && !p.endTime).sort(sortProjects); |
|
|
|
$: inactiveProjects = visibleProjects.filter(p => !p.active).sort(sortProjects); |
|
|
|
$: completedProjects = inactiveProjects.filter(p => p.statusTag === "completed" || p.statusTag == null); |
|
|
|
$: failedProjects = inactiveProjects.filter(p => p.statusTag === "failed" || p.statusTag === "declined"); |
|
|
|
$: 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); |
|
|
|
|
|
|
|
$: project = selectedGroup?.projects.find(p => p.id === projectId) || null; |
|
|
|
</script> |
|
|
|
|
|
|
|
<ProjectGroupMenu selected={groupId} groups={groups} /> |
|
|
@ -80,18 +77,18 @@ |
|
|
|
</OptionRow> |
|
|
|
{/if} |
|
|
|
<Boi compacter open={mdProjectAdd}>Add Project</Boi> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["deadlines"] || "Deadlines"} projects={expiringProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["active"] || "Active"} projects={activeProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["background"] || "Background"} projects={backgroundProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["progress"] || "Progress"} projects={progressProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["to do"] || "To Do"} projects={ideaProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["on hold"] || "On Hold"} projects={onholdProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["completed"] || "Completed"} projects={completedProjects} /> |
|
|
|
<QlList selected={project?.id} label={selectedGroup?.categoryNames["failed"] || "Failed"} projects={failedProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["deadlines"] || "Deadlines"} projects={expiringProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["active"] || "Active"} projects={activeProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["background"] || "Background"} projects={backgroundProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["progress"] || "Progress"} projects={progressProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["to do"] || "To Do"} projects={ideaProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["on hold"] || "On Hold"} projects={onholdProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["completed"] || "Completed"} projects={completedProjects} /> |
|
|
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["failed"] || "Failed"} projects={failedProjects} /> |
|
|
|
</div> |
|
|
|
<div class="body"> |
|
|
|
{#if project != null} |
|
|
|
<ProjectEntry removeHook hideIcon project={project} showAllOptions /> |
|
|
|
{#if selectedProject != null} |
|
|
|
<ProjectEntry removeHook hideIcon project={selectedProject} showAllOptions /> |
|
|
|
{/if} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|