Browse Source

Clean unused logic

jnfrati 3 years ago
parent
commit
0835776caa

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

@@ -511,19 +511,8 @@ const ExpandedChart: React.FC<Props> = (props) => {
           <BuildSettingsTab
             chart={chart}
             isPreviousVersion={isPreview}
-            onSave={(data) => {
+            onSave={() => {
               getChartData(currentChart);
-              // setCurrentChart((prev) => {
-              //   const newChart = { ...prev };
-
-              //   newChart.git_action_config = data.gitActionConfig;
-
-              //   if (data.buildConfig) {
-              //     newChart.build_config = data.buildConfig;
-              //   }
-
-              //   return { ...newChart };
-              // });
             }}
           />
         );

+ 3 - 20
dashboard/src/main/home/cluster-dashboard/expanded-chart/build-settings/BuildSettingsTab.tsx

@@ -19,15 +19,10 @@ import Banner from "components/Banner";
 import { UpdateBuildconfigResponse } from "./types";
 import BuildpackConfigSection from "./_BuildpackConfigSection";
 
-type OnSaveProps = {
-  buildConfig: BuildConfig;
-  gitActionConfig: FullActionConfigType;
-};
-
 type Props = {
   chart: ChartTypeWithExtendedConfig;
   isPreviousVersion: boolean;
-  onSave: (props: OnSaveProps) => void;
+  onSave: () => void;
 };
 
 const BuildSettingsTab: React.FC<Props> = ({
@@ -251,13 +246,7 @@ const BuildSettingsTab: React.FC<Props> = ({
       setCurrentError(error);
     } finally {
       clearButtonStatus();
-      onSave({
-        buildConfig,
-        gitActionConfig: {
-          ...chart.git_action_config,
-          git_branch: currentBranch,
-        },
-      });
+      onSave();
     }
   };
 
@@ -283,13 +272,7 @@ const BuildSettingsTab: React.FC<Props> = ({
       setCurrentError(error);
     } finally {
       clearButtonStatus();
-      onSave({
-        buildConfig,
-        gitActionConfig: {
-          ...chart.git_action_config,
-          git_branch: currentBranch,
-        },
-      });
+      onSave();
     }
   };