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

Merge pull request #707 from porter-dev/0.3.0-upgrade-error-notifs

add set current error to all calls in launch flow
abelanger5 5 лет назад
Родитель
Сommit
5a4c7fb412
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      dashboard/src/main/home/launch/launch-flow/LaunchFlow.tsx

+ 7 - 2
dashboard/src/main/home/launch/launch-flow/LaunchFlow.tsx

@@ -78,7 +78,7 @@ class LaunchFlow extends Component<PropsType, StateType> {
   };
 
   createGHAction = (chartName: string, chartNamespace: string, env?: any) => {
-    let { currentProject, currentCluster } = this.context;
+    let { currentProject, currentCluster, setCurrentError } = this.context;
     let {
       actionConfig,
       branch,
@@ -123,6 +123,8 @@ class LaunchFlow extends Component<PropsType, StateType> {
         this.setState({
           saveValuesStatus: `Could not create GitHub Action: ${err}`,
         });
+
+        setCurrentError(err)
       });
   };
 
@@ -192,7 +194,7 @@ class LaunchFlow extends Component<PropsType, StateType> {
   };
 
   onSubmit = async (rawValues: any) => {
-    let { currentCluster, currentProject } = this.context;
+    let { currentCluster, currentProject, setCurrentError } = this.context;
     let {
       selectedNamespace,
       templateName,
@@ -278,6 +280,8 @@ class LaunchFlow extends Component<PropsType, StateType> {
               this.setState({
                 saveValuesStatus: `Could not create subdomain: ${err}`,
               });
+
+              setCurrentError(err)
             });
         });
 
@@ -332,6 +336,7 @@ class LaunchFlow extends Component<PropsType, StateType> {
         this.setState({
           saveValuesStatus: `Could not deploy template: ${err}`,
         });
+        setCurrentError(err)
       });
   };