From cef66f2bd4f11719698c5d7b7d87e0adadb5160c Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sun, 2 Mar 2025 16:08:14 +0100 Subject: [PATCH] made parent empty lines hidden --- dispatcher/static/table.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/dispatcher/static/table.js b/dispatcher/static/table.js index e2fa788..f958510 100644 --- a/dispatcher/static/table.js +++ b/dispatcher/static/table.js @@ -241,18 +241,20 @@ class Table { } }) - this.addProject( - parent.id, - parent.name, - parent.project_num, - parentDurations.map(v => v === 0 ? "" : v), - true, - parent.is_productive - ) + if (parentDurations.reduce((a, b) => a + b, 0) !== 0) { + this.addProject( + parent.id, + parent.name, + parent.project_num, + parentDurations.map(v => v === 0 ? "" : v), + true, + parent.is_productive + ) - projects.filter(p => p.total !== 0).forEach(project => { - this.addProject(project.id, project.name, "", project.durations) - }) + projects.filter(p => p.total !== 0).forEach(project => { + this.addProject(project.id, project.name, "", project.durations) + }) + } }) this.updateTotals() }