diff --git a/gateway/app.py b/gateway/app.py index 66d3ccd..58d1f24 100644 --- a/gateway/app.py +++ b/gateway/app.py @@ -300,7 +300,9 @@ def operator_ui() -> FileResponse: @app.get("/dashboard") def dashboard_ui() -> FileResponse: # Backward-compatible entrypoint used in production bookmarks. - return operator_ui() + # Route dashboard directly to the sales cockpit so users can continue + # their sales funnel workflow from legacy /dashboard links. + return sales_ui() @app.get("/supervisor") diff --git a/tests/test_gateway_ui.py b/tests/test_gateway_ui.py index c3ae37c..16a6438 100644 --- a/tests/test_gateway_ui.py +++ b/tests/test_gateway_ui.py @@ -476,6 +476,16 @@ def test_admin_ui_route_exists(): assert "admin/assets/app.js" in response.text +def test_dashboard_route_points_to_sales_ui(): + client = TestClient(app) + response = client.get("/dashboard") + assert response.status_code == 200 + assert "КонтурCC Продажи" not in response.text + assert "KonturCC Продажи" in response.text + assert "sales/assets/app.js" in response.text + assert 'id="salesDashboard"' in response.text + + def test_supervisor_ui_uses_realtime_and_kpi_endpoints(): app_js = (Path(__file__).resolve().parents[1] / "ui" / "supervisor" / "app.js").read_text(encoding="utf-8") index_html = (Path(__file__).resolve().parents[1] / "ui" / "supervisor" / "index.html").read_text(encoding="utf-8")