Merge "Provide full URL to site theme"
This commit is contained in:
commit
564d2f945b
@ -40,7 +40,7 @@
|
||||
this._handleMigrations(plugins.js_resource_paths || [], htmlPlugins)
|
||||
.map(p => this._urlFor(p))
|
||||
.filter(p => !Gerrit._isPluginPreloaded(p));
|
||||
const defaultTheme = config.default_theme;
|
||||
const defaultTheme = this._urlFor(config.default_theme);
|
||||
const pluginsPending =
|
||||
[].concat(jsPlugins, htmlPlugins, defaultTheme || []);
|
||||
Gerrit._setPluginsPending(pluginsPending);
|
||||
@ -98,6 +98,9 @@
|
||||
},
|
||||
|
||||
_urlFor(pathOrUrl) {
|
||||
if (!pathOrUrl) {
|
||||
return pathOrUrl;
|
||||
}
|
||||
if (pathOrUrl.startsWith('preloaded:') ||
|
||||
pathOrUrl.startsWith('http')) {
|
||||
// Plugins are loaded from another domain or preloaded.
|
||||
|
@ -188,6 +188,15 @@ limitations under the License.
|
||||
assert.equal(Gerrit._pluginInstallError.callCount, 2);
|
||||
});
|
||||
|
||||
test('default theme is loaded with html plugins', () => {
|
||||
sandbox.stub(Gerrit, '_setPluginsPending');
|
||||
element.config = {
|
||||
default_theme: '/oof',
|
||||
plugin: {},
|
||||
};
|
||||
assert.isTrue(Gerrit._setPluginsPending.calledWith([url + '/oof']));
|
||||
});
|
||||
|
||||
test('skips preloaded plugins', () => {
|
||||
sandbox.stub(Gerrit, '_isPluginPreloaded')
|
||||
.withArgs(url + '/plugins/foo/bar').returns(true)
|
||||
|
Loading…
Reference in New Issue
Block a user