Skip to content

Commit

Permalink
Merge branch 'master' into color-mapping-config
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Sep 10, 2015
2 parents 1609cba + 327f589 commit 7b14699
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 8 deletions.
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ Please make sure you have signed the [Contributor License Agreement](http://www.
./bin/kibana --dev
```

#### `config/kibana.dev.yml`

The `config/kibana.yml` file stores user configuration directives. Since this file is checked into source control, however, developer preferences can't be saved without the risk of accidentally committing the modified version. To make customizing configuration easier during development, the Kibana CLI will look for a `config/kibana.dev.yml` file if run with the `--dev` flag. This file behaves just like the non-dev version and accepts any of the [standard settings](https://www.elastic.co/guide/en/kibana/master/kibana-server-properties.html).

The `config/kibana.dev.yml` file is very commonly used to store some opt-in/**unsafe** optimizer tweaks which can significantly increase build performance. Below is a commonly used `config/kibana.dev.yml` file, but additional options can be found [in #4611](https://github.com/elastic/kibana/pull/4611#issue-99706918).

```yaml
optimize:
sourceMaps: '#cheap-source-map' # options -> http://webpack.github.io/docs/configuration.html#devtool
unsafeCache: true
lazyPrebuild: false
```
#### Linting
A note about linting: We use [eslint](http://eslint.org) to check that the [styleguide](STYLEGUIDE.md) is being followed. It runs in a pre-commit hook and as a part of the tests, but most contributors integrate it with their code editors for real-time feedback.
Expand Down
2 changes: 1 addition & 1 deletion config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# kibana.defaultAppId: "discover"

# If your Elasticsearch is protected with basic auth, this is the user credentials
# used by the Kibana server to perform maintence on the kibana_index at statup. Your Kibana
# used by the Kibana server to perform maintenance on the kibana_index at startup. Your Kibana
# users will still need to authenticate with Elasticsearch (which is proxied through
# the Kibana server)
# elasticsearch.username: user
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ key Kibana functionality. By the end of this tutorial, you will have:

* Loaded a sample data set into your Elasticsearch installation
* Defined at least one index pattern
* Used the <<discover, Discover>> functionality to explore your data
* Use the <<discover, Discover>> functionality to explore your data
* Set up some <<visualize,_visualizations_>> to graphically represent your data
* Assembled visualizations into a <<dashboard,Dashboard>>

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/testsBundle/testsEntryTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function ({env, bundle}) {
*
* This is programatically created and updated, do not modify
*
* context: <%= JSON.stringify(env.context) %>
* context: ${JSON.stringify(env.context)}
* includes code from:
${pluginSlug}
*
Expand Down
5 changes: 4 additions & 1 deletion src/server/plugins/PluginApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.exports = class PluginApi {
this.package = require(join(pluginPath, 'package.json'));
this.autoload = require('../../ui/autoload');
this.Plugin = Plugin.scoped(kibana, pluginPath, this.package);
this.mixin = _.bindKey(kibana, 'mixin');
}

get uiExports() {
throw new Error('plugin.uiExports is not defined until initialize phase');
}
};
8 changes: 8 additions & 0 deletions src/server/plugins/PluginCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ let PluginApi = require('./PluginApi');
let Collection = require('requirefrom')('src')('utils/Collection');

let byIdCache = Symbol('byIdCache');
let pluginApis = Symbol('pluginApis');

module.exports = class Plugins extends Collection {

constructor(kbnServer) {
super();
this.kbnServer = kbnServer;
this[pluginApis] = new Set();
}

async new(path) {
let api = new PluginApi(this.kbnServer, path);
this[pluginApis].add(api);

let output = [].concat(require(path)(api) || []);
let config = this.kbnServer.config;

Expand Down Expand Up @@ -42,4 +46,8 @@ module.exports = class Plugins extends Collection {
return this[byIdCache] || (this[byIdCache] = indexBy([...this], 'id'));
}

getPluginApis() {
return this[pluginApis];
}

};
13 changes: 11 additions & 2 deletions src/server/plugins/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ module.exports = async function (kbnServer, server, config) {
}

let { plugins } = kbnServer;
let path = [];

// extend plugin apis with additional context
plugins.getPluginApis().forEach(api => {

Object.defineProperty(api, 'uiExports', {
value: kbnServer.uiExports
});

});


let path = [];
async function initialize(id) {
let plugin = plugins.byId[id];

Expand All @@ -27,7 +37,6 @@ module.exports = async function (kbnServer, server, config) {
}

await plugin.init();

path.pop();
};

Expand Down
2 changes: 1 addition & 1 deletion src/ui/appEntryTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function ({env, bundle}) {
*
* This is programatically created and updated, do not modify
*
* context: <%= JSON.stringify(env.context) %>
* context: ${JSON.stringify(env.context)}
* includes code from:
${pluginSlug}
*
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/vislib/lib/handler/types/point_series.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ define(function (require) {
{
type: 'warning',
msg: 'Positive and negative values are not accurately represented by stacked ' +
'area charts. Either changing the chart mode to "overlay" or using a ' +
'area charts. Either changing the chart mode to "overlap" or using a ' +
'bar chart is recommended.',
test: function (vis, data) {
if (!data.shouldBeStacked() || data.maxNumberOfSeries() < 2) return;
Expand Down

0 comments on commit 7b14699

Please sign in to comment.