diff --git a/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx b/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx index ce790fbd30b..99317466712 100644 --- a/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx +++ b/frontend/packages/insights-plugin/src/components/InsightsPopup/index.tsx @@ -30,20 +30,28 @@ const DataComponent: FC = ({ x, y, datum }) => { return ; }; -const LabelComponent = ({ clusterID, ...props }) => ( - - - -); +const LabelComponent = ({ clusterID, ...props }) => { + 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 ( + + + + ); +}; const SubTitleComponent = (props) => (