create-pmos 0.401.0 → 0.403.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 -30
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/board-programs-test.js +227 -0
- package/workspace/board-shot.js +54 -0
- package/workspace/briefing-premium-adddoc-test.js +28 -22
- package/workspace/briefing-premium-board-test.js +107 -82
- package/workspace/briefing-premium-calendar-2-test.js +23 -10
- package/workspace/briefing-premium-calendar-3-test.js +23 -19
- package/workspace/briefing-premium-calendar-test.js +20 -15
- package/workspace/briefing-premium-initiative-test.js +25 -12
- package/workspace/briefing-premium-insights-test.js +31 -18
- package/workspace/briefing-premium-metrics-test.js +8 -8
- package/workspace/briefing-premium-sources-test.js +15 -10
- package/workspace/briefing-premium-test.js +39 -16
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +20 -3
- package/workspace/fixtures/briefing-premium-facts.js +18 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
- package/workspace/fixtures/program-ascent.js +101 -0
- package/workspace/guide/home.md +11 -7
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/jira.md +38 -6
- package/workspace/guide/programs.md +37 -0
- package/workspace/home-rows-test.js +184 -0
- package/workspace/lib/briefing-premium-products.js +4 -4
- package/workspace/lib/briefing-premium.js +2 -2
- package/workspace/lib/calendar-layers.js +8 -4
- package/workspace/lib/initiative-layout.js +4 -3
- package/workspace/lib/jira-cli.js +17 -12
- package/workspace/lib/jira-status.js +1 -1
- package/workspace/lib/jira-tickets.js +126 -24
- package/workspace/lib/meeting-files.js +58 -0
- package/workspace/lib/meeting-learn.js +139 -0
- package/workspace/lib/meeting-material.js +12 -5
- package/workspace/lib/notes.js +3 -0
- package/workspace/lib/programs.js +129 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-brief-page.js +8 -1
- package/workspace/lib/routes-briefing-premium.js +1 -1
- package/workspace/lib/routes-calendar-views.js +24 -3
- package/workspace/lib/routes-meeting-material.js +38 -0
- package/workspace/lib/routes-meeting-points.js +23 -3
- package/workspace/lib/routes-programs.js +122 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +31 -25
- package/workspace/premium-chat-context-test.js +1 -1
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-viewer-test.js +1 -1
- package/workspace/premium-core-doc-issue-test.js +13 -7
- package/workspace/premium-discuss-landing-test.js +83 -0
- package/workspace/premium-link-suggest-test.js +103 -0
- package/workspace/premium-report-read-test.js +86 -82
- package/workspace/premium-vw-backlog-test.js +6 -5
- package/workspace/premium-vw-cal-test.js +45 -19
- package/workspace/premium-vw-item-test.js +8 -6
- package/workspace/premium-vw-jira-test.js +3 -2
- package/workspace/premium-vw-meet-test.js +122 -66
- package/workspace/premium-vw-notes-test.js +7 -6
- package/workspace/premium-vw-rec-test.js +14 -13
- package/workspace/premium-vw-slides-test.js +11 -5
- package/workspace/program-panel-test.js +152 -0
- package/workspace/public/pm/bd-acts.js +24 -15
- package/workspace/public/pm/bd-asks.js +111 -30
- package/workspace/public/pm/bd-ini-panel.js +229 -0
- package/workspace/public/pm/bd-pop.js +2 -2
- package/workspace/public/pm/bd-prog-panel.js +436 -0
- package/workspace/public/pm/bd-prog.js +191 -0
- package/workspace/public/pm/bd-span.js +98 -15
- package/workspace/public/pm/bd-views.js +93 -29
- package/workspace/public/pm/cozy-board.css +214 -20
- package/workspace/public/pm/cozy-evui.js +4 -2
- package/workspace/public/pm/cozy-home-rows.css +54 -0
- package/workspace/public/pm/cozy-home.css +35 -0
- package/workspace/public/pm/cozy-insights.css +1 -2
- package/workspace/public/pm/cozy-mtg-present.css +160 -0
- package/workspace/public/pm/cozy-panel.css +155 -0
- package/workspace/public/pm/cozy-rec-pill.css +12 -0
- package/workspace/public/pm/cozy-rec-pill.js +46 -0
- package/workspace/public/pm/cozy-today.css +189 -0
- package/workspace/public/pm/cozy-viewer.js +307 -43
- package/workspace/public/pm/cozy-vw-mtg.css +96 -94
- package/workspace/public/pm/cozy-vw-rp.css +40 -25
- package/workspace/public/pm/cozy-vw-shell.css +127 -0
- package/workspace/public/pm/cozy-xv.css +51 -0
- package/workspace/public/pm/cozy-xv.js +34 -0
- package/workspace/public/pm/home-app.js +192 -72
- package/workspace/public/pm/home-chat.js +17 -4
- package/workspace/public/pm/home-data.js +1 -1
- package/workspace/public/pm/home-day.js +64 -0
- package/workspace/public/pm/home-ini-model.js +1 -1
- package/workspace/public/pm/home-ini.js +197 -54
- package/workspace/public/pm/home-list.js +100 -27
- package/workspace/public/pm/home-mentions.js +187 -0
- package/workspace/public/pm/home-rec-row.js +67 -0
- package/workspace/public/pm/home-review.js +20 -10
- package/workspace/public/pm/home-task.js +19 -18
- package/workspace/public/pm/home-today.js +137 -59
- package/workspace/public/pm/premium-board.js +294 -288
- package/workspace/public/pm/premium-insights.js +118 -82
- package/workspace/public/pm/premium-mtg-present.js +408 -100
- package/workspace/public/pm/premium-mtg-replay.js +70 -10
- package/workspace/public/pm/premium-report-read.js +118 -63
- package/workspace/public/pm/premium-vw-cal.js +62 -34
- package/workspace/public/pm/premium-vw-mtg.js +348 -192
- package/workspace/public/pm/program-model.js +192 -0
- package/workspace/public/pm/rec-state.js +63 -0
- package/workspace/public/pm/rp-parts.js +33 -8
- package/workspace/public/pm/tk-draft.js +107 -0
- package/workspace/public/pm/tk-model.js +134 -0
- package/workspace/public/pm/tk-send.js +124 -0
- package/workspace/public/pm/tk-tasks.css +120 -0
- package/workspace/public/premium-board.html +4 -2
- package/workspace/server.js +4 -2
- package/workspace/skills/jira-push.skill +3 -3
- package/workspace/test-lists/board-programs.json +9 -0
- package/workspace/test-lists/prd-to-jira.json +6 -0
- package/workspace/test-lists/program-hierarchy.json +11 -0
- package/workspace/test-lists/program-panel.json +9 -0
- package/workspace/test-lists/viewer-home-rows.json +9 -0
- package/workspace/test-lists/viewer-meetings.json +9 -0
- package/workspace/test-lists/viewer-shell-a.json +15 -0
- package/workspace/tk-tasks-test.js +199 -0
|
@@ -25,6 +25,7 @@ import { $, $$, esc, toast, wireRail, setPageGaps } from './premium-shell.js';
|
|
|
25
25
|
import { pmPost } from './http.js';
|
|
26
26
|
import { openReport } from './premium-report-read.js';
|
|
27
27
|
import { mountNav } from './cozy-nav.js';
|
|
28
|
+
import { mountRecPill } from './cozy-rec-pill.js';
|
|
28
29
|
|
|
29
30
|
let M = null; // the model
|
|
30
31
|
let BM = null, bmErr = ''; // the Board measures (Delivery trends)
|
|
@@ -38,6 +39,7 @@ let loadedAt = 0;
|
|
|
38
39
|
let selecting = false; let picked = []; // New dashboard: the goals picked in the table, in order
|
|
39
40
|
wireRail('rep');
|
|
40
41
|
mountNav('insights');
|
|
42
|
+
mountRecPill();
|
|
41
43
|
|
|
42
44
|
const SV = (d, sw) => `<svg viewBox="0 0 24 24" aria-hidden="true"${sw ? ` stroke-width="${sw}"` : ''}><path d="${d}"/></svg>`;
|
|
43
45
|
const I = {
|
|
@@ -67,8 +69,7 @@ function viewer(o) {
|
|
|
67
69
|
}
|
|
68
70
|
const isPhone = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
|
|
69
71
|
const closeViewer = () => { if (window.czViewer && typeof window.czViewer.close === 'function') window.czViewer.close(); else closeSide(); };
|
|
70
|
-
// The
|
|
71
|
-
document.addEventListener('cz-viewer', (e) => document.body.classList.toggle('ins-vwon', !!(e.detail && e.detail.open)));
|
|
72
|
+
// The Viewer floats over the page (XvAInsight); the page does not move for it.
|
|
72
73
|
|
|
73
74
|
/* ── small menus: one open at a time, Escape and an outside press close it ─────────────────────────────────────────────────────── */
|
|
74
75
|
const MENUS = [['#prodPick', '#prodMenu'], ['#viewChip', '#viewMenu'], ['#perChip', '#perMenu'], ['#filtB', '#filtMenu'], ['#newB', '#newMenu'], ['#moreB', '#moreMenu']];
|
|
@@ -497,95 +498,128 @@ function detailSvg(g, c, W = 490, H = 150) {
|
|
|
497
498
|
const emptyTrend = (g, add) => `<div class="ins-box ins-etr"><span>${g.readings ? 'A trend needs 2 readings.' : 'No reading yet. A trend needs 2 readings.'} ${esc(nextReading(g))}</span>${add ? '<button type="button" class="ins-btn sm" data-gx="add">Add a reading</button>' : ''}</div>`;
|
|
498
499
|
const dashSwitches = (g) => savedDash().map((D) => { const on = D.charts.includes(g.id); return `<div class="ins-trow"><span>${esc(D.name)}</span><button type="button" class="ins-tog${on ? ' on' : ''}" role="switch" aria-checked="${on}" aria-label="On ${esc(D.name)}" data-gx="dash" data-d="${esc(D.id)}"></button></div>`; }).join('')
|
|
499
500
|
|| '<p class="note">No dashboard is saved yet. New dashboard makes one.</p>';
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
501
|
+
/* ── a goal in the Viewer's shell A (initiative viewer-shell-a, V9; canvas XvAInsight): the summary card with its one primary (Add a
|
|
502
|
+
* reading), the chart, then the folding rows Readings, Moved by and On your dashboards. The tabs Readings | Moved by are gone; on a phone
|
|
503
|
+
* it is the same shell, full screen. ⋯ holds Edit chart, then Copy link and Copy as text. Discuss in chat takes the goal to Home. ── */
|
|
504
|
+
const vwOpen = (o) => { const V = window.czViewer; return V && typeof V.open === 'function' && typeof V.czSummary === 'function' ? V.open(o) : null; };
|
|
505
|
+
/** The change since the reading before: "Up 3 since Oct 6." in the goal's unit; '' with fewer than 2 readings. */
|
|
506
|
+
function sinceOf(g) {
|
|
507
|
+
const S = g.series || []; if (S.length < 2) return '';
|
|
508
|
+
const a = S[S.length - 2], b = S[S.length - 1], d = Math.round((b.v - a.v) * 100) / 100;
|
|
509
|
+
return (d === 0 ? 'No change' : (d > 0 ? 'Up ' : 'Down ') + unitV(g, Math.abs(d))) + ' since ' + md(day(a.at)) + '.';
|
|
510
|
+
}
|
|
511
|
+
function goalSummary(g, own) {
|
|
512
|
+
const steps = g.type === 'Done or not' && g.steps && g.steps.length;
|
|
513
|
+
const line = [g.nowTxt ? g.nowTxt + ' now' : 'No reading yet', g.targetTxt ? 'target ' + g.targetTxt + (g.byAt ? ' by ' + md(day(g.byAt)) : '') : 'no target'].join(' · ');
|
|
506
514
|
const pace = g.pace ? (g.pace.head !== '—' ? g.pace.head + (g.pace.sub ? ', ' + g.pace.sub : '') : g.pace.sub) : '';
|
|
507
|
-
const
|
|
508
|
-
const
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
|
|
515
|
+
const ship = shipsOf(g).sort((x, y) => y.t - x.t)[0];
|
|
516
|
+
const text = [sinceOf(g), pace ? pace.charAt(0).toUpperCase() + pace.slice(1) + '.' : '', ship ? ship.label + ' on ' + md(ship.t) + '.' : ''].filter(Boolean).join(' ');
|
|
517
|
+
const meta = [PF ? g.prod : '', g.source ? 'From ' + srcOf(g).toLowerCase() : '', g.owner, g.dirTxt, g.guardrail].filter(Boolean).join(' · ');
|
|
518
|
+
const tone = g.pace && g.pace.tone === 'late' ? 'warn' : '';
|
|
519
|
+
return { line, tone, text, meta, primary: !steps && own ? { label: 'Add a reading', act: 'add' } : null };
|
|
520
|
+
}
|
|
521
|
+
function readingsHtml(g, o) {
|
|
522
|
+
const steps = g.type === 'Done or not' && g.steps && g.steps.length, R = g.series.slice().reverse(), shown = o.more ? R : R.slice(0, 3);
|
|
523
|
+
return (R.length ? `<div class="ins-th2"><span>Reading</span><span>Value</span><span>Source</span></div>` + shown.map((r) => `<div class="ins-trow ins-rd3"><span>${esc(md(day(r.at)) + ' ' + r.at.slice(0, 4))}</span><b>${esc(unitV(g, r.v))}</b><span class="note">${esc(srcOf(g))}</span></div>`).join('')
|
|
524
|
+
+ (R.length > shown.length ? `<div><button type="button" class="ins-btn sm ghost" data-gx="all">All ${R.length} readings</button></div>` : '') : `<p class="note">${esc(nextReading(g))}</p>`)
|
|
525
|
+
+ (steps ? `<form class="ins-mf" data-stf><p class="ins-lbl">Steps</p>${g.steps.map((x, i) => `<label class="ins-ck2"><input type="checkbox" name="s${i}"${x.done ? ' checked' : ''}> ${esc(x.text)}</label>`).join('')}<div class="ins-mact"><button type="submit" class="ins-btn sm dark">Save steps</button><span class="note" data-msg role="status"></span></div></form>` : '');
|
|
526
|
+
}
|
|
527
|
+
const movedHtml = (g) => (g.moves.length ? `<div class="ins-mvl">${g.moves.map((r) => initRow(r)).join('')}</div>` : `<p class="note">${M.initiativesRead ? 'No initiative anchors to it yet. An initiative moves it once its anchor names it.' : 'The initiatives are not read yet.'}</p>`);
|
|
528
|
+
function goalBodyHtml(g, o) {
|
|
529
|
+
const V = window.czViewer, c = g.key ? byKey(g.key) : null, phone = isPhone(), steps = g.type === 'Done or not' && g.steps && g.steps.length;
|
|
530
|
+
const chart = steps ? stepsHtml(g) : c ? detailSvg(g, c, phone ? 358 : 490, phone ? 120 : 150) : emptyTrend(g, false);
|
|
531
|
+
const form = !steps && o.adding ? `<form class="ins-mf ins-box" data-rdf><div class="ins-2"><label class="ins-fl">Date<input class="ins-inp" type="date" name="at" value="${esc(M.today || '')}"></label><label class="ins-fl">Value${g.unit ? ' (' + esc(g.unit) + ')' : ''}<input class="ins-inp" name="v" inputmode="decimal" maxlength="16"></label></div><div class="ins-mact"><button type="submit" class="ins-btn sm dark">Add reading</button><button type="button" class="ins-btn sm ghost" data-gx="cancel">Cancel</button><span class="note" data-msg role="status"></span></div></form>` : '';
|
|
532
|
+
const onDash = savedDash().filter((D) => D.charts.includes(g.id)).length;
|
|
533
|
+
const rows = [
|
|
534
|
+
{ id: 'read', title: 'Readings', count: g.series.length, open: o.open === 'read', render: () => readingsHtml(g, o) },
|
|
535
|
+
{ id: 'moved', title: 'Moved by', count: g.moves.length, open: o.open === 'moved', render: () => movedHtml(g) },
|
|
536
|
+
o.own ? { id: 'dash', title: 'On your dashboards', count: onDash, render: () => dashSwitches(g) } : null,
|
|
537
|
+
];
|
|
538
|
+
return V.czSummary(goalSummary(g, o.own && !o.adding)) + chart + form + V.czSections(rows, { key: 'goal' }) + '<p class="note ins-gmsg" data-gmsg role="status"></p>';
|
|
539
|
+
}
|
|
540
|
+
/** The goal as plain text, for Copy as text. */
|
|
541
|
+
function goalText(g) {
|
|
542
|
+
const s = goalSummary(g, false), kr = krId(g);
|
|
543
|
+
return [(kr ? kr + ' · ' : '') + g.title, s.line, s.text, s.meta].filter(Boolean).join('\n') + (g.moves.length ? '\nMoved by: ' + g.moves.map((m) => m.title).join(', ') : '');
|
|
525
544
|
}
|
|
526
|
-
|
|
545
|
+
const goalLink = (g) => new URL(setQ({ goal: g.id, tab: null }), location.href).href;
|
|
546
|
+
function copyText(text, said) { try { navigator.clipboard.writeText(text).then(() => toast(said), () => toast('This browser did not allow the copy.')); } catch { toast('This browser did not allow the copy.'); } }
|
|
547
|
+
function openGoalDetail(id, open0) {
|
|
527
548
|
let g = goalById(id); if (!g) return;
|
|
528
|
-
const own = goalWs(g) === M.board.ws, st = {
|
|
549
|
+
const own = goalWs(g) === M.board.ws, st = { open: open0 || '', more: false, adding: false, own };
|
|
529
550
|
const kr = krId(g);
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
551
|
+
const more = [];
|
|
552
|
+
if (own && M.goals.some((x) => x.id === g.id)) more.push({ label: 'Edit chart', on: () => openChartEdit(g.id) }, { sep: true });
|
|
553
|
+
more.push({ label: 'Copy link', on: () => copyText(goalLink(g), 'Link copied.') }, { label: 'Copy as text', on: () => copyText(goalText(g), 'Copied as text.') });
|
|
554
|
+
const body = vwOpen({ kind: 'Goal', title: (kr ? kr + ' · ' : '') + g.title, icon: 'goal', id: 'goal:' + id, more,
|
|
555
|
+
discuss: true,
|
|
556
|
+
render: (el) => {
|
|
557
|
+
el.classList.add('ins-vbody', 'ins-xv');
|
|
558
|
+
const draw = () => { const top = el.scrollTop; el.innerHTML = goalBodyHtml(g, st); el.scrollTop = top; };
|
|
559
|
+
const fresh = async (said) => { toast(said); await load(); if (PF) await openPortfolio(); g = goalById(id); if (g) draw(); };
|
|
560
|
+
draw();
|
|
561
|
+
el.onclick = async (e) => {
|
|
562
|
+
const x = e.target.closest('[data-gx], [data-czs-act]'); if (!x || x.disabled) return;
|
|
563
|
+
const k = x.dataset.gx || x.dataset.czsAct, msg = el.querySelector('[data-gmsg]');
|
|
564
|
+
if (k === 'all') { st.more = true; st.open = 'read'; draw(); }
|
|
565
|
+
else if (k === 'add') { st.adding = true; draw(); const f = el.querySelector('[data-rdf] [name="v"]'); if (f) f.focus(); }
|
|
566
|
+
else if (k === 'cancel') { st.adding = false; draw(); }
|
|
567
|
+
else if (k === 'dash') {
|
|
568
|
+
const D = savedDash().find((d) => d.id === x.dataset.d); if (!D) return;
|
|
569
|
+
const on = D.charts.includes(g.id); x.disabled = true; msg.textContent = 'Saving.';
|
|
570
|
+
const res = await saveDash({ id: D.id, name: D.name, purpose: D.purpose, charts: on ? D.charts.filter((c) => c !== g.id) : D.charts.concat(g.id), main: D.main });
|
|
571
|
+
if (!res || res.ok !== true) { x.disabled = false; msg.textContent = (res && res.error) || 'The dashboard could not be saved. Nothing changed.'; return; }
|
|
572
|
+
await fresh((on ? 'Took it off ' : 'Added it to ') + D.name + '.');
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
el.onsubmit = async (e) => {
|
|
576
|
+
const f = e.target; if (!f.matches('[data-rdf], [data-stf]')) return;
|
|
577
|
+
e.preventDefault(); const m = f.querySelector('[data-msg]');
|
|
578
|
+
if (f.matches('[data-rdf]')) {
|
|
579
|
+
const v = f.v.value.trim(), at = f.at.value;
|
|
580
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(at) || v === '' || !Number.isFinite(Number(v))) { m.textContent = 'Pick a date and type a number.'; return; }
|
|
581
|
+
m.textContent = 'Saving.';
|
|
582
|
+
const res = await pmPost('/api/records/kr-metrics/reading', { ws: goalWs(g), rid: goalRid(g), at, value: Number(v), why: 'Reading from Insights' });
|
|
583
|
+
if (!res || res.ok !== true) { m.textContent = (res && res.error) || 'It could not be saved. Nothing changed.'; return; }
|
|
584
|
+
st.adding = false; await fresh('Added the reading.');
|
|
585
|
+
} else {
|
|
586
|
+
m.textContent = 'Saving.';
|
|
587
|
+
const res = await pmPost('/api/insights-records/steps', { ws: goalWs(g), rid: goalRid(g), done: g.steps.map((_, i) => f['s' + i].checked) });
|
|
588
|
+
if (!res || res.ok !== true) { m.textContent = (res && res.error) || 'It could not be saved. Nothing changed.'; return; }
|
|
589
|
+
await fresh('Saved the steps.');
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
} });
|
|
593
|
+
if (!body) openGoalSide(g, st); // no shell A on this page: the page's own side panel
|
|
568
594
|
}
|
|
569
|
-
|
|
595
|
+
/** The fallback with no Viewer: the goal's summary and rows in the page's side panel. */
|
|
596
|
+
function openGoalSide(g, st) {
|
|
597
|
+
openSide({ kind: 'view', eye: 'Goal', title: g.title, body: '', note: '', go: null });
|
|
598
|
+
const sum = goalSummary(g, false);
|
|
599
|
+
$('#sideBody').innerHTML = `<div class="ins-gd"><div class="ins-gh"><p class="ins-gsub">${esc(sum.line)}</p>${sum.text ? `<p class="note">${esc(sum.text)}</p>` : ''}</div>${readingsHtml(g, st)}${movedHtml(g)}</div>`;
|
|
600
|
+
}
|
|
601
|
+
/* a health budget in the same shell: its reading is its share of the board's open initiatives against its cap; what moves it is the work anchored to it */
|
|
570
602
|
function openBudget(id) {
|
|
571
603
|
const b = (M.budgets || []).find((x) => x.id === id); if (!b) return;
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
604
|
+
const R = b.reading, has = R && R.share !== null;
|
|
605
|
+
const sum = { line: [has ? pct(R.share) + ' now' : 'No reading yet', b.cap !== null ? 'cap ' + pct(b.cap) + ' of a quarter’s initiatives' : 'no cap declared'].join(' · '), tone: has && R.over ? 'warn' : '',
|
|
606
|
+
text: has ? (R.over ? 'Over its cap.' : 'Within its cap.') + ' ' + R.n + ' of ' + R.total + ' open on the Board.' : 'It has no reading: ' + (b.declared ? 'no open initiative to share.' : 'it is not in the budget registry.'),
|
|
607
|
+
meta: [b.anchor, 'always on', 'judged every week'].join(' · ') };
|
|
608
|
+
const text = [b.title, sum.line, sum.text].join('\n');
|
|
609
|
+
vwOpen({ kind: 'Health budget', title: b.title, icon: 'goal', id: 'budget:' + id, more: [{ label: 'Copy as text', on: () => copyText(text, 'Copied as text.') }],
|
|
610
|
+
discuss: true,
|
|
611
|
+
render: (el) => {
|
|
612
|
+
el.classList.add('ins-vbody', 'ins-xv');
|
|
613
|
+
const V = window.czViewer;
|
|
578
614
|
const meter = has && b.cap !== null ? bandSvg([{ at: M.today || iso(today()), v: R.share * 100 }], b.cap * 100, true, R.over ? 'late' : 'ok', b.title + ': ' + pct(R.share) + ' of open initiatives, the green band is inside its ' + pct(b.cap) + ' cap', isPhone() ? 358 : 490, 60) : '';
|
|
579
|
-
const
|
|
580
|
-
: (has ? `<div class="ins-th2"><span>Reading</span><span>Value</span><span>Source</span></div><div class="ins-trow ins-rd3"><span>${esc(md(today()) + ' ' + iso(today()).slice(0, 4))}</span><b>${esc(pct(R.share))}</b><span class="note">${esc(R.n + ' of ' + R.total + ' open on the Board')}</span></div>` : '
|
|
581
|
-
+ `<
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
} });
|
|
615
|
+
const rows = [
|
|
616
|
+
{ id: 'bread', title: 'Readings', count: has ? 1 : 0, render: () => (has ? `<div class="ins-th2"><span>Reading</span><span>Value</span><span>Source</span></div><div class="ins-trow ins-rd3"><span>${esc(md(today()) + ' ' + iso(today()).slice(0, 4))}</span><b>${esc(pct(R.share))}</b><span class="note">${esc(R.n + ' of ' + R.total + ' open on the Board')}</span></div>` : '')
|
|
617
|
+
+ `<p class="note">${esc(b.covers ? 'Covers ' + b.covers + '. ' : 'What it covers is not declared. ')}It is read each time the Board is read. The PM edits the budgets in planning/okrs/health-budgets.md.</p>` },
|
|
618
|
+
{ id: 'bmoved', title: 'Moved by', count: b.moves.length, render: () => (b.moves.length ? `<div class="ins-mvl">${b.moves.map((r) => initRow(r)).join('')}</div>` : '<p class="note">No initiative anchors to it.</p>') },
|
|
619
|
+
];
|
|
620
|
+
el.innerHTML = V.czSummary(sum) + meter + V.czSections(rows, { key: 'budget' });
|
|
621
|
+
} });
|
|
587
622
|
}
|
|
588
|
-
|
|
589
623
|
/* the phone (AgInsPhone): one card per goal, its status at the top right, its value, its so-far, its bar and the first initiative that moves it */
|
|
590
624
|
function cardPill(g) {
|
|
591
625
|
const t = g.pace && g.pace.tone !== 'q' ? g.pace.tone : g.tone;
|
|
@@ -1293,6 +1327,8 @@ async function load() {
|
|
|
1293
1327
|
return;
|
|
1294
1328
|
}
|
|
1295
1329
|
const first = !M; M = r.model; loadedAt = Date.now(); draw(); if (first || !BM) bmLoad();
|
|
1330
|
+
// A shared goal link (?goal=<id>, from "Copy link" in the goal's ⋯) opens that goal once, after the first read.
|
|
1331
|
+
if (first) { const gid = new URLSearchParams(location.search).get('goal'); if (gid && allGoals().some((g) => g.id === gid)) openGoalDetail(gid); }
|
|
1296
1332
|
}
|
|
1297
1333
|
{ const t = new URLSearchParams(location.search).get('tab'); setTab(t === 'outcomes' || t === 'library' ? t : 'goals'); }
|
|
1298
1334
|
load();
|