Merge branch 'master' into feature/ingest

This commit is contained in:
Matthew Bargar 2016-03-08 14:24:07 -05:00
commit f55c59885f
10 changed files with 48 additions and 34 deletions

View file

@ -221,6 +221,7 @@ Remember, someone is blocked by a pull awaiting review, make it count. Be thorou
1. **Understand the issue** that is being fixed, or the feature being added. Check the description on the pull, and check out the related issue. If you don't understand something, ask the person the submitter for clarification.
1. **Reproduce the bug** (or the lack of feature I guess?) in the destination branch, usually `master`. The referenced issue will help you here. If you're unable to reproduce the issue, contact the issue submitter for clarification
1. **Check out the pull** and test it. Is the issue fixed? Does it have nasty side effects? Try to create suspect inputs. If it operates on the value of a field try things like: strings (including an empty string), null, numbers, dates. Try to think of edge cases that might break the code.
1. **Merge the target branch**. It is possible that tests or the linter have been updated in the target branch since the pull was submitted. Merging the pull could cause core to start failing.
1. **Read the code**. Understanding the changes will help you find additional things to test. Contact the submitter if you don't understand something.
1. **Go line-by-line**. Are there [style guide](https://github.com/elastic/kibana/blob/master/STYLEGUIDE.md) violations? Strangely named variables? Magic numbers? Do the abstractions make sense to you? Are things arranged in a testable way?
1. **Speaking of tests** Are they there? If a new function was added does it have tests? Do the tests, well, TEST anything? Do they just run the function or do they properly check the output?

View file

@ -1,5 +1,7 @@
import SetupError from './setup_error';
import { format } from 'util';
import { mappings } from './kibana_index_mappings';
module.exports = function (server) {
const client = server.plugins.elasticsearch.client;
const index = server.config().get('kibana.index');
@ -16,16 +18,7 @@ module.exports = function (server) {
settings: {
number_of_shards: 1
},
mappings: {
config: {
properties: {
buildNum: {
type: 'string',
index: 'not_analyzed'
}
}
}
}
mappings
}
})
.catch(handleError('Unable to create Kibana index "<%= kibana.index %>"'))

View file

@ -9,6 +9,19 @@ import callWithRequest from './call_with_request';
module.exports = function (server) {
const config = server.config();
class ElasticsearchClientLogging {
error(err) {
server.log(['error', 'elasticsearch'], err);
}
warning(message) {
server.log(['warning', 'elasticsearch'], message);
}
info() {}
debug() {}
trace() {}
close() {}
}
function createClient(options) {
options = _.defaults(options || {}, {
url: config.get('elasticsearch.url'),
@ -52,18 +65,7 @@ module.exports = function (server) {
defer: function () {
return Bluebird.defer();
},
log: function () {
this.error = function (err) {
server.log(['error', 'elasticsearch'], err);
};
this.warning = function (message) {
server.log(['warning', 'elasticsearch'], message);
};
this.info = _.noop;
this.debug = _.noop;
this.trace = _.noop;
this.close = _.noop;
}
log: ElasticsearchClientLogging
});
}
@ -73,6 +75,7 @@ module.exports = function (server) {
const noAuthClient = createClient({ auth: false });
server.on('close', _.bindKey(noAuthClient, 'close'));
server.expose('ElasticsearchClientLogging', ElasticsearchClientLogging);
server.expose('client', client);
server.expose('createClient', createClient);
server.expose('callWithRequestFactory', callWithRequest);

View file

@ -0,0 +1,10 @@
export const mappings = {
config: {
properties: {
buildNum: {
type: 'string',
index: 'not_analyzed'
}
}
}
};

View file

@ -1,4 +1,5 @@
import upgrade from './upgrade_config';
import { mappings } from './kibana_index_mappings';
module.exports = function (server) {
const config = server.config();
@ -8,11 +9,16 @@ module.exports = function (server) {
type: 'config',
body: {
size: 1000,
sort: [ { buildNum: { order: 'desc', ignore_unmapped: true } } ]
sort: [
{
buildNum: {
order: 'desc',
unmapped_type: mappings.config.properties.buildNum.type
}
}
]
}
};
return client.search(options).then(upgrade(server));
};

View file

@ -32,7 +32,7 @@ export default function configDefaultsProvider() {
type: 'json',
value:
'[\n' +
' ["", "hh:mm:ss.SSS"],\n' +
' ["", "HH:mm:ss.SSS"],\n' +
' ["PT1S", "HH:mm:ss"],\n' +
' ["PT1M", "HH:mm"],\n' +
' ["PT1H",\n' +

View file

@ -6,14 +6,14 @@
class="form-control url">
</input>
<button
class="shorten-button"
class="shorten-button btn btn-default"
tooltip="Generate Short URL"
ng-click="generateShortUrl()"
ng-disabled="shortGenerated">
<span aria-hidden="true" class="fa fa-compress"></span>
</button>
<button
class="clipboard-button"
class="clipboard-button btn btn-default"
tooltip="Copy to Clipboard"
ng-click="copyToClipboard()">
<span aria-hidden="true" class="fa fa-clipboard"></span>

View file

@ -106,7 +106,7 @@ export default function DispatchClass(Private) {
var isClickable = this.listenerCount('click') > 0;
var addEvent = this.addEvent;
var $el = this.handler.el;
if(!this.handler.highlight) {
if (!this.handler.highlight) {
this.handler.highlight = self.highlight;
}
@ -132,7 +132,7 @@ export default function DispatchClass(Private) {
var self = this;
var addEvent = this.addEvent;
var $el = this.handler.el;
if(!this.handler.unHighlight) {
if (!this.handler.unHighlight) {
this.handler.unHighlight = self.unHighlight;
}

View file

@ -41,8 +41,9 @@ export default function AreaChartFactory(Private) {
var highlightOpacity = 0.8;
var highlightElements = $('[data-label]', element.parentNode).filter(
function (els, el) { return `${$(el).data('label')}` === label;
});
function (els, el) {
return `${$(el).data('label')}` === label;
});
$('[data-label]', element.parentNode).not(highlightElements).css('opacity', defaultOpacity / 2); // half of the default opacity
highlightElements.css('opacity', highlightOpacity);
};

View file

@ -32,14 +32,14 @@ uiModules.get('kibana')
$scope.highlight = function (event) {
var el = event.currentTarget;
var handler = $scope.renderbot.vislibVis.handler;
if(!handler) return;
if (!handler) return;
handler.highlight.call(el, handler.el);
};
$scope.unhighlight = function (event) {
var el = event.currentTarget;
var handler = $scope.renderbot.vislibVis.handler;
if(!handler) return;
if (!handler) return;
handler.unHighlight.call(el, handler.el);
};