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

Reverted last changes on error display

jnfrati 4 лет назад
Родитель
Сommit
83f577a1a0
1 измененных файлов с 25 добавлено и 26 удалено
  1. 25 26
      dashboard/src/main/home/cluster-dashboard/expanded-chart/BuildSettingsTab.tsx

+ 25 - 26
dashboard/src/main/home/cluster-dashboard/expanded-chart/BuildSettingsTab.tsx

@@ -140,7 +140,6 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
         }
         }
       );
       );
     } catch (error) {
     } catch (error) {
-      console.log(error);
       if (!error?.response) {
       if (!error?.response) {
         throw error;
         throw error;
       }
       }
@@ -154,49 +153,49 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
        */
        */
 
 
       if (tmpError.response.status === 400) {
       if (tmpError.response.status === 400) {
-        setReRunError({
-          title: "No previous run found",
-          description:
-            "There are no previous runs for this workflow, please trigger manually a run before changing the build settings.",
-        });
-        // setCurrentError(
-        //   "There are no previous runs for this workflow, please trigger manually a run before changing the build settings."
-        // );
+        // setReRunError({
+        //   title: "No previous run found",
+        //   description:
+        //     "There are no previous runs for this workflow, please trigger manually a run before changing the build settings.",
+        // });
+        setCurrentError(
+          "There are no previous runs for this workflow, please trigger manually a run before changing the build settings."
+        );
         return;
         return;
       }
       }
 
 
       if (tmpError.response.status === 409) {
       if (tmpError.response.status === 409) {
-        setReRunError({
-          title: "The workflow is still running",
-          description:
-            'If you want to make more changes, please choose the option "Save" until the workflow finishes.',
-        });
+        // setReRunError({
+        //   title: "The workflow is still running",
+        //   description:
+        //     'If you want to make more changes, please choose the option "Save" until the workflow finishes.',
+        // });
 
 
         if (typeof tmpError.response.data === "string") {
         if (typeof tmpError.response.data === "string") {
           setRunningWorkflowURL(tmpError.response.data);
           setRunningWorkflowURL(tmpError.response.data);
         }
         }
-        // setCurrentError(
-        //   'The workflow is still running. If you want to make more changes, please choose the option "Save" until the workflow finishes. You can check the current status of the workflow here ' +
-        //     tmpError.response.data
-        // );
+        setCurrentError(
+          'The workflow is still running. If you want to make more changes, please choose the option "Save" until the workflow finishes. You can check the current status of the workflow here ' +
+            tmpError.response.data
+        );
         return;
         return;
       }
       }
 
 
       if (tmpError.response.status === 404) {
       if (tmpError.response.status === 404) {
         let description =
         let description =
-          "Apparently there's no action file that corresponds to this deployment.";
+          "Apparently there's no action file that corresponds to this deployment. ";
         if (typeof tmpError.response.data === "string") {
         if (typeof tmpError.response.data === "string") {
           const filename = tmpError.response.data;
           const filename = tmpError.response.data;
           description = description.concat(
           description = description.concat(
             `Please check that the file ${filename} exists on your repository.`
             `Please check that the file ${filename} exists on your repository.`
           );
           );
         }
         }
-        setReRunError({
-          title: "The action doesn't seem to exist",
-          description,
-        });
+        // setReRunError({
+        //   title: "The action doesn't seem to exist",
+        //   description,
+        // });
 
 
-        // setCurrentError(description);
+        setCurrentError(description);
         return;
         return;
       }
       }
       throw error;
       throw error;
@@ -240,7 +239,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
 
 
   return (
   return (
     <Wrapper>
     <Wrapper>
-      {reRunError !== null ? (
+      {/* {reRunError !== null ? (
         <AlertCard>
         <AlertCard>
           <AlertCardIcon className="material-icons">error</AlertCardIcon>
           <AlertCardIcon className="material-icons">error</AlertCardIcon>
           <AlertCardContent className="content">
           <AlertCardContent className="content">
@@ -267,7 +266,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
             <span className="material-icons">close</span>
             <span className="material-icons">close</span>
           </AlertCardAction>
           </AlertCardAction>
         </AlertCard>
         </AlertCard>
-      ) : null}
+      ) : null} */}
       <StyledSettingsSection>
       <StyledSettingsSection>
         <Heading isAtTop>Build step environment variables:</Heading>
         <Heading isAtTop>Build step environment variables:</Heading>
         <KeyValueArray
         <KeyValueArray