Add delete capability to Tasks subtask rows
Each subtask row now has a small delete button, confirm-before-delete, POSTs to the Input Interface backend's new /delete-task endpoint (localhost:8507, keyed on trackId + the newly-migrated stable subtask id rather than name-matching). On success removes the row from this page's in-memory TASKS_DATA and re-renders immediately; on failure shows the backend's error message and leaves the data untouched. Also commits the id migration itself: all 17 existing subtasks now carry a stable id (st-<8 hex>), added by the Input Interface session directly against the real file, verified here via fresh JSON/JS validation before building on top of it.
This commit is contained in:
1 parent
a0083ca94b
commit
b68ded4465
1 file changed
+66
-19
+66
-19
@@ -725,6 +725,13 @@
|
||||
.ab-card-weekly { background: #fffbe6; }
|
||||
.ab-card-progress-log { background: #eefbf1; }
|
||||
.ab-card-unassigned { background: #fdecea; border-color: #e2a29b; }
|
||||
.ti-delete-btn {
|
||||
background: none; border: 1px solid #e0e7ef; border-radius: 6px;
|
||||
color: #b3261e; font-size: 0.8rem; font-family: inherit; line-height: 1;
|
||||
width: 26px; height: 26px; cursor: pointer;
|
||||
}
|
||||
.ti-delete-btn:hover { background: #fdecea; border-color: #e2a29b; }
|
||||
.ti-delete-btn:disabled { opacity: 0.4; cursor: default; }
|
||||
|
||||
.pl-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
|
||||
.pl-cal-label { font-size: 1.05rem; font-weight: 800; color: #1b3a5c; }
|
||||
@@ -6408,7 +6415,7 @@
|
||||
id: "open-items-unassigned",
|
||||
label: "Unassigned / Needs Triage",
|
||||
subtasks: [
|
||||
{ subtask: "this is an unassigned task", ask: "this is an unassigned task", kpi: "—", status: "Still open" }
|
||||
{ id: "st-82f68836", subtask: "this is an unassigned task", ask: "this is an unassigned task", kpi: "—", status: "Still open" }
|
||||
],
|
||||
notes: [
|
||||
{ date: "2026-08-25", source: "Input Interface (Mckinley)", text: "New task submitted via Input Interface: \"this is an unassigned task\"" }
|
||||
@@ -6419,8 +6426,8 @@
|
||||
id: "open-items-linkedin",
|
||||
label: "LinkedIn",
|
||||
subtasks: [
|
||||
{ subtask: "July EOM Report", ask: "July's End of Month Report — narrative sections written, but the actual build isn't complete", kpi: "—", status: "Still open, specific remaining gap not yet identified" },
|
||||
{ subtask: "Posts audit", ask: "LinkedIn posts need to be audited", kpi: "—", status: "Still open" }
|
||||
{ id: "st-65ccdb7a", subtask: "July EOM Report", ask: "July's End of Month Report — narrative sections written, but the actual build isn't complete", kpi: "—", status: "Still open, specific remaining gap not yet identified" },
|
||||
{ id: "st-44674ab5", subtask: "Posts audit", ask: "LinkedIn posts need to be audited", kpi: "—", status: "Still open" }
|
||||
],
|
||||
notes: [],
|
||||
reports: []
|
||||
@@ -6429,9 +6436,9 @@
|
||||
id: "open-items-outreach",
|
||||
label: "Outreach",
|
||||
subtasks: [
|
||||
{ subtask: "PE-company LinkedIn sends", ask: "Send the 12 PE-company LinkedIn connection requests — drafts ready and verified", kpi: "—", status: "Still open, manual send still pending with Mckinley" },
|
||||
{ subtask: "13-company backlog", ask: "WBG Device Manufacturer, Device Testing, Radiation Hardness — verified named contact and role for each", kpi: "13/13", status: "Done", closedDate: "2026-08-25", closedSource: "Peter's weekly task" },
|
||||
{ subtask: "Duplicate file cleanup", ask: "Contact_List_Phase1_Mckinley (1).xlsx and Updated_Contact_List_Phase1_Mckinley (1).xlsx — both harmless leftovers", kpi: "—", status: "Still open, low priority" }
|
||||
{ id: "st-23b98087", subtask: "PE-company LinkedIn sends", ask: "Send the 12 PE-company LinkedIn connection requests — drafts ready and verified", kpi: "—", status: "Still open, manual send still pending with Mckinley" },
|
||||
{ id: "st-7ad11c26", subtask: "13-company backlog", ask: "WBG Device Manufacturer, Device Testing, Radiation Hardness — verified named contact and role for each", kpi: "13/13", status: "Done", closedDate: "2026-08-25", closedSource: "Peter's weekly task" },
|
||||
{ id: "st-62bb0d3a", subtask: "Duplicate file cleanup", ask: "Contact_List_Phase1_Mckinley (1).xlsx and Updated_Contact_List_Phase1_Mckinley (1).xlsx — both harmless leftovers", kpi: "—", status: "Still open, low priority" }
|
||||
],
|
||||
notes: [
|
||||
{ date: "2026-08-25", source: "Peter's weekly task", text: "13-company backlog closed (13/13): WBG Device Manufacturer, Device Testing, Radiation Hardness — verified named contact and role for each, closing out the full 25-company Phase 1 list (12 Power Electronics + these 13). Notable contacts: Nobuyuki Wakai (GM Semiconductor Quality & Reliability Center, Toshiba), Dr. Nabil Mansour (Engineering Manager, Radiation Test Solutions), Ruben Garcia Alia (Project Coordinator, RADNEXT/CERN). Two flags: GaNPower International's contact is unconfirmed pending manual verification, and no email addresses were found for any of the 13 — a gap across the whole contact list, not specific to this batch." }
|
||||
@@ -6442,7 +6449,7 @@
|
||||
id: "open-items-department-dash",
|
||||
label: "Department Dash",
|
||||
subtasks: [
|
||||
{ subtask: "Outreach Board stage-tracking", ask: "8500 Directory tab: 184 leads listed, but no way to persist a \"contacted\" status yet", kpi: "—", status: "Still open, blocks live KPI tracking" }
|
||||
{ id: "st-4a77167d", subtask: "Outreach Board stage-tracking", ask: "8500 Directory tab: 184 leads listed, but no way to persist a \"contacted\" status yet", kpi: "—", status: "Still open, blocks live KPI tracking" }
|
||||
],
|
||||
notes: [],
|
||||
reports: []
|
||||
@@ -6451,8 +6458,8 @@
|
||||
id: "open-items-demographics",
|
||||
label: "Demographics",
|
||||
subtasks: [
|
||||
{ subtask: "Demographics ↔ Outreach Board wiring", ask: "Recommended link-out from 8500's Directory tab to Demographics' import/export tool (port 8506)", kpi: "—", status: "Still open, not built yet" },
|
||||
{ subtask: "SPIE source data anomaly", ask: "Unexplained \"Mckinley Black\" dummy row in the raw SPIE presenter source file — worth investigating why it's there", kpi: "—", status: "Still open, needs investigation" }
|
||||
{ id: "st-ea5ae426", subtask: "Demographics ↔ Outreach Board wiring", ask: "Recommended link-out from 8500's Directory tab to Demographics' import/export tool (port 8506)", kpi: "—", status: "Still open, not built yet" },
|
||||
{ id: "st-eaaf78b6", subtask: "SPIE source data anomaly", ask: "Unexplained \"Mckinley Black\" dummy row in the raw SPIE presenter source file — worth investigating why it's there", kpi: "—", status: "Still open, needs investigation" }
|
||||
],
|
||||
notes: [],
|
||||
reports: []
|
||||
@@ -6461,7 +6468,7 @@
|
||||
id: "open-items-mail-merge",
|
||||
label: "Mail Merge Interface",
|
||||
subtasks: [
|
||||
{ subtask: "Mail Merge email gap", ask: "138-row contact sheet is well-enriched, but only 2 rows have an actual email address", kpi: "—", status: "Still open, blocks any real batch send" }
|
||||
{ id: "st-7105497c", subtask: "Mail Merge email gap", ask: "138-row contact sheet is well-enriched, but only 2 rows have an actual email address", kpi: "—", status: "Still open, blocks any real batch send" }
|
||||
],
|
||||
notes: [
|
||||
{ date: "2026-08-21", source: "Mckinley-directed", text: "Still undecided whether Outreach or Mail Merge Interface owns the actual email-finding work — flagged as pending a decision, not yet assigned." }
|
||||
@@ -6472,12 +6479,12 @@
|
||||
id: "open-items-crm-research",
|
||||
label: "CRM Research",
|
||||
subtasks: [
|
||||
{ subtask: "Requirements Definition", ask: "Work Package", kpi: "2026-08-18 → 2026-08-22", status: "Done", closedDate: "2026-08-22", closedSource: "Peter's weekly task" },
|
||||
{ subtask: "Candidate Research & Vendor Verification", ask: "Work Package", kpi: "2026-08-22 → 2026-08-27", status: "Still open" },
|
||||
{ subtask: "Pricing & Cost Comparison", ask: "Work Package", kpi: "2026-08-27 → 2026-08-29", status: "Still open" },
|
||||
{ subtask: "Dashboard Build (CRM Research Page)", ask: "Work Package", kpi: "2026-08-29 → 2026-08-30", status: "Still open" },
|
||||
{ subtask: "Outstanding Verification", ask: "Work Package", kpi: "2026-08-29 → 2026-08-30", status: "Still open" },
|
||||
{ subtask: "Final Review & Sign-off", ask: "Milestone", kpi: "2026-08-31", status: "Still open" }
|
||||
{ id: "st-3e16f9bc", subtask: "Requirements Definition", ask: "Work Package", kpi: "2026-08-18 → 2026-08-22", status: "Done", closedDate: "2026-08-22", closedSource: "Peter's weekly task" },
|
||||
{ id: "st-338fa6b9", subtask: "Candidate Research & Vendor Verification", ask: "Work Package", kpi: "2026-08-22 → 2026-08-27", status: "Still open" },
|
||||
{ id: "st-f5a7909b", subtask: "Pricing & Cost Comparison", ask: "Work Package", kpi: "2026-08-27 → 2026-08-29", status: "Still open" },
|
||||
{ id: "st-ca6ae036", subtask: "Dashboard Build (CRM Research Page)", ask: "Work Package", kpi: "2026-08-29 → 2026-08-30", status: "Still open" },
|
||||
{ id: "st-3424dd8f", subtask: "Outstanding Verification", ask: "Work Package", kpi: "2026-08-29 → 2026-08-30", status: "Still open" },
|
||||
{ id: "st-3b191591", subtask: "Final Review & Sign-off", ask: "Milestone", kpi: "2026-08-31", status: "Still open" }
|
||||
],
|
||||
notes: [
|
||||
{ date: "2026-08-22", source: "Peter's weekly task", text: "WP1 closed: Requirements Definition Work Package formally closed following Peter Gaal's approval of the CRM Requirements Research IPP/IPO. Interim report submitted per the confirmed WP-boundary reporting cadence. WP2 (Candidate Research & Vendor Verification) now underway." },
|
||||
@@ -6501,7 +6508,7 @@
|
||||
id: "open-items-market-intelligence",
|
||||
label: "Market Intelligence / Prospect Scout",
|
||||
subtasks: [
|
||||
{ subtask: "Prospect Scout built and populated", ask: "New capability under Market Intelligence, mirroring Conference Scout's pattern — 73 companies/institutions across 6 categories, 60/73 enriched with named contacts", kpi: "73 companies", status: "Done", closedDate: "2026-08-22", closedSource: "Mckinley-directed" }
|
||||
{ id: "st-9ba9f5b5", subtask: "Prospect Scout built and populated", ask: "New capability under Market Intelligence, mirroring Conference Scout's pattern — 73 companies/institutions across 6 categories, 60/73 enriched with named contacts", kpi: "73 companies", status: "Done", closedDate: "2026-08-22", closedSource: "Mckinley-directed" }
|
||||
],
|
||||
notes: [
|
||||
{ date: "2026-08-22", source: "Mckinley-directed", text: "Prospect Scout built and populated: new Prospect Scout capability built under Market Intelligence, mirroring Conference Scout's pattern. Two research sweeps produced 73 companies/institutions across 6 categories (Semiconductor Materials & Substrates, Power Electronics, WBG Device Manufacturer, Device Testing, Radiation Hardness, Research & Collaborations) — 68 genuinely new beyond Peter's original 25-company list. Outreach then enriched all 73 with named contacts: 60/73 now have a verified contact and role. Standout find: Thu Nhi Tran Caliste, Industrial Liaison Engineer on ESRF's BM05 beamline — a near-perfect match for TXproducts' X-ray topography service." }
|
||||
@@ -6593,9 +6600,46 @@
|
||||
} else {
|
||||
var selected = allSelectable.filter(function (t) { return t.id === tasksSelectedId; })[0];
|
||||
detail.innerHTML = selected ? buildTaskDetail(selected) : "<div class=\"ab-outreach-empty\">No tasks yet.</div>";
|
||||
wireTaskDeleteButtons();
|
||||
}
|
||||
}
|
||||
|
||||
function wireTaskDeleteButtons() {
|
||||
document.querySelectorAll(".ti-delete-btn").forEach(function (btn) {
|
||||
btn.addEventListener("click", function () {
|
||||
var trackId = btn.getAttribute("data-track-id");
|
||||
var subtaskId = btn.getAttribute("data-subtask-id");
|
||||
var track = TASKS_DATA.concat(WEEKLY_TASKS_DATA).filter(function (t) { return t.id === trackId; })[0];
|
||||
var subtask = track && track.subtasks.filter(function (s) { return s.id === subtaskId; })[0];
|
||||
var label = subtask ? subtask.subtask : "this task";
|
||||
if (!window.confirm("Delete \"" + label + "\"? This can't be undone from here.")) return;
|
||||
|
||||
btn.disabled = true;
|
||||
fetch("http://localhost:8507/delete-task", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ trackId: trackId, subtaskId: subtaskId })
|
||||
})
|
||||
.then(function (r) { return r.json().then(function (data) { return { ok: r.ok, data: data }; }); })
|
||||
.then(function (result) {
|
||||
if (!result.ok) {
|
||||
window.alert((result.data && result.data.error) || "Couldn't delete that task.");
|
||||
btn.disabled = false;
|
||||
return;
|
||||
}
|
||||
if (track) {
|
||||
track.subtasks = track.subtasks.filter(function (s) { return s.id !== subtaskId; });
|
||||
}
|
||||
renderTasksBoard();
|
||||
})
|
||||
.catch(function () {
|
||||
window.alert("Couldn't reach the task input backend (localhost:8507) — is it running?");
|
||||
btn.disabled = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Dropdown toggle only -- doesn't itself become the selection, just expands/collapses
|
||||
// the week sub-cards indented beneath it, so the detail pane always shows one full-width
|
||||
// entry (a track or a single week) rather than splitting space with a picker.
|
||||
@@ -6661,11 +6705,14 @@
|
||||
} else {
|
||||
var rows = entry.subtasks.map(function (s) {
|
||||
var closed = s.closedDate ? tasksEsc(s.closedDate) + " · " + tasksEsc(s.closedSource) : "";
|
||||
return "<tr><td>" + tasksEsc(s.subtask) + "</td><td>" + tasksEsc(s.ask) + "</td><td>" + tasksEsc(s.kpi) + "</td><td>" + taskStatusIcon(s.status) + tasksEsc(s.status) + "</td><td>" + closed + "</td></tr>";
|
||||
var deleteBtn = s.id
|
||||
? "<button type=\"button\" class=\"ti-delete-btn\" data-track-id=\"" + tasksEsc(entry.id) + "\" data-subtask-id=\"" + tasksEsc(s.id) + "\" title=\"Delete this task\">✕</button>"
|
||||
: "";
|
||||
return "<tr><td>" + tasksEsc(s.subtask) + "</td><td>" + tasksEsc(s.ask) + "</td><td>" + tasksEsc(s.kpi) + "</td><td>" + taskStatusIcon(s.status) + tasksEsc(s.status) + "</td><td>" + closed + "</td><td>" + deleteBtn + "</td></tr>";
|
||||
}).join("");
|
||||
body =
|
||||
"<table class=\"crm-detail-table\">" +
|
||||
"<thead><tr><th>Subtask</th><th>Ask</th><th>KPI</th><th>Status</th><th>Closed</th></tr></thead>" +
|
||||
"<thead><tr><th>Subtask</th><th>Ask</th><th>KPI</th><th>Status</th><th>Closed</th><th></th></tr></thead>" +
|
||||
"<tbody>" + rows + "</tbody>" +
|
||||
"</table>";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user