From ba387b8e8bdf8f8732ae237397083072d280977e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 18:21:52 +0000 Subject: [PATCH] fix(ui): correct OAuth setup page links in integrations dashboard The oauthLink() function in integrations_dashboard.html returned /dropbox, /google-drive, /onedrive which are not valid routes (404). The actual view routes are /dropbox-setup, /google-drive-setup, /onedrive-setup. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- frontend/templates/integrations_dashboard.html | 6 +++--- tests/test_views_integrations.py | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/templates/integrations_dashboard.html b/frontend/templates/integrations_dashboard.html index 434ba630..48a86a98 100644 --- a/frontend/templates/integrations_dashboard.html +++ b/frontend/templates/integrations_dashboard.html @@ -840,9 +840,9 @@ function integrationsDashboard() { hasFormFields(t) { return TYPES_WITH_FORM_FIELDS.has(t); }, oauthLink(t) { - if (t === 'DROPBOX') return '/dropbox'; - if (t === 'GOOGLE_DRIVE') return '/google-drive'; - if (t === 'ONEDRIVE') return '/onedrive'; + if (t === 'DROPBOX') return '/dropbox-setup'; + if (t === 'GOOGLE_DRIVE') return '/google-drive-setup'; + if (t === 'ONEDRIVE') return '/onedrive-setup'; return '#'; }, diff --git a/tests/test_views_integrations.py b/tests/test_views_integrations.py index 1869ca1d..1bd71f17 100644 --- a/tests/test_views_integrations.py +++ b/tests/test_views_integrations.py @@ -63,6 +63,19 @@ class TestIntegrationsDashboardView: assert response.status_code == 200 assert b"integrationsDashboard" in response.content + def test_integrations_page_oauth_links_point_to_setup_pages(self, client): + """oauthLink() must reference the correct -setup URLs, not bare paths.""" + response = client.get("/integrations") + assert response.status_code == 200 + body = response.text + assert "'/dropbox-setup'" in body or '"/dropbox-setup"' in body + assert "'/google-drive-setup'" in body or '"/google-drive-setup"' in body + assert "'/onedrive-setup'" in body or '"/onedrive-setup"' in body + # Ensure the old broken paths are gone + assert "return '/dropbox'" not in body.replace("/dropbox-setup", "") + assert "return '/google-drive'" not in body.replace("/google-drive-setup", "") + assert "return '/onedrive'" not in body.replace("/onedrive-setup", "") + def test_integrations_page_contains_quota_indicators(self, client): """GET /integrations page includes quota labels.""" response = client.get("/integrations")