Ask before a destructive board or search switch; queue a pull after a reopening one
Switching a company's board or a job board search off, replacing a company's board and detaching one all close open roles in a tap; each now asks first, naming the count (a replace also names the old and the new board), the same as removing a search and deleting an agent already do. Switching a target back on, following a board, setting a board and saving a search used to show nothing until the schedule's next pull, up to six hours later. Each now queues a pull job right in the API route, so the CLI and any other caller of the same endpoint behave like the page; the queued pull's own refusal while one is already running is not surfaced as an error. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
This commit is contained in:
1 parent
92ff2bc069
commit
e6be593542
6 files changed
+143
-23
No files matched your search
+11
-1
@@ -34,6 +34,14 @@
|
||||
box.checked = source.on;
|
||||
box.setAttribute("aria-label", `Run ${source.label}`);
|
||||
box.addEventListener("change", async () => {
|
||||
// Switching off closes every open role in one tap; ask first, naming
|
||||
// the count, as removing a search and deleting an agent already do.
|
||||
if (!box.checked && source.open_roles
|
||||
&& !window.confirm(`Switch off ${source.label}? `
|
||||
+ `Its ${count(source.open_roles, "open role")} close.`)) {
|
||||
box.checked = true;
|
||||
return;
|
||||
}
|
||||
box.disabled = true;
|
||||
try {
|
||||
const result = await api(`/api/sources/${source.id}/switch`,
|
||||
@@ -41,6 +49,8 @@
|
||||
Object.assign(source, result.source);
|
||||
if (!box.checked && result.closed) {
|
||||
window.toast.info(`${source.label}: ${count(result.closed, "open role")} closed.`);
|
||||
} else if (box.checked) {
|
||||
window.toast.info(`${source.label}: reading now, or with the pull right after.`);
|
||||
}
|
||||
} catch (err) {
|
||||
box.checked = !box.checked;
|
||||
@@ -184,7 +194,7 @@
|
||||
renderSearches();
|
||||
fillSearchForm(null);
|
||||
status.textContent = `Saved ${result.source.label}. ${found(result)} `
|
||||
+ "Its roles arrive with the next pull.";
|
||||
+ "Reading now, or with the pull right after.";
|
||||
} catch (err) {
|
||||
status.textContent = "";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user