File tree 4 files changed +12
-5
lines changed
multi-pipeline-graph-view/multi-pipeline-graph/main
4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ export const SingleRun: (data: Props) => JSX.Element = ({ run }) => {
13
13
const [ stages , setStages ] = useState < Array < StageInfo > > ( [ ] ) ;
14
14
let path = `tree?runId=${ run . id } ` ;
15
15
16
- const onJobView = ! window . location . href . endsWith ( "multi-pipeline-graph/" ) ;
16
+ const url = new URL ( window . location . href ) ;
17
+
18
+ const onJobView = ! url . pathname . endsWith ( "multi-pipeline-graph/" ) ;
17
19
if ( onJobView ) {
18
20
path = `multi-pipeline-graph/${ path } ` ;
19
21
}
Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ export default function startPollingRunsStatus(
11
11
) {
12
12
let path = "runs" ;
13
13
14
- if ( ! window . location . href . endsWith ( "multi-pipeline-graph/" ) ) {
14
+ const url = new URL ( window . location . href ) ;
15
+
16
+ if ( ! url . pathname . endsWith ( "multi-pipeline-graph/" ) ) {
15
17
path = `multi-pipeline-graph/${ path } ` ;
16
18
}
17
19
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ import "./pipeline-graph/styles/main.scss";
8
8
9
9
function handleNodeClick ( nodeName : string , id : number ) {
10
10
let location = `../pipeline-console?selected-node=${ id } ` ;
11
- if ( ! window . location . href . endsWith ( "pipeline-graph/" ) ) {
11
+ const url = new URL ( window . location . href ) ;
12
+ if ( ! url . pathname . endsWith ( "pipeline-graph/" ) ) {
12
13
location = `pipeline-console?selected-node=${ id } ` ;
13
14
}
14
15
Original file line number Diff line number Diff line change @@ -81,8 +81,10 @@ export class PipelineGraph extends React.Component {
81
81
}
82
82
83
83
getTreePath ( ) {
84
- if ( ! window . location . href . endsWith ( "pipeline-graph/" ) ) {
85
- return `pipeline-graph/tree` ;
84
+ const url = new URL ( window . location . href ) ;
85
+
86
+ if ( ! url . pathname . endsWith ( "pipeline-graph/" ) ) {
87
+ return "pipeline-graph/tree" ;
86
88
}
87
89
88
90
return "tree" ;
You can’t perform that action at this time.
0 commit comments