Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core_plugins/state_session_storage_redirect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default function (kibana) {
id: 'stateSessionStorageRedirect',
main: 'plugins/state_session_storage_redirect',
hidden: true,
hasCSS: false,
}
}
});
Expand Down
9 changes: 9 additions & 0 deletions src/ui/ui_apps/__tests__/ui_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function createStubUiAppSpec(extraParams) {
linkToLastSubUrl: true,
hidden: false,
listed: false,
hasCSS: false,
templateName: 'ui_app_test',
uses: [
'visTypes',
Expand Down Expand Up @@ -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);
});
Expand Down Expand Up @@ -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' });
});
Expand Down
6 changes: 6 additions & 0 deletions src/ui/ui_apps/ui_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class UiApp {
listed,
templateName = 'ui_app',
injectVars,
hasCSS = true,
url = `/app/${id}`,
uses = []
} = spec;
Expand All @@ -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;

Expand Down Expand Up @@ -98,6 +100,10 @@ export class UiApp {
}
}

getHasCSS() {
return this._hasCSS;
}

getInjectedVars() {
const provider = this._injectedVarsProvider;
const plugin = this._getPlugin();
Expand Down
2 changes: 2 additions & 0 deletions src/ui/ui_exports/ui_export_types/ui_apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function applySpecDefaults(spec, type, pluginSpec) {
listed = !hidden,
templateName = 'ui_app',
injectVars = noop,
hasCSS = true,
url = `/app/${id}`,
uses = [],
} = spec;
Expand All @@ -34,6 +35,7 @@ function applySpecDefaults(spec, type, pluginSpec) {
listed,
templateName,
injectVars,
hasCSS,
url,
uses: uniq([
...uses,
Expand Down
5 changes: 4 additions & 1 deletion src/ui/ui_render/views/ui_app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down