Просмотр исходного кода

Merge pull request #2249 from porter-dev/nico/fix-branch-update

Fix branch update not showing latest
Porter Support 3 лет назад
Родитель
Сommit
0558fa3bbf

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

@@ -507,7 +507,15 @@ const ExpandedChart: React.FC<Props> = (props) => {
           />
         );
       case "build-settings":
-        return <BuildSettingsTab chart={chart} isPreviousVersion={isPreview} />;
+        return (
+          <BuildSettingsTab
+            chart={chart}
+            isPreviousVersion={isPreview}
+            onSave={() => {
+              getChartData(currentChart);
+            }}
+          />
+        );
       default:
     }
   };

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

@@ -11,7 +11,7 @@ import {
   ChartTypeWithExtendedConfig,
   FullActionConfigType,
 } from "shared/types";
-import styled, { keyframes } from "styled-components";
+import styled from "styled-components";
 import yaml from "js-yaml";
 import { AxiosError } from "axios";
 import BranchList from "components/repo-selector/BranchList";
@@ -22,9 +22,14 @@ import BuildpackConfigSection from "./_BuildpackConfigSection";
 type Props = {
   chart: ChartTypeWithExtendedConfig;
   isPreviousVersion: boolean;
+  onSave: () => void;
 };
 
-const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
+const BuildSettingsTab: React.FC<Props> = ({
+  chart,
+  isPreviousVersion,
+  onSave,
+}) => {
   const { currentCluster, currentProject, setCurrentError } = useContext(
     Context
   );
@@ -65,7 +70,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
     };
 
     try {
-      api.updateGitActionConfig(
+      await api.updateGitActionConfig(
         "<token>",
         {
           git_action_config: newGitActionConfig,
@@ -241,6 +246,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
       setCurrentError(error);
     } finally {
       clearButtonStatus();
+      onSave();
     }
   };
 
@@ -266,6 +272,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart, isPreviousVersion }) => {
       setCurrentError(error);
     } finally {
       clearButtonStatus();
+      onSave();
     }
   };