Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/5.x' into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Feb 15, 2017
2 parents d54757b + 59a68f2 commit 04a7dae
Show file tree
Hide file tree
Showing 24 changed files with 213 additions and 77 deletions.
1 change: 1 addition & 0 deletions docs/release-notes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This section summarizes the changes in each release.
* <<release-notes-5.0.0>>

--
include::release-notes/5.2.1.asciidoc[]
include::release-notes/5.2.0.asciidoc[]
include::release-notes/5.1.2.asciidoc[]
include::release-notes/5.1.1.asciidoc[]
Expand Down
27 changes: 27 additions & 0 deletions docs/release-notes/5.2.1.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[[release-notes-5.2.1]]
== 5.2.1 Release Notes

Also see <<breaking-changes-5.0>>.

[float]
[[security-5.2.1]]
=== Security fix
When previous versions of Kibana 5 are configured for SSL client access, file
descriptors will fail to be cleaned up after certain requests and will
accumulate over time until the process crashes. Requests that are canceled
before data is sent can also crash the process. +
{security}[ESA-2017-02] ({pull}10225[#10225])

[float]
[[bug-5.2.1]]
=== Bug fixes
Core::
* Bump Node.js to version 6.9.5. This was a low severity security release for Node.js, which has minimal impact to Kibana, but is still worth upgrading. {pull}10135[#10135]
Discover::
* Prevented a background action that was causing unnecessary CPU cycles {pull}10036[#10036]
Management::
* Delete button for color formatters no longer overlaps format dropdown {issue}8864[#8864]
Visualize::
* Fixed regression where certain visualizations were being limited to 25 series {issue}10132[#10132]
* Fixed typo on a tag cloud warning message {pull}10092[#10092]
* Fixed a bug where data table visualizations would incorrectly appear empty in certain circumstances {issue}9757[#9757]
4 changes: 3 additions & 1 deletion src/core_plugins/kibana/public/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import FilterBarQueryFilterProvider from 'ui/filter_bar/query_filter';
import DocTitleProvider from 'ui/doc_title';
import { getTopNavConfig } from './top_nav/get_top_nav_config';
import { DashboardConstants } from './dashboard_constants';
import { VisualizeConstants } from 'plugins/kibana/visualize/visualize_constants';
import UtilsBrushEventProvider from 'ui/utils/brush_event';
import FilterBarFilterBarClickHandlerProvider from 'ui/filter_bar/filter_bar_click_handler';
import { DashboardState } from './dashboard_state';
Expand Down Expand Up @@ -212,7 +213,8 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
}

const addNewVis = function addNewVis() {
kbnUrl.change(`/visualize?${DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM}`);
kbnUrl.change(
`${VisualizeConstants.WIZARD_STEP_1_PAGE_PATH}?${DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM}`);
};

// Setup configurable values for config directive, after objects are initialized
Expand Down
59 changes: 57 additions & 2 deletions src/ui/public/agg_types/__tests__/buckets/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Terms Agg', function () {

let $rootScope;

function init({ responseValueAggs = [] }) {
function init({ responseValueAggs = [], aggParams = {} }) {
ngMock.module('kibana');
ngMock.inject(function (Private, $controller, _$rootScope_) {
const terms = Private(AggTypesIndexProvider).byName.terms;
Expand All @@ -16,7 +16,7 @@ describe('Terms Agg', function () {
$rootScope = _$rootScope_;
$rootScope.agg = {
id: 'test',
params: {},
params: aggParams,
type: terms,
vis: {
aggs: []
Expand Down Expand Up @@ -152,5 +152,60 @@ describe('Terms Agg', function () {
it('displays a metric editor if "custom metric" is selected');
it('saves the "custom metric" to state and refreshes from it');
it('invalidates the form if the metric agg form is not complete');

describe('convert import/export from old format', function () {

it('it doesnt do anything with string type', function () {
init({
aggParams: {
include: '404',
exclude: '400',
}
});

const aggConfig = $rootScope.agg;
const includeArg = $rootScope.agg.type.params.byName.include;
const excludeArg = $rootScope.agg.type.params.byName.exclude;

expect(includeArg.serialize(aggConfig.params.include)).to.equal('404');
expect(excludeArg.serialize(aggConfig.params.exclude)).to.equal('400');

const output = { params: {} };

includeArg.write(aggConfig, output);
excludeArg.write(aggConfig, output);

expect(output.params.include).to.equal('404');
expect(output.params.exclude).to.equal('400');
});

it('converts object to string type', function () {
init({
aggParams: {
include: {
pattern: '404'
}, exclude: {
pattern: '400'
},
}
});

const aggConfig = $rootScope.agg;
const includeArg = $rootScope.agg.type.params.byName.include;
const excludeArg = $rootScope.agg.type.params.byName.exclude;

expect(includeArg.serialize(aggConfig.params.include)).to.equal('404');
expect(excludeArg.serialize(aggConfig.params.exclude)).to.equal('400');

const output = { params: {} };

includeArg.write(aggConfig, output);
excludeArg.write(aggConfig, output);

expect(output.params.include).to.equal('404');
expect(output.params.exclude).to.equal('400');
});

});
});
});
25 changes: 21 additions & 4 deletions src/ui/public/agg_types/buckets/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ export default function TermsAggDefinition(Private) {
};
}

const migrateIncludeExcludeFormat = {
serialize: function (value) {
if (!value || _.isString(value)) return value;
else return value.pattern;
},
write: function (aggConfig, output) {
const value = aggConfig.params[this.name];
if (_.isObject(value)) {
output.params[this.name] = value.pattern;
} else if (value) {
output.params[this.name] = value;
}
}
};

return new BucketAggType({
name: 'terms',
title: 'Terms',
Expand All @@ -48,15 +63,17 @@ export default function TermsAggDefinition(Private) {
},
{
name: 'exclude',
type: 'regex',
type: 'string',
advanced: true,
disabled: isNotType('string')
disabled: isNotType('string'),
...migrateIncludeExcludeFormat
},
{
name: 'include',
type: 'regex',
type: 'string',
advanced: true,
disabled: isNotType('string')
disabled: isNotType('string'),
...migrateIncludeExcludeFormat
},
{
name: 'size',
Expand Down
3 changes: 3 additions & 0 deletions src/ui/public/parse_query/lib/to_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ export default function toUser(text) {
if (text.query_string) return toUser(text.query_string.query);
return angular.toJson(text);
}
if (text === '*') {
return '';
}
return '' + text;
}
10 changes: 5 additions & 5 deletions src/ui/public/vis_maps/__tests__/tile_maps/markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ describe('tilemaptest - Marker Tests', function () {
let mapData;
let markerLayer;

function createMarker(MarkerClass, geoJson) {
function createMarker(MarkerClass, geoJson, tooltipFormatter) {
mapData = _.assign({}, geoJsonData.geoJson, geoJson || {});
mapData.properties.allmin = mapData.properties.min;
mapData.properties.allmax = mapData.properties.max;

return new MarkerClass(mockMap, mapData, {
valueFormatter: geoJsonData.valueFormatter
valueFormatter: geoJsonData.valueFormatter,
tooltipFormatter: tooltipFormatter || null
});
}

Expand Down Expand Up @@ -143,15 +144,14 @@ describe('tilemaptest - Marker Tests', function () {

describe('showTooltip', function () {
it('should use the tooltip formatter', function () {
let content;
const sample = _.sample(mapData.features);

markerLayer = createMarker(MarkerClass, null, Function.prototype);//create marker with tooltip
markerLayer._attr.addTooltip = true;
const stub = sinon.stub(markerLayer, '_tooltipFormatter', function (val) {
return;
});

markerLayer._showTooltip(sample);

expect(stub.callCount).to.equal(1);
expect(stub.firstCall.calledWith(sample)).to.be(true);
});
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/vis_maps/visualizations/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function MapFactory(Private, tilemapSettings) {
this._events = _.get(params, 'events');
this._markerType = markerTypes[params.markerType] ? params.markerType : defaultMarkerType;
this._valueFormatter = params.valueFormatter || _.identity;
this._tooltipFormatter = params.tooltipFormatter || _.identity;
this._tooltipFormatter = params.tooltipFormatter;
this._geoJson = _.get(this._chartData, 'geoJson');
this._attr = params.attr || {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function MarkerFactory() {
this.geoJson = geoJson;
this.popups = [];

this._tooltipFormatter = params.tooltipFormatter || _.identity;
this._tooltipFormatter = params.tooltipFormatter || null;
this._valueFormatter = params.valueFormatter || _.identity;
this._attr = params.attr || {};

Expand Down Expand Up @@ -218,7 +218,11 @@ export default function MarkerFactory() {
* @return undefined
*/
_showTooltip(feature, latLng) {
if (!this.map) return;
const hasMap = !!this.map;
const hasTooltip = !!this._attr.addTooltip;
if (!hasMap || !hasTooltip) {
return;
}
const lat = _.get(feature, 'geometry.coordinates.1');
const lng = _.get(feature, 'geometry.coordinates.0');
latLng = latLng || L.latLng(lat, lng);
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/vis_maps/visualizations/tile_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ export default function TileMapFactory(Private) {

const params = _.assign({}, _.get(this._chartData, 'geoAgg.vis.params'), uiStateParams);

const tooltipFormatter = this.handler.visConfig.get('addTooltip') ? this.tooltipFormatter : null;
const map = new TileMapMap(container, this._chartData, {
center: params.mapCenter,
zoom: params.mapZoom,
events: this.events,
markerType: this.handler.visConfig.get('mapType'),
tooltipFormatter: this.tooltipFormatter,
tooltipFormatter: tooltipFormatter,
valueFormatter: this.valueFormatter,
attr: this.handler.visConfig._values
});
Expand Down
Loading

0 comments on commit 04a7dae

Please sign in to comment.