Explorar el Código

Fixed null link

jnfrati hace 4 años
padre
commit
5b1204478f
Se han modificado 1 ficheros con 5 adiciones y 4 borrados
  1. 5 4
      dashboard/src/main/home/cluster-dashboard/chart/Chart.tsx

+ 5 - 4
dashboard/src/main/home/cluster-dashboard/chart/Chart.tsx

@@ -24,7 +24,7 @@ const Chart: React.FunctionComponent<Props> = ({
   chart,
   controllers,
   jobStatus,
-  isJob
+  isJob,
 }) => {
   const [expand, setExpand] = useState<boolean>(false);
   const [chartControllers, setChartControllers] = useState<any>([]);
@@ -96,9 +96,10 @@ const Chart: React.FunctionComponent<Props> = ({
       onMouseLeave={() => setExpand(false)}
       expand={expand}
       onClick={() => {
-        let urlParams = new URLSearchParams(location.search);
-        let cluster = urlParams.get("cluster");
-        let route = `${isJob ? "/jobs" : "/applications"}/${cluster}/${chart.namespace}/${chart.name}`;
+        const cluster = context.currentCluster?.name;
+        let route = `${isJob ? "/jobs" : "/applications"}/${cluster}/${
+          chart.namespace
+        }/${chart.name}`;
         pushFiltered({ location, history }, route, ["project_id"]);
       }}
     >