diff --git a/plugins/kanban/dashboard/dist/index.js b/plugins/kanban/dashboard/dist/index.js index 02935b73eb..b4d85432d8 100644 --- a/plugins/kanban/dashboard/dist/index.js +++ b/plugins/kanban/dashboard/dist/index.js @@ -2416,11 +2416,10 @@ ), ), h("div", { className: "hermes-kanban-deps-row" }, - h(Select, { + h(Select, Object.assign({ value: newParent, - onChange: function (e) { setNewParent(e.target.value); }, className: "h-7 text-xs flex-1", - }, + }, selectChangeHandler(setNewParent)), h(SelectOption, { value: "" }, "— add parent —"), candidatesFor(parentExclude).map(function (t) { return h(SelectOption, { key: t.id, value: t.id }, @@ -2455,11 +2454,10 @@ ), ), h("div", { className: "hermes-kanban-deps-row" }, - h(Select, { + h(Select, Object.assign({ value: newChild, - onChange: function (e) { setNewChild(e.target.value); }, className: "h-7 text-xs flex-1", - }, + }, selectChangeHandler(setNewChild)), h(SelectOption, { value: "" }, "— add child —"), candidatesFor(childExclude).map(function (t) { return h(SelectOption, { key: t.id, value: t.id }, diff --git a/tests/plugins/test_kanban_dashboard_plugin.py b/tests/plugins/test_kanban_dashboard_plugin.py index 893e9f15cf..b266f0914e 100644 --- a/tests/plugins/test_kanban_dashboard_plugin.py +++ b/tests/plugins/test_kanban_dashboard_plugin.py @@ -622,6 +622,32 @@ def test_dashboard_done_actions_prompt_for_completion_summary(): assert "body: JSON.stringify(finalPatch)" in bundle +def test_dashboard_dependency_selects_use_value_change_handler(): + """Regression for the dependency selects in the task drawer: the + add-parent / add-child dropdowns must wire through the shared + selectChangeHandler helper so their value actually lands on the + underlying React state. Salvaged from #20019 @LeonSGP43. + """ + repo_root = Path(__file__).resolve().parents[2] + bundle = ( + repo_root / "plugins" / "kanban" / "dashboard" / "dist" / "index.js" + ).read_text() + + parent_select = ( + 'value: newParent,\n' + ' className: "h-7 text-xs flex-1",\n' + ' }, selectChangeHandler(setNewParent))' + ) + child_select = ( + 'value: newChild,\n' + ' className: "h-7 text-xs flex-1",\n' + ' }, selectChangeHandler(setNewChild))' + ) + + assert parent_select in bundle + assert child_select in bundle + + def test_bulk_archive(client): a = client.post("/api/plugins/kanban/tasks", json={"title": "a"}).json()["task"] b = client.post("/api/plugins/kanban/tasks", json={"title": "b"}).json()["task"]