fix go to classic link in the pipeline editor (#1731)

This commit is contained in:
Nicolae Pascu 2018-05-04 17:21:35 +10:00 committed by GitHub
parent 118e690ae5
commit 8a2e2b5017
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -229,7 +229,13 @@ export function toClassicJobPage(currentPageUrl, isMultibranch = false) {
pageUrlTokens.shift();
// The next token is the "full" job name, URL encoded.
const fullJobName = decodeURIComponent(pageUrlTokens.shift());
let fullJobName = decodeURIComponent(pageUrlTokens.shift());
// If the URL comes from pipeline-editor then the "full" job name is the next token
if (fullJobName === 'pipeline-editor' && pageUrlTokens.length === 2) {
fullJobName = decodeURIComponent(pageUrlTokens.shift());
}
const fullJobNameTokens = fullJobName.split('/');
if (fullJobName !== 'pipelines' && pageUrlTokens.length > 0) {
classicJobFullName = classicJobFullName + '/job/' + fullJobNameTokens.join('/job/');