Explorar el Código

Reverted last changes on error display

jnfrati hace 4 años
padre
commit
83f577a1a0

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

@@ -140,7 +140,6 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
         }
       );
     } catch (error) {
-      console.log(error);
       if (!error?.response) {
         throw error;
       }
@@ -154,49 +153,49 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
        */
 
       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;
       }
 
       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") {
           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;
       }
 
       if (tmpError.response.status === 404) {
         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") {
           const filename = tmpError.response.data;
           description = description.concat(
             `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;
       }
       throw error;
@@ -240,7 +239,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
 
   return (
     <Wrapper>
-      {reRunError !== null ? (
+      {/* {reRunError !== null ? (
         <AlertCard>
           <AlertCardIcon className="material-icons">error</AlertCardIcon>
           <AlertCardContent className="content">
@@ -267,7 +266,7 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
             <span className="material-icons">close</span>
           </AlertCardAction>
         </AlertCard>
-      ) : null}
+      ) : null} */}
       <StyledSettingsSection>
         <Heading isAtTop>Build step environment variables:</Heading>
         <KeyValueArray