diff --git a/backend/src/routes/dashboardRoutes.js b/backend/src/routes/dashboardRoutes.js index 5169873..b81b236 100644 --- a/backend/src/routes/dashboardRoutes.js +++ b/backend/src/routes/dashboardRoutes.js @@ -145,9 +145,13 @@ router.get( ]; // Package update priority distribution + const regularUpdates = Math.max( + 0, + totalOutdatedPackages - securityUpdates, + ); const packageUpdateDistribution = [ { name: "Security", count: securityUpdates }, - { name: "Regular", count: totalOutdatedPackages - securityUpdates }, + { name: "Regular", count: regularUpdates }, ]; res.json({ diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 81de8b4..9397c4e 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -144,8 +144,8 @@ const Dashboard = () => { // Map priority names to filter parameters if (priorityName.toLowerCase().includes("security")) { navigate("/packages?filter=security", { replace: true }); - } else if (priorityName.toLowerCase().includes("outdated")) { - navigate("/packages?filter=outdated", { replace: true }); + } else if (priorityName.toLowerCase().includes("regular")) { + navigate("/packages?filter=regular", { replace: true }); } } }; @@ -718,19 +718,9 @@ const Dashboard = () => { case "packagePriority": return ( - + ); case "quickStats": { diff --git a/frontend/src/pages/Packages.jsx b/frontend/src/pages/Packages.jsx index e3ac20c..23cfa45 100644 --- a/frontend/src/pages/Packages.jsx +++ b/frontend/src/pages/Packages.jsx @@ -105,6 +105,10 @@ const Packages = () => { // For security updates, filter to show only security updates setUpdateStatusFilter("security-updates"); setCategoryFilter("all"); + } else if (filter === "regular") { + // For regular (non-security) updates + setUpdateStatusFilter("regular-updates"); + setCategoryFilter("all"); } }, [searchParams]);