diff --git a/plugins/kanban/dashboard/dist/index.js b/plugins/kanban/dashboard/dist/index.js index 62a0a2e6f1..8bd2c8f40b 100644 --- a/plugins/kanban/dashboard/dist/index.js +++ b/plugins/kanban/dashboard/dist/index.js @@ -511,6 +511,7 @@ if (!boardData) return null; const q = search.trim().toLowerCase(); const filterTask = function (t) { + if (tenantFilter && t.tenant !== tenantFilter) return false; if (assigneeFilter && t.assignee !== assigneeFilter) return false; if (q) { const hay = `${t.id} ${t.title || ""} ${t.assignee || ""} ${t.tenant || ""}`.toLowerCase(); @@ -523,7 +524,7 @@ return Object.assign({}, col, { tasks: col.tasks.filter(filterTask) }); }), }); - }, [boardData, assigneeFilter, search]); + }, [boardData, tenantFilter, assigneeFilter, search]); // --- actions ------------------------------------------------------------ const moveTask = useCallback(function (taskId, newStatus) { diff --git a/tests/plugins/test_kanban_dashboard_plugin.py b/tests/plugins/test_kanban_dashboard_plugin.py index 5e1b771f88..f1e562425d 100644 --- a/tests/plugins/test_kanban_dashboard_plugin.py +++ b/tests/plugins/test_kanban_dashboard_plugin.py @@ -147,6 +147,23 @@ def test_dashboard_select_filters_use_sdk_value_change_handler(): assert "selectChangeHandler(props.setAssigneeFilter)" in js +def test_dashboard_client_side_filtering_includes_tenant_filter(): + """The rendered board must also filter by tenant. + + The API request includes ``?tenant=...``, but the dashboard also filters the + locally cached board for search/assignee changes. Without checking + ``tenantFilter`` here, switching tenants can leave stale cards visible until a + full reload finishes. + """ + + repo_root = Path(__file__).resolve().parents[2] + bundle = repo_root / "plugins" / "kanban" / "dashboard" / "dist" / "index.js" + js = bundle.read_text() + + assert "if (tenantFilter && t.tenant !== tenantFilter) return false;" in js + assert "[boardData, tenantFilter, assigneeFilter, search]" in js + + # --------------------------------------------------------------------------- # GET /tasks/:id returns body + comments + events + links # ---------------------------------------------------------------------------