Преглед изворни кода

Setup prop to redirect to job or applications only from chart

Nicolas Frati пре 4 година
родитељ
комит
ef7d2c3bb1

+ 3 - 1
dashboard/src/main/home/cluster-dashboard/chart/Chart.tsx

@@ -17,12 +17,14 @@ type Props = {
   chart: ChartType;
   controllers: Record<string, any>;
   jobStatus: JobStatusWithTimeType;
+  isJob: boolean;
 };
 
 const Chart: React.FunctionComponent<Props> = ({
   chart,
   controllers,
   jobStatus,
+  isJob
 }) => {
   const [expand, setExpand] = useState<boolean>(false);
   const [chartControllers, setChartControllers] = useState<any>([]);
@@ -96,7 +98,7 @@ const Chart: React.FunctionComponent<Props> = ({
       onClick={() => {
         let urlParams = new URLSearchParams(location.search);
         let cluster = urlParams.get("cluster");
-        let route = `${match.url}/${cluster}/${chart.namespace}/${chart.name}`;
+        let route = `${isJob ? "/jobs" : "/applications"}/${cluster}/${chart.namespace}/${chart.name}`;
         pushFiltered({ location, history }, route, ["project_id"]);
       }}
     >

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/chart/ChartList.tsx

@@ -389,6 +389,7 @@ const ChartList: React.FunctionComponent<Props> = ({
             getChartKey(chart.name, chart.namespace),
             null
           )}
+          isJob={currentView === "jobs"}
         />
       );
     });