Merge "Double-encode project name and branch links"
This commit is contained in:
@@ -108,11 +108,15 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
_computeProjectURL: function(project) {
|
_computeProjectURL: function(project) {
|
||||||
return '/q/status:open+project:' + project;
|
// @see Issue 4255.
|
||||||
|
return '/q/status:open+project:' +
|
||||||
|
encodeURIComponent(encodeURIComponent(project));
|
||||||
},
|
},
|
||||||
|
|
||||||
_computeProjectBranchURL: function(project, branch) {
|
_computeProjectBranchURL: function(project, branch) {
|
||||||
return '/q/status:open+project:' + project + '+branch:' + branch;
|
// @see Issue 4255.
|
||||||
|
return this._computeProjectURL(project) +
|
||||||
|
'+branch:' + encodeURIComponent(encodeURIComponent(branch));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
@@ -120,12 +120,12 @@ limitations under the License.
|
|||||||
assert.equal(element._computeLabelValue(
|
assert.equal(element._computeLabelValue(
|
||||||
{labels: {Verified: {rejected: true}}}, 'Verified'), '✕');
|
{labels: {Verified: {rejected: true}}}, 'Verified'), '✕');
|
||||||
|
|
||||||
assert.equal(element._computeProjectURL('combustible-stuff'),
|
assert.equal(element._computeProjectURL('combustible/stuff'),
|
||||||
'/q/status:open+project:combustible-stuff');
|
'/q/status:open+project:combustible%252Fstuff');
|
||||||
|
|
||||||
assert.equal(element._computeProjectBranchURL(
|
assert.equal(element._computeProjectBranchURL(
|
||||||
'combustible-stuff', 'lemons'),
|
'combustible-stuff', 'le/mons'),
|
||||||
'/q/status:open+project:combustible-stuff+branch:lemons');
|
'/q/status:open+project:combustible-stuff+branch:le%252Fmons');
|
||||||
|
|
||||||
element.change = {_number: 42};
|
element.change = {_number: 42};
|
||||||
assert.equal(element.changeURL, '/c/42/');
|
assert.equal(element.changeURL, '/c/42/');
|
||||||
|
Reference in New Issue
Block a user