Add a Discuss button beside Start on TODO items
This commit is contained in:
Vendored
+7
-4
@@ -35,12 +35,11 @@ function fill(el, model) {
|
||||
titleEl.classList.remove("task-name");
|
||||
const key = `${projectId}\n${title}`;
|
||||
const busy = starting.has(key);
|
||||
const button = h("button", { disabled: busy }, busy ? "Starting…" : "Start");
|
||||
button.onclick = async () => {
|
||||
const start = async (discuss) => {
|
||||
starting.add(key);
|
||||
fill(el, model);
|
||||
try {
|
||||
await post("/api/projects/{projectId}/todo/tasks", { path: { projectId }, body: { title, model } });
|
||||
await post("/api/projects/{projectId}/todo/tasks", { path: { projectId }, body: { title, model, discuss } });
|
||||
}
|
||||
catch (err) {
|
||||
void showAlert(errorText(err));
|
||||
@@ -48,6 +47,10 @@ function fill(el, model) {
|
||||
starting.delete(key);
|
||||
fill(el, model);
|
||||
};
|
||||
replace(action, button);
|
||||
const startButton = h("button", { disabled: busy, title: "Start a task that gets straight to work" }, busy ? "Starting…" : "Start");
|
||||
startButton.onclick = () => void start(false);
|
||||
const discussButton = h("button", { disabled: busy, title: "Start a task that talks it through with you before changing anything" }, "Discuss");
|
||||
discussButton.onclick = () => void start(true);
|
||||
replace(action, startButton, " ", discussButton);
|
||||
}
|
||||
//# sourceMappingURL=todolink.js.map
|
||||
Reference in New Issue
Block a user