Merge "Lazy Loading Registering Polymer Elements"
diff --git a/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.js b/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.js
index 9a06b2a..f4e0e8f 100644
--- a/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.js
+++ b/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.js
@@ -310,9 +310,10 @@
// so we'll just disable it altogether for now.
delete linkObj.target;
- // Because the user provided links may be arbitrary URLs, we assume
- // links starting with / are internal, otherwise links are external.
- linkObj.external = !linkObj.url.startsWith('/');
+ // Because the user provided links may be arbitrary URLs, we don't know
+ // whether they correspond to any client routes. Mark all such links as
+ // external.
+ linkObj.external = true;
return linkObj;
},
diff --git a/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header_test.html b/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header_test.html
index 4bb02e9..782a8da 100644
--- a/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header_test.html
+++ b/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header_test.html
@@ -87,13 +87,9 @@
assert.deepEqual([
{url: 'https://awesometown.com/#hashyhash'},
{url: 'url', target: '_blank'},
- {url: '/dashboard/self'},
- {url: '#/dashboard/self'},
].map(element._fixCustomMenuItem), [
{url: 'https://awesometown.com/#hashyhash', external: true},
{url: 'url', external: true},
- {url: '/dashboard/self', external: false},
- {url: '/dashboard/self', external: false},
]);
});
@@ -222,7 +218,7 @@
title: 'Projects',
links: [{
name: 'Project List',
- external: false,
+ external: true,
url: '/plugins/myplugin/index.html',
}],
}]);