From 8493a6a764680e72c1fa2d910f51b6aad93d0949 Mon Sep 17 00:00:00 2001 From: kitos Date: Thu, 16 Jul 2026 08:32:31 +0200 Subject: [PATCH] feat(nav): hide unfinished Reports section platform-wide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Route and nav link removed (not the page/component files, kept as a base to resume later) — navigating to /reports now falls through to the catch-all redirect to /dashboard for every role, including admin. fix(campaigns): show all non-campaign tests when adding to a campaign The 'Existing Test' picker only ever queried state=draft, but the backend places no restriction on a test's own state when adding it to a campaign (only the campaign's own status matters) — tests already in progress or completed were invisible here for no real reason. --- frontend/src/App.tsx | 7 ++++--- frontend/src/components/AddTestToCampaignModal.tsx | 8 ++++++-- frontend/src/components/Sidebar.tsx | 3 +-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4452d8b..5256c3a 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -20,7 +20,9 @@ const TestCatalogPage = React.lazy(() => import("./pages/TestCatalogPage")); const ValidatedTestsPage = React.lazy(() => import("./pages/ValidatedTestsPage")); const ReviewQueuePage = React.lazy(() => import("./pages/ReviewQueuePage")); const ImportRTPage = React.lazy(() => import("./pages/ImportRTPage")); -const ReportsPage = React.lazy(() => import("./pages/ReportsPage")); +// Reports is unfinished — hidden platform-wide (route + nav link removed +// below) until it's ready. Left unimported/unrouted rather than deleted. +// const ReportsPage = React.lazy(() => import("./pages/ReportsPage")); const SystemPage = React.lazy(() => import("./pages/SystemPage")); const UsersPage = React.lazy(() => import("./pages/UsersPage")); const AuditLogPage = React.lazy(() => import("./pages/AuditLogPage")); @@ -110,8 +112,7 @@ export default function App() { } /> - {/* ── Reports ──────────────────────────────────────────── */} - }>} /> + {/* ── Reports (hidden — unfinished, see import comment above) ── */} {/* ── Settings (all authenticated users) ───────────────── */} }>} /> diff --git a/frontend/src/components/AddTestToCampaignModal.tsx b/frontend/src/components/AddTestToCampaignModal.tsx index d85fda9..0bdd09b 100644 --- a/frontend/src/components/AddTestToCampaignModal.tsx +++ b/frontend/src/components/AddTestToCampaignModal.tsx @@ -110,7 +110,11 @@ export default function AddTestToCampaignModal({ const { data: allTests, isLoading: testsLoading } = useQuery({ queryKey: ["tests", "for-campaign-picker"], - queryFn: () => getTests({ state: "draft", not_in_any_campaign: true, limit: 200 }), + // No state filter — the backend places no restriction on a test's own + // state when adding it to a campaign (only the campaign's own status + // matters), so limiting this picker to "draft" only was hiding tests + // that could legitimately be added. + queryFn: () => getTests({ not_in_any_campaign: true, limit: 200 }), enabled: open && tab === "existing", }); @@ -511,7 +515,7 @@ export default function AddTestToCampaignModal({

{existingSearch ? "No tests match your search." - : "No draft tests available. All existing tests are already in a campaign."} + : "No tests available. All existing tests are already in a campaign."}

) : ( diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 958e5ae..9169486 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -5,7 +5,6 @@ import { LayoutDashboard, FlaskConical, BookOpen, - BarChart3, Settings, Users, FileText, @@ -62,7 +61,7 @@ const mainLinks: NavItem[] = [ { to: "/threat-actors", label: "Threat Actors", icon: Crosshair }, { to: "/compliance", label: "Compliance", icon: ShieldCheck }, { to: "/comparison", label: "Comparison", icon: GitCompareArrows, roles: ["admin", "red_lead", "blue_lead", "viewer"] }, - { to: "/reports", label: "Reports", icon: BarChart3 }, + // Reports is unfinished — hidden platform-wide until it's ready (see App.tsx). { to: "/settings", label: "Settings", icon: Settings }, ];