create-pmos 0.405.0 → 0.407.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 +1 -1
- 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/workspace/briefing-premium-adddoc-test.js +4 -3
- package/workspace/briefing-premium-doc-edit-test.js +3 -5
- package/workspace/briefing-premium-initiative-test.js +46 -27
- package/workspace/changelog.json +24 -0
- package/workspace/guide/home.md +21 -4
- package/workspace/guide/programs.md +1 -0
- package/workspace/lib/engine/boards.js +2 -1
- package/workspace/lib/initiative-writer.js +45 -1
- package/workspace/lib/routes-boards.js +13 -0
- package/workspace/lib/routes-initiatives.js +12 -0
- 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 +4 -1
- package/workspace/premium-vw-backlog-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +4 -6
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +2 -2
- package/workspace/public/pm/bd-ini-panel.js +2 -2
- package/workspace/public/pm/bd-prog-panel.js +15 -5
- package/workspace/public/pm/cozy-home.css +5 -0
- package/workspace/public/pm/cozy-nav.js +4 -0
- package/workspace/public/pm/cozy-today.css +2 -0
- package/workspace/public/pm/cozy-viewer.js +75 -10
- package/workspace/public/pm/cozy-vw-shell.css +20 -1
- package/workspace/public/pm/home-app.js +135 -61
- package/workspace/public/pm/home-ini.css +14 -0
- package/workspace/public/pm/home-ini.js +98 -81
- package/workspace/public/pm/home-task.js +5 -2
- package/workspace/public/pm/home-today.js +7 -5
- package/workspace/public/pm/premium-board.js +21 -2
- package/workspace/public/pm/premium-viewer.js +1 -1
- package/workspace/public/pm/premium-vw-item.js +1 -0
- package/workspace/public/pm/rename-press.js +81 -0
- package/workspace/public/premium.html +1 -1
- package/workspace/rename-test.js +166 -0
- package/workspace/test-lists/rename.json +9 -0
- package/workspace/tk-tasks-test.js +2 -3
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* InTasks, InDocs, InPhone). The pure half is home-ini-model.js.
|
|
3
3
|
*
|
|
4
4
|
* mountIni(ctx) once, from home-app.js. ctx: { S, VW, pmGet, pmPost, toast, load, openFile, iniTitle, drawList, wait }
|
|
5
|
-
* iniList(sc) after each draw of the list column: the
|
|
6
|
-
*
|
|
5
|
+
* iniList(sc) after each draw of the list column: reads the layout record and moves the stage by itself when it may. The list column
|
|
6
|
+
* never changes for an initiative (canvas HbC): the initiative is a page of the Viewer.
|
|
7
|
+
* iniPage() the initiative's page in the Viewer (canvas HbCDesk): the stage card with Move to <next>, three tasks and the documents that
|
|
8
|
+
* need a look. "Show N more" and "Show all N" drill into Tasks and Documents, with ← back to the page. true when it opened.
|
|
9
|
+
* iniOverview(v, o) the initiative in the Viewer: Tasks (the default), Documents or Stage; o.back keeps the page behind it. true when it opened.
|
|
7
10
|
*
|
|
8
11
|
* The stage move (InStage): the card shows "Moves on by itself when all N are done" (a switch, on by default, kept in file mode) and Move to <next>
|
|
9
12
|
* with Back beside it. Move with items still open asks first (Move anyway, with a note); Back always asks for a reason. Both go to POST /api/boards/move
|
|
@@ -182,55 +185,64 @@ function ask(anchor, label, value, go, o = {}) { // one line of words, inline
|
|
|
182
185
|
i.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); const v = i.value.trim(); if (v) { closePop(); go(v); } } });
|
|
183
186
|
}
|
|
184
187
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
export function iniList(sc) {
|
|
189
|
+
if (!X.ctx || !sc) return;
|
|
190
|
+
sc.querySelectorAll('[data-hi-slot]').forEach((n) => n.remove());
|
|
191
|
+
const S = X.ctx.S, M = curM();
|
|
192
|
+
if (!M) return;
|
|
193
|
+
readL(S.ini, M);
|
|
194
|
+
autoCheck(S.ini, M, mvOf(S.ini, M));
|
|
195
|
+
if (X.view === 'page') redrawView(); // a new read of the initiative shows on its page
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* ── the initiative's page in the Viewer (canvas HbCDesk, HbCNew, HbCPhone) ── */
|
|
199
|
+
function pageHtml(id, M) {
|
|
200
|
+
const L = Lof(id), mv = mvOf(id, M), rows = MD.taskRows(M, L), T = MD.listTasks(rows);
|
|
201
|
+
let card = X.ctx.cardHtml(id, { page: true });
|
|
202
|
+
if (mv.cur) { const at = card.lastIndexOf('<div class="hm-acts">'); if (at > 0) card = card.slice(0, at) + moveHtml(id, M, mv) + card.slice(at); }
|
|
203
|
+
const trow = (t) => `<div class="hm-r hi-r">`
|
|
191
204
|
+ (t.canCheck ? `<button type="button" class="hi-chk" data-hi-chk="${esc(t.key)}" aria-pressed="false" aria-label="Mark ${esc(t.title)} done"></button>` : '<span class="hi-chk off" aria-hidden="true"></span>')
|
|
192
205
|
+ `<button type="button" class="hm-rm" data-hi-task="${esc(t.key)}"><span class="hm-rt"><b>${esc(t.title)}</b><em class="${t.late ? 'late' : 'q'}">${esc([t.owner || (t.jira ? 'Jira' : ''), t.due].filter(Boolean).join(' · ') || t.state)}</em></span></button></div>`;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
+ (
|
|
196
|
-
|
|
206
|
+
const more = T.all - T.top.length;
|
|
207
|
+
const tasks = `<section class="hi-pg" aria-label="Tasks"><div class="hi-pgh"><b>Tasks</b>${T.open ? `<span class="hi-n">${T.open}</span>` : ''}<button type="button" class="hm-gadd" data-hi-addtask aria-label="Add a task to ${esc(X.ctx.iniTitle(id))}" title="Add a task">${SVG(I.plus, 14, 2.2)}</button></div>`
|
|
208
|
+
+ (rows.length ? T.top.map(trow).join('') + (more > 0 ? `<button type="button" class="hi-pgm" data-hi-open="tasks">Show ${more} more${SVG(I.right, 14, 2)}</button>` : '')
|
|
209
|
+
: `<div class="hi-pge"><p>No tasks yet</p><button type="button" class="hi-btn sm" data-hi-addtask>${SVG(I.plus, 14)}Add a task</button></div>`)
|
|
197
210
|
+ '</section>';
|
|
211
|
+
const docs = MD.docRows(M), look = docs.filter((d) => d.look);
|
|
212
|
+
const drow = (d) => `<div class="hm-r hi-r"><button type="button" class="hm-rm" data-hi-doc="${esc(d.key)}"><i class="hm-dot hi-risk" aria-hidden="true"></i><span class="hm-tile">${SVG(I.doc, 14)}</span><span class="hm-rt"><b>${esc(d.title)}</b><em class="risk">${esc(MD.docPill(d)[0] + (d.when ? ' · ' + d.when : ''))}</em></span></button></div>`;
|
|
213
|
+
const dsec = docs.length ? `<section class="hi-pg" aria-label="Documents"><div class="hi-pgh"><b>Documents</b><span class="hi-n">${docs.length}</span></div>`
|
|
214
|
+
+ look.map(drow).join('') + `<button type="button" class="hi-pgm" data-hi-open="docs">Show all ${docs.length}${SVG(I.right, 14, 2)}</button></section>` : '';
|
|
215
|
+
// a phone: the page is a sheet over the list, and the chat is one press away (HbCPhone)
|
|
216
|
+
const talk = isPhone() ? `<button type="button" class="hi-talk" data-hi-talk>Message Claude about ${esc(X.ctx.iniTitle(id))}</button>` : '';
|
|
217
|
+
return `<div class="hi-v hi-page" data-hi-v="page">${card}${tasks}${dsec}${talk}<p class="hi-small" role="status" id="ovMsg"></p></div>`;
|
|
218
|
+
}
|
|
219
|
+
/** ⋯ of the page (HbCMore): change it, look at it elsewhere, then stop it, red and last. */
|
|
220
|
+
function pageMore(id) {
|
|
221
|
+
const M = curM(); if (!M) return [];
|
|
222
|
+
const mv = mvOf(id, M), out = [];
|
|
223
|
+
if (!mv.why) out.push({ label: 'Moves on by itself', note: mv.auto ? 'On' : 'Off', on: () => press(id, M, { kind: 'auto', on: !mv.auto }) });
|
|
224
|
+
if (mv.canBack) out.push({ label: 'Move back a stage', note: mv.prev, on: (b) => popBack(b || document.querySelector('#czViewer [data-cz-vw="more"]'), id, M, mv) });
|
|
225
|
+
if ((M.acts.stages || []).length && !M.acts.self) out.push({ label: 'Move to a stage', on: () => iniOverview('stage', { back: true }) });
|
|
226
|
+
out.push({ label: 'Add a stakeholder', on: () => X.ctx.addPerson() });
|
|
227
|
+
if (X.ctx.turnProgram) out.push({ label: 'Turn into a program', on: () => X.ctx.turnProgram(id) });
|
|
228
|
+
out.push({ sep: true }, { label: 'Open on the Board', on: () => { location.href = '/premium-board.html?focus=' + encodeURIComponent(id) + (M.board.ws ? '&ws=' + encodeURIComponent(M.board.ws) : '') + (M.board.id ? '&board=' + encodeURIComponent(M.board.id) : ''); } },
|
|
229
|
+
{ label: 'The record', on: async () => (X.ctx.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...bw(M) }) });
|
|
230
|
+
if (!M.acts.life) out.push({ sep: true }, { label: 'Put on hold', on: () => { iniOverview('stage', { back: true, ask: 'on-hold' }); } }, { label: 'Cancel the initiative', danger: true, on: () => { iniOverview('stage', { back: true, ask: 'cancelled' }); } });
|
|
231
|
+
return out;
|
|
198
232
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
let n = sc.querySelector(`:scope [data-hi-slot="${key}"]`);
|
|
213
|
-
if (!html) { if (n) n.remove(); return; }
|
|
214
|
-
if (!n) { n = document.createElement('div'); n.dataset.hiSlot = key; n.className = 'hi-slot'; }
|
|
215
|
-
if (n.__h !== html) { n.__h = html; n.innerHTML = html; }
|
|
216
|
-
where(n);
|
|
217
|
-
}
|
|
218
|
-
export function iniList(sc) {
|
|
219
|
-
if (!X.ctx || !sc) return;
|
|
220
|
-
const S = X.ctx.S, M = curM();
|
|
221
|
-
if (!M) { sc.querySelectorAll('[data-hi-slot]').forEach((n) => n.remove()); return; }
|
|
222
|
-
const id = S.ini;
|
|
223
|
-
readL(id, M);
|
|
224
|
-
const L = Lof(id), mv = mvOf(id, M);
|
|
225
|
-
const box = sc.querySelector('.hm-card .hm-box');
|
|
226
|
-
if (box) put(box, 'mv', mv.cur ? moveHtml(id, M, mv) : '', (n) => { const a = box.querySelector(':scope > .hm-acts'); if (n.nextElementSibling !== a) box.insertBefore(n, a); });
|
|
227
|
-
const card = sc.querySelector(':scope > .hm-card');
|
|
228
|
-
put(sc, 'tasks', tasksGroupHtml(id, M, L), (n) => { const after = card || null; if (after ? after.nextElementSibling !== n : sc.firstElementChild !== n) { if (after) after.after(n); else sc.prepend(n); } });
|
|
229
|
-
// the Files group listed the same documents: Core documents takes its place (InDocs), the documents that need a look and "All N documents"
|
|
230
|
-
const files = sc.querySelector(':scope > section.hm-g[aria-label="Files"]');
|
|
231
|
-
if (files) files.hidden = true;
|
|
232
|
-
put(sc, 'docs', docsGroupHtml(M), (n) => { const gs = [...sc.querySelectorAll(':scope > section.hm-g:not([hidden])')]; const last = gs[gs.length - 1]; if (last && last.nextElementSibling !== n) last.after(n); else if (!last && n.parentNode !== sc) sc.append(n); });
|
|
233
|
-
autoCheck(id, M, mv);
|
|
233
|
+
export function iniPage() {
|
|
234
|
+
if (!X.ctx) return false;
|
|
235
|
+
const S = X.ctx.S, id = S.ini;
|
|
236
|
+
if (!id || id === 'product') return false;
|
|
237
|
+
STAGE_ASK = null;
|
|
238
|
+
const VW = X.ctx.VW;
|
|
239
|
+
let rename = X.ctx.renameIni ? X.ctx.renameIni(id, '') : null;
|
|
240
|
+
if (rename) rename = { ...rename, value: X.ctx.iniTitle(id) };
|
|
241
|
+
BODY = VW.open({ id: 'ov:' + id, kind: X.ctx.kindOf(id), title: X.ctx.iniTitle(id), icon: 'goal', more: () => pageMore(id), rename,
|
|
242
|
+
add: { label: 'New session', on: () => X.ctx.newIn(id) },
|
|
243
|
+
render: (b) => { X.view = 'page'; BODY = b; draw(b); wire(b, id); } });
|
|
244
|
+
if (!curM()) { X.failed = null; X.ctx.loadIni().then(() => { if (S.ini !== id) return; if (!curM()) X.failed = id; redrawView(); }); }
|
|
245
|
+
return true;
|
|
234
246
|
}
|
|
235
247
|
|
|
236
248
|
/* ── the Viewer: Tasks, Documents, Stage ── */
|
|
@@ -362,8 +374,10 @@ function stageView(id, M, ask) {
|
|
|
362
374
|
let STAGE_ASK = null;
|
|
363
375
|
function draw(b) {
|
|
364
376
|
const S = X.ctx.S, id = S.ini, M = curM();
|
|
365
|
-
if (!M) { b.innerHTML = `<div class="hi-v"><p class="hi-small" role="status">${X.failed === id ? 'The initiative could not be read.' : 'Reading the initiative.'}</p></div>`; return; }
|
|
377
|
+
if (!M) { b.__pg = null; b.innerHTML = `<div class="hi-v"><p class="hi-small" role="status">${X.failed === id ? 'The initiative could not be read.' : 'Reading the initiative.'}</p></div>`; return; }
|
|
366
378
|
const v = X.view;
|
|
379
|
+
if (v !== 'page') b.__pg = null;
|
|
380
|
+
if (v === 'page') { const h = pageHtml(id, M); if (b.__pg !== h || !b.firstChild) { b.__pg = h; b.innerHTML = h; } return; }
|
|
367
381
|
// Documents is shell A (XvADocs): no tabs, the summary card and folding groups straight in the body
|
|
368
382
|
if (v === 'docs') { b.innerHTML = docsView(id, M) + '<p class="hi-small" role="status" id="ovMsg"></p>'; return; }
|
|
369
383
|
// the phone keeps the Tasks | Stage switch (PgTkList); in shell A on a desktop the other views sit under ⋯ (XvATasks)
|
|
@@ -382,8 +396,8 @@ function moreOf(id, view) {
|
|
|
382
396
|
const out = [];
|
|
383
397
|
if (view === 'tasks') out.push({ label: 'Group tasks by', on: (b) => { const M = M0(); if (M) groupMenu(b, id, M); } });
|
|
384
398
|
for (const [k, l] of Object.entries(KIND)) if (k !== view) out.push({ label: l, on: () => iniOverview(k) });
|
|
385
|
-
out.push({ sep: true }, { label: 'Open the full record', on: async () => { const M = M0(); if (M) (await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...bw(M) }); } });
|
|
386
|
-
if (M0() && M0().board && M0().board.id) out.push({ label: 'Sprint', on: async () => { const M = M0(); if (M) (await import('./premium-vw-jira.js')).openSprint(bw(M)); } });
|
|
399
|
+
out.push({ sep: true }, { label: 'Open the full record', on: async () => { const M = M0(); if (M) (X.ctx.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...bw(M) }); } });
|
|
400
|
+
if (M0() && M0().board && M0().board.id) out.push({ label: 'Sprint', on: async () => { const M = M0(); if (M) (X.ctx.VW.drill(), await import('./premium-vw-jira.js')).openSprint(bw(M)); } });
|
|
387
401
|
return out;
|
|
388
402
|
}
|
|
389
403
|
function groupMenu(t, id, M) {
|
|
@@ -411,17 +425,23 @@ async function openTicket(id, M, tid) {
|
|
|
411
425
|
D.openDraft({ VW: X.ctx.VW, ws: wsOf(M), initiative: id, id: tid, view: T && T.ok ? T : null, toast: X.ctx.toast, ui: { menu, ask },
|
|
412
426
|
onChange: () => readT(id, M, true), onSend: (x) => sendSheet(id, M, { ticket: x }) });
|
|
413
427
|
}
|
|
414
|
-
export function iniOverview(view) {
|
|
428
|
+
export function iniOverview(view, o = {}) {
|
|
415
429
|
if (!X.ctx) return false;
|
|
416
430
|
const S = X.ctx.S, id = S.ini;
|
|
417
431
|
if (!id || id === 'product') return false;
|
|
418
|
-
|
|
419
|
-
|
|
432
|
+
const v = KIND[view] ? view : 'tasks'; // the page's "Show N more" opens Tasks (InTasks); "Show all N" and ⋯ name their own view
|
|
433
|
+
const c = X.ctx.VW.current(), keep = !o.back && !!c && c.id === 'ov:' + id && X.view !== 'page'; // a switch between views keeps the page behind them
|
|
434
|
+
X.view = v;
|
|
435
|
+
STAGE_ASK = o.ask || null;
|
|
420
436
|
const VW = X.ctx.VW;
|
|
421
437
|
const docs = X.view === 'docs';
|
|
422
438
|
// render wires the body too, so ← from a drill-in (a drafted ticket) draws the view again with its presses
|
|
423
|
-
|
|
424
|
-
|
|
439
|
+
// tap the title to rename the initiative (canvas RnAIni): the field holds its name; the view's word before it stays
|
|
440
|
+
const pre = KIND[X.view] + ' · ';
|
|
441
|
+
let rename = X.ctx.renameIni ? X.ctx.renameIni(id, pre) : null;
|
|
442
|
+
if (rename) { const save = rename.save; rename = { ...rename, value: X.ctx.iniTitle(id), save: async (t, o) => { const r = await save(t, o); if (r.ok) rename.value = r.title; return r.ok ? { ...r, title: pre + r.title } : r; } }; }
|
|
443
|
+
BODY = VW.open({ id: 'ov:' + id, kind: KIND[X.view], title: pre + X.ctx.iniTitle(id), icon: ICON[X.view], more: docs ? () => docsMore(id) : moreOf(id, X.view), rename, back: !!o.back, keep,
|
|
444
|
+
render: (b) => { X.view = v; BODY = b; draw(b); wire(b, id); } });
|
|
425
445
|
if (!curM()) { X.failed = null; X.ctx.loadIni().then(() => { if (S.ini !== id) return; if (!curM()) X.failed = id; X.ctx.drawList(); redrawView(); }); } // a slow first read: read it again rather than say it failed
|
|
426
446
|
return true;
|
|
427
447
|
}
|
|
@@ -437,7 +457,7 @@ function docsMore(id) {
|
|
|
437
457
|
{ sep: true },
|
|
438
458
|
{ label: 'Tasks', on: () => iniOverview('tasks') },
|
|
439
459
|
{ label: 'Stage', on: () => iniOverview('stage') },
|
|
440
|
-
{ label: 'Open the full record', on: async () => (await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...bw(M) }) },
|
|
460
|
+
{ label: 'Open the full record', on: async () => (X.ctx.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...bw(M) }) },
|
|
441
461
|
];
|
|
442
462
|
}
|
|
443
463
|
async function addDoc(id) {
|
|
@@ -469,6 +489,7 @@ function wire(body, id) {
|
|
|
469
489
|
body.onclick = async (e) => {
|
|
470
490
|
const t = e.target.closest('button'); const M = curM(); if (!t || t.disabled || !M) return;
|
|
471
491
|
const d = t.dataset;
|
|
492
|
+
if (X.view === 'page' && pagePress(t, id, M)) return;
|
|
472
493
|
if (d.hiView) { iniOverview(d.hiView); return; }
|
|
473
494
|
if ('hiAuto' in d) { press(id, M, { kind: 'auto', on: t.getAttribute('aria-checked') !== 'true' }); return; }
|
|
474
495
|
if ('hiBy' in d) { groupMenu(t, id, M); return; }
|
|
@@ -517,8 +538,8 @@ function wire(body, id) {
|
|
|
517
538
|
if (d.ovTk) { openTask(id, M, d.ovTk); return; }
|
|
518
539
|
if ('ovRecord' in d || 'ovSprint' in d) {
|
|
519
540
|
const o = bw(M);
|
|
520
|
-
if ('ovSprint' in d) { (await import('./premium-vw-jira.js')).openSprint(o); return; }
|
|
521
|
-
(await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...o });
|
|
541
|
+
if ('ovSprint' in d) { (X.ctx.VW.drill(), await import('./premium-vw-jira.js')).openSprint(o); return; }
|
|
542
|
+
(X.ctx.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'initiative', id, title: M.title, ...o });
|
|
522
543
|
return;
|
|
523
544
|
}
|
|
524
545
|
// documents
|
|
@@ -567,32 +588,30 @@ async function openTask(id, M, key) {
|
|
|
567
588
|
const row = (M.tasks.rows || []).find((x) => x.key === key); if (!row) return;
|
|
568
589
|
const o = bw(M);
|
|
569
590
|
if (!row.pmos && row.ref && /^Jira/.test(row.src || '')) { (await import('./premium-vw-jira.js')).openTicket({ ...o, initiative: id, ref: row.ref }); return; }
|
|
570
|
-
|
|
591
|
+
const rename = row.pmos && row.uid && X.ctx.renameTask ? X.ctx.renameTask({ uid: row.uid, title: row.title, ws: o.ws, board: o.board }) : null;
|
|
592
|
+
(X.ctx.VW.drill(), await import('./premium-vw-item.js')).openWorkItem({ kind: 'task', ini: id, key: row.key, title: row.title, ...o, rename });
|
|
571
593
|
}
|
|
572
594
|
|
|
573
|
-
|
|
574
|
-
function
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
if (
|
|
578
|
-
if ('
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
if (
|
|
585
|
-
if (
|
|
586
|
-
if (d.
|
|
587
|
-
if ('hiAddtask' in d) { X.view = 'tasks'; iniOverview(); setTimeout(() => { const n = document.querySelector('#czViewer #ovTask'); if (n) n.focus(); }, 0); return; }
|
|
588
|
-
if (d.hiOpen) { iniOverview(d.hiOpen); return; }
|
|
589
|
-
if (d.hiTask) { openTask(id, M, d.hiTask); return; }
|
|
590
|
-
if (d.hiChk) { const row = MD.taskRows(M, Lof(id)).find((x) => x.key === d.hiChk); if (row && row.canCheck) X.ctx.pmPost('/api/boards/tasks/state', { ...bw(M), task: row.uid, state: 'Done' }).then(async (r) => { if (r && r.ok !== false) { X.ctx.toast('Done: ' + row.title + '.'); await X.ctx.load(); redrawView(); } else X.ctx.toast((r && r.error) || 'Nothing was changed.'); }); return; }
|
|
595
|
+
/** A press on the initiative's page: the card's own presses go to Home; a task or a document drills in, so ← comes back to the page. */
|
|
596
|
+
function pagePress(t, id, M) {
|
|
597
|
+
const d = t.dataset, C = X.ctx, VW = C.VW;
|
|
598
|
+
if ('hmCta' in d) { C.cta(); return true; }
|
|
599
|
+
if ('hmOv' in d) { C.overviewAsk(id); return true; }
|
|
600
|
+
if ('hmCfold' in d) { C.foldCard(); redrawView(); return true; }
|
|
601
|
+
if ('hmDone' in d) { C.S.doneOpen = !C.S.doneOpen; redrawView(); return true; }
|
|
602
|
+
if ('hiTalk' in d) { C.talk(id); return true; }
|
|
603
|
+
if ('hiMove' in d) { const mv = mvOf(id, M); if (!mv.canMove) return true; if (mv.open.length) popMove(t, id, M, mv); else doMove(id, M, mv.next, mv.allDone ? 'Moved by hand: every exit item is done.' : 'Moved by hand'); return true; }
|
|
604
|
+
if ('hiBack' in d) { const mv = mvOf(id, M); if (mv.canBack) popBack(t, id, M, mv); return true; }
|
|
605
|
+
if ('hiAddtask' in d) { iniOverview('tasks', { back: true }); setTimeout(() => { const n = document.querySelector('#czViewer #ovTask'); if (n) n.focus(); }, 0); return true; }
|
|
606
|
+
if (d.hiOpen) { iniOverview(d.hiOpen, { back: true }); return true; }
|
|
607
|
+
if (d.hiTask) { VW.drill(); openTask(id, M, d.hiTask); return true; }
|
|
608
|
+
if (d.hiChk) { const row = MD.taskRows(M, Lof(id)).find((x) => x.key === d.hiChk); if (row && row.canCheck) C.pmPost('/api/boards/tasks/state', { ...bw(M), task: row.uid, state: 'Done' }).then(async (r) => { if (r && r.ok !== false) { C.toast('Done: ' + row.title + '.'); await C.load(); redrawView(); } else C.toast((r && r.error) || 'Nothing was changed.'); }); return true; }
|
|
591
609
|
if (d.hiDoc) {
|
|
592
610
|
const doc = MD.docRows(M).find((x) => x.key === d.hiDoc);
|
|
593
|
-
if (doc && doc.path && !(doc.st === 'draft' && doc.slot))
|
|
594
|
-
|
|
611
|
+
if (doc && doc.path && !(doc.st === 'draft' && doc.slot)) { VW.drill(); C.openFile({ path: doc.path, name: doc.title }); } else iniOverview('docs', { back: true });
|
|
612
|
+
return true;
|
|
595
613
|
}
|
|
614
|
+
return false;
|
|
596
615
|
}
|
|
597
616
|
|
|
598
617
|
export function mountIni(ctx) {
|
|
@@ -600,8 +619,6 @@ export function mountIni(ctx) {
|
|
|
600
619
|
if (typeof document === 'undefined') return X;
|
|
601
620
|
if (!document.querySelector('link[data-hi-css]')) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '/pm/home-ini.css'; l.dataset.hiCss = ''; document.head.appendChild(l); }
|
|
602
621
|
if (!document.querySelector('link[data-tk-css]')) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = '/pm/tk-tasks.css'; l.dataset.tkCss = ''; document.head.appendChild(l); }
|
|
603
|
-
const list = document.getElementById('hmList');
|
|
604
|
-
if (list) list.addEventListener('click', onList);
|
|
605
622
|
ctx.VW.onChange((v) => { if (!v.open || !/^ov:/.test(v.id || '')) closePop(); });
|
|
606
623
|
return X;
|
|
607
624
|
}
|
|
@@ -23,7 +23,8 @@ export function dueText(iso, now = Date.now()) {
|
|
|
23
23
|
/** h: { VW, pmPost, toast, now, ws, board, iniTitle(id), docs(id) → [{ title, path }], openIni(id), openDoc(doc), askInChat(task), openRecord(task), onChange() }
|
|
24
24
|
* Shell A (canvas XvATask): the summary card says when it is due, quotes the task's words, says where it sits, and holds the one primary
|
|
25
25
|
* (Talk it through in chat) with Done as a quiet check beside it. "Needs" folds below: the initiative, its documents and the Jira item.
|
|
26
|
-
* The status moves and the task's record are under ⋯ (the xvMore note: change it, then look back).
|
|
26
|
+
* The status moves and the task's record are under ⋯ (the xvMore note: change it, then look back). h.rename(task), when given, is the
|
|
27
|
+
* Viewer's rename option for the task (rename-press.js taskRename). */
|
|
27
28
|
export function openTask(task, h) {
|
|
28
29
|
const st = { msg: '', busy: false };
|
|
29
30
|
const t = task;
|
|
@@ -45,7 +46,9 @@ export function openTask(task, h) {
|
|
|
45
46
|
};
|
|
46
47
|
const more = () => STATES.filter((x) => x !== 'Done' && x !== t.status).map((x) => ({ label: 'Mark ' + x.toLowerCase(), on: () => setState(x) }))
|
|
47
48
|
.concat(h.openRecord ? [{ sep: true }, { label: "Open the task's record", on: () => h.openRecord(t) }] : []);
|
|
48
|
-
|
|
49
|
+
// tap the title to rename (canvas RnATask): a PMOS task only; a Jira ticket's name is Jira's
|
|
50
|
+
const rename = t.src === 'pmos' && h.rename ? h.rename(t) : null;
|
|
51
|
+
const body = h.VW.open({ id: 'task:' + t.uid, kind: 'Task', title: t.title, icon: 'task', more: more(), render: draw, rename });
|
|
49
52
|
const setState = async (state) => {
|
|
50
53
|
if (st.busy) return; st.busy = true;
|
|
51
54
|
const r = await h.pmPost('/api/boards/tasks/state', { ws: h.ws, board: t.board || h.board, task: t.uid, state }).catch(() => null);
|
|
@@ -81,7 +81,7 @@ function iniHtml(r, o) {
|
|
|
81
81
|
const nest = open ? `<div class="hm-nest" role="group" aria-label="In ${esc(r.name)}">${kids.map((k) => rowHtml(k, { ...o, kid: true })).join('')}${more}</div>` : '';
|
|
82
82
|
const badge = !open && r.yours ? `<span class="hv-c" role="img" aria-label="${r.yours === 1 ? '1 is yours' : r.yours + ' are yours'}">${r.yours}</span>` : '';
|
|
83
83
|
const chev = r.kids.length ? `<button type="button" class="hv-xc" data-hm-kids="${esc(r.id)}" aria-expanded="${open}" aria-label="${open ? 'Hide' : 'Show'} what is in ${esc(r.name)}">${svg(open ? P.chevD : P.chevR, 15)}</button>` : '<span class="hv-xc" aria-hidden="true"></span>';
|
|
84
|
-
return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}" title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
|
|
84
|
+
return `<div class="hm-r hv-r ini st-${esc(r.state)}${o.sel === r.id ? ' sel' : ''}" data-id="${esc(r.id)}"><button type="button" class="hm-rm" data-hm-sel="${esc(r.id)}"${o.sel === r.id ? ' aria-current="true"' : ''} title="${esc(r.hint)}">${markHtml(r.yours && r.state !== 'blocked' ? { state: 'needs' } : r)}`
|
|
85
85
|
+ `<span class="hm-rt"><b>${esc(r.name)}</b></span>${badge}${track(r.at, r.stage)}</button>${chev}</div>${nest}`;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -93,8 +93,10 @@ function productHtml(g, o) {
|
|
|
93
93
|
const open = o.pOpen(g);
|
|
94
94
|
// open: the goal dots; folded: the tile's dot says something in it is yours (blue) or late (amber). No counts in words (HvAC)
|
|
95
95
|
const say = [g.name, open ? (g.goals && g.goals.n ? g.goals.text : '') : [plural(g.count, 'initiative', 'initiatives'), yoursWords(g)].filter(Boolean).join(', ')].filter(Boolean).join(', ');
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
// the name opens the product in the Viewer, with its own chat; the rest of the header folds the group (canvas HbCProduct)
|
|
97
|
+
const head = `<div class="hv-gh hv-prg${open ? '' : ' closed'}${o.selHead === g.key ? ' sel' : ''}"><button type="button" class="hv-pt" data-hm-prodopen="${esc(g.key)}" aria-label="Open ${esc(g.name)}, a product"${o.selHead === g.key ? ' aria-current="true"' : ''}>`
|
|
98
|
+
+ `<span class="hv-tl t${g.tone}" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${esc(g.initials)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b></button>`
|
|
99
|
+
+ `<button type="button" class="hv-pf" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(say)}. ${open ? 'Close' : 'Open'} the group">${open ? dots(g) : ''}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button></div>`;
|
|
98
100
|
if (!open) return `<section class="hm-pg hv-g" aria-label="${esc(g.name)}">${head}</section>`;
|
|
99
101
|
const pinned = (x) => (o.pin.has(x.key) ? 0 : 1);
|
|
100
102
|
const flat = g.flat.slice().sort((a, b) => pinned(a) - pinned(b)).map((r) => rowHtml(r, o)).join('');
|
|
@@ -109,14 +111,14 @@ function productHtml(g, o) {
|
|
|
109
111
|
}
|
|
110
112
|
/** A program's group (canvas PgHomePhone, PgHomeDesk): above the products. Its header: the program tile, the name, the next milestone's
|
|
111
113
|
* diamond with its date and one small diamond per initiative it waits on (filled when that initiative is past the Deliver milestone), a chevron.
|
|
112
|
-
* The title opens the program
|
|
114
|
+
* The title opens the program in Home's Viewer with its own chat (canvas HbCProg); the chevron folds the group. Inside: the program's own tasks first, then a sub-heading
|
|
113
115
|
* per product with that product's initiatives. */
|
|
114
116
|
function programHtml(g, o) {
|
|
115
117
|
const open = o.pOpen(g);
|
|
116
118
|
const nx = g.st && g.st.next;
|
|
117
119
|
const ms = nx ? `<span class="hv-msd${nx.late ? ' late' : ''}"><span class="hv-dm"></span>${esc(nx.day || nx.name)}${nx.n ? `<span class="hv-rd">${Array.from({ length: nx.n }, (_, i) => `<i${i < nx.ready ? ' class="on"' : ''}></i>`).join('')}</span>` : ''}</span>` : '';
|
|
118
120
|
const line = nx ? 'Next milestone ' + nx.name + (nx.day ? ', ' + nx.day : '') + (nx.late ? ', late' : '') + (nx.n ? ', ' + nx.ready + ' of ' + nx.n + (nx.n === 1 ? ' initiative' : ' initiatives') + ' ready' : '') : 'No open milestone';
|
|
119
|
-
const head = `<div class="hv-gh hv-prg${open ? '' : ' closed'}"><button type="button" class="hv-pt" data-hm-prog="${esc(g.program.id)}" aria-label="Open ${esc(g.name)}, a program">`
|
|
121
|
+
const head = `<div class="hv-gh hv-prg${open ? '' : ' closed'}${o.selHead === g.key ? ' sel' : ''}"><button type="button" class="hv-pt" data-hm-prog="${esc(g.program.id)}" aria-label="Open ${esc(g.name)}, a program"${o.selHead === g.key ? ' aria-current="true"' : ''}>`
|
|
120
122
|
+ `<span class="hv-tl tp" aria-hidden="true" data-cz-rail-tile="${esc(g.key)}" data-cz-rail-name="${esc(g.name)}">${svg(P.layers, 16)}${open ? '' : nd(g)}</span><b>${esc(g.name)}</b></button>`
|
|
121
123
|
+ `<button type="button" class="hv-pf" data-hm-pg="${esc(g.key)}" aria-expanded="${open}" aria-label="${esc(g.name)}. ${esc(line)}${g.yours ? '. ' + yoursWords(g) : ''}. ${open ? 'Close' : 'Open'} the group">${ms}<span class="hv-cv">${svg(open ? P.chevD : P.chevR, 16)}</span></button></div>`;
|
|
122
124
|
if (!open) return `<section class="hm-pg hv-g prg" aria-label="${esc(g.name)}">${head}</section>`;
|
|
@@ -29,6 +29,7 @@ import { open as viewerOpen } from './cozy-viewer.js';
|
|
|
29
29
|
import * as VW from './cozy-viewer.js';
|
|
30
30
|
import * as PP from './bd-prog-panel.js';
|
|
31
31
|
import * as BI from './bd-ini-panel.js';
|
|
32
|
+
import { initiativeRename } from './rename-press.js';
|
|
32
33
|
import { setSay } from './cozy-xv.js';
|
|
33
34
|
|
|
34
35
|
const VIEW_KEY = 'pmos.board.view', PVIEW_KEY = 'pmos.board.pview', SPAN_KEY = 'pmos.board.span', GROUP_KEY = 'pmos.board.group', GROUPING_KEY = 'pmos.board.grouping';
|
|
@@ -707,7 +708,7 @@ async function load() {
|
|
|
707
708
|
setTimeout(load, 15000);
|
|
708
709
|
return;
|
|
709
710
|
}
|
|
710
|
-
M = r.model; draw();
|
|
711
|
+
M = r.model; holdNames(); draw();
|
|
711
712
|
focusOnce(); programOnce(); loadOthers();
|
|
712
713
|
if (r.stale) setTimeout(load, 2000); // a press is still being derived: ask again
|
|
713
714
|
else { loadTrail(); loadGrill(); }
|
|
@@ -725,7 +726,25 @@ Acts.init({ M: () => M, load, say, panel: actsPanel, close: closePanel, redraw:
|
|
|
725
726
|
BI.mount({ M: () => M, statusOf, dayTitle, fmt, md, ago, segHtml, barHtml: V.barHtml, grill: (id) => GR[id], rowOf, pageHref, askHref, refreshJira: () => refreshJira(), viewDoc,
|
|
726
727
|
send: (r) => import('./tk-send.js').then((S) => S.openSend({ ws: r.ws || M.board.ws || null, board: r.boardId || M.board.id, initiative: r.id, toast: say })),
|
|
727
728
|
acts: (r, b) => Acts.open.row(r, b), grillOpen: (r, b) => Asks.openGrill(r.id, r.title, (r.track && r.track.label) || 'Triage', false, b), onShow: iniShown, onHide: iniHidden,
|
|
728
|
-
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), turnProgram });
|
|
729
|
+
programOf: (r) => programOf(PGS, r.ws || M.board.ws || '', r.id), rename: renameIni, turnProgram });
|
|
730
|
+
/** Tap the title to rename (canvas RnAIni): the list, the Timeline and the panel show the new name at once; Undo is the same press.
|
|
731
|
+
* The Jira box opens Home's chat about it with the request typed, for the PM to send (PMOS holds no Jira credential, D53). */
|
|
732
|
+
// a name the PM just saved holds over a read that predates it (the board derives off the request path) until a read says it too
|
|
733
|
+
const RENAMED = new Map();
|
|
734
|
+
function renamedOn(ids, title) { for (const id of ids) RENAMED.set(id, title); if (!M) return; holdNames(); draw(); }
|
|
735
|
+
function holdNames() {
|
|
736
|
+
if (!M || !RENAMED.size) return;
|
|
737
|
+
const I = M.initiatives || {};
|
|
738
|
+
const all = [].concat(M.rows || [], (I.list && I.list.rows) || [], ...((I.stages || []).map((c) => c.rows || [])), (I.timeline && I.timeline.bars) || []);
|
|
739
|
+
for (const r of M.rows || []) if (RENAMED.has(r.id) && r.title === RENAMED.get(r.id)) RENAMED.delete(r.id); // the read says it: nothing to hold
|
|
740
|
+
for (const r of all) if (r && RENAMED.has(r.id)) r.title = RENAMED.get(r.id);
|
|
741
|
+
}
|
|
742
|
+
function renameIni(r) { return r && r.id ? initiativeRename({ pmPost, ws: r.ws || M.board.ws, id: r.id, epics: r.epics,
|
|
743
|
+
onSaved: (o) => {
|
|
744
|
+
renamedOn([r.id], o.title); load();
|
|
745
|
+
if (o.jira) { location.assign('/premium.html?about=' + encodeURIComponent('init:' + r.id) + '&label=' + encodeURIComponent(o.title) + '&say=' + encodeURIComponent(o.jira)); return; }
|
|
746
|
+
say('Renamed', async () => { const u = await o.undo(); if (!u.ok) { say(u.error); return; } renamedOn([r.id], u.title); VW.retitle(BI.vidOf(r), u.title); load(); });
|
|
747
|
+
} }) : null; }
|
|
729
748
|
setSay(say);
|
|
730
749
|
PP.mount({ M: () => M, programs: () => PGS, openIni: (id, from) => openIni((M.rows || []).find((x) => x.id === id && x.track), from), close: closePanel, reload: loadPrograms, say }); // the program panel (PgProgram)
|
|
731
750
|
setTab('ini');
|
|
@@ -87,7 +87,7 @@ let czLast = null;
|
|
|
87
87
|
export function vwReopen() { if (!czLast) return false; czVw(czLast); return true; }
|
|
88
88
|
function czVw(it) {
|
|
89
89
|
let el = null; czLast = it;
|
|
90
|
-
czOpen({ id: 'vw:' + it.id, kind: it.kind || it.title || 'Item', title: it.name || it.title || 'Item', icon: CZ_ICON[it.icon] || 'doc', url: it.url || '',
|
|
90
|
+
czOpen({ id: 'vw:' + it.id, kind: it.kind || it.title || 'Item', title: it.name || it.title || 'Item', icon: CZ_ICON[it.icon] || 'doc', url: it.url || '', rename: it.rename || null,
|
|
91
91
|
render: (body) => {
|
|
92
92
|
el = document.createElement('div'); el.className = 'obody vw'; el.dataset.vw = it.id; el.setAttribute('role', 'region'); body.append(el);
|
|
93
93
|
if (it.render) it.render(el); else el.innerHTML = it.html || '';
|
|
@@ -39,6 +39,7 @@ export function openWorkItem(o) {
|
|
|
39
39
|
id: isTask ? taskId(ctx.id, o.key) : iniId(ctx.id),
|
|
40
40
|
title: o.title || (isTask ? 'Task' : 'Initiative'),
|
|
41
41
|
icon: isTask ? 'tk' : 'list',
|
|
42
|
+
rename: o.rename || null, // the Viewer's rename option, from the page that knows how to write it (rename-press.js)
|
|
42
43
|
render(el) {
|
|
43
44
|
el.innerHTML = readingHtml(isTask ? 'the task' : 'the initiative');
|
|
44
45
|
read(ctx).then((s) => {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* pm/rename-press.js — rename a program, an initiative or a PMOS task (testing feedback 2026-10-24; canvas RnATask, RnAIni,
|
|
2
|
+
* RnAProg, RnASaved). The Viewer's title is the press (cozy-viewer.js `rename`); these are the writes behind it, one per level,
|
|
3
|
+
* each the level's own route and the PM's press. Only the name changes: the id, the file, the links and the history stay.
|
|
4
|
+
*
|
|
5
|
+
* initiativeRename({ pmPost, ws, id, epics }) → the Viewer's `rename` option for an initiative (Jira box when it has an epic)
|
|
6
|
+
* taskRename({ pmPost, ws, board, uid, ref }) → the same for a PMOS task (Jira box when it has a Jira key)
|
|
7
|
+
* programRename({ pmPost, program }) → the same for a program: its whole charter again, with its id (no Jira box)
|
|
8
|
+
* jiraAsk(kind, keys, title) → the words the chat starts with when the PM ticks the Jira box. PMOS holds no
|
|
9
|
+
* Jira credential (D53): the PM's own agent renames it, after the PM sends them.
|
|
10
|
+
* Each `save` resolves { ok, title, from, undo() } or { ok: false, error }; the caller says "Renamed" with Undo. */
|
|
11
|
+
|
|
12
|
+
const said = (r, fallback) => (r && r.error) || fallback;
|
|
13
|
+
|
|
14
|
+
export function jiraAsk(kind, keys, title) {
|
|
15
|
+
const k = (keys || []).filter(Boolean);
|
|
16
|
+
if (!k.length) return '';
|
|
17
|
+
return 'Rename the Jira ' + kind + (k.length > 1 ? 's ' : ' ') + k.join(', ') + ' to "' + title + '".';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function initiativeRename({ pmPost, ws, id, epics, onSaved }) {
|
|
21
|
+
const keys = (epics || []).filter(Boolean);
|
|
22
|
+
const write = async (title) => {
|
|
23
|
+
const r = await pmPost('/api/initiatives/rename', { ws: ws || undefined, id, title }).catch(() => null);
|
|
24
|
+
return r && r.ok ? { ok: true, title: r.title, from: r.from } : { ok: false, error: said(r, 'The name was not saved.') };
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
max: 120,
|
|
28
|
+
jira: keys.length ? { label: 'Rename the Jira ' + (keys.length > 1 ? 'epics' : 'epic') + ' too', key: keys.join(', ') } : null,
|
|
29
|
+
save: async (title, o = {}) => {
|
|
30
|
+
const r = await write(title);
|
|
31
|
+
if (!r.ok) return r;
|
|
32
|
+
const out = { ...r, jira: o.jira ? jiraAsk('epic', keys, r.title) : '', undo: () => write(r.from) };
|
|
33
|
+
if (onSaved) await onSaved(out);
|
|
34
|
+
return out;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function taskRename({ pmPost, ws, board, uid, ref, onSaved }) {
|
|
40
|
+
const write = async (title) => {
|
|
41
|
+
const r = await pmPost('/api/boards/tasks/rename', { ws: ws || undefined, board: board || undefined, task: uid, title }).catch(() => null);
|
|
42
|
+
return r && r.ok ? { ok: true, title: (r.item && r.item.title) || title, from: r.from } : { ok: false, error: said(r, 'The name was not saved.') };
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
max: 200,
|
|
46
|
+
jira: ref ? { label: 'Rename the Jira ticket too', key: ref } : null,
|
|
47
|
+
save: async (title, o = {}) => {
|
|
48
|
+
const r = await write(title);
|
|
49
|
+
if (!r.ok) return r;
|
|
50
|
+
const out = { ...r, jira: o.jira && ref ? jiraAsk('ticket', [ref], r.title) : '', undo: () => write(r.from) };
|
|
51
|
+
if (onSaved) await onSaved(out);
|
|
52
|
+
return out;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The charter as POST /api/programs/save takes it: every field it keeps, with the id, so a new title never makes a new program. */
|
|
58
|
+
export function charterOf(p, title) {
|
|
59
|
+
const ms = (p.milestones || []).map((m) => ({ id: m.id, name: m.name, date: m.date || '', waits: m.waits || [], ...(m.waits && m.waits.length ? {} : { done: !!m.done }) }));
|
|
60
|
+
return { id: p.id, title, owner: p.owner || '', goal: p.goal || '', why: p.why || '', start: p.start || '', target: p.target || '', jira: p.jira || '', milestones: ms };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function programRename({ pmPost, program, onSaved }) {
|
|
64
|
+
const p = program;
|
|
65
|
+
const write = async (title) => {
|
|
66
|
+
const r = await pmPost('/api/programs/save', { ws: p.home || undefined, program: charterOf(p, title) }).catch(() => null);
|
|
67
|
+
return r && r.ok !== false ? { ok: true, title, from: p.title } : { ok: false, error: said(r, 'The name was not saved.') };
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
max: 120,
|
|
71
|
+
jira: null,
|
|
72
|
+
save: async (title) => {
|
|
73
|
+
const from = p.title;
|
|
74
|
+
const r = await write(title);
|
|
75
|
+
if (!r.ok) return r;
|
|
76
|
+
const out = { ...r, from, undo: () => write(from) };
|
|
77
|
+
if (onSaved) await onSaved(out);
|
|
78
|
+
return out;
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<main class="hm-desk" id="hmDesk">
|
|
32
32
|
<aside class="hm-list" id="hmList" aria-label="Sessions"></aside>
|
|
33
33
|
<section class="hm-chat" id="hmChat" aria-label="Conversation"></section>
|
|
34
|
-
<div class="hm-vw" data-cz-viewer-host></div>
|
|
34
|
+
<div class="hm-vw" data-cz-viewer-host data-cz-vw-overlay></div>
|
|
35
35
|
</main>
|
|
36
36
|
<div class="hm-menu" id="hmMenu" role="menu" aria-label="More" hidden></div>
|
|
37
37
|
<div class="hm-toast" id="toast" role="status" aria-live="polite"></div>
|