Files

2.3 KiB

tags, type
tags type
process/goal
Leben

[!note]+ Ziel Progress:: $= dv.view('progress', {file: 'Wohnung'}) Target:: $= dv.view('target', {file: 'Wohnung'}) Bar:: $= dv.view('total-progress-bar', {file: 'Wohnung'}) Projects:: $= const projects = dv.page('Wohnung').file.inlinks.where(p => { const mp = dv.page(p.path); return mp.tags?.includes('process/project') && mp.status != 'Archiv'}); if (projects.length > 0) { dv.header(4, projects.length > 1 ? "Projects" : "Project"); dv.list(projects) }

Wie sieht der Erfolg aus? Was soll erreicht werden?

Projekte, um das Ziel zu erreichen

Ideen

  • Baumarkt: Paulownia Holz erfragen
  • Kann Martin Transporte übernehmen? [start:: 2022-10-25] [scheduled:: 2022-10-27] [completion:: 2023-07-12]

Offene Projekte

const pages = dv.current().file.inlinks.where(p => dv.page(p.path).tags?.includes('process/project'));

let projects = new Set();
for (let projectPage of pages) {
    const page = dv.page(projectPage.path);
    const tasks = page.file.inlinks.where((p) => {
        const mp = dv.page(p.path);
        return mp.tags?.includes("process/task");
    });
    const totalProjectTasks = page.file.tasks.length;
    const totalProjectTasksCompleted = page.file.tasks.where(t => t.fullyCompleted === true).length;
    let totalTasksCompleted = 0;
    let totalTasks = 0;
    tasks.values.reduce((acc, p) => {
        const mp = dv.page(p.path);
        totalTasksCompleted += mp.file.tasks.where( (t) => t.fullyCompleted === true).length;
        totalTasks += mp.file.tasks.length;
        return mp.file.tasks.length;
    }, 0);
    const progress = totalProjectTasksCompleted + totalTasksCompleted;
    const total = totalProjectTasks + totalTasks;
    if (progress != total) {
        projects.add([page.file.link, page.status, progress, total]);
    }
}

dv.table(["Project", "Status", "Completed", "Tasks"], Array.from(projects));

Projekte

const pages = dv.current().file.inlinks.where(p => dv.page(p.path).tags?.includes('process/project'));

dv.table(["Project", "Status", "Completed", "Tasks"], pages.map(p => {
	const page = dv.page(p.path);
	const tasks = page.file.tasks;
	return [
		page.file.link,
		page.status,
		tasks.where(t => t.fullyCompleted === true).length,
		tasks.length
	]
}));