create-pmos 0.397.0 → 0.399.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 +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/briefing-premium-adddoc-test.js +105 -52
- package/workspace/briefing-premium-board-test.js +284 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +85 -196
- package/workspace/briefing-premium-doc-edit-test.js +99 -83
- package/workspace/briefing-premium-initiative-test.js +175 -290
- package/workspace/briefing-premium-insights-test.js +414 -219
- package/workspace/briefing-premium-metrics-test.js +55 -97
- package/workspace/briefing-premium-products-test.js +44 -28
- package/workspace/briefing-premium-sources-test.js +70 -49
- package/workspace/briefing-premium-test.js +155 -648
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +68 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +121 -24
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +64 -15
- package/workspace/lib/insights-records.js +115 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +12 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +16 -4
- package/workspace/lib/routes-insights-records.js +133 -0
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +3 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +128 -82
- package/workspace/premium-briefing-depth-test.js +104 -90
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +37 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +46 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +52 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +10 -3
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +152 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -33
- package/workspace/premium-vw-cal-test.js +97 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +17 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +115 -187
- package/workspace/premium-vw-notes-test.js +88 -109
- package/workspace/premium-vw-rec-test.js +71 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +383 -0
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +222 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +798 -230
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +437 -170
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +104 -29
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +145 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +1179 -0
- package/workspace/public/pm/home-around.js +413 -0
- package/workspace/public/pm/home-chat.js +512 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +132 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +547 -0
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +548 -395
- package/workspace/public/pm/premium-chart-tab.js +109 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +23 -21
- package/workspace/public/pm/premium-insights.js +1102 -581
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +669 -476
- package/workspace/public/pm/premium-report-tab.js +116 -67
- package/workspace/public/pm/premium-shell.js +76 -123
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +277 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +958 -0
- package/workspace/public/pm/premium-vw-notes.js +116 -68
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +29 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +26 -64
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +18 -107
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -1,120 +1,260 @@
|
|
|
1
|
-
/* pm/bd-span.js — the premium Board's timeline (initiative premium-agreed-design, B2
|
|
2
|
-
* PMOS plan dates against the Jira forecast
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
1
|
+
/* pm/bd-span.js — the premium Board's timeline (initiative premium-agreed-design, B2; the AgBoardTimeline, AgBoardTimelinePhone, AgBoardTlYear
|
|
2
|
+
* and AgBoardTl5y frames). PMOS plan dates against the Jira forecast:
|
|
3
|
+
* · Quarter: one row per initiative over seven weeks (three on a phone), the plan bar with its done part, the days over, the Jira forecast,
|
|
4
|
+
* the sprint band, the today line and the release line, with their labels under the axis. Monitor and Evaluate are hidden here.
|
|
5
|
+
* · Year: themes, with their initiatives as bars inside, coloured by theme.
|
|
6
|
+
* · 5 yr: themes only, as one phase each from the dates on record; past 18 months is directional.
|
|
7
|
+
* · Sprint (BdSpans, initiative premium-uncovered-features): the sprint's working days, each initiative with its tickets in the sprint as rows,
|
|
8
|
+
* who has each one, the release sign-off and "Push tickets" as ◆, and the backlog row. Half is the Year view over six months; 2 yr is the
|
|
9
|
+
* 5 yr view over two years (themes as phases).
|
|
10
|
+
* Themes come from GET /api/board-trail (lib/board-trail.js): one per objective, named by the PRD's theme: key, else the objective's title. The Group
|
|
11
|
+
* control groups the long spans by theme, lane or owner. Milestones: a release's sign-off (◆ with its name), "Push tickets" where drafted tickets
|
|
12
|
+
* wait on the Commit, and "after <initiative>" where a dependency is not done. A bar is drawn only from dates a record holds. Pure: rows and the
|
|
13
|
+
* model in, markup out. */
|
|
6
14
|
import { esc } from './premium-shell.js';
|
|
7
15
|
|
|
8
|
-
const DAY = 86400000;
|
|
9
16
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
10
17
|
const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
11
|
-
const
|
|
18
|
+
export const md = (d) => MON[d.getMonth()] + ' ' + d.getDate();
|
|
12
19
|
const addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
13
20
|
const addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
14
21
|
export const SPANS = [['sprint', 'Sprint'], ['quarter', 'Quarter'], ['half', 'Half'], ['year', 'Year'], ['y2', '2 yr'], ['y5', '5 yr']];
|
|
22
|
+
/** The spans a design draws: every one since the uncovered-features build. */
|
|
23
|
+
export const DRAWN = new Set(SPANS.map(([k]) => k));
|
|
24
|
+
/** The trail's theme tones (lib/board-trail.js TONES), in THEME_TONES order. */
|
|
25
|
+
const TONE_KEYS = ['grey', 'blue', 'green', 'amber', 'violet', 'teal'];
|
|
26
|
+
export const GROUPS = [['theme', 'Theme'], ['lane', 'Lane'], ['owner', 'Owner']];
|
|
27
|
+
/** Theme colours, in the order the Agreed design's themes take them (grey, blue, green, amber, then two more). */
|
|
15
28
|
export const THEME_TONES = ['var(--cz-c-8c929b)', 'var(--cz-c-4894ea)', 'var(--cz-c-5e9c6a)', 'var(--cz-c-d4a13a)', 'var(--cz-c-b07cc6)', 'var(--cz-c-d9773f)'];
|
|
29
|
+
const SV = (d) => `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
30
|
+
const FLAG = 'M5 21V4M5 4h11l-2 4 2 4H5';
|
|
31
|
+
const LINK = 'M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1';
|
|
16
32
|
|
|
17
|
-
/** The window and the ticks of a span, around `now`. */
|
|
18
|
-
export function windowOf(span, now, sprint) {
|
|
33
|
+
/** The window and the ticks of a span, around `now`. Quarter: from the Monday of last week, seven weeks (a phone: this week's Monday, three). */
|
|
34
|
+
export function windowOf(span, now, phone, sprint) {
|
|
19
35
|
const t = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
36
|
+
const mon = addDays(t, -((t.getDay() + 6) % 7));
|
|
20
37
|
if (span === 'sprint') {
|
|
38
|
+
// the sprint the Jira reading holds; with none, two weeks from this Monday
|
|
21
39
|
const a = sprint && day(sprint.start), b = sprint && day(sprint.end);
|
|
22
|
-
const from = a ?
|
|
23
|
-
const
|
|
40
|
+
const from = a && b && b > a ? a : mon, to = a && b && b > a ? addDays(b, 1) : addDays(mon, 14);
|
|
41
|
+
const n = Math.round((to - from) / 86400000), step = phone ? Math.max(2, Math.ceil(n / 4)) : n > 16 ? 2 : 1;
|
|
42
|
+
const ticks = []; for (let i = 0; i < n; i += step) { const d = addDays(from, i); ticks.push({ at: d, label: md(d) }); }
|
|
24
43
|
return { from, to, ticks };
|
|
25
44
|
}
|
|
26
|
-
if (span === '
|
|
27
|
-
const
|
|
28
|
-
const ticks = []; for (let
|
|
29
|
-
return { from: mon, to, ticks };
|
|
30
|
-
}
|
|
31
|
-
if (span === 'half' || span === 'year') {
|
|
32
|
-
const n = span === 'half' ? 6 : 12, from = addMonths(t, span === 'half' ? -1 : -6), to = addMonths(from, n);
|
|
33
|
-
const ticks = []; for (let i = 0; i < n; i++) { const d = addMonths(from, i); ticks.push({ at: d, label: MON[d.getMonth()], sub: d.getMonth() % 3 === 0 ? 'Q' + (d.getMonth() / 3 + 1) + (d.getFullYear() !== t.getFullYear() ? ' ’' + String(d.getFullYear()).slice(2) : '') : '' }); }
|
|
45
|
+
if (span === 'half') {
|
|
46
|
+
const from = addMonths(t, -1), to = addMonths(from, 6);
|
|
47
|
+
const ticks = []; for (let i = 0; i < 6; i++) { const d = addMonths(from, i); ticks.push({ at: d, label: MON[d.getMonth()], sub: d.getMonth() % 3 === 0 ? 'Q' + (d.getMonth() / 3 + 1) : '' }); }
|
|
34
48
|
return { from, to, ticks };
|
|
35
49
|
}
|
|
36
50
|
if (span === 'y2') {
|
|
37
|
-
const q0 = new Date(t.getFullYear(),
|
|
38
|
-
const ticks = []; for (let i = 0; i <
|
|
39
|
-
return { from
|
|
51
|
+
const q0 = new Date(t.getFullYear(), t.getMonth() - (t.getMonth() % 3), 1), from = addMonths(q0, -3), to = addMonths(from, 24);
|
|
52
|
+
const ticks = []; for (let i = 0; i < 24; i += 3) { const d = addMonths(from, i); ticks.push({ at: d, label: 'Q' + (d.getMonth() / 3 + 1), sub: '’' + String(d.getFullYear()).slice(2) }); }
|
|
53
|
+
return { from, to, ticks };
|
|
40
54
|
}
|
|
41
|
-
|
|
55
|
+
if (span === 'quarter') {
|
|
56
|
+
const from = phone ? mon : addDays(mon, -7), n = phone ? 3 : 7, to = addDays(from, 7 * n);
|
|
57
|
+
const ticks = []; for (let i = 0; i < n; i++) { const d = addDays(from, 7 * i); ticks.push({ at: d, label: md(d) }); }
|
|
58
|
+
return { from, to, ticks };
|
|
59
|
+
}
|
|
60
|
+
if (span === 'year') {
|
|
61
|
+
const from = addMonths(t, -6), to = addMonths(from, 12);
|
|
62
|
+
const ticks = []; for (let i = 0; i < 12; i++) { const d = addMonths(from, i); ticks.push({ at: d, label: MON[d.getMonth()], sub: d.getMonth() % 3 === 0 ? 'Q' + (d.getMonth() / 3 + 1) + (d.getFullYear() !== t.getFullYear() ? ' ’' + String(d.getFullYear()).slice(2) : '') : '' }); }
|
|
63
|
+
return { from, to, ticks };
|
|
64
|
+
}
|
|
65
|
+
const from = new Date(t.getFullYear() - 1, 0, 1), to = new Date(t.getFullYear() + 5, 0, 1);
|
|
42
66
|
const ticks = []; for (let y = from.getFullYear(); y < to.getFullYear(); y++) ticks.push({ at: new Date(y, 0, 1), label: String(y), sub: 'H1 · H2' });
|
|
43
67
|
return { from, to, ticks };
|
|
44
68
|
}
|
|
45
69
|
|
|
46
70
|
const pctOf = (W) => (d) => Math.max(0, Math.min(100, ((d - W.from) / (W.to - W.from)) * 100));
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const tn = now > W.from && now < W.to ? `<u class="tg-td" style="left:${X(now).toFixed(2)}%"></u>` : '';
|
|
53
|
-
return tl + band + rl + tn;
|
|
54
|
-
};
|
|
55
|
-
const toneOf = (r) => (r.track && r.track.blocked ? 'red' : r.late ? 'late' : r.status === 'at risk' ? 'risk' : r.status === 'on track' ? 'ok' : 'q');
|
|
71
|
+
const P = (x) => x.toFixed(2) + '%';
|
|
72
|
+
const doneOf = (r) => { const p = r.track && r.track.prog; return p ? Math.max(0, Math.min(100, (p.done / Math.max(1, p.total)) * 100)) : 0; };
|
|
73
|
+
const toneOf = (r) => (r.late ? 'late' : r.status === 'at risk' ? 'risk' : r.track && r.track.you ? 'you' : r.status === 'on track' ? 'ok' : 'q');
|
|
74
|
+
const dated = (r) => day(r.start) || day(r.end) || (r.track && day(r.track.forecast));
|
|
75
|
+
const hidden = (r) => r.track && (r.track.key === 'monitor' || r.track.key === 'evaluate');
|
|
56
76
|
|
|
57
|
-
/** One initiative's
|
|
58
|
-
function
|
|
59
|
-
const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast);
|
|
60
|
-
|
|
61
|
-
let out = '';
|
|
77
|
+
/** One initiative's marks on the quarter: the plan with its done part, the days over, the forecast past the plan, and one label after the furthest mark. */
|
|
78
|
+
function qBar(r, X, now, phone) {
|
|
79
|
+
const s = day(r.start), e = day(r.end), fc = r.track && day(r.track.forecast), tone = toneOf(r);
|
|
80
|
+
let out = marks(r, X, now, phone);
|
|
62
81
|
if (s && e) {
|
|
63
|
-
const l = X(s), w = Math.max(0.8, X(e) - l)
|
|
64
|
-
out += `<span class="tg-bar${r.track && r.track.ms ? ' ms' : ''}" style="left:${l
|
|
82
|
+
const l = X(s), w = Math.max(0.8, X(e) - l);
|
|
83
|
+
out += `<span class="tg-bar t-${tone}${r.track && r.track.ms ? ' ms' : ''}" style="left:${P(l)};width:${P(w)}" title="PMOS plan ${esc(md(s))} to ${esc(md(e))}"><b style="width:${doneOf(r).toFixed(1)}%"></b></span>`;
|
|
65
84
|
const over = r.over && now > e, late = fc && fc > e, words = [];
|
|
66
|
-
if (over) { out += `<span class="tg-over" style="left:${X(e)
|
|
67
|
-
if (late) { out += `<span class="tg-fc" style="left:${X(e)
|
|
68
|
-
|
|
69
|
-
if (words.length && !label) out += `<span class="tg-lab ${over ? 'late' : 'fc'}" style="left:${Math.max(over ? X(now) : 0, late ? X(fc) : 0).toFixed(2)}%">${esc(words.join(' · '))}</span>`;
|
|
85
|
+
if (over) { out += `<span class="tg-over" style="left:${P(X(e))};width:${P(Math.max(0.5, X(now) - X(e)))}"></span>`; words.push(r.overDays + ' ' + (r.overDays === 1 ? 'day' : 'days') + ' over'); }
|
|
86
|
+
if (late) { out += `<span class="tg-fc" style="left:${P(X(e))};width:${P(X(fc) - X(e))}" title="Jira forecast ${esc(md(fc))}"></span>`; words.push('Jira forecast ' + md(fc)); }
|
|
87
|
+
if (words.length && !phone) out += `<span class="tg-lab ${over ? 'late' : 'fc'}" style="left:${P(Math.max(over ? X(now) : 0, late ? X(fc) : 0))}">${esc(words.join(' · '))}</span>`;
|
|
70
88
|
} else if (fc) {
|
|
71
|
-
out += `<span class="tg-fc solo" style="left:${Math.max(0, X(fc) - 3)
|
|
89
|
+
out += `<span class="tg-fc solo" style="left:${P(Math.max(0, X(fc) - 3))};width:3%" title="Jira forecast ${esc(md(fc))}"></span>${phone ? '' : `<span class="tg-lab fc" style="left:${P(X(fc))}">Jira forecast ${esc(md(fc))}</span>`}`;
|
|
72
90
|
} else {
|
|
73
|
-
const d = s || e; out += `<i class="tg-dm" style="left:${X(d)
|
|
91
|
+
const d = s || e; out += `<i class="tg-dm" style="left:${P(X(d))}" title="${s ? 'Starts' : 'Ends'} ${esc(md(d))}"></i>`;
|
|
74
92
|
}
|
|
75
93
|
return out;
|
|
76
94
|
}
|
|
77
95
|
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
/** A row's milestones: its release's sign-off (◆ at the release date), "Push tickets" where drafted tickets wait on your Commit (today), and
|
|
97
|
+
* "after <initiative>" at the plan start where a dependency is not done. Each one only from a record. */
|
|
98
|
+
function marks(r, X, now, phone) {
|
|
99
|
+
const T = r.trail || {}, out = [], rd = r.release && day(r.release.iso);
|
|
100
|
+
const at = (d) => d && X(d) > 0 && X(d) < 100;
|
|
101
|
+
if (rd && at(rd) && r.track && (r.track.key === 'deliver' || r.track.you)) out.push(`<i class="tg-msd" style="left:${P(X(rd))}" title="${esc(r.release.name)} sign-off"></i>${phone ? '' : `<span class="tg-msl" style="left:${P(X(rd))}">${esc(r.release.name)} sign-off</span>`}`);
|
|
102
|
+
if (T.you && T.you.kind === 'commit' && at(now)) out.push(`<i class="tg-msd you" style="left:${P(X(now))}" title="${esc(T.you.text)}"></i>${phone ? '' : `<span class="tg-msl you" style="left:${P(X(now))}">Push tickets · now</span>`}`);
|
|
103
|
+
const dep = (T.deps || []).find((d) => d.known && !d.done), s = day(r.start);
|
|
104
|
+
if (dep && !phone) out.push(`<span class="tg-dep" style="left:${P(s && at(s) ? X(s) : 0)}" title="Waits on ${esc(dep.title || dep.id)}">${SV(LINK)}after ${esc(dep.title || dep.id)}</span>`);
|
|
105
|
+
return out.join('');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** The overlay of a quarter row: week lines, the sprint band, the release line and the today line. */
|
|
109
|
+
function overlay(W, X, now, sprint, rel) {
|
|
110
|
+
const tl = W.ticks.slice(1).map((k) => `<i class="tg-gl" style="left:${P(X(k.at))}"></i>`).join('');
|
|
111
|
+
const sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
|
|
112
|
+
const band = sa && sb && sb > W.from && sa < W.to ? `<i class="tg-sb" style="left:${P(X(sa))};width:${P(X(sb) - X(sa))}"></i>` : '';
|
|
113
|
+
const ra = rel && day(rel.iso), rl = ra && ra > W.from && ra < W.to ? `<i class="tg-rl" style="left:${P(X(ra))}"></i>` : '';
|
|
114
|
+
const tn = now > W.from && now < W.to ? `<u class="tg-td" style="left:${P(X(now))}"></u>` : '';
|
|
115
|
+
return tl + band + rl + tn;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** The quarter's markup. o: { now, phone, sel, status(r) → { tone, text }, hiddenCount, askHref } */
|
|
119
|
+
function quarter(rows, M, o) {
|
|
120
|
+
const now = o.now, sprint = M.jira && M.jira.sprint, rel = M.jira && M.jira.release;
|
|
121
|
+
const W = windowOf(o.span === 'sprint' ? 'sprint' : 'quarter', now, o.phone, sprint), X = pctOf(W);
|
|
122
|
+
const shown = rows.filter((r) => !hidden(r)), list = shown.filter(dated), none = shown.filter((r) => !dated(r));
|
|
85
123
|
const ov = overlay(W, X, now, sprint, rel);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return { html: `<div class="tg" data-span="sprint">${head('Ticket', sprint ? esc(sprint.name) : '')}${body}</div>`, none: [] };
|
|
124
|
+
const ra = rel && day(rel.iso), sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
|
|
125
|
+
const askBtn = none.length ? `<a class="bd-chip tg-ask" id="askDates" href="${esc(o.askHref(none))}">${SV('M4 5h16v11h-9l-5 4v-4H4z')}Ask to propose dates</a>` : '';
|
|
126
|
+
if (o.phone) {
|
|
127
|
+
const head = `<div class="tgp-h">${W.ticks.map((k) => `<span>${esc(k.label)}</span>`).join('')}</div>`;
|
|
128
|
+
const body = list.map((r) => { const s = o.status(r); return `<button type="button" class="tgp-r${o.sel === r.key ? ' sel' : ''}" data-key="${esc(r.key)}"><span class="tgp-t"><b>${esc(r.title)}</b><span class="cs s-${s.tone}"><i class="cz-dot ${s.tone}"></i>${esc(s.text)}</span></span><span class="tgp-p">${ov}${qBar(r, X, now, true)}</span></button>`; }).join('');
|
|
129
|
+
const foot = `<div class="tgp-f"><span>Today ${esc(md(now))}</span>${ra ? `<span class="tg-rel">${SV(FLAG)}${esc(rel.name)} · ${esc(md(ra))}</span>` : ''}</div>`;
|
|
130
|
+
const below = `${none.length ? `<div class="tg-none"><span>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates</span>${askBtn}</div>` : ''}<p class="tg-note">Grey bars are PMOS plan dates. The dark part is points done in Jira.</p>`;
|
|
131
|
+
return { html: `<div class="tgp" data-span="${o.span === 'sprint' ? 'sprint' : 'quarter'}">${head}<div class="tgp-b">${body || '<p class="tg-empty">No initiative on screen has a date on record.</p>'}</div>${foot}</div>${below}`, none };
|
|
95
132
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
const head = `<div class="tg-r tg-h"><button type="button" class="tg-n tg-help" data-rules aria-haspopup="dialog" title="How the timeline groups by span"><b>Initiative</b></button><div class="tg-p">${W.ticks.map((k) => `<span style="left:${P(X(k.at))}"><b>${esc(k.label)}</b></span>`).join('')}</div></div>`;
|
|
134
|
+
const lgd = '<div class="tg-lgd" aria-hidden="true"><span><i class="k dn"></i>done in Jira (points)</span><span><i class="k pl"></i>PMOS plan</span><span><i class="k fc"></i>Jira forecast</span></div>';
|
|
135
|
+
const body = list.map((r) => `<div class="tg-r${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tg-n ini2" data-key="${esc(r.key)}"><b>${esc(r.title)}</b><small>${esc([r.owner, r.track ? r.track.label : r.stage].filter(Boolean).join(' · '))}</small></button><div class="tg-p">${ov}${qBar(r, X, now, false)}</div></div>`).join('');
|
|
136
|
+
const axis = `<div class="tg-ax"><span></span><div class="tg-p">${now > W.from && now < W.to ? `<span class="tg-axl td" style="left:${P(X(now))}">Today</span>` : ''}${sa && sb && sb > W.from && sa < W.to ? `<span class="tg-axl sb" style="left:${P(X(sa))}">Jira ${esc(sprint.name.toLowerCase())} · ${esc(md(sa))} – ${esc(md(sb))}</span>` : ''}${ra && ra > W.from && ra < W.to ? `<span class="tg-axl rl" style="left:${P(X(ra))}">${SV(FLAG)}${esc(rel.name)} · ${esc(md(ra))}</span>` : ''}</div></div>`;
|
|
137
|
+
const foot = `<div class="tg-ft">${none.length ? `<span class="tg-none"><b>${none.length} ${none.length === 1 ? 'has' : 'have'} no dates:</b> <span>${esc(none.slice(0, 4).map((r) => r.title).join(', '))}${none.length > 4 ? ' and ' + (none.length - 4) + ' more' : ''}</span>${askBtn}</span>` : '<span></span>'}${o.hiddenCount ? `<span class="tg-hid">Monitor and Evaluate hidden · ${o.hiddenCount}</span>` : ''}</div>`;
|
|
138
|
+
return { html: `<div class="tg tg-q" data-span="${o.span === 'sprint' ? 'sprint' : 'quarter'}">${head}<div class="tg-body">${lgd}${body || '<p class="tg-empty">No initiative on screen has a date on record.</p>'}</div>${axis}${foot}</div>`, none };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Sprint (BdSpans): the sprint's working days as columns; per initiative with work in the sprint, its row (the release sign-off ◆, "Push
|
|
142
|
+
* tickets" ◆ where drafted tickets wait on the Commit) and one row per ticket with its state and who has it. A Jira reading holds no dates per
|
|
143
|
+
* ticket, so a bar runs from the sprint's first day to today; a drafted ticket runs from today to the sprint's end, dashed. The backlog row counts
|
|
144
|
+
* the open tickets in no sprint and opens the backlog. o: { now, sel, avatar(name) } */
|
|
145
|
+
const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
146
|
+
const TB = (k) => (k.blocked ? 'r' : k.status === 'Done' ? 'k' : k.status === 'In review' ? 'y' : '');
|
|
147
|
+
function sprintSpan(rows, M, o) {
|
|
148
|
+
const now = o.now, J = M.jira || {}, sp = J.sprint, W = windowOf('sprint', now, false, sp);
|
|
149
|
+
const days = []; for (let d = W.from; d < W.to; d = addDays(d, 1)) if (d.getDay() % 6) days.push(d);
|
|
150
|
+
const n = days.length || 1, same = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
151
|
+
const idx = (d) => { if (!d) return -1; const i = days.findIndex((x) => same(x, d) || x > d); return i < 0 ? (d >= W.to ? n : -1) : i; };
|
|
152
|
+
const ti = Math.min(n, Math.max(0, idx(now))), at = (i) => P((i / n) * 100);
|
|
153
|
+
const head = `<div class="sp-r sp-h"><div class="sp-n">Initiative and ticket</div><div class="sp-g" style="--n:${n}">${days.map((d) => `<span${same(d, now) ? ' class="td"' : ''}>${WD[d.getDay()]} ${d.getDate()}</span>`).join('')}</div></div>`;
|
|
154
|
+
// the label sits right of the ◆, or left of it in the last third of the sprint so it stays inside the row
|
|
155
|
+
const dia = (i, label, cls) => `<i class="sp-dia${cls ? ' ' + cls : ''}" style="left:${at(i + 0.5)}"></i><span class="sp-dl${cls ? ' ' + cls : ''}" style="${i > n * 0.66 ? `right:calc(${P(100 - ((i + 0.5) / n) * 100)} + 14px)` : `left:calc(${at(i + 0.5)} + 14px)`}">${esc(label)}</span>`;
|
|
156
|
+
const groups = rows.map((r) => {
|
|
157
|
+
const t = r.track || {}, tk = (t.tickets || []).filter((k) => sp && k.sprint === sp.name), dr = ((r.trail && r.trail.drafted) || []).filter((x) => !x.key);
|
|
158
|
+
if (!tk.length && !dr.length) return '';
|
|
159
|
+
const ra = r.release && day(r.release.iso), ri = ra ? idx(ra) : -1;
|
|
160
|
+
const ms = (ri >= 0 && ri < n ? dia(ri, r.release.name + ' sign-off · ' + WD[ra.getDay()] + ' ' + ra.getDate(), '') : '') + (dr.length && ti < n ? dia(Math.min(n - 1, ti), 'Push tickets · ' + WD[(days[Math.min(n - 1, ti)] || now).getDay()], 'bl') : '');
|
|
161
|
+
const ini = `<div class="sp-r sp-i${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="sp-n ini2" data-key="${esc(r.key)}"><b>${esc(r.title)}</b></button><div class="sp-g sp-t" style="--n:${n}">${ms}</div></div>`;
|
|
162
|
+
const tks = tk.map((k) => {
|
|
163
|
+
const w = Math.max(1, ti + (k.status === 'Done' ? 0 : 1)), word = k.blocked ? 'Blocked' + (k.reason ? ' · ' + k.reason.replace(/^Waiting on /i, 'waits on ') : '') : k.status === 'In progress' ? 'Doing' : k.status;
|
|
164
|
+
return `<div class="sp-r"><button type="button" class="sp-n sp-k" data-tk="${esc(k.key)}" data-ini="${esc(r.key)}">${esc(k.key)} · ${esc(k.title)}</button><div class="sp-g sp-t" style="--n:${n}"><span class="sp-b ${TB(k)}" style="left:0;width:${at(Math.min(n, w))}"><span>${esc(word)}</span>${k.assignee && o.avatar ? o.avatar(k.assignee) : ''}</span></div></div>`;
|
|
108
165
|
}).join('');
|
|
109
|
-
|
|
166
|
+
const drafted = dr.length ? `<div class="sp-r"><span class="sp-n sp-k">${esc(dr.length === 1 ? (dr[0].id || 'A ticket') : (dr[0].id && dr[dr.length - 1].id ? dr[0].id + ' to ' + dr[dr.length - 1].id : dr.length + ' tickets'))} · drafted</span><div class="sp-g sp-t" style="--n:${n}"><span class="sp-b d" style="left:${at(Math.max(0, n - Math.max(3, n - ti)))};width:${at(Math.min(n, Math.max(3, n - ti)))}"><span>Draft · not pushed · waits on your Commit</span></span></div></div>` : '';
|
|
167
|
+
return ini + tks + drafted;
|
|
168
|
+
}).join('');
|
|
169
|
+
const bl = (J.backlog || []).length;
|
|
170
|
+
const back = `<div class="sp-r sp-bk"><span class="sp-n">Backlog · ${bl} not in ${sp ? esc(sp.name) : 'a sprint'}</span><div class="sp-g sp-bkg"><button type="button" class="bd-btn sm" data-backlog${bl ? '' : ' disabled'}>Show backlog</button></div></div>`;
|
|
171
|
+
const cap = sp ? `${esc(sp.name)} · ${esc(String(days[0] ? days[0].getDate() : ''))} to ${esc(days.length ? days[n - 1].getDate() + ' ' + MON[days[n - 1].getMonth()] : '')} · tickets with who has them` : 'No sprint is in the Jira reading. These are the next two weeks.';
|
|
172
|
+
const empty = `<p class="tg-empty">${sp ? 'No initiative on screen has a ticket in ' + esc(sp.name) + '.' : 'Read Jira to see the sprint\'s tickets here.'}</p>`;
|
|
173
|
+
return { html: `<p class="sp-cap"><span>${cap}</span><span class="bd-sp"></span><span>Group: Initiative</span></p><div class="sp" data-span="sprint">${head}<div class="sp-body">${groups || empty}</div>${back}</div><p class="tg-note">Jira holds no dates for each ticket, so a bar runs from the sprint's first day to today.</p>`, none: [] };
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** The groups of the long spans. By theme (default): the trail's themes (one per objective; the PRD's theme: names it, theme_note: says what it
|
|
177
|
+
* is for, theme_color: picks its colour), in the trail's order; a row the trail has not reached yet takes its anchor's objective. By lane or by owner. */
|
|
178
|
+
const cap = (x) => x.charAt(0).toUpperCase() + x.slice(1);
|
|
179
|
+
function themesOf(rows, o = {}) {
|
|
180
|
+
const g = o.group || 'theme', T = o.themes || [], byKey = new Map(T.map((t) => [t.key, t]));
|
|
181
|
+
const groups = new Map();
|
|
182
|
+
for (const r of rows) {
|
|
183
|
+
let k, base;
|
|
184
|
+
if (g === 'lane') { k = r.lane || 'none'; base = { key: k, label: r.lane ? cap(r.lane) : 'No lane', what: 'Lane', kind: 'lane' }; }
|
|
185
|
+
else if (g === 'owner') { k = r.owner || 'none'; base = { key: k, label: r.owner || 'No owner', what: 'Owner', kind: 'owner' }; }
|
|
186
|
+
else {
|
|
187
|
+
const th = r.trail && byKey.get(r.trail.theme);
|
|
188
|
+
if (th) { k = th.key; base = { key: k, label: th.name, what: th.note || (th.key === 'health' ? 'Upkeep anchored to a health budget' : [th.period ? th.period + ' objective' : 'Objective', th.from ? '' : 'name it with theme: in the PRD'].filter(Boolean).join(' · ')), kind: th.key === 'health' ? 'health' : 'kr', tone: th.tone }; }
|
|
189
|
+
else { const t = r.theme || { key: 'none', label: 'No anchor', kind: 'none', period: '' }; k = 'a:' + t.key; base = { key: k, label: t.label, what: t.kind === 'kr' ? t.period + ' objective' : t.kind === 'health' ? 'Health budgets' : 'No theme', kind: t.kind }; }
|
|
190
|
+
}
|
|
191
|
+
if (!groups.has(k)) groups.set(k, { ...base, rows: [] });
|
|
192
|
+
groups.get(k).rows.push(r);
|
|
110
193
|
}
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
194
|
+
const list = [...groups.values()];
|
|
195
|
+
if (g === 'theme' && T.length) list.sort((a, b) => { const ia = T.findIndex((t) => t.key === a.key), ib = T.findIndex((t) => t.key === b.key); return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib); });
|
|
196
|
+
return list.map((t, i) => ({ ...t, tone: THEME_TONES[t.tone && TONE_KEYS.includes(t.tone) ? TONE_KEYS.indexOf(t.tone) : i % THEME_TONES.length] }));
|
|
197
|
+
}
|
|
198
|
+
/** A group's left cell: its colour and name, what it is for, and its counts. */
|
|
199
|
+
function themeCell(t, wide) {
|
|
200
|
+
const late = t.rows.filter((r) => r.late).length, risk = t.rows.filter((r) => r.status === 'at risk').length;
|
|
201
|
+
const anchor = t.kind === 'health' ? 'health budget' : t.kind === 'kr' || t.kind === 'other' ? t.rows.map((r) => r.kr).filter(Boolean)[0] || '' : '';
|
|
202
|
+
return `<div class="tg-n tg-tn"><b><i class="tg-sw" style="background:${t.tone}"></i>${esc(t.label)}</b><small>${esc(t.what)}</small><em>${t.rows.length} ${t.rows.length === 1 ? 'initiative' : 'initiatives'}${anchor ? ' · ' + esc(anchor) : ''}${!wide && late ? ' · ' + late + ' late' : ''}${!wide && risk ? ' · ' + risk + ' at risk' : ''}</em></div>`;
|
|
203
|
+
}
|
|
204
|
+
/** The releases the rows ride on, as milestones of the long spans: name and date, once each. */
|
|
205
|
+
function releasesOf(rows) {
|
|
206
|
+
const seen = new Map();
|
|
207
|
+
for (const r of rows) { const d = r.release && day(r.release.iso); if (d && !seen.has(r.release.name)) seen.set(r.release.name, { name: r.release.name, at: d }); }
|
|
208
|
+
return [...seen.values()];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Year: themes with their initiatives as bars inside. */
|
|
212
|
+
function year(rows, o) {
|
|
213
|
+
const sp = o.span === 'half' ? 'half' : 'year';
|
|
214
|
+
const now = o.now, W = windowOf(sp, now), X = pctOf(W), T = themesOf(rows, o), G = (GROUPS.find((x) => x[0] === (o.group || 'theme')) || GROUPS[0])[1];
|
|
215
|
+
const tn = now > W.from && now < W.to ? X(now) : null;
|
|
216
|
+
const head = `<div class="tg-r tg-h"><button type="button" class="tg-n tg-help" data-rules aria-haspopup="dialog" title="How the timeline groups by span"><b>${G}</b><small>${T.length} ${T.length === 1 ? G.toLowerCase() : G.toLowerCase() + 's'} · ${rows.length} ${rows.length === 1 ? 'initiative' : 'initiatives'}</small></button><div class="tg-p">${W.ticks.map((k) => `<span style="left:${P(X(k.at))}"><b>${esc(k.label)}</b>${k.sub ? `<small>${esc(k.sub)}</small>` : ''}</span>`).join('')}</div></div>`;
|
|
217
|
+
// AgBoardTlYear draws no release line or flag: a release shows as the ◆ at the end of a bar that rides on it
|
|
218
|
+
const grid = W.ticks.slice(1).map((k) => `<i class="tg-gl" style="left:${P(X(k.at))}"></i>`).join('') + (tn != null ? `<u class="tg-td" style="left:${P(tn)}"></u>` : '');
|
|
219
|
+
const body = T.map((t) => {
|
|
220
|
+
const lines = t.rows.filter(dated).map((r) => {
|
|
221
|
+
const s = day(r.start) || day(r.end) || day(r.track && r.track.forecast), e = day(r.end) || s, l = X(s), w = Math.max(1.2, X(e) - l), st = o.status(r);
|
|
222
|
+
return `<button type="button" class="tg-line" data-key="${esc(r.key)}" aria-label="${esc(r.title)}"><span class="tg-yb${r.track && r.track.ms ? ' ms' : ''}" style="left:${P(l)};width:${P(w)};--tone:${t.tone}"><b style="width:${doneOf(r).toFixed(1)}%"></b><em><i class="cz-dot ${toneOf(r)}"></i><strong>${esc(r.title)}</strong> ${esc([r.track ? r.track.label : '', st.tone === 'late' || st.tone === 'risk' ? st.text.toLowerCase() : ''].filter(Boolean).join(' · '))}</em></span></button>`;
|
|
223
|
+
}).join('');
|
|
224
|
+
return `<div class="tg-r tg-th">${themeCell(t, false)}<div class="tg-p tg-stack">${grid}${lines || '<span class="tg-nod">No dates on record</span>'}</div></div>`;
|
|
225
|
+
}).join('');
|
|
226
|
+
const pill = tn != null ? `<span class="tg-today" style="left:calc(230px + (100% - 230px) * ${(tn / 100).toFixed(4)})">Today · ${esc(md(now))}</span>` : '';
|
|
227
|
+
return { html: `<div class="tg tg-y" data-span="${sp}">${head}<div class="tg-body">${pill}${body || '<p class="tg-empty">No initiative is on screen.</p>'}</div><div class="tg-ft"><span>Bars show initiatives inside their ${G.toLowerCase()}. The darker part is done. <i class="cz-ms" aria-hidden="true"></i> is a milestone.</span><button type="button" class="tg-go" data-span-go="quarter">Switch to Quarter to see one row per initiative</button></div></div>`, none: [] };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** 5 yr: themes only, as one phase each from the earliest date on record to the latest; past 18 months is directional (dashed). */
|
|
231
|
+
function fiveYear(rows, o) {
|
|
232
|
+
const sp = o.span === 'y2' ? 'y2' : 'y5';
|
|
233
|
+
const now = o.now, W = windowOf(sp, now), X = pctOf(W), T = themesOf(rows, o), G = (GROUPS.find((x) => x[0] === (o.group || 'theme')) || GROUPS[0])[1];
|
|
234
|
+
const far = addMonths(now, 18), fx = X(far), tn = now > W.from && now < W.to ? X(now) : null;
|
|
235
|
+
const head = `<div class="tg-r tg-h"><button type="button" class="tg-n tg-help" data-rules aria-haspopup="dialog" title="How the timeline groups by span"><b>${G}</b><small>what each ${G.toLowerCase()} is for</small></button><div class="tg-p">${fx < 100 ? `<i class="tg-dir" style="left:${P(fx)}"></i>` : ''}${W.ticks.map((k) => `<span style="left:${P(X(k.at))}"><b>${esc(k.label)}</b><small>${esc(k.sub)}</small></span>`).join('')}</div></div>`;
|
|
236
|
+
const grid = W.ticks.slice(1).map((k) => `<i class="tg-gl" style="left:${P(X(k.at))}"></i>`).join('') + (fx < 100 ? `<i class="tg-dir" style="left:${P(fx)}"></i>` : '') + (tn != null ? `<u class="tg-td" style="left:${P(tn)}"></u>` : '');
|
|
237
|
+
const body = T.map((t) => {
|
|
238
|
+
const ds = t.rows.flatMap((r) => [day(r.start), day(r.end), r.track && day(r.track.forecast)]).filter(Boolean).sort((a, b) => a - b);
|
|
239
|
+
const shipped = t.rows.filter((r) => r.track && r.track.k >= 6).length, planned = t.rows.filter((r) => !r.track || r.track.k < 4).length, active = t.rows.length - shipped - planned;
|
|
240
|
+
const a = ds[0], b = ds[ds.length - 1];
|
|
241
|
+
const words = [active ? active + ' active' : '', planned ? planned + ' planned' : '', shipped ? shipped + ' shipped' : ''].filter(Boolean).join(' · ');
|
|
242
|
+
// a milestone sits under the phase, in the theme's colour, with its name right of the ◆ (AgBoardTl5y)
|
|
243
|
+
const ms = releasesOf(t.rows).filter((m) => X(m.at) > 0 && X(m.at) < 100).map((m) => `<i class="tg-msd" style="left:${P(X(m.at))};--tone:${t.tone}" title="${esc(m.name)} · ${esc(md(m.at))}"></i><span class="tg-msl" style="left:${P(X(m.at))}">${esc(m.name)}</span>`).join('');
|
|
244
|
+
const ph = ds.length ? `<button type="button" class="tg-phase${a > far ? ' dir' : ''}" data-tgtheme="${esc(t.key)}" style="left:${P(X(a))};width:${P(Math.max(2, X(b) - X(a)))};--tone:${t.tone}"><b>${esc(t.label)}</b><small>${esc(words)}${a > far ? ' · directional' : ''}</small></button>${ms}` : '<span class="tg-nod">No dates on record</span>';
|
|
245
|
+
return `<div class="tg-r tg-th tg-5">${themeCell(t, true)}<div class="tg-p">${grid}${ph}</div></div>`;
|
|
118
246
|
}).join('');
|
|
119
|
-
|
|
247
|
+
const lab = (x) => `calc(230px + (100% - 230px) * ${(x / 100).toFixed(4)})`; // the 230 px theme column
|
|
248
|
+
const marks = (tn != null ? `<span class="tg-today" style="left:${lab(tn)}">Today</span>` : '') + (fx < 100 ? `<span class="tg-far" style="left:${lab(fx)}">Beyond 18 months · directional</span>` : '');
|
|
249
|
+
return { html: `<div class="tg tg-5y" data-span="${sp}">${head}<div class="tg-body">${marks}${body || '<p class="tg-empty">No initiative is on screen.</p>'}</div><div class="tg-ft"><span>Only themes and their phases at this span. Dashed means directional, not committed.</span><span class="tg-go2">Open a phase to see its initiatives</span></div></div>`, none: [] };
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** The timeline's markup for the rows on screen. → { html, none: [rows with no dates] } */
|
|
253
|
+
export function timelineHtml(rows, M, span, o = {}) {
|
|
254
|
+
const opt = { now: new Date(), phone: false, sel: null, status: () => ({ tone: 'q', text: '' }), hiddenCount: 0, askHref: () => '#', ...o };
|
|
255
|
+
opt.span = span;
|
|
256
|
+
if (span === 'year' || span === 'half') return year(rows, opt);
|
|
257
|
+
if (span === 'y5' || span === 'y2') return fiveYear(rows, opt);
|
|
258
|
+
if (span === 'sprint' && !opt.phone) return sprintSpan(rows, M, opt);
|
|
259
|
+
return quarter(rows, M, opt);
|
|
120
260
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/* pm/bd-stages.js — the Board's help
|
|
2
|
-
*
|
|
3
|
-
* frame draws it; and the timeline's spans, as its "The longer the span, the higher the grouping" frame draws it. Pure markup; no reads. */
|
|
1
|
+
/* pm/bd-stages.js — the Board's two help frames (initiative premium-agreed-design, B1 B2): "What finishes each step" (AgBoardStages) and
|
|
2
|
+
* "The longer the span, the higher the grouping" (AgBoardTlRules), as two separate popovers. Pure markup; no reads. */
|
|
4
3
|
import { esc } from './premium-shell.js';
|
|
5
4
|
|
|
6
5
|
export const STEP_HELP = [
|
|
@@ -14,20 +13,35 @@ export const STEP_HELP = [
|
|
|
14
13
|
['Evaluate', true, 'Keep, iterate or stop', 'The report reviewed, the evaluation, your verdict', 'PMOS'],
|
|
15
14
|
];
|
|
16
15
|
export const SPAN_HELP = [
|
|
17
|
-
['Sprint', '2 weeks', 'Jira tickets inside each initiative', 'Tickets,
|
|
16
|
+
['Sprint', '2 weeks', 'Jira tickets inside each initiative', 'Tickets, assignees, blockers'],
|
|
18
17
|
['Quarter', '3 months', 'One row per initiative', 'Stage, output progress, plan against the Jira forecast'],
|
|
19
18
|
['Half · Year', '6–12 months', 'Themes, with their initiatives as bars inside', 'Which initiatives carry each theme, milestones'],
|
|
20
|
-
['2 yr · 5 yr', '2–5 years', 'Themes only, as phases', 'Where each theme is heading,
|
|
19
|
+
['2 yr · 5 yr', '2–5 years', 'Themes only, as phases', 'Where each theme is heading, what is committed and what is directional'],
|
|
21
20
|
];
|
|
21
|
+
export const THEME_HELP = [
|
|
22
|
+
['Foundation', 'var(--cz-c-8c929b)', 'Make PMOS reliable to run', 'Platform, reliability, state, health budgets'],
|
|
23
|
+
['Closing gaps', 'var(--cz-c-4894ea)', 'Match what PMs already expect', 'Features users expect but miss today'],
|
|
24
|
+
['Expansion', 'var(--cz-c-5e9c6a)', 'Reach partners and teams', 'New segments, partners, integrations'],
|
|
25
|
+
['Maturity', 'var(--cz-c-d4a13a)', 'Prove outcomes, then scale', 'Outcome proof, automation, scale'],
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const X = '<button type="button" class="bd-x" data-pop-close aria-label="Close"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg></button>';
|
|
29
|
+
const row = (cells, cls = '') => `<div class="bd-tr${cls}" role="row">${cells.map((c) => `<span role="${cls ? 'columnheader' : 'cell'}">${c}</span>`).join('')}</div>`;
|
|
22
30
|
|
|
23
|
-
/**
|
|
31
|
+
/** AgBoardStages: what finishes each of the eight steps and where its count comes from. */
|
|
24
32
|
export function stepsHelpHtml() {
|
|
25
|
-
|
|
26
|
-
return `<div class="bd-help"><div class="bd-help-h"><h2 id="hSteps">What finishes each step</h2><button type="button" class="cz-ib" data-pop-close aria-label="Close"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg></button></div>`
|
|
33
|
+
return `<div class="bd-help"><div class="bd-help-h"><h2 id="hSteps">What finishes each step</h2>${X}</div>`
|
|
27
34
|
+ '<p class="bd-help-p">Six stages and two milestones. Every initiative on the Board shows progress toward the output of the step it is in. A milestone is a checkpoint: the initiative waits there until its conditions are met.</p>'
|
|
28
35
|
+ `<div class="bd-tbl" role="table" aria-label="What finishes each step">${row(['Step', 'Type', 'Output that finishes it', 'How progress is counted', 'Where the count comes from'], ' th')}`
|
|
29
|
-
+ STEP_HELP.map(([n, ms, o, how, src]) => row([`<b>${ms ? '<i class="cz-ms" aria-hidden="true"></i>' : ''}${esc(n)}</b>`, ms ? 'Milestone' : 'Stage'
|
|
30
|
-
|
|
36
|
+
+ STEP_HELP.map(([n, ms, o, how, src]) => row([`<b>${ms ? '<i class="cz-ms" aria-hidden="true"></i>' : ''}${esc(n)}</b>`, `<em>${ms ? 'Milestone' : 'Stage'}</em>`, esc(o), esc(how), `<em>${esc(src)}</em>`])).join('') + '</div></div>';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** AgBoardTlRules: what a row is at each span, and the themes (an example: themes are not set in PMOS yet). */
|
|
40
|
+
export function rulesHelpHtml() {
|
|
41
|
+
return `<div class="bd-help"><div class="bd-help-h"><h2 id="hRules">The longer the span, the higher the grouping</h2>${X}</div>`
|
|
42
|
+
+ '<p class="bd-help-p">The timeline switches what a row is as you zoom out. Each initiative belongs to one theme, set in its panel and on the PRD. Themes are set per product.</p>'
|
|
31
43
|
+ `<div class="bd-tbl bd-tbl4" role="table" aria-label="Timeline spans">${row(['Span', 'Covers', 'Rows are', 'You see'], ' th')}`
|
|
32
|
-
+ SPAN_HELP.map(([s, c, r, y]) => row([`<b>${esc(s)}</b>`, `<em>${esc(c)}</em>`, esc(r), esc(y)])).join('') + '</div
|
|
44
|
+
+ SPAN_HELP.map(([s, c, r, y]) => row([`<b>${esc(s)}</b>`, `<em>${esc(c)}</em>`, esc(r), esc(y)])).join('') + '</div>'
|
|
45
|
+
+ `<div class="bd-tbl bd-tbl3" role="table" aria-label="Themes">${row(['Theme (example)', 'What it is for', 'Typical work'], ' th')}`
|
|
46
|
+
+ THEME_HELP.map(([n, c, w, t], i) => row([`<b><i class="tg-sw k${i}"></i>${esc(n)}</b>`, esc(w), esc(t)])).join('') + '</div></div>';
|
|
33
47
|
}
|