commit | 8e8466f45ac5d4d0f5a911f211ebcba704e42c4d | [log] [tgz] |
---|---|---|
author | Paladox none <thomasmulhall410@yahoo.com> | Wed Sep 26 23:34:23 2018 +0000 |
committer | Paladox none <thomasmulhall410@yahoo.com> | Mon Nov 12 17:27:18 2018 +0000 |
tree | 12b4a6260d3f2fa12ffaf95515b3b61d8b8ec25b | |
parent | 25828e08e098121c4825c938a8912b4367ede273 [diff] |
Fix Top Menu Url This fixes it so that if it provides a url with https:// then it will use it instead of building from the base url and then adding a extra url. Bug: Issue 9772 Change-Id: I984204249425ba44c432794f804e0357cd5a2cfb
diff --git a/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown.js b/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown.js index dcb428f..3d9d36b 100644 --- a/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown.js +++ b/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown.js
@@ -229,7 +229,7 @@ if (typeof link.url === 'undefined') { return ''; } - if (link.target) { + if (link.target || !link.url.startsWith('/')) { return link.url; } return this._computeRelativeURL(link.url);
diff --git a/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown_test.html b/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown_test.html index 456f235..7bb4dce 100644 --- a/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown_test.html +++ b/polygerrit-ui/app/elements/shared/gr-dropdown/gr-dropdown_test.html
@@ -73,6 +73,12 @@ test('link URLs', () => { assert.equal( + element._computeLinkURL({url: 'http://example.com/test'}), + 'http://example.com/test'); + assert.equal( + element._computeLinkURL({url: 'https://example.com/test'}), + 'https://example.com/test'); + assert.equal( element._computeLinkURL({url: '/test'}), '//' + window.location.host + '/test'); assert.equal(