@harborppm/cli 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.mjs +25 -9
- package/package.json +1 -1
package/dist/app.mjs
CHANGED
|
@@ -3348,19 +3348,23 @@ function RowList({ title, right, rows, empty, active, width, height, onOpen, key
|
|
|
3348
3348
|
]
|
|
3349
3349
|
});
|
|
3350
3350
|
}
|
|
3351
|
-
/** Every project, under its program and portfolio, with health and progress.
|
|
3351
|
+
/** Every project, under its program and portfolio, with health and progress. Done
|
|
3352
|
+
* projects and programs stay out of the way until D shows them. */
|
|
3352
3353
|
function ProjectsView({ active, width, height, go }) {
|
|
3353
3354
|
const portfolios = useHarbor((s) => s.portfolios);
|
|
3354
3355
|
const programs = useHarbor((s) => s.programs);
|
|
3355
3356
|
const projects = useHarbor((s) => s.projects);
|
|
3356
3357
|
const tasks = useHarbor((s) => s.tasks);
|
|
3357
3358
|
const { today } = useDeps();
|
|
3358
|
-
const
|
|
3359
|
+
const [showDone, setShowDone] = useState(false);
|
|
3360
|
+
const { rows, shown, hidden } = useMemo(() => {
|
|
3359
3361
|
const data = {
|
|
3360
3362
|
tasks,
|
|
3361
3363
|
projects
|
|
3362
3364
|
};
|
|
3363
3365
|
const out = [];
|
|
3366
|
+
let shown = 0;
|
|
3367
|
+
let hidden = 0;
|
|
3364
3368
|
for (const portfolio of portfolios) {
|
|
3365
3369
|
out.push({
|
|
3366
3370
|
id: portfolio.id,
|
|
@@ -3371,6 +3375,11 @@ function ProjectsView({ active, width, height, go }) {
|
|
|
3371
3375
|
health: portfolio.health
|
|
3372
3376
|
});
|
|
3373
3377
|
for (const program of programs.filter((g) => g.portfolioId === portfolio.id)) {
|
|
3378
|
+
const { open, done } = splitDone(projects.filter((p) => p.programId === program.id));
|
|
3379
|
+
if (program.health === "done" && open.length === 0) {
|
|
3380
|
+
hidden += 1 + done.length;
|
|
3381
|
+
if (!showDone) continue;
|
|
3382
|
+
} else hidden += done.length;
|
|
3374
3383
|
out.push({
|
|
3375
3384
|
id: program.id,
|
|
3376
3385
|
kind: "program",
|
|
@@ -3378,8 +3387,9 @@ function ProjectsView({ active, width, height, go }) {
|
|
|
3378
3387
|
title: program.name,
|
|
3379
3388
|
health: program.health
|
|
3380
3389
|
});
|
|
3381
|
-
for (const project of
|
|
3382
|
-
|
|
3390
|
+
for (const project of showDone ? [...open, ...done] : open) {
|
|
3391
|
+
shown++;
|
|
3392
|
+
const { done: finished, total } = projectSummary(data, project);
|
|
3383
3393
|
const late = tasksOf(tasks, project.id).filter((t) => isLate(t, today())).length;
|
|
3384
3394
|
out.push({
|
|
3385
3395
|
id: project.id,
|
|
@@ -3387,22 +3397,27 @@ function ProjectsView({ active, width, height, go }) {
|
|
|
3387
3397
|
depth: 2,
|
|
3388
3398
|
title: `${project.name}${project.key ? ` ${project.key}` : ""}`,
|
|
3389
3399
|
health: project.health,
|
|
3390
|
-
detail: `${
|
|
3400
|
+
detail: `${finished}/${total} done${late ? ` · ${late} late` : ""} · ends ${shortDay(project.endDate, today())}`
|
|
3391
3401
|
});
|
|
3392
3402
|
}
|
|
3393
3403
|
}
|
|
3394
3404
|
}
|
|
3395
|
-
return
|
|
3405
|
+
return {
|
|
3406
|
+
rows: out,
|
|
3407
|
+
shown,
|
|
3408
|
+
hidden
|
|
3409
|
+
};
|
|
3396
3410
|
}, [
|
|
3397
3411
|
portfolios,
|
|
3398
3412
|
programs,
|
|
3399
3413
|
projects,
|
|
3400
3414
|
tasks,
|
|
3401
|
-
today
|
|
3415
|
+
today,
|
|
3416
|
+
showDone
|
|
3402
3417
|
]);
|
|
3403
3418
|
return /* @__PURE__ */ jsx(RowList, {
|
|
3404
3419
|
title: "Portfolios, programs and projects",
|
|
3405
|
-
right: `${count(
|
|
3420
|
+
right: `${count(shown, "project")}${hidden ? ` · ${hidden} done ${showDone ? "shown" : "hidden"} (D)` : ""} · n new project · e edit`,
|
|
3406
3421
|
rows,
|
|
3407
3422
|
empty: "No projects yet. n adds one.",
|
|
3408
3423
|
active,
|
|
@@ -3414,7 +3429,8 @@ function ProjectsView({ active, width, height, go }) {
|
|
|
3414
3429
|
const programId = r?.kind === "program" ? r.id : r?.kind === "project" ? projects.find((p) => p.id === r.id)?.programId : void 0;
|
|
3415
3430
|
go.create("project", programId ? { programId } : {});
|
|
3416
3431
|
},
|
|
3417
|
-
e: (r) => r && r.kind !== "raid" && r.kind !== "person" && go.openPanel(r.kind, r.id)
|
|
3432
|
+
e: (r) => r && r.kind !== "raid" && r.kind !== "person" && go.openPanel(r.kind, r.id),
|
|
3433
|
+
D: () => hidden > 0 && setShowDone((v) => !v)
|
|
3418
3434
|
}
|
|
3419
3435
|
});
|
|
3420
3436
|
}
|