Ver código fonte

fix: branch name in porter error modal, warning banner shown when no errors

Soham Parekh 3 anos atrás
pai
commit
10c0d9fcf3

+ 1 - 1
dashboard/src/main/home/cluster-dashboard/preview-environments/components/PorterYAMLErrorsModal.tsx

@@ -34,7 +34,7 @@ const PorterYAMLErrorsModal = ({
         </InfoTab>
         <InfoTab>
           <img src={info} /> <Bold>Branch:</Bold>
-          {branch ?? "default"}
+          {branch ?? "base"}
         </InfoTab>
       </InfoRow>
       <Message>

+ 0 - 6
dashboard/src/main/home/cluster-dashboard/preview-environments/deployments/DeploymentCard.tsx

@@ -234,12 +234,6 @@ const DeploymentCard: React.FC<{
               )}
             </MergeInfoWrapper>
           ) : null}
-          {deployment.last_workflow_run_url ? (
-            <RepoLink to={deployment.last_workflow_run_url} target="_blank">
-              <i className="material-icons">open_in_new</i>
-              View last workflow
-            </RepoLink>
-          ) : null}
         </PRName>
 
         <Flex>

+ 3 - 4
dashboard/src/main/home/cluster-dashboard/preview-environments/deployments/DeploymentList.tsx

@@ -231,8 +231,8 @@ const DeploymentList = () => {
     if (!deploymentList.length) {
       return (
         <Placeholder height="calc(100vh - 400px)">
-          No preview apps have been found. Open a PR to create a new preview
-          app.
+          No preview developments have been found. Open a PR to create a new
+          preview app.
         </Placeholder>
       );
     }
@@ -240,7 +240,7 @@ const DeploymentList = () => {
     if (!filteredDeployments.length) {
       return (
         <Placeholder height="calc(100vh - 400px)">
-          No preview apps have been found with the given filter.
+          No preview developments have been found with the given filter.
         </Placeholder>
       );
     }
@@ -272,7 +272,6 @@ const DeploymentList = () => {
         errors={expandedPorterYAMLErrors}
         onClose={() => setExpandedPorterYAMLErrors([])}
         repo={selectedRepo}
-        branch=""
       />
 
       <BreadcrumbRow>

+ 4 - 5
dashboard/src/main/home/cluster-dashboard/preview-environments/environments/CreateEnvironment.tsx

@@ -150,7 +150,7 @@ const CreateEnvironment: React.FC = () => {
           );
         })}
       </PullRequestList>
-      {showErrorsModal ? (
+      {showErrorsModal && selectedPR ? (
         <PorterYAMLErrorsModal
           errors={porterYAMLErrors}
           onClose={() => setShowErrorsModal(false)}
@@ -158,11 +158,10 @@ const CreateEnvironment: React.FC = () => {
           branch={selectedPR.branch_from}
         />
       ) : null}
-      {selectedPR ? (
+      {selectedPR && porterYAMLErrors.length ? (
         <ValidationErrorBannerWrapper>
           <Banner type="warning">
-            We found some errors in the porter.yaml file on your default branch.
-            &nbsp;
+            We found some errors in the porter.yaml file on your branch. &nbsp;
             <LearnMoreButton onClick={() => setShowErrorsModal(true)}>
               Learn more
             </LearnMoreButton>
@@ -176,7 +175,7 @@ const CreateEnvironment: React.FC = () => {
         >
           Create preview deployment
         </SubmitButton>
-        {selectedPR ? (
+        {selectedPR && porterYAMLErrors.length ? (
           <RevalidatePorterYAMLSpanWrapper>
             Please fix your porter.yaml file to continue.{" "}
             <RevalidateSpan