Skip to content

Commit 976d15b

Browse files
Suggest the live publish approve command
1 parent 00e0e5d commit 976d15b

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/lib/publication-queue.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ describe("the row badge on a real queue row", () => {
196196

197197
describe("cliApproveCommand", () => {
198198
it("points a pending request at a plain approve", () => {
199-
expect(cliApproveCommand(variant(833, {}))).toBe("nemar admin publish approve nm000288");
199+
expect(cliApproveCommand(variant(833, {}))).toBe("nemar admin repo publish approve nm000288");
200200
});
201201

202202
// An approving request has already run steps, some of them irreversible.
203203
// Without --resume the CLI would start the whole list again.
204204
it("resumes an approving request instead of starting it over", () => {
205205
const stuck = variant(833, { status: "approving", current_step: "s3_lock" });
206-
expect(cliApproveCommand(stuck)).toBe("nemar admin publish approve nm000288 --resume");
206+
expect(cliApproveCommand(stuck)).toBe("nemar admin repo publish approve nm000288 --resume");
207207
});
208208

209209
// The id comes from the backend and the command is meant to be pasted into a
@@ -217,7 +217,7 @@ describe("cliApproveCommand", () => {
217217

218218
it("accepts an exemplar id, which only the dev catalog holds", () => {
219219
expect(cliApproveCommand(variant(833, { dataset_id: "xx099904" }))).toBe(
220-
"nemar admin publish approve xx099904",
220+
"nemar admin repo publish approve xx099904",
221221
);
222222
});
223223
});
@@ -327,15 +327,15 @@ describe("rowView", () => {
327327
expect(view.start).toBeNull();
328328
expect(view.terminal).toEqual({
329329
lead: "Approve from a terminal",
330-
command: "nemar admin publish approve nm000288",
330+
command: "nemar admin repo publish approve nm000288",
331331
});
332332
});
333333

334334
// The production response today: no dispatch fields. The web cannot start it.
335335
it("falls back to the CLI command on a backend that cannot dispatch", () => {
336336
const view = rowView(variant(833, {}), true);
337337
expect(view.start).toBeNull();
338-
expect(view.terminal?.command).toBe("nemar admin publish approve nm000288");
338+
expect(view.terminal?.command).toBe("nemar admin repo publish approve nm000288");
339339
expect(view.canDeny).toBe(true);
340340
});
341341

@@ -349,7 +349,7 @@ describe("rowView", () => {
349349
const view = rowView(live({ status: "approving", current_step: "s3_lock" }), true);
350350
expect(view.start).toEqual({ kind: "resume", label: "Resume approval" });
351351
expect(view.canDeny).toBe(false);
352-
expect(view.terminal?.command).toBe("nemar admin publish approve nm000288 --resume");
352+
expect(view.terminal?.command).toBe("nemar admin repo publish approve nm000288 --resume");
353353
expect(view.terminal?.lead).toBe("Or from a terminal");
354354
});
355355

‎src/lib/publication-queue.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export function cliApproveCommand(
193193
request: Pick<PublicationRequest, "dataset_id" | "status">,
194194
): string | null {
195195
if (!DATASET_ID_SHAPE.test(request.dataset_id)) return null;
196-
const base = `nemar admin publish approve ${request.dataset_id}`;
196+
const base = `nemar admin repo publish approve ${request.dataset_id}`;
197197
return request.status === "approving" ? `${base} --resume` : base;
198198
}
199199

0 commit comments

Comments
 (0)