fix project links in goals not using new path format.
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { Link } from "svelte-routing";
|
||||||
|
|
||||||
import type { GoalCompositionMode } from "../models/goal";
|
import type { GoalCompositionMode } from "../models/goal";
|
||||||
import type { LogResult } from "../models/log";
|
import type { LogResult } from "../models/log";
|
||||||
|
|
||||||
@@ -60,7 +62,7 @@
|
|||||||
const amount = calculateAmount(log, unweighted);
|
const amount = calculateAmount(log, unweighted);
|
||||||
|
|
||||||
if (!map[project.id]) {
|
if (!map[project.id]) {
|
||||||
map[project.id] = {name: project.name, amount, link: `/questlog#${project.id}`};
|
map[project.id] = {name: project.name, amount, link: `/questlog/${project.groupId}/${project.id}`};
|
||||||
} else {
|
} else {
|
||||||
map[project.id].amount += amount;
|
map[project.id].amount += amount;
|
||||||
}
|
}
|
||||||
@@ -72,7 +74,7 @@
|
|||||||
const amount = calculateAmount(log, unweighted);
|
const amount = calculateAmount(log, unweighted);
|
||||||
|
|
||||||
if (!map[task.id]) {
|
if (!map[task.id]) {
|
||||||
map[task.id] = {name: task.name, amount, link: `/questlog#${task.projectId}`};
|
map[task.id] = {name: task.name, amount, link: `/questlog/${task.project.groupId}/${task.projectId}`};
|
||||||
} else {
|
} else {
|
||||||
map[task.id].amount += amount;
|
map[task.id].amount += amount;
|
||||||
}
|
}
|
||||||
@@ -87,7 +89,7 @@
|
|||||||
{#each list as item}
|
{#each list as item}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="amount">{item.amount}x </span>
|
<span class="amount">{item.amount}x </span>
|
||||||
<a href={item.link}>{item.name}</a>
|
<Link to={item.link}>{item.name}</Link>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
@@ -108,7 +110,7 @@
|
|||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
div.item :global(a) {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { ProjectResult } from "../models/project";
|
import type { ProjectResult } from "../models/project";
|
||||||
import selectionStore from "../stores/selection";
|
|
||||||
import ProjectEntry from "./ProjectEntry.svelte";
|
import ProjectEntry from "./ProjectEntry.svelte";
|
||||||
import QlList from "./QLList.svelte";
|
import QlList from "./QLList.svelte";
|
||||||
import Boi from "../components/Boi.svelte";
|
import Boi from "../components/Boi.svelte";
|
||||||
@@ -23,7 +22,7 @@
|
|||||||
let mdGroupEdit: ModalData = {name: "projectgroup.edit", projectGroup: {} as ProjectGroup};
|
let mdGroupEdit: ModalData = {name: "projectgroup.edit", projectGroup: {} as ProjectGroup};
|
||||||
let mdGroupDelete: ModalData = {name: "projectgroup.delete", projectGroup: {} as ProjectGroup};
|
let mdGroupDelete: ModalData = {name: "projectgroup.delete", projectGroup: {} as ProjectGroup};
|
||||||
|
|
||||||
let projects: ProjectResult[] = [];
|
let visibleProjects: ProjectResult[] = [];
|
||||||
let expiringProjects: ProjectResult[];
|
let expiringProjects: ProjectResult[];
|
||||||
let activeProjects: ProjectResult[];
|
let activeProjects: ProjectResult[];
|
||||||
let inactiveProjects: ProjectResult[];
|
let inactiveProjects: ProjectResult[];
|
||||||
@@ -31,7 +30,7 @@
|
|||||||
let failedProjects: ProjectResult[];
|
let failedProjects: ProjectResult[];
|
||||||
let onholdProjects: ProjectResult[];
|
let onholdProjects: ProjectResult[];
|
||||||
let ideaProjects: ProjectResult[];
|
let ideaProjects: ProjectResult[];
|
||||||
let project: ProjectResult = null;
|
let selectedProject: ProjectResult = null;
|
||||||
let selectedGroup: ProjectGroupResult | null = null;
|
let selectedGroup: ProjectGroupResult | null = null;
|
||||||
|
|
||||||
function sortProjects(a: ProjectResult, b: ProjectResult) {
|
function sortProjects(a: ProjectResult, b: ProjectResult) {
|
||||||
@@ -49,24 +48,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: selectedGroup = groups.find(g => g.id === groupId)
|
$: 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 }
|
$: mdProjectAdd = { name: "project.add", groupId: groupId }
|
||||||
$: mdGroupEdit = { name: "projectgroup.edit", projectGroup: selectedGroup }
|
$: mdGroupEdit = { name: "projectgroup.edit", projectGroup: selectedGroup }
|
||||||
$: mdGroupDelete = { name: "projectgroup.delete", projectGroup: selectedGroup }
|
$: mdGroupDelete = { name: "projectgroup.delete", projectGroup: selectedGroup }
|
||||||
|
|
||||||
$: project = $selectionStore.hash.startsWith("P") ? projects.find(p => p.id === $selectionStore.hash) : null;
|
$: expiringProjects = visibleProjects.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 = visibleProjects.filter(p => p.active && !p.endTime).sort(sortProjects);
|
||||||
$: activeProjects = projects.filter(p => p.active && !p.endTime).sort(sortProjects);
|
$: inactiveProjects = visibleProjects.filter(p => !p.active).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").sort(sortProjects);
|
$: 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);
|
$: ideaProjects = inactiveProjects.filter(p => p.statusTag === "to do" || p.statusTag === "idea").sort(sortProjects);
|
||||||
$: backgroundProjects = inactiveProjects.filter(p => p.statusTag === "background").sort(sortProjects);
|
$: backgroundProjects = inactiveProjects.filter(p => p.statusTag === "background").sort(sortProjects);
|
||||||
$: progressProjects = inactiveProjects.filter(p => p.statusTag === "progress").sort(sortProjects);
|
$: progressProjects = inactiveProjects.filter(p => p.statusTag === "progress").sort(sortProjects);
|
||||||
|
|
||||||
$: project = selectedGroup?.projects.find(p => p.id === projectId) || null;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ProjectGroupMenu selected={groupId} groups={groups} />
|
<ProjectGroupMenu selected={groupId} groups={groups} />
|
||||||
@@ -80,18 +77,18 @@
|
|||||||
</OptionRow>
|
</OptionRow>
|
||||||
{/if}
|
{/if}
|
||||||
<Boi compacter open={mdProjectAdd}>Add Project</Boi>
|
<Boi compacter open={mdProjectAdd}>Add Project</Boi>
|
||||||
<QlList selected={project?.id} label={selectedGroup?.categoryNames["deadlines"] || "Deadlines"} projects={expiringProjects} />
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["deadlines"] || "Deadlines"} projects={expiringProjects} />
|
||||||
<QlList selected={project?.id} label={selectedGroup?.categoryNames["active"] || "Active"} projects={activeProjects} />
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["active"] || "Active"} projects={activeProjects} />
|
||||||
<QlList selected={project?.id} label={selectedGroup?.categoryNames["background"] || "Background"} projects={backgroundProjects} />
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["background"] || "Background"} projects={backgroundProjects} />
|
||||||
<QlList selected={project?.id} label={selectedGroup?.categoryNames["progress"] || "Progress"} projects={progressProjects} />
|
<QlList selected={selectedProject?.id} label={selectedGroup?.categoryNames["progress"] || "Progress"} projects={progressProjects} />
|
||||||
<QlList selected={project?.id} label={selectedGroup?.categoryNames["to do"] || "To Do"} projects={ideaProjects} />
|
<QlList selected={selectedProject?.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={selectedProject?.id} label={selectedGroup?.categoryNames["on hold"] || "On Hold"} projects={onholdProjects} />
|
||||||
<QlList selected={project?.id} label={selectedGroup?.categoryNames["completed"] || "Completed"} projects={completedProjects} />
|
<QlList selected={selectedProject?.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["failed"] || "Failed"} projects={failedProjects} />
|
||||||
</div>
|
</div>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
{#if project != null}
|
{#if selectedProject != null}
|
||||||
<ProjectEntry removeHook hideIcon project={project} showAllOptions />
|
<ProjectEntry removeHook hideIcon project={selectedProject} showAllOptions />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user