create-pmos 0.820.0 → 0.821.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 +10 -3
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/workflows.js +26 -6
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +9 -2
- package/workspace/guide/cli.md +3 -0
- package/workspace/lib/driver.js +2 -0
- package/workspace/lib/engine/workflows.js +26 -6
- package/workspace/lib/line-driver.js +40 -12
- package/workspace/lib/line.js +30 -8
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +1 -1
- package/workspace/lib/routes-stage-signoffs.js +71 -0
- package/workspace/lib/routes-your-move.js +10 -1
- package/workspace/lib/signoff-cli.js +13 -3
- package/workspace/lib/signoffs.js +24 -4
- package/workspace/lib/stage-signoffs.js +207 -0
- package/workspace/lib/vendor/scripts/workflows.js +26 -6
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-today-app.js +61 -1
- package/workspace/public/pm/cozy-today-model.js +20 -4
- package/workspace/public/pm/cozy-today-view.js +17 -2
- package/workspace/public/pm/home-app.js +1 -1
- package/workspace/test-lists/factory-signoffs-reach-you.json +9 -0
|
@@ -34,6 +34,7 @@ export const I = {
|
|
|
34
34
|
reply: 'M5 5h14v10H9l-4 4z', decide: 'M12 4l8 8-8 8-8-8z', send: 'M4 12l16-8-6 16-3-7z',
|
|
35
35
|
spark: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z',
|
|
36
36
|
undo: 'M9 14L4 9l5-5M4 9h11a5 5 0 0 1 0 10h-3',
|
|
37
|
+
open: 'M14 4h6v6M20 4l-9 9M18 14v5H5V6h5',
|
|
37
38
|
sun: 'M12 3v2M12 19v2M5 5l1.4 1.4M17.6 17.6L19 19M3 12h2M19 12h2M5 19l1.4-1.4M17.6 6.4L19 5M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z',
|
|
38
39
|
};
|
|
39
40
|
/** The small sign of each type (one stroke icon). */
|
|
@@ -67,6 +68,16 @@ export function whyLine(r) {
|
|
|
67
68
|
/** The first action of a row, by its job: Done for a thing to do, else the item opens where the PM replies, decides or sends. */
|
|
68
69
|
const JOB_ACT = { Reply: ['open', 'Reply', I.reply], Decide: ['open', 'Decide', I.decide], Send: ['open', 'Send', I.send] };
|
|
69
70
|
|
|
71
|
+
/** factory-signoffs-reach-you (boards LnYou4, LnBy4): the one action of a sign-off row, and Keep or Change on PMOS's suggestion. A sign-off is
|
|
72
|
+
* recorded (✓) only when its source passed the check; otherwise the row opens the source, or drafts the question for the tracker. */
|
|
73
|
+
export function signoffActs(r) {
|
|
74
|
+
const t = r.title, s = r.ref || {};
|
|
75
|
+
if (r.src === 'signoff-by') return ib('sb-keep', 'Keep: ' + t, I.yes, r.key) + ib('sb-change', 'Change them in the workflow: ' + t, I.no, r.key);
|
|
76
|
+
if (s.action === 'record') return ib('so-record', 'Record the sign-off: ' + t + '. Source: ' + (s.ref || ''), I.yes, r.key);
|
|
77
|
+
if (s.action === 'open') return ib('so-open', 'Check the source first: ' + (s.ref || '') + '. ' + (s.why || ''), I.open, r.key);
|
|
78
|
+
return ib('so-ask', 'Ask in the tracker: ' + (s.draft || t), I.send, r.key);
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
/** One row of the log: a ListRow (pm-li). o.lit: the lit first row of a group; o.sopen: its members are listed. */
|
|
71
82
|
export function rowHtml(r, o = {}) {
|
|
72
83
|
const [kd, kl] = kindOf(r);
|
|
@@ -74,6 +85,7 @@ export function rowHtml(r, o = {}) {
|
|
|
74
85
|
let acts = '';
|
|
75
86
|
if (!r.done && r.src !== 'note') {
|
|
76
87
|
if (r.src === 'question') acts = ib('open', 'Answer: ' + t, I.decide, r.key); // the register's line: it is answered where it opens, not marked done here
|
|
88
|
+
else if (r.src === 'signoff' || r.src === 'signoff-by') acts = signoffActs(r);
|
|
77
89
|
else if (r.src === 'lab') acts = ib('lab-keep', 'Keep it: start an initiative from ' + t, I.yes, r.key) + ib('lab-drop', 'Drop it: ' + t, I.no, r.key);
|
|
78
90
|
else {
|
|
79
91
|
const j = JOB_ACT[r.job];
|
|
@@ -159,11 +171,12 @@ export function overviewHtml(O) {
|
|
|
159
171
|
* work, the kind, the age), the ✦ line that says why it is in that place, and two icon Buttons: one action for its kind, and Put off a day. */
|
|
160
172
|
export const YM_SHOW = 5;
|
|
161
173
|
const KIND_WORD = { Ask: 'reply', Decision: 'a decision', Check: 'a check', Milestone: 'a date change', Task: 'task', Report: 'a draft to send' };
|
|
162
|
-
const ageOf = (r) => Math.max(0, r.src === 'question' ? r.age || 0 : r.carried || 0);
|
|
174
|
+
const ageOf = (r) => Math.max(0, r.src === 'question' || r.src === 'signoff' ? r.age || 0 : r.carried || 0);
|
|
163
175
|
/** The one action of a Your move row: an answer, a reply, a decision or a send opens the item; a thing to do is Done. */
|
|
164
176
|
function moveAct(r) {
|
|
165
177
|
const t = r.title;
|
|
166
178
|
if (r.src === 'question') return ib('open', 'Answer: ' + t, I.decide, r.key);
|
|
179
|
+
if (r.src === 'signoff' || r.src === 'signoff-by') return signoffActs(r);
|
|
167
180
|
const j = JOB_ACT[r.job];
|
|
168
181
|
if (j) return ib('open', j[1] + ': ' + t, j[2], r.key);
|
|
169
182
|
if (r.members) return ib('open', 'Show them: ' + t, I.more, r.key, ` aria-expanded="false"`);
|
|
@@ -173,7 +186,7 @@ function moveAct(r) {
|
|
|
173
186
|
export function moveRowHtml(r, n, o = {}) {
|
|
174
187
|
const [kd, kl] = kindOf(r);
|
|
175
188
|
const late = lateOf(r), age = ageOf(r);
|
|
176
|
-
const meta = [r.work || '', r.src === 'question' || r.src === 'batch' ? '' : KIND_WORD[r.type] || '', !late && r.tier !== 3 && age ? plural(age, 'day', 'days') : ''].filter(Boolean).join(' · ');
|
|
189
|
+
const meta = [r.work || '', r.src === 'question' || r.src === 'batch' || r.src === 'signoff-by' ? '' : r.src === 'signoff' ? 'a sign-off' : KIND_WORD[r.type] || '', !late && r.tier !== 3 && age ? plural(age, 'day', 'days') : ''].filter(Boolean).join(' · ');
|
|
177
190
|
// what the PM typed opens nothing: its words are the whole of it
|
|
178
191
|
const title = r.src === 'own' ? `<span class="t td-t">${esc(r.title)}</span>`
|
|
179
192
|
: `<button type="button" class="t td-t" data-td="open" data-key="${esc(r.key)}"${r.members ? ` aria-expanded="${!!o.sopen}"` : ''}>${esc(r.title)}${r.members ? ic(I.more, 14) : ''}</button>`;
|
|
@@ -305,6 +318,8 @@ export function swipeActs(r) {
|
|
|
305
318
|
if (r.looks) return { right: 'lk-yes', left: 'lk-no' };
|
|
306
319
|
if (r.members && r.drafts) return { right: 'same-yes', left: 'same-no' };
|
|
307
320
|
// a Your move row (your-move): right does its action, so a reply, an answer, a decision or a send opens the item; left puts it off a day
|
|
321
|
+
if (r.src === 'signoff-by') return { right: 'sb-keep', left: 'tomorrow' };
|
|
322
|
+
if (r.src === 'signoff') { const a = (r.ref || {}).action; return { right: a === 'record' ? 'so-record' : a === 'open' ? 'so-open' : 'so-ask', left: 'tomorrow' }; }
|
|
308
323
|
if (r.tier != null && (r.src === 'question' || JOB_ACT[r.job] || r.members)) return { right: 'open', left: 'tomorrow' };
|
|
309
324
|
return { right: 'done', left: 'tomorrow' };
|
|
310
325
|
}
|
|
@@ -2452,7 +2452,7 @@ mountPanels({
|
|
|
2452
2452
|
if (TD_PAGE) TDY = mountToday({ S, VW, POP, pmGet, pmPost, toast, toastUndo, isPhone, now: NOW,
|
|
2453
2453
|
rank: () => { S.topRank = rankMove({ ...rankIn(), calls: YD.callsOf((S.M && S.M.move) || []), now: NOW() }); return S.topRank; },
|
|
2454
2454
|
rows: () => new Map(allRows().map((r) => [r.id, r])), titleOf: (id) => (iniRowOf(id) ? iniTitle(id) : String(id || '').replace(/[-_]+/g, ' ').replace(/^./, (c) => c.toUpperCase())), hasIni: (id) => !!(id && iniRowOf(id)), boardWs, boardId,
|
|
2455
|
-
goIni: (id, o) => goIni(id, o || {}), select: (id) => select(id),
|
|
2455
|
+
goIni: (id, o) => goIni(id, o || {}), select: (id) => select(id), openFile: (f) => openFile(f),
|
|
2456
2456
|
// a mention row opens that one mention (Today round 3), never the Mentions list
|
|
2457
2457
|
openMention: (id, o) => { const L = MEN.mentionsOf(S.D), m = [...L.waiting, ...L.toread, ...L.answered].find((x) => x.id === id) || (o && o.m); if (!m) return false; MEN.openOneMention(m, menCtx(), o || {}); return true; },
|
|
2458
2458
|
mentions: () => MEN.mentionsOf(S.D), mentionAct: (id, act) => pmPost('/api/mentions/act', { id, act }), reloadMentions: () => MEN.load(menCtx()).then(() => drawList()),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "factory-signoffs-reach-you (job #1861, Factory page slice A): a stage's sign-offs reach Today's Your move, ✓ records one and moves the stage, one Undo. An IDPF-shaped repository; no browser, no network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"stage-signoffs.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"stage-signoffs.test.js": 8
|
|
8
|
+
}
|
|
9
|
+
}
|