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

Implemented build settings tab to jobs

jnfrati пре 4 година
родитељ
комит
cbcb233245

+ 6 - 6
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -542,12 +542,12 @@ const ExpandedChart: React.FC<Props> = (props) => {
       );
     }
 
-    // if (currentChart?.git_action_config?.git_repo) {
-    rightTabOptions.push({
-      label: "Build Settings",
-      value: "build-settings",
-    });
-    // }
+    if (currentChart?.git_action_config?.git_repo) {
+      rightTabOptions.push({
+        label: "Build Settings",
+        value: "build-settings",
+      });
+    }
 
     // Settings tab is always last
     if (isAuthorized("application", "", ["get", "delete"])) {

+ 12 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -27,6 +27,7 @@ import ConnectToJobInstructionsModal from "./jobs/ConnectToJobInstructionsModal"
 import CommandLineIcon from "assets/command-line-icon";
 import CronParser from "cron-parser";
 import CronPrettifier from "cronstrue";
+import BuildSettingsTab from "./BuildSettingsTab";
 
 const readableDate = (s: string) => {
   let ts = new Date(s);
@@ -84,6 +85,13 @@ export const ExpandedJobChartFC: React.FC<{
     rightTabOptions.push({ label: "Settings", value: "settings" });
   }
 
+  if (chart?.git_action_config?.git_repo) {
+    rightTabOptions.push({
+      label: "Build Settings",
+      value: "build-settings",
+    });
+  }
+
   const leftTabOptions = [{ label: "Jobs", value: "jobs" }];
 
   const processValuesToUpdateChart = (newConfig?: any) => (
@@ -234,6 +242,10 @@ export const ExpandedJobChartFC: React.FC<{
       );
     }
 
+    if (currentTab === "build-settings") {
+      return <BuildSettingsTab chart={chart} />;
+    }
+
     if (
       currentTab === "settings" &&
       isAuthorized("job", "", ["get", "delete"])