create-pmos 0.421.0 → 0.423.0
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/package.json +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/anchor-resolve.js +93 -15
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +87 -3
- package/workspace/briefing-premium-adddoc-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +13 -11
- package/workspace/briefing-premium-initiative-test.js +30 -38
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/report-api/draft.json +2 -1
- package/workspace/guide/briefing-premium.md +2 -1
- package/workspace/guide/home.md +14 -4
- package/workspace/guide/programs.md +5 -3
- package/workspace/guide/workflows.md +5 -1
- package/workspace/home-other-product-test.js +55 -0
- package/workspace/ini-workflow-test.js +4 -4
- package/workspace/lib/board-premium.js +21 -6
- package/workspace/lib/custom-docs.js +65 -3
- package/workspace/lib/doc-live-root.js +37 -0
- package/workspace/lib/engine/anchor-resolve.js +93 -15
- package/workspace/lib/engine/boards.js +30 -2
- package/workspace/lib/engine/intake.js +1 -1
- package/workspace/lib/hold-spans.js +24 -10
- package/workspace/lib/initiative-writer.js +63 -1
- package/workspace/lib/kg.js +1 -1
- package/workspace/lib/plan-items.js +36 -5
- package/workspace/lib/programs.js +11 -3
- package/workspace/lib/report-draft.js +3 -0
- package/workspace/lib/route-modules.js +2 -0
- package/workspace/lib/routes-board-premium.js +28 -0
- package/workspace/lib/routes-boards.js +92 -13
- package/workspace/lib/routes-doc-sheet.js +29 -1
- package/workspace/lib/routes-initiatives.js +12 -0
- package/workspace/lib/routes-programs.js +44 -5
- package/workspace/lib/routes-task-links.js +329 -0
- package/workspace/lib/routes-task-plans.js +333 -0
- package/workspace/lib/split-merge-suggest.js +162 -0
- package/workspace/lib/split-merge.js +379 -0
- package/workspace/lib/task-cli.js +73 -13
- package/workspace/lib/task-items.js +15 -3
- package/workspace/lib/task-links.js +422 -0
- package/workspace/lib/task-plans.js +232 -0
- package/workspace/lib/vendor/scripts/anchor-resolve.js +93 -15
- package/workspace/lib/vendor/scripts/intake.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/premium-core-doc-issue-test.js +2 -2
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +26 -3
- package/workspace/premium-vw-item-test.js +3 -3
- package/workspace/premium-vw-jira-test.js +6 -6
- package/workspace/product-lane-test.js +165 -0
- package/workspace/program-leave-test.js +203 -0
- package/workspace/program-panel-test.js +1 -1
- package/workspace/public/pm/bd-acts.js +5 -2
- package/workspace/public/pm/bd-ini-panel.js +32 -9
- package/workspace/public/pm/bd-prog-panel.js +22 -7
- package/workspace/public/pm/bd-prog.js +6 -1
- package/workspace/public/pm/bd-span.js +234 -30
- package/workspace/public/pm/bd-views.js +3 -2
- package/workspace/public/pm/cozy-board.css +90 -0
- package/workspace/public/pm/cozy-home.css +3 -0
- package/workspace/public/pm/doc-follow.js +36 -0
- package/workspace/public/pm/home-app.js +62 -14
- package/workspace/public/pm/home-ini-model.js +0 -34
- package/workspace/public/pm/home-ini.js +81 -204
- package/workspace/public/pm/home-list.js +2 -2
- package/workspace/public/pm/home-today.js +3 -1
- package/workspace/public/pm/ini-groups.js +228 -0
- package/workspace/public/pm/ini-links.js +561 -0
- package/workspace/public/pm/ini-tasks.js +131 -30
- package/workspace/public/pm/ini-versions.js +348 -0
- package/workspace/public/pm/ini-view-model.js +113 -43
- package/workspace/public/pm/ini-view.css +341 -18
- package/workspace/public/pm/ini-view.js +153 -38
- package/workspace/public/pm/premium-board.js +160 -21
- package/workspace/public/pm/premium-report-read.js +20 -1
- package/workspace/public/pm/premium-shell.js +29 -4
- package/workspace/public/pm/premium-vw-doc.js +46 -11
- package/workspace/public/pm/prog-move.js +69 -0
- package/workspace/public/pm/split-merge.css +77 -0
- package/workspace/public/pm/split-merge.js +265 -0
- package/workspace/public/pm/stage-line.js +414 -0
- package/workspace/public/pm/task-card.css +3 -0
- package/workspace/public/pm/task-card.js +15 -6
- package/workspace/public/pm/wf-page.css +2 -0
- package/workspace/public/pm/wf-page.js +2 -0
- package/workspace/public/pm/wf-stage.js +2 -1
- package/workspace/server.js +15 -1
- package/workspace/split-merge-ui-test.js +175 -0
- package/workspace/stage-card-test.js +12 -11
- package/workspace/task-card-test.js +3 -2
- package/workspace/task-delete-test.js +126 -0
- package/workspace/task-links-test.js +227 -0
- package/workspace/task-milestones-test.js +176 -0
- package/workspace/task-plans-test.js +181 -0
- package/workspace/task-views-test.js +3 -3
- package/workspace/test-lists/bd-ini-panel.json +8 -2
- package/workspace/test-lists/product-lane.json +6 -0
- package/workspace/test-lists/program-leave.json +6 -0
- package/workspace/test-lists/split-merge.json +15 -0
- package/workspace/test-lists/task-delete.json +5 -0
- package/workspace/test-lists/task-links.json +6 -0
- package/workspace/test-lists/task-milestones.json +6 -0
- package/workspace/test-lists/task-plans.json +6 -0
- package/workspace/test-lists/viewer-live-file.json +9 -0
- package/workspace/timeline-holds-test.js +61 -4
- package/workspace/tk-tasks-test.js +173 -57
- package/workspace/workflows-setup-test.js +4 -3
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/* pm/ini-versions.js — planned versus actual in the initiative's Tasks (feedback batch 11 item 8; canvas In development, row "Planned vs
|
|
2
|
+
* actual": PvaACGrill, PvaAC1Live, PvaAC2Menu, PvaAC3Draft, PvaAC5Phone). The fold and the routes are lib/task-plans.js and
|
|
3
|
+
* lib/routes-task-plans.js; the Board's row carries r.versions (null: no draft, no Not chosen, no saved plan).
|
|
4
|
+
*
|
|
5
|
+
* rowFor(r) → the row the one view draws: Live, or the draft the PM shows (its tasks as r.tasks, each `draft`), every task
|
|
6
|
+
* with `cmp` ({ start, due } of the compared version, where the dates differ, or a dropped task's line) and
|
|
7
|
+
* `added` (⊕: not in the compared version), and r.__vs: { v, show, cmp, slip, n } for the header
|
|
8
|
+
* headHtml(vs) the Tasks header's chip ("Live" grey, a draft's name blue, the blue count of drafts; hidden with nothing to show)
|
|
9
|
+
* and the end slip (+14d orange, −15d grey)
|
|
10
|
+
* liveHtml(vs) the seal icon "Make <draft> live", while a draft is shown
|
|
11
|
+
* countText(vs, count) "6 in Proposal A" while a draft is shown, else the count as it was
|
|
12
|
+
* wrap(h, body, shown) the host's handlers with a draft's writes routed here: a dt:<draft>:<key> task's dates and status, + in a draft,
|
|
13
|
+
* the first task of an initiative with no Live task and no plan (it goes to the draft "Proposal"); and the presses
|
|
14
|
+
* of the chip, its menu (a bottom sheet on a phone) and Make live with its summary, ✓, and Undo in the toast
|
|
15
|
+
* press(b, d, root, H) a press this file owns → true
|
|
16
|
+
*
|
|
17
|
+
* The host gives h.where() → { ws, board }, h.reload() (read the Board again, then draw), h.toast(text, undo?) and h.redraw(). A draft
|
|
18
|
+
* changes nothing in Live, on the Board or in Jira until Make live. Draft is not a status: the five task states stay as they are. */
|
|
19
|
+
import { pmPost } from './http.js';
|
|
20
|
+
|
|
21
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
22
|
+
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
23
|
+
export const PV = {
|
|
24
|
+
down: 'M7 10l5 5 5-5', right: 'M10 7l5 5-5 5', check: 'M5 12l5 5 9-10', plus: 'M12 5v14M5 12h14', x: 'M6 6l12 12M18 6L6 18',
|
|
25
|
+
flag: 'M5 21V4M5 4h11l-2 4 2 4H5', pen: 'M4 20h4L19 9l-4-4L4 16zM13 7l4 4', copy: 'M9 9h10v10H9zM5 15V5h10', bin: 'M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13',
|
|
26
|
+
seal: 'M12 3l2.5 1.6 2.9-.2 1.1 2.7 2.5 1.6-.7 2.9.7 2.9-2.5 1.6-1.1 2.7-2.9-.2L12 21l-2.5-1.6-2.9.2-1.1-2.7-2.5-1.6.7-2.9-.7-2.9 2.5-1.6 1.1-2.7 2.9.2zM8.5 12l2.4 2.4 4.6-4.8',
|
|
27
|
+
line: 'M4 9v6M4 12h16M20 9v6', addc: 'M12 8v8M8 12h8M12 3a9 9 0 1 0 0 18 9 9 0 1 0 0-18',
|
|
28
|
+
};
|
|
29
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
30
|
+
const DAY = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
31
|
+
const dn = (iso) => { const m = DAY.exec(String(iso || '')); return m ? Math.round(Date.UTC(+m[1], +m[2] - 1, +m[3]) / 864e5) : null; };
|
|
32
|
+
const md = (iso) => { const m = DAY.exec(String(iso || '')); return m ? MON[+m[2] - 1] + ' ' + +m[3] : ''; };
|
|
33
|
+
/** "+14d" late, "−15d" early, '' the same day (zero is silence). */
|
|
34
|
+
export const slipText = (n) => (!n ? '' : n > 0 ? '+' + n + 'd' : '−' + -n + 'd');
|
|
35
|
+
|
|
36
|
+
const SEL = new Map(); // initiative id → { show: 'live' | draft id, cmp: plan or draft id | 'none' } the PM's pick, for the session
|
|
37
|
+
const CACHE = new Map(); // initiative id → { v, t } the versions a write here answered, until a Board read is as new
|
|
38
|
+
const ROWS = new Map(); // initiative id → the row rowFor last drew (the presses read it)
|
|
39
|
+
/** For the tests: forget the picks and what the writes answered. */
|
|
40
|
+
export const resetVersions = () => { SEL.clear(); CACHE.clear(); ROWS.clear(); };
|
|
41
|
+
const counts = (k) => k && k.status !== "Won't do" && k.status !== 'Archived';
|
|
42
|
+
const spanEnd = (L) => { let b = null; for (const x of L) { const e = dn(x.due || x.end || x.start); if (e != null && (b == null || e > b)) b = e; } return b; };
|
|
43
|
+
|
|
44
|
+
function versionsOf(r) {
|
|
45
|
+
const c = CACHE.get(r.id), s = r.versions || null;
|
|
46
|
+
if (!c) return s;
|
|
47
|
+
if (s && String(s.t || '') > String(c.t || '')) { CACHE.delete(r.id); return s; }
|
|
48
|
+
return c.v;
|
|
49
|
+
}
|
|
50
|
+
/** The row as the one view draws it, with what the PM picked. */
|
|
51
|
+
export function rowFor(r) {
|
|
52
|
+
if (!r || !r.id) return r;
|
|
53
|
+
const v = versionsOf(r);
|
|
54
|
+
if (!v) { ROWS.set(r.id, { r, vs: null }); return r; }
|
|
55
|
+
const sel = SEL.get(r.id) || {}, live = (r.tasks || []).filter(counts);
|
|
56
|
+
let d = sel.show && sel.show !== 'live' ? v.drafts.find((x) => x.id === sel.show) : null;
|
|
57
|
+
// an initiative with no Live task opens on its newest draft (a proposal is all there is)
|
|
58
|
+
if (!d && !sel.show && !live.length && v.drafts.length) d = v.drafts[v.drafts.length - 1];
|
|
59
|
+
const show = d ? { kind: 'draft', id: d.id, name: d.name, auto: d.auto } : { kind: 'live', name: 'Live' };
|
|
60
|
+
const base = d ? d.tasks : r.tasks || [];
|
|
61
|
+
// what the thin line compares with: the PM's pick, else the newest saved plan
|
|
62
|
+
let cmp = null;
|
|
63
|
+
if (sel.cmp !== 'none') {
|
|
64
|
+
const p = sel.cmp ? v.plans.find((x) => x.id === sel.cmp) : null, o = sel.cmp && !p ? v.drafts.concat(v.notChosen).find((x) => x.id === sel.cmp && (!d || x.id !== d.id)) : null;
|
|
65
|
+
if (p) cmp = { kind: 'plan', id: p.id, name: p.name, at: p.at, tasks: p.tasks.map((t) => ({ key: t.uid, start: t.start, due: t.due })) };
|
|
66
|
+
else if (o) cmp = { kind: 'draft', id: o.id, name: o.name, at: o.at, tasks: o.tasks.map((t) => ({ key: t.src || t.uid, start: t.start, due: t.end })) };
|
|
67
|
+
else if (v.plans[0]) { const q = v.plans[0]; cmp = { kind: 'plan', id: q.id, name: q.name, at: q.at, tasks: q.tasks.map((t) => ({ key: t.uid, start: t.start, due: t.due })) }; }
|
|
68
|
+
}
|
|
69
|
+
const by = cmp ? new Map(cmp.tasks.map((t) => [t.key, t])) : null;
|
|
70
|
+
const tasks = base.map((k) => {
|
|
71
|
+
if (!by) return k;
|
|
72
|
+
const e = by.get(k.src || k.uid);
|
|
73
|
+
if (!e) return k.status === 'Archived' ? k : { ...k, added: true };
|
|
74
|
+
const differs = (e.start || '') !== (k.start || '') || (e.due || '') !== (k.end || '');
|
|
75
|
+
return differs || k.status === "Won't do" ? { ...k, cmp: { start: e.start || '', due: e.due || '' } } : k;
|
|
76
|
+
});
|
|
77
|
+
const a = spanEnd((d ? d.tasks : live).filter(counts)), b = cmp ? spanEnd(cmp.tasks) : null;
|
|
78
|
+
const vs = { id: r.id, v, show, cmp: cmp ? { kind: cmp.kind, id: cmp.id, name: cmp.name, at: cmp.at } : null, slip: a != null && b != null ? a - b : 0, n: v.drafts.length,
|
|
79
|
+
lines: tasks.some((k) => k.cmp), draft: !!d };
|
|
80
|
+
const out = { ...r, tasks, __vs: vs };
|
|
81
|
+
ROWS.set(r.id, { r, vs, d });
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ── the header ── */
|
|
86
|
+
export function headHtml(vs) {
|
|
87
|
+
if (!vs) return '';
|
|
88
|
+
const dr = vs.show.kind === 'draft';
|
|
89
|
+
const lbl = dr ? 'Showing the draft ' + vs.show.name : 'Showing Live' + (vs.n ? ', ' + vs.n + (vs.n === 1 ? ' draft' : ' drafts') : '');
|
|
90
|
+
const chip = `<button type="button" class="vs-chip${dr ? ' dr' : ''}" data-vs-chip aria-haspopup="menu" aria-expanded="false" aria-label="${esc(lbl + '. Change')}" title="Versions and compare"><span class="t">${esc(vs.show.name)}</span>${!dr && vs.n ? `<span class="c" aria-hidden="true">${vs.n}</span>` : ''}${SVG(PV.down, 14, 2)}</button>`;
|
|
91
|
+
const s = slipText(vs.slip);
|
|
92
|
+
const slip = s ? `<span class="vs-slip${vs.slip > 0 ? ' late' : ''}" role="img" aria-label="${esc((vs.slip > 0 ? s.slice(1) + ' late' : s.slice(1) + ' early') + ' against ' + (vs.cmp ? vs.cmp.name : 'the plan'))}" title="${esc('End against ' + (vs.cmp ? vs.cmp.name : 'the plan'))}">${esc(s)}</span>` : '';
|
|
93
|
+
return chip + slip;
|
|
94
|
+
}
|
|
95
|
+
export function liveHtml(vs) {
|
|
96
|
+
if (!vs || vs.show.kind !== 'draft') return '';
|
|
97
|
+
const l = 'Make ' + vs.show.name + ' live';
|
|
98
|
+
return `<button type="button" class="vs-seal" data-vs-live aria-haspopup="dialog" aria-expanded="false" aria-label="${esc(l)}" title="${esc(l)}">${SVG(PV.seal, 18, 1.8)}</button>`;
|
|
99
|
+
}
|
|
100
|
+
export function countText(vs, count, n) { return vs && vs.show.kind === 'draft' ? n + (n === 1 ? ' task' : ' tasks') : count; }
|
|
101
|
+
|
|
102
|
+
/* ── the popover: right under its press; a bottom sheet on a phone ── */
|
|
103
|
+
let POP = null;
|
|
104
|
+
const phone = () => typeof matchMedia === 'function' && matchMedia('(max-width: 640px)').matches;
|
|
105
|
+
// a press on a phone sheet's scrim closes it (the document's listener: the scrim is not a control)
|
|
106
|
+
document.addEventListener('click', (e) => { if (POP && POP.scrim && e.target === POP.scrim) closePop(); });
|
|
107
|
+
function closePop() { if (!POP) return; const { el, scrim, anchor } = POP; POP = null; el.remove(); if (scrim) scrim.remove(); if (anchor && anchor.isConnected) anchor.setAttribute('aria-expanded', 'false'); }
|
|
108
|
+
function openPop(anchor, html, onPress, o = {}) {
|
|
109
|
+
closePop();
|
|
110
|
+
const sheet = o.sheet && phone();
|
|
111
|
+
const el = document.createElement('div');
|
|
112
|
+
el.className = 'tkc ivq vs-pop' + (sheet ? ' sheet' : ''); el.dataset.escLayer = ''; el.innerHTML = html;
|
|
113
|
+
let scrim = null;
|
|
114
|
+
if (sheet) { scrim = document.createElement('div'); scrim.className = 'vs-scrim'; document.body.appendChild(scrim); }
|
|
115
|
+
document.body.appendChild(el);
|
|
116
|
+
if (!sheet) {
|
|
117
|
+
const r = anchor.getBoundingClientRect(), w = el.offsetWidth, h = el.offsetHeight;
|
|
118
|
+
const left = Math.max(8, Math.min(o.right ? r.right - w : r.left, innerWidth - w - 8)), below = r.bottom + 6 + h <= innerHeight - 8;
|
|
119
|
+
el.style.setProperty('--tl-x', left + 'px'); el.style.setProperty('--tl-y', (below ? r.bottom + 6 : Math.max(8, r.top - 6 - h)) + 'px');
|
|
120
|
+
}
|
|
121
|
+
anchor.setAttribute('aria-expanded', 'true');
|
|
122
|
+
POP = { el, scrim, anchor, onPress };
|
|
123
|
+
const f = el.querySelector('[aria-checked="true"], button'); if (f) f.focus({ preventScroll: true });
|
|
124
|
+
return el;
|
|
125
|
+
}
|
|
126
|
+
if (typeof document !== 'undefined' && document.head) {
|
|
127
|
+
document.addEventListener('pointerdown', (e) => { if (POP && !POP.el.contains(e.target) && e.target !== POP.anchor && !(POP.anchor && POP.anchor.contains(e.target)) && e.target !== POP.scrim) closePop(); }, true);
|
|
128
|
+
document.addEventListener('click', (e) => { if (!POP) return; const b = e.target.closest && e.target.closest('button'); if (b && POP.el.contains(b)) POP.onPress(b, e); });
|
|
129
|
+
document.addEventListener('keydown', (e) => {
|
|
130
|
+
if (!POP) return;
|
|
131
|
+
if (e.key === 'Escape') { e.stopPropagation(); const a = POP.anchor; closePop(); if (a && a.isConnected) a.focus(); return; }
|
|
132
|
+
if (e.key === 'Enter' && e.target && e.target.matches && e.target.matches('.vs-pop input[data-vs-rn]')) { e.preventDefault(); const b = POP.el.querySelector('[data-vs-rnok]'); if (b) b.click(); }
|
|
133
|
+
}, true);
|
|
134
|
+
addEventListener('resize', () => { if (POP && !POP.scrim) closePop(); });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ── the menu: Show (Live, drafts, New draft), Compare with (saved plans, drafts, Nothing, Save Live as a plan), Not chosen ── */
|
|
138
|
+
let NC_OPEN = false, RENAME = null;
|
|
139
|
+
const ago = (iso) => (iso ? md(iso.slice(0, 10)) : '');
|
|
140
|
+
function menuHtml(vs, liveN) {
|
|
141
|
+
const v = vs.v, showId = vs.show.kind === 'draft' ? vs.show.id : 'live', cmpId = vs.cmp ? vs.cmp.id : 'none';
|
|
142
|
+
const row = (o) => `<div class="vs-r${o.on ? ' on' : ''}"><button type="button" class="o${o.on ? ' hl' : ''}" role="${o.role || 'menuitemradio'}"${o.role === 'menuitem' ? '' : ` aria-checked="${!!o.on}"`} ${o.attr}>`
|
|
143
|
+
+ `<span class="ck" aria-hidden="true">${o.icon || (o.on ? SVG(PV.check, 15, 2.4) : '')}</span><span class="nn">${esc(o.label)}${o.sub ? `<small>${esc(o.sub)}</small>` : ''}</span>${o.dot ? '<i class="vs-dot" aria-hidden="true"></i>' : ''}${o.tail || ''}</button>${o.tools || ''}</div>`;
|
|
144
|
+
const tools = (d, more) => `<span class="vs-tl">${more ? '' : `<button type="button" class="vs-ti" data-vs-rename="${esc(d.id)}" aria-label="${esc('Rename ' + d.name)}" title="Rename">${SVG(PV.pen, 14)}</button>`}`
|
|
145
|
+
+ `<button type="button" class="vs-ti" data-vs-copy="${esc(d.id)}" aria-label="${esc('New draft from ' + d.name)}" title="Copy">${SVG(PV.copy, 14)}</button>`
|
|
146
|
+
+ `<button type="button" class="vs-ti" data-vs-del="${esc(d.id)}" aria-label="${esc('Delete ' + d.name)}" title="Delete">${SVG(PV.bin, 14)}</button></span>`;
|
|
147
|
+
const draftRow = (d, attr, on) => (RENAME === d.id
|
|
148
|
+
? `<div class="vs-r rn"><input type="text" maxlength="60" data-vs-rn="${esc(d.id)}" value="${esc(d.name)}" aria-label="${esc('New name for ' + d.name)}"><button type="button" class="vs-ti" data-vs-rnok="${esc(d.id)}" aria-label="Save the name" title="Save">${SVG(PV.check, 15, 2.2)}</button></div>`
|
|
149
|
+
: row({ attr, on, label: d.name, sub: [d.auto ? 'Proposal' : d.from === 'live' ? 'Draft from Live' : 'Draft', d.tasks.length + (d.tasks.length === 1 ? ' task' : ' tasks'), d.liveChanged ? 'Live changed since' : ''].filter(Boolean).join(' · '), dot: d.liveChanged, tools: tools(d) }));
|
|
150
|
+
let h = '<span class="h">Show</span>';
|
|
151
|
+
h += row({ attr: 'data-vs-show="live"', on: showId === 'live', label: 'Live', sub: 'The real tasks' + (liveN ? ' · ' + liveN : '') });
|
|
152
|
+
for (const d of v.drafts) h += draftRow(d, `data-vs-show="${esc(d.id)}"`, showId === d.id);
|
|
153
|
+
h += row({ role: 'menuitem', attr: 'data-vs-new', icon: SVG(PV.plus, 15, 2), label: 'New draft from Live' });
|
|
154
|
+
h += '<hr><span class="h">Compare with</span>';
|
|
155
|
+
for (const p of v.plans) h += row({ attr: `data-vs-cmp="${esc(p.id)}"`, on: cmpId === p.id, label: 'Plan · ' + p.name, sub: ['Saved ' + ago(p.at) + (p.source === 'build' ? ' by PMOS' : p.source === 'draft' ? ' when it went live' : ''), p.span ? 'ends ' + md(p.span.end) : ''].filter(Boolean).join(' · '),
|
|
156
|
+
tail: cmpId === p.id ? `<span class="vs-k" aria-hidden="true">${SVG(PV.line, 16, 1.8)}</span>` : '' });
|
|
157
|
+
for (const d of v.drafts) if (d.id !== showId) h += row({ attr: `data-vs-cmp="${esc(d.id)}"`, on: cmpId === d.id, label: 'Draft · ' + d.name, sub: d.span ? 'ends ' + md(d.span.end) : '' });
|
|
158
|
+
h += row({ attr: 'data-vs-cmp="none"', on: cmpId === 'none', label: 'Nothing' });
|
|
159
|
+
h += row({ role: 'menuitem', attr: 'data-vs-save', icon: SVG(PV.flag, 15, 1.8), label: 'Save Live as a plan' });
|
|
160
|
+
if (v.notChosen.length) {
|
|
161
|
+
h += `<hr><button type="button" class="o vs-nc" data-vs-nc aria-expanded="${NC_OPEN}"><span class="ck" aria-hidden="true">${SVG(NC_OPEN ? PV.down : PV.right, 15, 2)}</span><span class="nn">Not chosen · ${v.notChosen.length}</span></button>`;
|
|
162
|
+
if (NC_OPEN) for (const d of v.notChosen) h += row({ role: 'menuitem', attr: `data-vs-open="${esc(d.id)}"`, label: d.name, sub: d.tasks.length + (d.tasks.length === 1 ? ' task' : ' tasks'), tools: tools(d, true) });
|
|
163
|
+
}
|
|
164
|
+
return `<div class="tkc-pop ivq-m vs-m" role="menu" aria-label="Versions and compare">${h}</div>`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* ── the writes ── */
|
|
168
|
+
async function write(H, route, body) {
|
|
169
|
+
const at = H.where ? H.where() : {};
|
|
170
|
+
return pmPost('/api/task-plans' + route, { ws: at.ws, board: at.board, ...body }).catch(() => null);
|
|
171
|
+
}
|
|
172
|
+
const say = (H, m, undo) => { if (H.toast) H.toast(m, undo); };
|
|
173
|
+
function took(id, res) { if (res && res.ok && 'versions' in res) CACHE.set(id, { v: res.versions, t: new Date().toISOString() }); }
|
|
174
|
+
const failed = (H, res, m) => { say(H, (res && res.error) || m || 'Nothing was changed.'); return false; };
|
|
175
|
+
|
|
176
|
+
/** The draft task a dt:<draft>:<key> uid names, as the row drew it. */
|
|
177
|
+
const draftTask = (id, uid) => { const R = ROWS.get(id); return R && R.d ? R.d.tasks.find((x) => x.uid === uid) : null; };
|
|
178
|
+
const iniOfUid = (uid) => { for (const [id, R] of ROWS) if (R.d && R.d.tasks.some((x) => x.uid === uid)) return id; return null; };
|
|
179
|
+
async function draftDates(H, uid, patch) {
|
|
180
|
+
const id = iniOfUid(uid), x = id && draftTask(id, uid);
|
|
181
|
+
const set = {}; if ('start' in patch) set.start = patch.start || ''; if ('due' in patch) set.due = patch.due || '';
|
|
182
|
+
const res = await write(H, '/task', { task: uid, set });
|
|
183
|
+
if (!res || res.ok === false) return failed(H, res);
|
|
184
|
+
took(id, res); if (H.redraw) H.redraw();
|
|
185
|
+
const R = ROWS.get(id), name = R && R.vs ? R.vs.show.name : 'the draft';
|
|
186
|
+
say(H, 'Dates saved in ' + name + (x ? ': ' + x.title : '') + '.', res.from ? async () => { const u = await write(H, '/task', { task: uid, set: res.from }); if (u && u.ok) { took(id, u); if (H.redraw) H.redraw(); } else failed(H, u, 'The undo did not land.'); } : undefined);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
async function draftStatus(H, uid, state) {
|
|
190
|
+
const id = iniOfUid(uid), x = id && draftTask(id, uid);
|
|
191
|
+
const R = ROWS.get(id), name = R && R.vs ? R.vs.show.name : 'the draft';
|
|
192
|
+
if (state === "Won't do" || state === 'Archived') return draftDrop(H, uid);
|
|
193
|
+
const res = await write(H, '/task', { task: uid, set: { status: state } });
|
|
194
|
+
if (!res || res.ok === false) return failed(H, res);
|
|
195
|
+
took(id, res); if (H.redraw) H.redraw();
|
|
196
|
+
say(H, state + ' in ' + name + (x ? ': ' + x.title : '') + '.', res.from ? async () => { const u = await write(H, '/task', { task: uid, set: res.from }); if (u && u.ok) { took(id, u); if (H.redraw) H.redraw(); } } : undefined);
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
/** Won't do, Archive or Delete on a draft's task: a draft change only, the task leaves the draft (batch 11 items 8 and 16). Live is not touched. */
|
|
200
|
+
async function draftDrop(H, uid) {
|
|
201
|
+
const id = iniOfUid(uid), x = id && draftTask(id, uid);
|
|
202
|
+
const R = ROWS.get(id), name = R && R.vs ? R.vs.show.name : 'the draft';
|
|
203
|
+
const res = await write(H, '/task', { task: uid, drop: true });
|
|
204
|
+
if (!res || res.ok === false) return failed(H, res);
|
|
205
|
+
took(id, res); if (H.redraw) H.redraw();
|
|
206
|
+
// a task copied from Live comes back with Undo; a task the draft added is gone, so Undo adds it again
|
|
207
|
+
const back = res.gone ? () => write(H, '/task', { draft: uid.split(':')[1], add: { title: x.title, start: x.start, due: x.end, owner: x.owner, ...(x.section ? { section: x.section } : {}) } }) : () => write(H, '/task', { task: uid, undrop: true });
|
|
208
|
+
say(H, 'Dropped from ' + name + (x ? ': ' + x.title : '') + '.', async () => { const u = await back(); if (u && u.ok) { took(id, u); if (H.redraw) H.redraw(); } else failed(H, u, 'The undo did not land.'); });
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
/** + in the Tasks header: into the draft shown; the first task of an initiative with no Live task and no plan goes to "Proposal". → true when handled here. */
|
|
212
|
+
async function draftAdd(H, id, title, inp, section) {
|
|
213
|
+
const R = ROWS.get(id), vs = R && R.vs, live = R ? (R.r.tasks || []).filter(counts) : [];
|
|
214
|
+
let res = null;
|
|
215
|
+
if (vs && vs.show.kind === 'draft') res = await write(H, '/task', { draft: vs.show.id, add: { title, ...(section ? { section } : {}) } });
|
|
216
|
+
else if (!live.length && !(vs && vs.v.plans.length) && !(SEL.get(id) || {}).show) {
|
|
217
|
+
res = await write(H, '/propose', { initiative: id, title, ...(section ? { section } : {}) });
|
|
218
|
+
if (res && res.status === 409) return false;
|
|
219
|
+
if (res && res.ok === false && /Live tasks or a saved plan/.test(res.error || '')) return false;
|
|
220
|
+
if (res && res.ok) SEL.set(id, { ...(SEL.get(id) || {}), show: res.draft.id });
|
|
221
|
+
} else return false;
|
|
222
|
+
if (inp) inp.disabled = false;
|
|
223
|
+
if (!res || res.ok === false) { failed(H, res, 'The task was not added.'); return true; }
|
|
224
|
+
took(id, res);
|
|
225
|
+
say(H, 'Task added to ' + (res.draft ? res.draft.name : vs.show.name) + '. Nothing in Live changes until you make it live.');
|
|
226
|
+
if (H.redraw) H.redraw();
|
|
227
|
+
if (inp && inp.isConnected) { inp.value = ''; inp.focus(); } else { const n = document.querySelector('#ivAddTask'); if (n) { n.value = ''; n.focus(); } }
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* ── Make live: the summary right under the seal, then ✓; Undo in the toast ── */
|
|
232
|
+
async function makeLive(b, H, id) {
|
|
233
|
+
const R = ROWS.get(id); if (!R || !R.vs || R.vs.show.kind !== 'draft') return;
|
|
234
|
+
const at = H.where ? H.where() : {}, d = R.vs.show;
|
|
235
|
+
let pv = null;
|
|
236
|
+
try { pv = await (await fetch('/api/task-plans/preview?ws=' + encodeURIComponent(at.ws || '') + '&board=' + encodeURIComponent(at.board || '') + '&draft=' + encodeURIComponent(d.id), { credentials: 'same-origin' })).json(); } catch { pv = null; }
|
|
237
|
+
if (!pv || !pv.ok) { say(H, (pv && pv.error) || 'What Make live would change could not be read.'); return; }
|
|
238
|
+
const s = pv.summary, n = (k, one, many) => `<b>${k} ${k === 1 ? one : many}</b>`;
|
|
239
|
+
const lines = [];
|
|
240
|
+
if (s.added) lines.push(`<span>${n(s.added, 'task', 'tasks')} ${s.added === 1 ? 'becomes' : 'become'} To do</span>`);
|
|
241
|
+
if (s.moved) lines.push(`<span>${n(s.moved, 'date moved', 'dates moved')}</span>`);
|
|
242
|
+
if (s.changed > s.moved) lines.push(`<span>${n(s.changed - s.moved, 'task renamed or reassigned', 'tasks renamed or reassigned')}</span>`);
|
|
243
|
+
if (s.dropped) lines.push(`<span>${n(s.dropped, 'task', 'tasks')} ${s.dropped === 1 ? 'becomes' : 'become'} Won’t do</span>`);
|
|
244
|
+
for (const m of s.milestones || []) lines.push(`<span><b>Milestone</b>, ${esc(m.title)}${m.due ? ' · ' + esc(md(m.due)) : ''}</span>`);
|
|
245
|
+
if (s.conflicts && s.conflicts.length) lines.push(`<span class="w">Changed in Live too, the draft wins: ${esc(s.conflicts.join(', '))}</span>`);
|
|
246
|
+
if (!lines.length) lines.push('<span>Nothing in Live changes</span>');
|
|
247
|
+
lines.push(`<span>Saved as the plan <b>${esc(s.planName)}</b></span>`);
|
|
248
|
+
if (s.notChosen && s.notChosen.length) lines.push(`<span class="q">${esc(s.notChosen.join(', '))} ${s.notChosen.length === 1 ? 'moves' : 'move'} to Not chosen</span>`);
|
|
249
|
+
const html = `<div class="tkc-pop vs-cf" role="dialog" aria-label="${esc('Make ' + d.name + ' live')}"><b class="l1">Make ${esc(d.name)} live</b><div class="lst">${lines.join('')}</div>`
|
|
250
|
+
+ `<span class="ft"><button type="button" class="vs-ti" data-vs-cf="no" aria-label="Cancel" title="Cancel">${SVG(PV.x, 16, 2)}</button><button type="button" class="vs-ok" data-vs-cf="yes" aria-label="Make it live" title="Make it live">${SVG(PV.check, 16, 2.4)}</button></span></div>`;
|
|
251
|
+
openPop(b, html, async (x) => {
|
|
252
|
+
const c = x.dataset.vsCf; if (!c) return;
|
|
253
|
+
closePop();
|
|
254
|
+
if (c !== 'yes') return;
|
|
255
|
+
const res = await write(H, '/live', { draft: d.id });
|
|
256
|
+
if (!res || res.ok === false) { failed(H, res, 'The draft was not made live.'); return; }
|
|
257
|
+
took(id, res); SEL.set(id, { show: 'live', cmp: res.plan });
|
|
258
|
+
say(H, d.name + ' is live. Its dates are saved as a plan.', async () => {
|
|
259
|
+
const u = await write(H, '/unlive', { draft: d.id });
|
|
260
|
+
if (!u || u.ok === false) { failed(H, u, 'The undo did not land.'); return; }
|
|
261
|
+
CACHE.delete(id); SEL.set(id, { show: d.id });
|
|
262
|
+
say(H, 'Back to the draft. Live is as it was' + (u.kept ? ', except ' + u.kept + (u.kept === 1 ? ' breakdown item that stays withdrawn' : ' breakdown items that stay withdrawn') : '') + '.');
|
|
263
|
+
if (H.reload) await H.reload(); else if (H.redraw) H.redraw();
|
|
264
|
+
});
|
|
265
|
+
if (H.reload) await H.reload(); else if (H.redraw) H.redraw();
|
|
266
|
+
}, { right: true });
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** The chip's menu, and each of its presses. */
|
|
270
|
+
function openMenu(b, H, id) {
|
|
271
|
+
const R = ROWS.get(id); if (!R || !R.vs) return;
|
|
272
|
+
const liveN = (R.r.tasks || []).filter(counts).length;
|
|
273
|
+
const draw = () => { const r2 = ROWS.get(id); if (POP && POP.anchor === b && r2 && r2.vs) POP.el.innerHTML = menuHtml(r2.vs, liveN); };
|
|
274
|
+
const after = () => { if (H.redraw) H.redraw(); };
|
|
275
|
+
openPop(b, menuHtml(R.vs, liveN), async (x) => {
|
|
276
|
+
const q = x.dataset, cur = SEL.get(id) || {};
|
|
277
|
+
if (q.vsShow) { SEL.set(id, { ...cur, show: q.vsShow }); closePop(); after(); return; }
|
|
278
|
+
if (q.vsCmp) { SEL.set(id, { ...cur, cmp: q.vsCmp }); closePop(); after(); return; }
|
|
279
|
+
if (q.vsOpen) { SEL.set(id, { ...cur, show: q.vsOpen }); closePop(); after(); return; }
|
|
280
|
+
if ('vsNc' in q) { NC_OPEN = !NC_OPEN; draw(); return; }
|
|
281
|
+
if (q.vsRename) { RENAME = q.vsRename; draw(); const i = POP && POP.el.querySelector('[data-vs-rn]'); if (i) { i.focus(); i.select(); } return; }
|
|
282
|
+
if (q.vsRnok) {
|
|
283
|
+
const i = POP && POP.el.querySelector('[data-vs-rn]'), name = i ? i.value.trim() : '';
|
|
284
|
+
RENAME = null;
|
|
285
|
+
if (!name) { draw(); return; }
|
|
286
|
+
const res = await write(H, '/name', { draft: q.vsRnok, name });
|
|
287
|
+
if (!res || res.ok === false) { failed(H, res); draw(); return; }
|
|
288
|
+
await refresh(H, id); draw(); after();
|
|
289
|
+
say(H, 'Renamed to ' + name + '.', async () => { await write(H, '/name', { draft: q.vsRnok, name: res.from }); await refresh(H, id); after(); });
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if ('vsNew' in q || q.vsCopy) {
|
|
293
|
+
closePop();
|
|
294
|
+
const res = await write(H, '/draft', { initiative: id, from: q.vsCopy || 'live' });
|
|
295
|
+
if (!res || res.ok === false) { failed(H, res, 'No draft was made.'); return; }
|
|
296
|
+
took(id, res); SEL.set(id, { ...cur, show: res.draft.id }); after();
|
|
297
|
+
say(H, res.draft.name + ' is a new draft. Nothing in Live changes until you make it live.');
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
if (q.vsDel) {
|
|
301
|
+
closePop();
|
|
302
|
+
const res = await write(H, '/delete', { draft: q.vsDel });
|
|
303
|
+
if (!res || res.ok === false) { failed(H, res); return; }
|
|
304
|
+
if (cur.show === q.vsDel) SEL.set(id, { ...cur, show: 'live' });
|
|
305
|
+
await refresh(H, id); after();
|
|
306
|
+
say(H, res.name + ' is deleted.', async () => { const u = await write(H, '/restore', { draft: q.vsDel }); if (u && u.ok) { await refresh(H, id); after(); } else failed(H, u, 'The undo did not land.'); });
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if ('vsSave' in q) {
|
|
310
|
+
closePop();
|
|
311
|
+
const res = await write(H, '/plan', { initiative: id });
|
|
312
|
+
if (!res || res.ok === false) { failed(H, res, 'No plan was saved.'); return; }
|
|
313
|
+
took(id, res); SEL.set(id, { ...cur, cmp: res.plan.id }); after();
|
|
314
|
+
say(H, 'Live is saved as the plan ' + res.plan.name + '.', async () => { const u = await write(H, '/plan/remove', { plan: res.plan.id }); if (u && u.ok) { SEL.set(id, { ...(SEL.get(id) || {}), cmp: undefined }); await refresh(H, id); after(); } else failed(H, u, 'The undo did not land.'); });
|
|
315
|
+
}
|
|
316
|
+
}, { sheet: true });
|
|
317
|
+
}
|
|
318
|
+
/** Read one initiative's versions again (after a write that does not answer them). */
|
|
319
|
+
async function refresh(H, id) {
|
|
320
|
+
const at = H.where ? H.where() : {};
|
|
321
|
+
try { const r = await (await fetch('/api/task-plans?ws=' + encodeURIComponent(at.ws || '') + '&board=' + encodeURIComponent(at.board || '') + '&initiative=' + encodeURIComponent(id), { credentials: 'same-origin' })).json(); if (r && r.ok) took(id, r); } catch { /* the next Board read has it */ }
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/** A press of this file's own controls in the Tasks header. → true when handled. */
|
|
325
|
+
export function press(b, d, root, H) {
|
|
326
|
+
const id = root && root.dataset.iv; if (!id) return false;
|
|
327
|
+
if ('vsChip' in d) { if (POP && POP.anchor === b) closePop(); else openMenu(b, H, id); return true; }
|
|
328
|
+
if ('vsLive' in d) { if (POP && POP.anchor === b) closePop(); else makeLive(b, H, id); return true; }
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
/** The host's handlers, with a draft's writes routed here. `shown(id)` → the view last drawn (the current stage a new draft task sits under). */
|
|
332
|
+
export function wrap(h, body, shown) {
|
|
333
|
+
const idOf = () => { const n = body.querySelector('[data-iv]'); return n ? n.dataset.iv : null; };
|
|
334
|
+
const isDraft = (uid) => /^dt:/.test(String(uid || ''));
|
|
335
|
+
const W = { ...h };
|
|
336
|
+
W.check = (uid, btn) => (isDraft(uid) ? undefined : h.check && h.check(uid, btn));
|
|
337
|
+
W.status = (uid, state) => (isDraft(uid) ? draftStatus(W, uid, state) : h.status && h.status(uid, state));
|
|
338
|
+
W.dates = (uid, patch) => (isDraft(uid) ? draftDates(W, uid, patch) : h.dates && h.dates(uid, patch));
|
|
339
|
+
if (h.remove) W.remove = (uid) => (isDraft(uid) ? draftDrop(W, uid) : h.remove(uid));
|
|
340
|
+
W.openTask = (uid, b) => (isDraft(uid) ? undefined : h.openTask && h.openTask(uid, b));
|
|
341
|
+
W.addTask = async (title, inp) => {
|
|
342
|
+
const id = idOf(), v = id && shown ? shown(id) : null;
|
|
343
|
+
const now = v && v.tasks ? v.tasks.sections.find((s) => s.kind === 'stage' && s.status === 'now') : null;
|
|
344
|
+
if (id && await draftAdd(W, id, title, inp, now ? now.key : '')) return;
|
|
345
|
+
return h.addTask && h.addTask(title, inp);
|
|
346
|
+
};
|
|
347
|
+
return W;
|
|
348
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* initiative as GET /api/board-premium sends it (both pages read it), with its trail (GET /api/board-trail), so the two can no longer count
|
|
5
5
|
* different things. Only the host's chrome differs.
|
|
6
6
|
*
|
|
7
|
-
* iniView(r, ctx) → { summary, stage, tasks } the whole view, as data
|
|
7
|
+
* iniView(r, ctx) → { summary, stage, tasks, vs } the whole view, as data (vs: what pm/ini-versions.js rowFor put on the row, or null)
|
|
8
8
|
* ctx: { steps (Product feature's eight, the model's), today (YYYY-MM-DD, the model's day), usual ({ days } | null, the usual days in the
|
|
9
9
|
* current stage), grill ({ open, later } | null), program ({ id, title } | null), jiraAt ('Jira · 2h ago' | ''), ask ({ title } | null: a
|
|
10
10
|
* session that waits on the PM, Home's), docs (count | null), linked (count | null) }
|
|
@@ -13,20 +13,27 @@
|
|
|
13
13
|
* wbsOf(title) → { code, top } | null "10.5 TC to review" → { code: '10.5', top: '10' }; "WP-03 Token exchange" → { code: 'WP-03', top: 'WP' }
|
|
14
14
|
* statusOf(r, grill, fmt) → { tone, text } the status the row and the view both say
|
|
15
15
|
* linkedOf(r) → [{ kind: doc | dep | epic, label, path?, title? }] the Linked fold, from the trail
|
|
16
|
+
* groupBy(L, T) → 'stage' | 'epic' | 'mine' | 'owner' | 'status' how Tasks groups (batch 11 item 20): the PM's pick, else Epic
|
|
17
|
+
* once the PRD's tickets are drafted, else Stage
|
|
18
|
+
* groupSections(tasks, by, L, T) → { sections, sum } the same tasks in the other groupings, each group a section the List, Timeline
|
|
19
|
+
* and Kanban draw as they draw a stage; sum: the By epic card ("N tickets are drafted, not in Jira") or null
|
|
16
20
|
*
|
|
17
21
|
* THE RULES (OvGrill):
|
|
18
22
|
* 1 the ladder says where the stage is ("5 of 7"); the card says how much of its section is done ("0 of 3 done"). Never one number for both.
|
|
19
23
|
* 2 Tasks are the WBS: one section per stage, in workflow order; "Not in a stage" last. A section is a task's place, never its state.
|
|
20
24
|
* 4 the stage card keeps where it is, its dates and the next stage; the tasks are said once, in Tasks.
|
|
21
25
|
* 5 a stage is finished when its section is: every task Done or Won't do.
|
|
22
|
-
* 6
|
|
23
|
-
*
|
|
26
|
+
* 6 every stage is its own row, never merged (batch 11 item 5); only what is live starts open: the current section and any section with a
|
|
27
|
+
* late task.
|
|
24
28
|
* 9 what waits on you leads, with the one primary; the status then moves to the meta line.
|
|
25
29
|
* 10 a new initiative with no breakdown draws its workflow's sections dashed, with Draft it.
|
|
26
30
|
* 11 Build with Jira tickets: the open tickets are Build's section, by epic, with "N of M done in Jira" and how fresh.
|
|
27
31
|
* 12 over the plan: the dates line turns amber with the days over; a skipped stage keeps its place, with its reason.
|
|
28
32
|
* 18 each section carries its dates: done stages when they ran, now from when to the plan end, later ones "Plan <date>", amber when missed.
|
|
29
33
|
* 19 a big section shows the 3 most urgent first, then folds the rest by the next WBS level, each with its count; done folds last. */
|
|
34
|
+
import { ticketGroups } from './tk-model.js'; // the drafted Jira tickets by epic (kit 2, T1): By epic's groups
|
|
35
|
+
|
|
36
|
+
import { lineOf } from './stage-line.js'; // the stage card's one line (batch 11 item 21)
|
|
30
37
|
|
|
31
38
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
32
39
|
const CLOSED = new Set(['Done', "Won't do", 'Archived']);
|
|
@@ -102,6 +109,8 @@ export function statusOf(r, grill, fmt) {
|
|
|
102
109
|
return { tone: 'q', text: r.statusLabel || '' };
|
|
103
110
|
}
|
|
104
111
|
|
|
112
|
+
/* a Jira ticket's dates as words (batch 11 item 23): the start and due the PM keeps in PMOS, else the sprint's end */
|
|
113
|
+
const jDays = (k, today) => { const e = k.due || k.sprintEnd || ''; return k.start && e ? span(k.start, e, today) : k.start ? 'from ' + dateY(k.start, today) : e ? dateY(e, today) : ''; };
|
|
105
114
|
/* ── one task row ── */
|
|
106
115
|
function rowOf(k, today) {
|
|
107
116
|
const closed = CLOSED.has(k.status), d = dayOf(k.end), late = !closed && !!d && d < today;
|
|
@@ -111,10 +120,16 @@ function rowOf(k, today) {
|
|
|
111
120
|
const who = ownerName(k.owner);
|
|
112
121
|
// the List's meta draws the dates as their own press (batch 9 item 5b): days is the dates alone, lateText what follows them
|
|
113
122
|
return { uid: k.uid, title: k.title, status: k.status || 'To do', closed, done: k.status === 'Done', wont: k.status === "Won't do", prog: k.status === 'In progress', late, due,
|
|
114
|
-
days, lateText: late ? plural(between(d, today), 'day', 'days') + ' late' : '', item: !!k.item,
|
|
123
|
+
days, lateText: late ? plural(between(d, today), 'day', 'days') + ' late' : '', item: !!k.item, ms: !!k.milestone, // ms: the ◇ flag (batch 11 item 3)
|
|
115
124
|
start: k.start || '', end: k.end || '', owner: who, av: initials(k.owner),
|
|
116
|
-
sub: [k.status === 'In progress' ? 'In progress' : '', due, who && who !== 'You' ? who : ''].filter(Boolean).join(' · '), wbs: wbsOf(k.title), canCheck: !!k.uid, order: k.order
|
|
125
|
+
sub: [k.status === 'In progress' ? 'In progress' : '', due, who && who !== 'You' ? who : ''].filter(Boolean).join(' · '), wbs: wbsOf(k.title), canCheck: !!k.uid && !k.draft, order: k.order,
|
|
126
|
+
// planned versus actual (batch 11 item 8, pm/ini-versions.js): the compared version's days where they differ, ⊕ added after it, a draft's task
|
|
127
|
+
cmp: k.cmp || null, added: !!k.added, dr: !!k.draft };
|
|
117
128
|
}
|
|
129
|
+
/** The Jira key a task's title starts with ("MSD-4376 Navigation tabs" → 'MSD-4376'), or ''. A task named for a ticket IS that ticket:
|
|
130
|
+
* Build's section shows it once, as the task (it carries the dates and the owner), not again as a Jira row (batch 11 item 4). */
|
|
131
|
+
const KEY_RE = /^\s*([A-Z][A-Z0-9]+-\d+)\b/;
|
|
132
|
+
export const jiraKeyOf = (title) => { const m = KEY_RE.exec(String(title || '')); return m ? m[1] : ''; };
|
|
118
133
|
const urgent = (a, b) => (b.late - a.late) || (a.end || '9999').localeCompare(b.end || '9999') || (a.order != null && b.order != null ? a.order - b.order : 0);
|
|
119
134
|
/** A section's rows: open ones first by urgency; past 5 open, the 3 most urgent then the rest folded by the next WBS level; done fold last
|
|
120
135
|
* (Won't do joins it), then the archived ones, which only the List draws, folded after Done (batch 9 item 5b). */
|
|
@@ -146,6 +161,9 @@ export function iniView(r, ctx = {}) {
|
|
|
146
161
|
const archOf = (keys) => arch.filter((x) => keys.includes(x.sec));
|
|
147
162
|
const open = rows.filter((x) => !x.closed), late = open.filter((x) => x.late);
|
|
148
163
|
const jira = !ownWf(r) && (t.key === 'build' || t.key === 'deliver') && (t.tickets || []).length > 0;
|
|
164
|
+
// a ticket a task is named for shows once, as the task: it is not drawn or counted again as a Jira row
|
|
165
|
+
const named = new Set(T.map((k) => jiraKeyOf(k.title)).filter(Boolean));
|
|
166
|
+
const tkOwn = (t.tickets || []).filter((k) => !named.has(k.key));
|
|
149
167
|
|
|
150
168
|
// the dates each stage ran: its board moves, oldest first; the first stage starts with the plan
|
|
151
169
|
const moves = Array.isArray(tr.moves) ? tr.moves : [];
|
|
@@ -173,10 +191,14 @@ export function iniView(r, ctx = {}) {
|
|
|
173
191
|
} : null;
|
|
174
192
|
let nx = null;
|
|
175
193
|
// Won't do and Archived hold their stage (D99 wfRules): no next stage to move to
|
|
176
|
-
if (cur >= 0 && !r.ended) { const n = list.slice(cur + 1).find((s) => s.status !== 'skip'); if (n) nx = { key: n.key, name: n.name, ms: n.ms, moves: n.ms && r.kr ? r.kr : '' }; }
|
|
194
|
+
if (cur >= 0 && !r.ended && r.status !== 'done' && r.status !== 'cancelled') { const n = list.slice(cur + 1).find((s) => s.status !== 'skip'); if (n) nx = { key: n.key, name: n.name, ms: n.ms, moves: n.ms && r.kr ? r.kr : '' }; }
|
|
195
|
+
// the stage card is one line (batch 11 item 21, agreed A): each stage on its own dates, the milestone tasks as ◇, the Board's states
|
|
196
|
+
const line = lineOf(r, { list, cur, ran, rows, today, deps: tr.deps || [] });
|
|
197
|
+
const ready = !!nx && curRows.length > 0 && curRows.every((x) => x.closed); // every task of the stage done: the → turns blue (state 1)
|
|
177
198
|
const stage = {
|
|
178
|
-
n: cur >= 0 ? cur + 1 : null, of: list.length, name: st ? st.name : (t.label || r.stage || 'No stage on record'), ms: !!(st && st.ms),
|
|
199
|
+
n: cur >= 0 ? cur + 1 : null, of: list.length, name: st ? st.name : (t.label || r.stage || 'No stage on record'), ms: !!(st && st.ms), key: st ? st.key : '',
|
|
179
200
|
doneOf, day: days != null ? 'day ' + days + (usual != null ? ' of ~' + usual : '') : '', dayOver: days != null && usual != null && days > usual,
|
|
201
|
+
clock: days != null && !line.chip ? (usual != null ? days + ' of ~' + usual + ' days' : plural(days, 'day', 'days')) : '', line, ready,
|
|
180
202
|
ladder: list.map((s) => ({ name: s.name, ms: s.ms, cls: s.status })), dates, next: nx,
|
|
181
203
|
aria: cur >= 0 ? 'Stage ' + (cur + 1) + ' of ' + list.length + ' of ' + ((r.wf && r.wf.name) || 'Product feature') + ': ' + st.name + '.' + (nx ? ' Next stage: ' + nx.name + '.' : '') : 'No stage on record.',
|
|
182
204
|
};
|
|
@@ -194,51 +216,28 @@ export function iniView(r, ctx = {}) {
|
|
|
194
216
|
else { const p = planOf(rs); if (p) { sub = 'Plan ' + dateY(p, today); if (dayOf(p) < today && op.length) { sub += ', missed'; subWarn = true; } } }
|
|
195
217
|
const h = headOf(rs); if (h) sub = [sub, h].filter(Boolean).join(' · ');
|
|
196
218
|
return { kind: 'stage', key: s.key, n: i + 1, name: s.name, ms: s.ms, status: s.status, sub, subWarn, count: countOf(op.length, lt.length, dn), warn: lt.length > 0,
|
|
197
|
-
open: s.status === 'now' || lt.length > 0, ...bodyOf(rs, archOf([s.key])), jira: null, why };
|
|
219
|
+
open: s.status === 'now' || lt.length > 0, ...bodyOf(rs, archOf([s.key])), jira: null, why, ...(s.status === 'skip' ? { skipWhy: s.why || '' } : {}) };
|
|
198
220
|
};
|
|
199
221
|
const anyTasks = rows.length > 0 || jira;
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
list.forEach((s, i) => { if (cur >= 0 && i < cur) { const rs = secOf(s, i); if (rs.some((x) => !x.closed && x.late)) keep.add(i); else past.push(i); } });
|
|
203
|
-
if (past.length) {
|
|
204
|
-
const rs = past.flatMap((i) => secOf(list[i], i)), skips = past.filter((i) => list[i].status === 'skip');
|
|
205
|
-
const a = past[0] + 1, b = past[past.length - 1] + 1;
|
|
206
|
-
const from = past.map((i) => ran[i].from).filter(Boolean).sort()[0] || '', to = past.map((i) => ran[i].to).filter(Boolean).sort().pop() || (cur >= 0 ? ran[cur].from : '') || '';
|
|
207
|
-
const sk = skips.map((i) => list[i].name + ' skipped' + (list[i].why ? ': ' + list[i].why.replace(/\.$/, '').replace(/^./, (c) => c.toLowerCase()) : '')).join(' · ');
|
|
208
|
-
sections.push({ kind: 'past', key: 'past', label: a === b ? list[a - 1].name : 'Stages ' + a + '–' + b, sub: [span(from, to, today), sk].filter(Boolean).join(' · '),
|
|
209
|
-
count: rs.length ? rs.filter((x) => x.closed).length + ' done' : '', open: false, ...bodyOf(rs, archOf(past.map((i) => list[i].key))), stages: past.map((i) => one(list[i], i)) });
|
|
210
|
-
}
|
|
211
|
-
// now and any past stage with a late task, in workflow order; later stages with a late task stay open, the rest fold into Later
|
|
212
|
-
const later = [];
|
|
222
|
+
// one row per stage, in workflow order (batch 11 item 5, Wawan: "one row/group per stage. Do not combine"): past and later stages are no
|
|
223
|
+
// longer merged into "Stages 1–4" or "Later: …". A stage that is not live starts folded; the current one and any with a late task start open.
|
|
213
224
|
list.forEach((s, i) => {
|
|
214
|
-
|
|
215
|
-
if (i === cur) {
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
x.count = countOf(opn.length + x.top.length + x.groups.reduce((n, g) => n + g.n, 0), x.top.filter((y) => y.late).length, 0);
|
|
222
|
-
x.sub = x.sub + (x.sub ? ' · ' : '') + 'Jira tickets, by epic';
|
|
223
|
-
}
|
|
224
|
-
sections.push(x); return;
|
|
225
|
+
const x = one(s, i);
|
|
226
|
+
if (i === cur && jira && tkOwn.length) {
|
|
227
|
+
const opn = tkOwn.filter((k) => k.status !== 'Done').sort((a, b) => (b.blocked ? 1 : 0) - (a.blocked ? 1 : 0));
|
|
228
|
+
x.jira = { open: opn.map((k) => ({ key: k.key, title: k.title, epic: k.epic || '', status: k.status || 'To do', start: k.start || '', due: k.due || k.sprintEnd || '', here: !!k.datesHere, days: jDays(k, today), av: initials(k.assignee), sub: [k.blocked ? 'Blocked' + (k.reason ? ' by ' + String(k.reason).replace(/^Waiting on /i, '') : '') : k.status || 'To do', k.assignee || ''].filter(Boolean).join(' · '), warn: !!k.blocked })),
|
|
229
|
+
done: tkOwn.length - opn.length, total: tkOwn.length, at: ctx.jiraAt || '' };
|
|
230
|
+
x.count = countOf(opn.length + x.top.length + x.groups.reduce((n, g) => n + g.n, 0), x.top.filter((y) => y.late).length, 0);
|
|
231
|
+
x.sub = x.sub + (x.sub ? ' · ' : '') + 'Jira tickets, by epic';
|
|
225
232
|
}
|
|
226
|
-
|
|
227
|
-
if (rs.some((x) => !x.closed && x.late)) sections.push(one(s, i));
|
|
228
|
-
else later.push(i);
|
|
233
|
+
sections.push(x);
|
|
229
234
|
});
|
|
230
|
-
if (later.length) {
|
|
231
|
-
const rs = later.flatMap((i) => secOf(list[i], i)), op = rs.filter((x) => !x.closed);
|
|
232
|
-
const ds = rs.map((x) => x.end).filter(Boolean).sort();
|
|
233
|
-
sections.push({ kind: 'later', key: 'later', label: 'Later: ' + later.map((i) => list[i].name).join(', '), sub: ds.length ? 'Plan ' + span(ds[0], ds[ds.length - 1], today) : '',
|
|
234
|
-
count: op.length ? op.length + ' to do' : '', open: false, ...bodyOf(rs, archOf(later.map((i) => list[i].key))), stages: later.map((i) => one(list[i], i)) });
|
|
235
|
-
}
|
|
236
235
|
const loose = rows.filter((x) => !x.sec);
|
|
237
236
|
if (loose.length) {
|
|
238
237
|
const op = loose.filter((x) => !x.closed), lt = op.filter((x) => x.late);
|
|
239
238
|
sections.push({ kind: 'none', key: '', label: 'Not in a stage', sub: '', count: countOf(op.length, lt.length, loose.length - op.length), warn: lt.length > 0, open: op.length > 0, ...bodyOf(loose, archOf([''])) });
|
|
240
239
|
}
|
|
241
|
-
const nOpen = open.length + (jira ?
|
|
240
|
+
const nOpen = open.length + (jira ? tkOwn.filter((k) => k.status !== 'Done').length : 0), nDone = rows.length - open.length + (jira ? tkOwn.filter((k) => k.status === 'Done').length : 0);
|
|
242
241
|
const tasks = { open: nOpen, done: nDone, late: late.length, count: [nOpen ? nOpen + ' open' : '', nDone ? nDone + ' done' : ''].filter(Boolean).join(' · '), sections,
|
|
243
242
|
empty: !anyTasks ? { stages: list.map((s, i) => ({ n: i + 1, name: s.name, ms: s.ms, now: i === cur })) } : null };
|
|
244
243
|
|
|
@@ -264,7 +263,15 @@ export function iniView(r, ctx = {}) {
|
|
|
264
263
|
summary.wf = r.wf || { id: PF_ID, name: 'Product feature', icon: 'feature' };
|
|
265
264
|
summary.program = ctx.program || null;
|
|
266
265
|
const today2 = (n) => String(n).padStart(2, '0');
|
|
267
|
-
return { id: r.id || null, key: r.key, title: r.title, today: today.getFullYear() + '-' + today2(today.getMonth() + 1) + '-' + today2(today.getDate()), summary, stage, tasks, docs: ctx.docs != null ? ctx.docs : null, linked: linkedOf(r)
|
|
266
|
+
return { vs: r.__vs || null, links: r.__vs && r.__vs.draft ? null : r.links || null, id: r.id || null, key: r.key, title: r.title, today: today.getFullYear() + '-' + today2(today.getMonth() + 1) + '-' + today2(today.getDate()), summary, stage, tasks, docs: ctx.docs != null ? ctx.docs : null, linked: linkedOf(r),
|
|
267
|
+
// split or merge (batch 11 item 14): Claude's suggestion for it, and where its work went when it was merged
|
|
268
|
+
suggest: r.suggest || null, merged: mergedOf(r) };
|
|
269
|
+
}
|
|
270
|
+
/** A merged initiative's closing line (XsmA7Closed): the one that stays and the day. null for every other row. */
|
|
271
|
+
export function mergedOf(r) {
|
|
272
|
+
const a = (r && r.acts && r.acts.archived) || (r && r.archived) || null;
|
|
273
|
+
if (!a || !a.intoId || !/^Merged into /.test(a.reason || '')) return null;
|
|
274
|
+
return { intoId: a.intoId, into: a.into || a.intoId, at: a.at || '' };
|
|
268
275
|
}
|
|
269
276
|
/** What it links to, from its trail: the PRD (with its version), the rubric, the evaluation, the release notes, what it waits on, its epic. */
|
|
270
277
|
export function linkedOf(r) {
|
|
@@ -275,6 +282,69 @@ export function linkedOf(r) {
|
|
|
275
282
|
if (epic) out.push({ kind: 'epic', label: 'Epic ' + epic });
|
|
276
283
|
return out;
|
|
277
284
|
}
|
|
285
|
+
|
|
286
|
+
/* ── Group by (batch 11 item 20; canvas In development, row "Tasks takes over the old All tasks panel": XtaA1Group to XtaA5Phone) ──
|
|
287
|
+
* The old All tasks panel is gone; its two jobs live in the Tasks section. The PM's grouping is kept for the workspace (lib/initiative-
|
|
288
|
+
* layout.js: by, picked, names, of, sets). Stage is the WBS above, unchanged. The other groupings take every task of every section and
|
|
289
|
+
* group it again; each group is a section of kind 'group' (or 'epic'), so the three views draw it with no code of their own. Links,
|
|
290
|
+
* the ◇ and the trash belong to the task, so they come with it. Jira's own tickets (Build's section) have no owner or epic here: in any
|
|
291
|
+
* grouping but Stage they sit in one "In Jira" section. */
|
|
292
|
+
export const GROUP_BY = { stage: 'Stage', epic: 'Epic', mine: 'Your groups', owner: 'Owner', status: 'Status' };
|
|
293
|
+
/** An old layout's 'stage' (from before tasks were the WBS) means what Stage means again; 'none' is no longer offered and reads as Stage. */
|
|
294
|
+
export function groupBy(L, T) {
|
|
295
|
+
const l = L || {};
|
|
296
|
+
if (l.picked && GROUP_BY[l.by]) return l.by;
|
|
297
|
+
if (l.picked) return 'stage';
|
|
298
|
+
return T && T.ok === true && T.drafted ? 'epic' : 'stage';
|
|
299
|
+
}
|
|
300
|
+
const STATUS_ORDER = ['To do', 'In progress', 'Done', "Won't do"];
|
|
301
|
+
export function groupSections(tasks, by, L, T) {
|
|
302
|
+
const S = (tasks && tasks.sections) || [];
|
|
303
|
+
if (!GROUP_BY[by] || by === 'stage') return { sections: S, sum: null };
|
|
304
|
+
const all = [], arch = [], jr = []; let jd = 0, jt = 0, jat = '';
|
|
305
|
+
const walk = (s) => {
|
|
306
|
+
if (s.stages) { s.stages.forEach(walk); return; }
|
|
307
|
+
all.push(...s.top, ...s.groups.flatMap((g) => g.rows), ...s.done); arch.push(...(s.archived || []));
|
|
308
|
+
if (s.jira) { jr.push(...s.jira.open); jd += s.jira.done; jt += s.jira.total; jat = s.jira.at || jat; }
|
|
309
|
+
};
|
|
310
|
+
S.forEach(walk);
|
|
311
|
+
const sec = (kind, key, label, rows, more = {}) => {
|
|
312
|
+
const op = rows.filter((x) => !x.closed), lt = op.filter((x) => x.late);
|
|
313
|
+
return { kind, key, label, sub: '', count: countOf(op.length, lt.length, rows.length - op.length), warn: lt.length > 0, open: true, ...bodyOf(rows, more.archived || []), jira: null, ...more };
|
|
314
|
+
};
|
|
315
|
+
const out = [], lay = L || {}, names = lay.names || [], of = lay.of || {};
|
|
316
|
+
let sum = null;
|
|
317
|
+
if (by === 'mine') {
|
|
318
|
+
const g = (x) => { const n = of['task:' + x.uid]; return n && names.includes(n) ? n : ''; };
|
|
319
|
+
for (const n of names) out.push(sec('group', 'g:' + n, n, all.filter((x) => g(x) === n), { archived: arch.filter((x) => g(x) === n), mine: n }));
|
|
320
|
+
const rest = all.filter((x) => !g(x));
|
|
321
|
+
// the tasks in no group fold while the PM's own groups are there (XtaA3Mine); with none yet they are the list
|
|
322
|
+
out.push(sec('group', 'g:', names.length ? 'Not in a group' : 'Not in a group yet', rest, { archived: arch.filter((x) => !g(x)), mine: '', loose: true, open: !names.length }));
|
|
323
|
+
} else if (by === 'owner') {
|
|
324
|
+
const who = [...new Set(all.concat(arch).map((x) => x.owner || ''))].sort((a, b) => (!a) - (!b) || a.localeCompare(b));
|
|
325
|
+
who.forEach((n, i) => out.push(sec('group', 'o:' + n, n || 'No owner', all.filter((x) => (x.owner || '') === n), { archived: arch.filter((x) => (x.owner || '') === n), open: i === 0 })));
|
|
326
|
+
} else if (by === 'status') {
|
|
327
|
+
const keys = STATUS_ORDER.concat([...new Set(all.map((x) => x.status).filter((s) => !STATUS_ORDER.includes(s)))]);
|
|
328
|
+
for (const k of keys) { const rs = all.filter((x) => x.status === k); if (rs.length) out.push(sec('group', 's:' + k, k, rs, { open: !out.length })); }
|
|
329
|
+
if (arch.length) out.push(sec('group', 's:Archived', 'Archived', [], { archived: arch, open: false }));
|
|
330
|
+
} else if (by === 'epic') {
|
|
331
|
+
const G = ticketGroups(T), pushed = new Set(((T && T.tickets) || []).map((t) => t.key).filter(Boolean));
|
|
332
|
+
G.forEach((g, i) => out.push({ kind: 'epic', key: 'ep:' + g.id, label: g.name, sub: '', epicKey: g.key || '', gid: g.id, send: T.pushing ? 0 : g.send,
|
|
333
|
+
count: g.inJira === g.n ? g.n + ' in Jira' : (g.n - g.inJira) + ' drafted', warn: false, open: i === 0, top: [], groups: [], done: [], archived: [], jira: null, tk: g.rows }));
|
|
334
|
+
// "Jira read at 9:02", said once, under the last epic that has a ticket in Jira
|
|
335
|
+
const lastJ = out.filter((x) => x.kind === 'epic' && x.tk.some((r) => r.inJira)).pop(); if (lastJ && T.checkedAt) lastJ.tkRead = T.checkedAt;
|
|
336
|
+
// nothing drafted: By epic says what comes next (every gap has its next action): Draft the tickets, or why there is nothing to draft
|
|
337
|
+
if (!G.length) out.push({ kind: 'epic', key: 'ep:', label: 'Jira tickets', sub: '', count: '', open: true, top: [], groups: [], done: [], archived: [], jira: null,
|
|
338
|
+
tkEmpty: !T ? { reading: true } : T.ok !== true ? { error: T.error || 'The tickets could not be read.' } : T.items ? { items: T.items } : { none: true } });
|
|
339
|
+
for (let i = jr.length - 1; i >= 0; i--) if (pushed.has(jr[i].key)) jr.splice(i, 1);
|
|
340
|
+
out.push(sec('group', 'yours', 'Your tasks', all, { archived: arch, open: !G.length }));
|
|
341
|
+
const send = G.reduce((a, g) => a + g.send, 0), open = tasks.open || 0, meta = [open ? open + ' open' : '', 'grouped by epic'].filter(Boolean).join(' · ');
|
|
342
|
+
if (T && T.ok === true && T.pushing) sum = { line: 'Sending to Jira', tone: 'live', text: 'Claude is creating the tickets with your Atlassian connection. Each task shows its Jira key when it is done.', meta };
|
|
343
|
+
else if (send) sum = { line: plural(send, 'ticket is', 'tickets are') + ' drafted, not in Jira', tone: 'you', text: 'Each PRD story is a task with its Jira ticket drafted. Nothing reaches Jira until you send it.', meta, primary: { act: 'sendall', label: 'Send to Jira' } };
|
|
344
|
+
}
|
|
345
|
+
if (jr.length || jt) out.push({ kind: 'group', key: 'jira', label: 'In Jira', sub: '', count: countOf(jr.length, 0, jd), warn: jr.some((k) => k.warn), open: false, top: [], groups: [], done: [], archived: [], jira: { open: jr, done: jd, total: jt, at: jat } });
|
|
346
|
+
return { sections: out, sum };
|
|
347
|
+
}
|
|
278
348
|
/** The one sentence that says why the status is what it is: the plan end passed, or Jira's pace runs past it, then the first blocked ticket. */
|
|
279
349
|
function whyText(r, list, cur, today, finished) {
|
|
280
350
|
const t = r.track || {}, end = dayOf(r.end), fc = dayOf(t.forecast), said = [];
|