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

prevent param from being filtered

portersupport 4 лет назад
Родитель
Сommit
721d4e2816

+ 4 - 1
dashboard/src/components/repo-selector/BuildpackSelection.tsx

@@ -297,7 +297,10 @@ export const BuildpackSelection: React.FC<{
         {!!availableBuildpacks?.length && (
           <>{renderBuildpacksList(availableBuildpacks, "add")}</>
         )}
-        <Helper>You may also add buildpacks by directly providing their GitHub links or links to ZIP files that contain the buildpack source code.</Helper>
+        <Helper>
+          You may also add buildpacks by directly providing their GitHub links
+          or links to ZIP files that contain the buildpack source code.
+        </Helper>
         <AddCustomBuildpackForm onAdd={handleAddCustomBuildpack} />
       </>
     </BuildpackConfigurationContainer>

+ 50 - 43
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -72,7 +72,7 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
     formData: {} as any,
     upgradeVersion: "",
     devOpsMode: localStorage.getItem("devOpsMode") === "true",
-    
+
     expandedJobRun: null as any,
     pods: null as any,
   };
@@ -160,7 +160,7 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
     pushFiltered(
       { location: this.props.location, history: this.props.history },
       this.props.match.url,
-      ["project_id"],
+      ["project_id", "job"],
       {
         chart_revision: this.state.currentChart.version,
       }
@@ -450,11 +450,9 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
   };
 
   sortJobsAndSave = (jobs: any[]) => {
-
     // Set job run from URL if needed
     const urlParams = new URLSearchParams(location.search);
     const urlJob = urlParams.get("job");
-    console.log("urljob:", urlJob);
 
     jobs.sort((job1, job2) => {
       if (job1.metadata.name === urlJob) {
@@ -483,11 +481,10 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
   };
 
   setJobRun = (job: any) => {
-    console.log("got to set job", job);
     this.getPods(job, () => {
       this.setState({ expandedJobRun: job, currentTab: "logs" });
     });
-  }
+  };
 
   renderTabContents = (currentTab: string, submitValues?: any) => {
     switch (currentTab) {
@@ -519,7 +516,6 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
               setJobs={(jobs: any) => this.setState({ jobs })}
               isAuthorized={this.props.isAuthorized}
               saveValuesStatus={this.state.saveValuesStatus}
-
               expandJob={(job: any) => this.setJobRun(job)}
             />
           </TabWrapper>
@@ -750,16 +746,23 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
                 <Br />
                 <Banner>
                   A template update is available.
-                  <Link onClick={(e) => {
-                    e.stopPropagation();
-                    this.setState({
-                      upgradeVersion: currentChart.latest_version,
-                    });
-                  }}>
+                  <Link
+                    onClick={(e) => {
+                      e.stopPropagation();
+                      this.setState({
+                        upgradeVersion: currentChart.latest_version,
+                      });
+                    }}
+                  >
                     View upgrade notes
                   </Link>
                 </Banner>
-                <Br /><Br /><Br /><Br /><Br /><Br />
+                <Br />
+                <Br />
+                <Br />
+                <Br />
+                <Br />
+                <Br />
               </>
             )}
           </HeaderWrapper>
@@ -825,10 +828,10 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
 
     if (job.status?.failed >= 1) {
       return (
-        <Status color="#cc3d42">Failed {time}
-          {
-            job.status.conditions.length > 0 && `: ${job.status.conditions[0].reason}`
-          }
+        <Status color="#cc3d42">
+          Failed {time}
+          {job.status.conditions.length > 0 &&
+            `: ${job.status.conditions[0].reason}`}
         </Status>
       );
     }
@@ -898,12 +901,18 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
             icon={currentChart.chart.metadata.icon}
             iconWidth="33px"
           >
-            {chart.name} <Gray>at {this.readableDate(run.status.startTime)}</Gray>
+            {chart.name}{" "}
+            <Gray>at {this.readableDate(run.status.startTime)}</Gray>
           </TitleSection>
 
           <InfoWrapper>
             <LastDeployed>
-              {this.renderStatus(run, run.status.completionTime ? this.readableDate(run.status.completionTime) : "")}
+              {this.renderStatus(
+                run,
+                run.status.completionTime
+                  ? this.readableDate(run.status.completionTime)
+                  : ""
+              )}
               <TagWrapper>
                 Namespace <NamespaceTag>{chart.namespace}</NamespaceTag>
               </TagWrapper>
@@ -917,26 +926,26 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
             setCurrentTab={(x: string) => this.setState({ currentTab: x })}
             options={[
               {
-                label: "Logs", value: "logs",
+                label: "Logs",
+                value: "logs",
               },
               {
-                label: "Config", value: "config",
-              }
+                label: "Config",
+                value: "config",
+              },
             ]}
           >
-            {
-              this.state.currentTab === "logs" ? (
-                <JobLogsWrapper>
-                  <Logs
-                    selectedPod={this.state.pods[0]}
-                    podError={!this.state.pods[0] ? "Pod no longer exists." : ""}
-                    rawText={true}
-                  />
-                </JobLogsWrapper>
-              ) : (
-                <>{this.renderConfigSection(run)}</>
-              )
-            }
+            {this.state.currentTab === "logs" ? (
+              <JobLogsWrapper>
+                <Logs
+                  selectedPod={this.state.pods[0]}
+                  podError={!this.state.pods[0] ? "Pod no longer exists." : ""}
+                  rawText={true}
+                />
+              </JobLogsWrapper>
+            ) : (
+              <>{this.renderConfigSection(run)}</>
+            )}
           </TabRegion>
         </BodyWrapper>
       </StyledExpandedChart>
@@ -946,13 +955,11 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
   render() {
     return (
       <>
-        { 
-          !this.state.expandedJobRun ? (
-            <>{this.renderExpandedChart()}</>
-          ) : (
-            <>{this.renderExpandedJobRun()}</>
-          )
-        }
+        {!this.state.expandedJobRun ? (
+          <>{this.renderExpandedChart()}</>
+        ) : (
+          <>{this.renderExpandedJobRun()}</>
+        )}
       </>
     );
   }

+ 4 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/JobResource.tsx

@@ -298,7 +298,10 @@ export default class JobResource extends Component<PropsType, StateType> {
                     delete
                   </i>
                 )}
-                <i className="material-icons" onClick={() => this.props.expandJob(this.props.job)}>
+                <i
+                  className="material-icons"
+                  onClick={() => this.props.expandJob(this.props.job)}
+                >
                   open_in_new
                 </i>
               </MaterialIconTray>

+ 5 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/TempJobList.tsx

@@ -46,7 +46,11 @@ const TempJobList: React.FC<Props> = (props) => {
   return (
     <>
       {saveButton}
-      <JobList jobs={props.jobs} setJobs={props.setJobs} expandJob={props.expandJob} />
+      <JobList
+        jobs={props.jobs}
+        setJobs={props.setJobs}
+        expandJob={props.expandJob}
+      />
     </>
   );
 };