Ver Fonte

debug: Testing re run error to see if state persists

jnfrati há 4 anos atrás
pai
commit
37818e8620

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

@@ -154,31 +154,31 @@ 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.',
-        // });
-
-        // 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
-        );
+        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
+        // );
         return;
         return;
       }
       }
 
 
@@ -191,12 +191,12 @@ const BuildSettingsTab: React.FC<Props> = ({ chart }) => {
             `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 +240,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 +267,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