From 0e268f3f3c3d25d0ecbadc10423fb7bda407a2d5 Mon Sep 17 00:00:00 2001 From: Wolf Date: Wed, 30 Sep 2026 15:44:32 +0200 Subject: [PATCH] Compare the full board target in Replace board Co-Authored-By: Claude Fable 5.1 --- app/static/companies.js | 8 ++++---- tests/test_web.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/static/companies.js b/app/static/companies.js index f4653ea..19ba470 100644 --- a/app/static/companies.js +++ b/app/static/companies.js @@ -217,8 +217,8 @@ // Replacing a different board closes its roles (see set_board in // app/jobs/sources.py); ask first, naming both boards and the count, // the same as Detach and a removed search already do. - if (company.board && company.board !== board - && !window.confirm(`Replace ${company.name}'s board (${company.board}) ` + if (company.target && company.target !== board + && !window.confirm(`Replace ${company.name}'s board (${company.target}) ` + `with ${board}? Its ${count(company.open_roles, "open role")} close.`)) { return; } @@ -429,8 +429,8 @@ // editor does, so it asks first too. const existing = [...companies.values()] .find((c) => c.name.toLowerCase() === name.toLowerCase()); - if (existing && existing.board && existing.board !== board - && !window.confirm(`Replace ${existing.name}'s board (${existing.board}) ` + if (existing && existing.target && existing.target !== board + && !window.confirm(`Replace ${existing.name}'s board (${existing.target}) ` + `with ${board}? Its ${count(existing.open_roles, "open role")} close.`)) { return; } diff --git a/tests/test_web.py b/tests/test_web.py index 5864863..6afd80a 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -597,6 +597,7 @@ def test_companies_lists_board_and_open_role_count( assert res.status_code == 200 [row] = [c for c in res.json() if c["key"] == "acme"] assert row == {"key": "acme", "name": "Acme", "notes": "", "board": "greenhouse", + "target": "greenhouse:acme", "subscription_id": sub.id, "on": True, "affinity": 0, "open_roles": 1, "ats": "greenhouse", "ats_slug": "", "careers_url": "", "country": "DK", "city": "", "domain": "", "watch": None, @@ -1449,7 +1450,8 @@ def test_a_company_is_added_by_hand_with_a_reason_and_a_link( assert res.status_code == 201, res.text assert res.json() == { "key": "revolut", "name": "Revolut Ltd", "domain": "", "notes": "wants a login", - "board": "", "subscription_id": None, "on": None, "affinity": 0, "open_roles": 0, + "board": "", "target": "", "subscription_id": None, "on": None, "affinity": 0, + "open_roles": 0, "ats": "", "ats_slug": "", "careers_url": "https://revolut.example/careers", "country": "", "city": "", "watch": None, "careers_opened_at": "", "failing_since": "", "failing_reason": "", "from_search": False,