From 501af453e4fdfd8160a04971878deadcab364b79 Mon Sep 17 00:00:00 2001 From: Jakub007d Date: Mon, 26 Jan 2026 12:45:43 +0100 Subject: [PATCH 1/2] fix: fixing severity not showing number of issues --- .../src/components/InsightsPopup/index.tsx | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx b/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx index ce790fbd30b..e1f45eb705e 100644 --- a/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx +++ b/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx @@ -30,20 +30,24 @@ const DataComponent: FC = ({ x, y, datum }) => { return ; }; -const LabelComponent = ({ clusterID, ...props }) => ( - - - -); +const LabelComponent = ({ clusterID, ...props }) => { + const href = `https://console.redhat.com/openshift/insights/advisor/clusters/${clusterID}?total_risk=${ + riskSorting[props.datum?.id] + 1 + }`; + + return ( + + + + ); +}; const SubTitleComponent = (props) => ( Date: Tue, 27 Jan 2026 10:43:02 +0100 Subject: [PATCH 2/2] fix: adding coderabit sugested code refinement --- .../src/components/InsightsPopup/index.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx b/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx index e1f45eb705e..99317466712 100644 --- a/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx +++ b/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx @@ -31,18 +31,22 @@ const DataComponent: FC = ({ x, y, datum }) => { }; const LabelComponent = ({ clusterID, ...props }) => { - const href = `https://console.redhat.com/openshift/insights/advisor/clusters/${clusterID}?total_risk=${ - riskSorting[props.datum?.id] + 1 - }`; + const riskId = props.datum?.id; + const riskIndex = riskId != null ? riskSorting[riskId] : undefined; + const totalRisk = Number.isFinite(riskIndex) ? riskIndex + 1 : undefined; + const href = + clusterID && totalRisk != null + ? `https://console.redhat.com/openshift/insights/advisor/clusters/${clusterID}?total_risk=${totalRisk}` + : undefined; return ( - +