@nanocollective/roster 0.1.0-beta.33 → 0.1.0-beta.34
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/dist/worker/assets/assets/js/readiness.js +3 -3
- package/dist/worker/assets/assets/js/views/home.js +14 -4
- package/dist/worker/assets/assets/js/views/staff.js +5 -0
- package/package.json +1 -1
- package/templates/ops/.github/workflows/session.yaml +7 -0
- package/templates/portal/js/readiness.js +3 -3
- package/templates/portal/js/views/home.js +14 -4
- package/templates/portal/js/views/staff.js +5 -0
|
@@ -61,10 +61,10 @@ const STEP_COMMANDS = {
|
|
|
61
61
|
"run once": (h) => `run ${h} --apply`,
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
|
-
* The steps
|
|
65
|
-
* files on Org, the charter on Staff
|
|
64
|
+
* The steps a hosted portal can do itself, so it offers that rather than a command: the org's
|
|
65
|
+
* two files on Org, the charter on Staff, and a first run, which is a workflow dispatch.
|
|
66
66
|
*/
|
|
67
|
-
export const IN_PORTAL = new Set(["business", "priorities", "write the charter"]);
|
|
67
|
+
export const IN_PORTAL = new Set(["business", "priorities", "write the charter", "run once"]);
|
|
68
68
|
|
|
69
69
|
export function stepCommand(what, handle) {
|
|
70
70
|
return STEP_COMMANDS[what]?.(handle) ?? "";
|
|
@@ -12,6 +12,7 @@ import { daysUntil, isFor, sortHome } from "../homesort.js";
|
|
|
12
12
|
import { mdlite } from "../md.js";
|
|
13
13
|
import { checkAll, notReady, ORG_STEPS, stepCommand } from "../readiness.js";
|
|
14
14
|
import { commandLine } from "./notready.js";
|
|
15
|
+
import { runOnce } from "./runonce.js";
|
|
15
16
|
import { parseReport } from "../report.js";
|
|
16
17
|
import { icon, iconHTML, staffIcon } from "../icons.js";
|
|
17
18
|
import { ensureInbox, stampCounts } from "../refresh.js";
|
|
@@ -637,11 +638,13 @@ function setupLeft(staff) {
|
|
|
637
638
|
go({ view: "staff" });
|
|
638
639
|
}
|
|
639
640
|
: null;
|
|
640
|
-
|
|
641
|
+
// A first run is a button anywhere: the same one Health has, right in the list.
|
|
642
|
+
const inline = what === "run once" ? s : null;
|
|
643
|
+
steps.push([`${s.name}: ${what}`, stepCommand(what, s.handle), here, inline]);
|
|
641
644
|
}
|
|
642
645
|
}
|
|
643
646
|
if (!steps.length) return null;
|
|
644
|
-
const wiring = steps.filter(([, , here]) => !here).length;
|
|
647
|
+
const wiring = steps.filter(([, , here, inline]) => !here && !inline).length;
|
|
645
648
|
|
|
646
649
|
const box = el("div", { className: "card homesetup" });
|
|
647
650
|
box.append(el("b", { textContent: "Setup is not finished" }));
|
|
@@ -659,11 +662,16 @@ function setupLeft(staff) {
|
|
|
659
662
|
el("p", { className: "sub homesetupor", textContent: "Or one at a time, in order:" }),
|
|
660
663
|
);
|
|
661
664
|
} else {
|
|
662
|
-
box.append(
|
|
665
|
+
box.append(
|
|
666
|
+
el("p", {
|
|
667
|
+
className: "sub",
|
|
668
|
+
textContent: S.hosted ? "Nobody runs until these are done, and each can be done here." : "Nobody runs until these are done.",
|
|
669
|
+
}),
|
|
670
|
+
);
|
|
663
671
|
}
|
|
664
672
|
const seen = new Set();
|
|
665
673
|
const list = el("ol", { className: "homesetupsteps" });
|
|
666
|
-
for (const [what, cmd, here] of steps) {
|
|
674
|
+
for (const [what, cmd, here, inline] of steps) {
|
|
667
675
|
// The credential is the org's, so two staff members missing it is one step.
|
|
668
676
|
if (cmd && seen.has(cmd)) continue;
|
|
669
677
|
seen.add(cmd);
|
|
@@ -674,6 +682,8 @@ function setupLeft(staff) {
|
|
|
674
682
|
const write = el("button", { className: "ghbtn sm", textContent: "Write it here" });
|
|
675
683
|
write.onclick = here;
|
|
676
684
|
label.append(" ", write);
|
|
685
|
+
} else if (S.hosted && inline) {
|
|
686
|
+
row.append(runOnce({ staff: inline.handle, name: inline.name, onDone: (ok) => ok && render() }));
|
|
677
687
|
} else if (S.hosted && cmd) row.append(commandLine(cmd));
|
|
678
688
|
list.append(row);
|
|
679
689
|
}
|
|
@@ -14,6 +14,7 @@ import { refreshAll } from "../refresh.js";
|
|
|
14
14
|
import { S } from "../state.js";
|
|
15
15
|
import { charterModes, hireFlow, line, rolePicker } from "./hire.js";
|
|
16
16
|
import { commandLine } from "./notready.js";
|
|
17
|
+
import { runOnce } from "./runonce.js";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Resolves once nothing is loading and `node` has stopped changing for a moment, or after a few
|
|
@@ -223,6 +224,10 @@ export function viewStaff(m, o = {}) {
|
|
|
223
224
|
warn.append(el("div", { className: "row" }, [write]));
|
|
224
225
|
}
|
|
225
226
|
warn.append(...cmds.map(commandLine));
|
|
227
|
+
// Once a run is all that is left, it is a button here like everywhere else.
|
|
228
|
+
if (left.length === 1 && left[0] === "run once") {
|
|
229
|
+
warn.append(runOnce({ staff: s.handle, name: s.name, onDone: (ok) => ok && refreshAll() }));
|
|
230
|
+
}
|
|
226
231
|
}
|
|
227
232
|
});
|
|
228
233
|
d.append(warn);
|
package/package.json
CHANGED
|
@@ -338,6 +338,13 @@ jobs:
|
|
|
338
338
|
cache: pnpm
|
|
339
339
|
cache-dependency-path: ${{ steps.plan.outputs.package_json }}
|
|
340
340
|
|
|
341
|
+
# setup-node saves pnpm's store when the job ends, and fails the run if the store is not
|
|
342
|
+
# there. A session that never installs anything (a CMO's, mostly) never creates it, so a
|
|
343
|
+
# run whose work all succeeded was reported as failed. An empty store is nothing to save.
|
|
344
|
+
- name: Make sure pnpm's store exists
|
|
345
|
+
if: steps.plan.outputs.needs_node == 'true'
|
|
346
|
+
run: mkdir -p "$(pnpm store path --silent)"
|
|
347
|
+
|
|
341
348
|
# A status issue lasts a week. The first daily run of a week opens the new one, pins it and
|
|
342
349
|
# moves staff.yaml on, before the prompt is composed from staff.yaml; the prompt is told
|
|
343
350
|
# which earlier week still needs its summary. `daily` only: a mention is not a session.
|
|
@@ -61,10 +61,10 @@ const STEP_COMMANDS = {
|
|
|
61
61
|
"run once": (h) => `run ${h} --apply`,
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
|
-
* The steps
|
|
65
|
-
* files on Org, the charter on Staff
|
|
64
|
+
* The steps a hosted portal can do itself, so it offers that rather than a command: the org's
|
|
65
|
+
* two files on Org, the charter on Staff, and a first run, which is a workflow dispatch.
|
|
66
66
|
*/
|
|
67
|
-
export const IN_PORTAL = new Set(["business", "priorities", "write the charter"]);
|
|
67
|
+
export const IN_PORTAL = new Set(["business", "priorities", "write the charter", "run once"]);
|
|
68
68
|
|
|
69
69
|
export function stepCommand(what, handle) {
|
|
70
70
|
return STEP_COMMANDS[what]?.(handle) ?? "";
|
|
@@ -12,6 +12,7 @@ import { daysUntil, isFor, sortHome } from "../homesort.js";
|
|
|
12
12
|
import { mdlite } from "../md.js";
|
|
13
13
|
import { checkAll, notReady, ORG_STEPS, stepCommand } from "../readiness.js";
|
|
14
14
|
import { commandLine } from "./notready.js";
|
|
15
|
+
import { runOnce } from "./runonce.js";
|
|
15
16
|
import { parseReport } from "../report.js";
|
|
16
17
|
import { icon, iconHTML, staffIcon } from "../icons.js";
|
|
17
18
|
import { ensureInbox, stampCounts } from "../refresh.js";
|
|
@@ -637,11 +638,13 @@ function setupLeft(staff) {
|
|
|
637
638
|
go({ view: "staff" });
|
|
638
639
|
}
|
|
639
640
|
: null;
|
|
640
|
-
|
|
641
|
+
// A first run is a button anywhere: the same one Health has, right in the list.
|
|
642
|
+
const inline = what === "run once" ? s : null;
|
|
643
|
+
steps.push([`${s.name}: ${what}`, stepCommand(what, s.handle), here, inline]);
|
|
641
644
|
}
|
|
642
645
|
}
|
|
643
646
|
if (!steps.length) return null;
|
|
644
|
-
const wiring = steps.filter(([, , here]) => !here).length;
|
|
647
|
+
const wiring = steps.filter(([, , here, inline]) => !here && !inline).length;
|
|
645
648
|
|
|
646
649
|
const box = el("div", { className: "card homesetup" });
|
|
647
650
|
box.append(el("b", { textContent: "Setup is not finished" }));
|
|
@@ -659,11 +662,16 @@ function setupLeft(staff) {
|
|
|
659
662
|
el("p", { className: "sub homesetupor", textContent: "Or one at a time, in order:" }),
|
|
660
663
|
);
|
|
661
664
|
} else {
|
|
662
|
-
box.append(
|
|
665
|
+
box.append(
|
|
666
|
+
el("p", {
|
|
667
|
+
className: "sub",
|
|
668
|
+
textContent: S.hosted ? "Nobody runs until these are done, and each can be done here." : "Nobody runs until these are done.",
|
|
669
|
+
}),
|
|
670
|
+
);
|
|
663
671
|
}
|
|
664
672
|
const seen = new Set();
|
|
665
673
|
const list = el("ol", { className: "homesetupsteps" });
|
|
666
|
-
for (const [what, cmd, here] of steps) {
|
|
674
|
+
for (const [what, cmd, here, inline] of steps) {
|
|
667
675
|
// The credential is the org's, so two staff members missing it is one step.
|
|
668
676
|
if (cmd && seen.has(cmd)) continue;
|
|
669
677
|
seen.add(cmd);
|
|
@@ -674,6 +682,8 @@ function setupLeft(staff) {
|
|
|
674
682
|
const write = el("button", { className: "ghbtn sm", textContent: "Write it here" });
|
|
675
683
|
write.onclick = here;
|
|
676
684
|
label.append(" ", write);
|
|
685
|
+
} else if (S.hosted && inline) {
|
|
686
|
+
row.append(runOnce({ staff: inline.handle, name: inline.name, onDone: (ok) => ok && render() }));
|
|
677
687
|
} else if (S.hosted && cmd) row.append(commandLine(cmd));
|
|
678
688
|
list.append(row);
|
|
679
689
|
}
|
|
@@ -14,6 +14,7 @@ import { refreshAll } from "../refresh.js";
|
|
|
14
14
|
import { S } from "../state.js";
|
|
15
15
|
import { charterModes, hireFlow, line, rolePicker } from "./hire.js";
|
|
16
16
|
import { commandLine } from "./notready.js";
|
|
17
|
+
import { runOnce } from "./runonce.js";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Resolves once nothing is loading and `node` has stopped changing for a moment, or after a few
|
|
@@ -223,6 +224,10 @@ export function viewStaff(m, o = {}) {
|
|
|
223
224
|
warn.append(el("div", { className: "row" }, [write]));
|
|
224
225
|
}
|
|
225
226
|
warn.append(...cmds.map(commandLine));
|
|
227
|
+
// Once a run is all that is left, it is a button here like everywhere else.
|
|
228
|
+
if (left.length === 1 && left[0] === "run once") {
|
|
229
|
+
warn.append(runOnce({ staff: s.handle, name: s.name, onDone: (ok) => ok && refreshAll() }));
|
|
230
|
+
}
|
|
226
231
|
}
|
|
227
232
|
});
|
|
228
233
|
d.append(warn);
|