[uiExports/styleSheetPaths] avoid string concatenation for paths (#27471)

This commit is contained in:
Spencer 2018-12-20 14:58:13 -08:00 committed by GitHub
parent 8f8c19d32d
commit b807b09f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 54 additions and 28 deletions

View file

@ -130,7 +130,7 @@ export default function (kibana) {
apps: apps,
hacks: ['plugins/console/hacks/register'],
devTools: ['plugins/console/console'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
injectDefaultVars(server) {
return {

View file

@ -17,13 +17,15 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
visTypes: [
'plugins/input_control_vis/register_vis'
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});
}

View file

@ -17,13 +17,15 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
inspectorViews: [
'plugins/inspector_views/register_views',
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});
}

View file

@ -19,6 +19,7 @@
import Promise from 'bluebird';
import { mkdirp as mkdirpNode } from 'mkdirp';
import { resolve } from 'path';
import manageUuid from './server/lib/manage_uuid';
import { searchApi } from './server/routes/api/search';
@ -72,7 +73,7 @@ export default function (kibana) {
}),
main: 'plugins/kibana/kibana',
},
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
links: [
{
id: 'kibana:discover',

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
@ -25,7 +27,7 @@ export default function (kibana) {
visTypes: [
'plugins/markdown_vis/markdown_vis'
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
@ -25,7 +27,7 @@ export default function (kibana) {
visTypes: [
'plugins/metric_vis/metric_vis'
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
import fieldsRoutes from './server/routes/fields';
import visDataRoutes from './server/routes/vis';
@ -28,7 +30,7 @@ export default function (kibana) {
visTypes: [
'plugins/metrics/kbn_vis_types'
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
},
config(Joi) {

View file

@ -17,12 +17,14 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
visTypes: ['plugins/region_map/region_map_vis'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
@ -26,7 +28,7 @@ export default function (kibana) {
hidden: true,
url: '/status',
},
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});
}

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
@ -24,7 +26,7 @@ export default function (kibana) {
visTypes: [
'plugins/table_vis/table_vis'
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});

View file

@ -17,12 +17,14 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
visTypes: ['plugins/tagcloud/tag_cloud_vis'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});
}

View file

@ -17,12 +17,14 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
visTypes: ['plugins/tile_map/tile_map_vis'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
}
});
}

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
export default function (kibana) {
return new kibana.Plugin({
require: ['kibana', 'elasticsearch'],
@ -29,7 +31,7 @@ export default function (kibana) {
euiIconType: 'timelionApp',
main: 'plugins/timelion/app',
},
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
hacks: [
'plugins/timelion/lib/panel_registry',
'plugins/timelion/panels/timechart/timechart'

View file

@ -17,6 +17,8 @@
* under the License.
*/
import { resolve } from 'path';
export default kibana => new kibana.Plugin({
id: 'vega',
require: ['elasticsearch'],
@ -24,7 +26,7 @@ export default kibana => new kibana.Plugin({
uiExports: {
visTypes: ['plugins/vega/vega_type'],
injectDefaultVars: server => ({ vegaConfig: server.config().get('vega') }),
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
},
config: (Joi) => Joi.object({

View file

@ -23,7 +23,7 @@ export function canvas(kibana) {
euiIconType: 'canvasApp',
main: 'plugins/canvas/app',
},
styleSheetPaths: `${__dirname}/public/style/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/style/index.scss'),
hacks: [
// window.onerror override
'plugins/canvas/lib/window_error_handler.js',

View file

@ -16,7 +16,7 @@ export function crossClusterReplication(kibana) {
publicDir: resolve(__dirname, 'public'),
require: ['kibana', 'elasticsearch', 'xpack_main', 'remote_clusters', 'index_management'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: ['plugins/cross_cluster_replication'],
injectDefaultVars(server) {
const config = server.config();

View file

@ -25,7 +25,7 @@ export function graph(kibana) {
description: 'Graph exploration',
main: 'plugins/graph/app',
},
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
hacks: ['plugins/graph/hacks/toggle_app_link_in_nav'],
home: ['plugins/graph/register_feature'],
mappings

View file

@ -29,7 +29,7 @@ export function indexLifecycleManagement(kibana) {
configPrefix: 'xpack.ilm',
require: ['kibana', 'elasticsearch', 'xpack_main', 'index_management'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: ['plugins/index_lifecycle_management'],
injectDefaultVars(server) {
const config = server.config();

View file

@ -18,7 +18,7 @@ export function indexManagement(kibana) {
publicDir: resolve(__dirname, 'public'),
require: ['kibana', 'elasticsearch', 'xpack_main'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: [
'plugins/index_management',
]

View file

@ -14,7 +14,7 @@ export function licenseManagement(kibana) {
publicDir: resolve(__dirname, 'public'),
require: ['kibana', 'elasticsearch'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: [
'plugins/license_management',
]

View file

@ -44,7 +44,7 @@ export const ml = (kibana) => {
euiIconType: 'machineLearningApp',
main: 'plugins/ml/app',
},
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
hacks: ['plugins/ml/hacks/toggle_app_link_in_nav'],
home: ['plugins/ml/register_feature'],
injectDefaultVars(server) {

View file

@ -5,6 +5,7 @@
*/
import { i18n } from '@kbn/i18n';
import { resolve } from 'path';
/**
* Configuration of dependency objects for the UI, which are needed for the
@ -32,5 +33,5 @@ export const getUiExports = () => ({
},
hacks: [ 'plugins/monitoring/hacks/toggle_app_link_in_nav' ],
home: [ 'plugins/monitoring/register_feature' ],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
});

View file

@ -21,7 +21,7 @@ export function remoteClusters(kibana) {
publicDir: resolve(__dirname, 'public'),
require: ['kibana', 'elasticsearch', 'xpack_main', 'index_management'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: [
'plugins/remote_clusters',
],

View file

@ -21,7 +21,7 @@ export function rollup(kibana) {
publicDir: resolve(__dirname, 'public'),
require: ['kibana', 'elasticsearch', 'xpack_main'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: [
'plugins/rollup/crud_app',
],

View file

@ -24,7 +24,7 @@ export const searchprofiler = (kibana) => {
devTools: ['plugins/searchprofiler/app'],
hacks: ['plugins/searchprofiler/register'],
home: ['plugins/searchprofiler/register_feature'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
},
init: function (server) {
const thisPlugin = this;

View file

@ -57,7 +57,7 @@ export const security = (kibana) => new kibana.Plugin({
uiExports: {
chromeNavControls: ['plugins/security/views/nav_control'],
managementSections: ['plugins/security/views/management'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
apps: [{
id: 'login',
title: 'Login',

View file

@ -44,7 +44,7 @@ export const spaces = (kibana: any) =>
uiExports: {
chromeNavControls: ['plugins/spaces/views/nav_control'],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
managementSections: ['plugins/spaces/views/management'],
apps: [
{

View file

@ -28,7 +28,7 @@ export const pluginDefinition = {
'plugins/watcher/sections/watch_list',
'plugins/watcher/sections/watch_history_item',
],
styleSheetPaths: `${__dirname}/public/index.scss`,
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
home: ['plugins/watcher/register_feature']
},
init: function (server) {