diff --git a/src/core_plugins/state_session_storage_redirect/index.js b/src/core_plugins/state_session_storage_redirect/index.js index 37e37ba3928e32..378b6b218817ac 100644 --- a/src/core_plugins/state_session_storage_redirect/index.js +++ b/src/core_plugins/state_session_storage_redirect/index.js @@ -7,6 +7,7 @@ export default function (kibana) { id: 'stateSessionStorageRedirect', main: 'plugins/state_session_storage_redirect', hidden: true, + hasCSS: false, } } }); diff --git a/src/ui/ui_apps/__tests__/ui_app.js b/src/ui/ui_apps/__tests__/ui_app.js index fedcdca6f61087..e67823e67a7fb4 100644 --- a/src/ui/ui_apps/__tests__/ui_app.js +++ b/src/ui/ui_apps/__tests__/ui_app.js @@ -15,6 +15,7 @@ function createStubUiAppSpec(extraParams) { linkToLastSubUrl: true, hidden: false, listed: false, + hasCSS: false, templateName: 'ui_app_test', uses: [ 'visTypes', @@ -86,6 +87,10 @@ describe('UiApp', () => { expect(app.getNavLink()).to.be.a(UiNavLink); }); + it('has CSS', () => { + expect(app.getHasCSS()).to.be(true); + }); + it('has no injected vars', () => { expect(app.getInjectedVars()).to.be(undefined); }); @@ -139,6 +144,10 @@ describe('UiApp', () => { expect(app.getNavLink()).to.be(undefined); }); + it('has no CSS', () => { + expect(app.getHasCSS()).to.be(false); + }); + it('has injected vars', () => { expect(app.getInjectedVars()).to.eql({ foo: 'bar' }); }); diff --git a/src/ui/ui_apps/ui_app.js b/src/ui/ui_apps/ui_app.js index 7c8c6e70a494aa..58c683bcca8887 100644 --- a/src/ui/ui_apps/ui_app.js +++ b/src/ui/ui_apps/ui_app.js @@ -15,6 +15,7 @@ export class UiApp { listed, templateName = 'ui_app', injectVars, + hasCSS = true, url = `/app/${id}`, uses = [] } = spec; @@ -35,6 +36,7 @@ export class UiApp { this._templateName = templateName; this._url = url; this._injectedVarsProvider = injectVars; + this._hasCSS = hasCSS; this._pluginId = pluginId; this._kbnServer = kbnServer; @@ -98,6 +100,10 @@ export class UiApp { } } + getHasCSS() { + return this._hasCSS; + } + getInjectedVars() { const provider = this._injectedVarsProvider; const plugin = this._getPlugin(); diff --git a/src/ui/ui_exports/ui_export_types/ui_apps.js b/src/ui/ui_exports/ui_export_types/ui_apps.js index 5e801c675f601b..88b9bb876cf639 100644 --- a/src/ui/ui_exports/ui_export_types/ui_apps.js +++ b/src/ui/ui_exports/ui_export_types/ui_apps.js @@ -17,6 +17,7 @@ function applySpecDefaults(spec, type, pluginSpec) { listed = !hidden, templateName = 'ui_app', injectVars = noop, + hasCSS = true, url = `/app/${id}`, uses = [], } = spec; @@ -34,6 +35,7 @@ function applySpecDefaults(spec, type, pluginSpec) { listed, templateName, injectVars, + hasCSS, url, uses: uniq([ ...uses, diff --git a/src/ui/ui_render/views/ui_app.jade b/src/ui/ui_render/views/ui_app.jade index 1595059410bfa0..1c16fd253b091a 100644 --- a/src/ui/ui_render/views/ui_app.jade +++ b/src/ui/ui_render/views/ui_app.jade @@ -121,11 +121,14 @@ block content } var files = [ bundleFile('commons.style.css'), - bundleFile('#{app.getId()}.style.css'), bundleFile('commons.bundle.js'), bundleFile('#{app.getId()}.bundle.js') ]; + if ('#{app.getHasCSS()}' == 'true') { + files.push(bundleFile('#{app.getId()}.style.css')); + } + (function next() { var file = files.shift(); if (!file) return;