-
Notifications
You must be signed in to change notification settings - Fork 14
Quickfix-Dashboard #710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quickfix-Dashboard #710
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,7 @@ import CVERainbowBadge from "../../../../../../components/CVERainbowBadge"; | |||||
| import Page from "../../../../../../components/Page"; | ||||||
| import { RiskHistoryDistributionDiagram } from "../../../../../../components/RiskHistoryDistributionDiagram"; | ||||||
| import SeverityCard from "../../../../../../components/SeverityCard"; | ||||||
| import QuickfixNotification from "../../../../../../components/QuickfixNotification"; | ||||||
| import { AsyncButton, Button } from "../../../../../../components/ui/button"; | ||||||
| import { | ||||||
| Card, | ||||||
|
|
@@ -52,12 +53,14 @@ import { | |||||
| normalizeContentTree, | ||||||
| reduceRiskHistories, | ||||||
| sortRisk, | ||||||
| withMockFixableRiskHistory, | ||||||
| } from "../../../../../../utils/view"; | ||||||
| import useRouterQuery from "../../../../../../hooks/useRouterQuery"; | ||||||
| import Link from "next/link"; | ||||||
| import { toast } from "sonner"; | ||||||
| import { useSession } from "@/context/SessionContext"; | ||||||
| import { browserApiClient } from "../../../../../../services/devGuardApi"; | ||||||
| import Callout from "@/components/common/Callout"; | ||||||
|
|
||||||
| const OverviewPage = () => { | ||||||
| const search = useSearchParams(); | ||||||
|
|
@@ -178,7 +181,10 @@ const OverviewPage = () => { | |||||
| ); | ||||||
|
|
||||||
| const completeRiskHistory: RiskHistory[][] = useMemo(() => { | ||||||
| const groups = groupBy(riskHistory ?? [], "day"); | ||||||
| const groups = groupBy( | ||||||
| withMockFixableRiskHistory(riskHistory ?? []), | ||||||
| "day", | ||||||
| ); | ||||||
|
Comment on lines
183
to
+187
|
||||||
| const days = Object.keys(groups).sort(); | ||||||
| return days.map((day) => { | ||||||
| return groups[day]; | ||||||
|
|
@@ -252,6 +258,59 @@ const OverviewPage = () => { | |||||
| ); | ||||||
| }, [completeRiskHistory, mode]); | ||||||
|
|
||||||
| const criticalFixableAmount = useMemo(() => { | ||||||
| if (completeRiskHistory.length === 0) return 0; | ||||||
| return completeRiskHistory[completeRiskHistory.length - 1].reduce( | ||||||
| (sum, r) => sum + (r?.cvePurlFixableCritical ?? 0), | ||||||
| 0, | ||||||
| ); | ||||||
| }, [completeRiskHistory]); | ||||||
|
|
||||||
| const highFixableAmount = useMemo(() => { | ||||||
| if (completeRiskHistory.length === 0) return 0; | ||||||
| return completeRiskHistory[completeRiskHistory.length - 1].reduce( | ||||||
| (sum, r) => sum + (r?.cvePurlFixableHigh ?? 0), | ||||||
| 0, | ||||||
| ); | ||||||
| }, [completeRiskHistory]); | ||||||
|
|
||||||
| const mediumFixableAmount = useMemo(() => { | ||||||
| if (completeRiskHistory.length === 0) return 0; | ||||||
| return completeRiskHistory[completeRiskHistory.length - 1].reduce( | ||||||
| (sum, r) => sum + (r?.cvePurlFixableMedium ?? 0), | ||||||
| 0, | ||||||
| ); | ||||||
| }, [completeRiskHistory]); | ||||||
|
|
||||||
| const lowFixableAmount = useMemo(() => { | ||||||
| if (completeRiskHistory.length === 0) return 0; | ||||||
| return completeRiskHistory[completeRiskHistory.length - 1].reduce( | ||||||
| (sum, r) => sum + (r?.cvePurlFixableLow ?? 0), | ||||||
| 0, | ||||||
| ); | ||||||
| }, [completeRiskHistory]); | ||||||
|
|
||||||
| const totalAmount = useMemo(() => { | ||||||
| if (completeRiskHistory.length === 0) return 0; | ||||||
| return completeRiskHistory[completeRiskHistory.length - 1].reduce( | ||||||
| (sum, r) => | ||||||
| sum + | ||||||
| (r?.totalAmount ?? | ||||||
| (r?.cvePurlLow ?? 0) + | ||||||
| (r?.cvePurlMedium ?? 0) + | ||||||
| (r?.cvePurlHigh ?? 0) + | ||||||
| (r?.cvePurlCritical ?? 0)), | ||||||
| 0, | ||||||
| ); | ||||||
| }, [completeRiskHistory]); | ||||||
| const quickfixAmount = | ||||||
| criticalFixableAmount + | ||||||
| highFixableAmount + | ||||||
| mediumFixableAmount + | ||||||
| lowFixableAmount; | ||||||
|
|
||||||
| console.log(quickfixAmount); | ||||||
|
|
||||||
|
Comment on lines
+312
to
+313
|
||||||
| console.log(quickfixAmount); |
Copilot
AI
Apr 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
className="col-2" doesn't correspond to a standard Tailwind grid utility (likely intended col-span-2). As written, this wrapper probably won't span both columns and may break the layout.
| <div className="col-2"> | |
| <div className="col-span-2"> |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||
| import { FunctionComponent } from "react"; | ||||
| import { ArrowRightIcon, FileTextIcon, WrenchIcon } from "lucide-react"; | ||||
| import { Button } from "./ui/button"; | ||||
| import { Card, CardContent } from "./ui/card"; | ||||
| import { Progress } from "./ui/progress"; | ||||
|
||||
| import { Progress } from "./ui/progress"; |
Copilot
AI
Apr 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Renovate icon path casing doesn't match the file added in this PR (public/assets/Renovate.svg). On case-sensitive filesystems this will 404. Either rename the asset to public/assets/renovate.svg or update src to /assets/Renovate.svg to match exactly.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -805,6 +805,18 @@ export interface RiskHistory { | |||||||||||||||||||||||||||||||||||||
| cvePurlMediumCvss: number; | ||||||||||||||||||||||||||||||||||||||
| cvePurlHighCvss: number; | ||||||||||||||||||||||||||||||||||||||
| cvePurlCriticalCvss: number; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| totalAmount?: number; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| fixableLow: number; | ||||||||||||||||||||||||||||||||||||||
| fixableMedium: number; | ||||||||||||||||||||||||||||||||||||||
| fixableHigh: number; | ||||||||||||||||||||||||||||||||||||||
| fixableCritical: number; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| cvePurlFixableLow: number; | ||||||||||||||||||||||||||||||||||||||
| cvePurlFixableMedium: number; | ||||||||||||||||||||||||||||||||||||||
| cvePurlFixableHigh: number; | ||||||||||||||||||||||||||||||||||||||
| cvePurlFixableCritical: number; | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+811
to
+819
|
||||||||||||||||||||||||||||||||||||||
| fixableLow: number; | |
| fixableMedium: number; | |
| fixableHigh: number; | |
| fixableCritical: number; | |
| cvePurlFixableLow: number; | |
| cvePurlFixableMedium: number; | |
| cvePurlFixableHigh: number; | |
| cvePurlFixableCritical: number; | |
| fixableLow?: number; | |
| fixableMedium?: number; | |
| fixableHigh?: number; | |
| fixableCritical?: number; | |
| cvePurlFixableLow?: number; | |
| cvePurlFixableMedium?: number; | |
| cvePurlFixableHigh?: number; | |
| cvePurlFixableCritical?: number; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -319,6 +319,32 @@ export const generateColor = (str: string) => { | |||||||||||||||||||||||||
| return colors[hash % colors.length]; | ||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export const withMockFixableRiskHistory = ( | ||||||||||||||||||||||||||
| data: RiskHistory[], | ||||||||||||||||||||||||||
| ): RiskHistory[] => { | ||||||||||||||||||||||||||
| return data.map((entry) => ({ | ||||||||||||||||||||||||||
| ...entry, | ||||||||||||||||||||||||||
| totalAmount: | ||||||||||||||||||||||||||
| entry.totalAmount ?? | ||||||||||||||||||||||||||
| entry.cvePurlLow + | ||||||||||||||||||||||||||
| entry.cvePurlMedium + | ||||||||||||||||||||||||||
| entry.cvePurlHigh + | ||||||||||||||||||||||||||
| entry.cvePurlCritical, | ||||||||||||||||||||||||||
| fixableLow: entry.fixableLow ?? 2, | ||||||||||||||||||||||||||
| fixableMedium: entry.fixableMedium ?? 7, | ||||||||||||||||||||||||||
| fixableHigh: entry.fixableHigh ?? entry.high * 9, | ||||||||||||||||||||||||||
| fixableCritical: entry.fixableCritical ?? entry.critical * 15, | ||||||||||||||||||||||||||
| cvePurlFixableLow: | ||||||||||||||||||||||||||
| entry.cvePurlFixableLow ?? Math.floor(entry.cvePurlLow / 2), | ||||||||||||||||||||||||||
| cvePurlFixableMedium: | ||||||||||||||||||||||||||
| entry.cvePurlFixableMedium ?? Math.floor(entry.cvePurlMedium / 4), | ||||||||||||||||||||||||||
| cvePurlFixableHigh: | ||||||||||||||||||||||||||
| entry.cvePurlFixableHigh ?? Math.floor(entry.cvePurlHigh / 3), | ||||||||||||||||||||||||||
| cvePurlFixableCritical: | ||||||||||||||||||||||||||
| entry.cvePurlFixableCritical ?? Math.floor(entry.cvePurlCritical / 2), | ||||||||||||||||||||||||||
|
Comment on lines
+333
to
+344
|
||||||||||||||||||||||||||
| fixableLow: entry.fixableLow ?? 2, | |
| fixableMedium: entry.fixableMedium ?? 7, | |
| fixableHigh: entry.fixableHigh ?? entry.high * 9, | |
| fixableCritical: entry.fixableCritical ?? entry.critical * 15, | |
| cvePurlFixableLow: | |
| entry.cvePurlFixableLow ?? Math.floor(entry.cvePurlLow / 2), | |
| cvePurlFixableMedium: | |
| entry.cvePurlFixableMedium ?? Math.floor(entry.cvePurlMedium / 4), | |
| cvePurlFixableHigh: | |
| entry.cvePurlFixableHigh ?? Math.floor(entry.cvePurlHigh / 3), | |
| cvePurlFixableCritical: | |
| entry.cvePurlFixableCritical ?? Math.floor(entry.cvePurlCritical / 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calloutis imported but never used in this file, which will trigger unused-import linting. Remove the import or use the component.