Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into upgrade/eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Nov 8, 2016
2 parents a9d213f + b38a106 commit 11eaad5
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 91 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ A high level overview of our contributing guidelines.
- [Voicing the importance of an issue](#voicing-the-importance-of-an-issue)
- ["My issue isn't getting enough attention"](#my-issue-isnt-getting-enough-attention)
- ["I want to help!"](#i-want-to-help)
- [How We Use Git and GitHub](#how-we-use-git-and-github)
- [Branching](#branching)
- [Commits and Merging](#commits-and-merging)
- [What Goes Into a Pull Request](#what-goes-into-a-pull-request)
- [Contributing Code](#contributing-code)
- [Setting Up Your Development Environment](#setting-up-your-development-environment)
- [Customizing `config/kibana.dev.yml`](#customizing-configkibanadevyml)
Expand Down Expand Up @@ -65,6 +69,31 @@ Feel free to bump your issues if you think they've been neglected for a prolonge

We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.

## How We Use Git and GitHub

### Branching

* All work on the next major release goes into master.
* Past major release branches are named `{majorVersion}.x`. They contain work that will go into the next minor release. For example, if the next minor release is `5.2.0`, work for it should go into the `5.x` branch.
* Past minor release branches are named `{majorVersion}.{minorVersion}`. They contain work that will go into the next patch release. For example, if the next patch release is `5.3.1`, work for it should go into the `5.3` branch.
* All work is done on feature branches and merged into one of these branches.
* Where appropriate, we'll backport changes into older release branches.

### Commits and Merging

* Feel free to make as many commits as you want, while working on a branch.
* When submitting a PR for review, please perform an interactive rebase to present a logical history that's easy for the reviewers to follow.
* Please use your commit messages to include helpful information on your changes, e.g. changes to APIs, UX changes, bugs fixed, and an explanation of *why* you made the changes that you did.
* Resolve merge conflicts by rebasing the target branch over your feature branch, and force-pushing.
* When merging, we'll squash your commits into a single commit.

### What Goes Into a Pull Request

* Please include an explanation of your changes in your PR description.
* Links to relevant issues, external resources, or related PRs are very important and useful.
* Please update any tests that pertain to your code, and add new tests where appropriate.
* See [Submitting a Pull Request](#submitting-a-pull-request) for more info.

## Contributing Code

These guidelines will help you get your Pull Request into shape so that a code review can start as soon as possible.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _Note: The version numbers below are only examples, meant to illustrate the rela
| ES patch number is newer. | 5.1.__2__ | 5.1.__5__ | ⚠️ Logged warning |
| ES minor number is newer. | 5.__1__.2 | 5.__5__.0 | ⚠️ Logged warning |
| ES major number is newer. | __5__.1.2 | __6__.0.0 | 🚫 Fatal error |
| ES patch number is older. | 5.1.__2__ | 5.1.__0__ | 🚫 Fatal error |
| ES patch number is older. | 5.1.__2__ | 5.1.__0__ | ⚠️ Logged warning |
| ES minor number is older. | 5.__1__.2 | 5.__0__.0 | 🚫 Fatal error |
| ES major number is older. | __5__.1.2 | __4__.0.0 | 🚫 Fatal error |

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/tutorial-load-dataset.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
The tutorials in this section rely on the following data sets:

* The complete works of William Shakespeare, suitably parsed into fields. Download this data set by clicking here:
https://www.elastic.co/guide/en/kibana/3.0/snippets/shakespeare.json[shakespeare.json].
https://download.elastic.co/demos/kibana/gettingstarted/shakespeare.json[shakespeare.json].
* A set of fictitious accounts with randomly generated data. Download this data set by clicking here:
https://github.com/bly2k/files/blob/master/accounts.zip?raw=true[accounts.zip]
https://download.elastic.co/demos/kibana/gettingstarted/accounts.zip[accounts.zip]
* A set of randomly generated log files. Download this data set by clicking here:
https://download.elastic.co/demos/kibana/gettingstarted/logs.jsonl.gz[logs.jsonl.gz]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ describe('plugins/elasticsearch', () => {
it('when majors are equal, but ES minor is less than Kibana minor', () => {
expect(isEsCompatibleWithKibana('1.0.0', '1.1.0')).to.be(false);
});

it('when majors and minors are equal, but ES patch is less than Kibana patch', () => {
expect(isEsCompatibleWithKibana('1.1.0', '1.1.1')).to.be(false);
});
});

describe('returns true', () => {
Expand All @@ -34,6 +30,10 @@ describe('plugins/elasticsearch', () => {
it('when majors and minors are equal, and ES patch is greater than Kibana patch', () => {
expect(isEsCompatibleWithKibana('1.1.1', '1.1.0')).to.be(true);
});

it('when majors and minors are equal, but ES patch is less than Kibana patch', () => {
expect(isEsCompatibleWithKibana('1.1.0', '1.1.1')).to.be(true);
});
});
});
});
13 changes: 6 additions & 7 deletions src/core_plugins/elasticsearch/lib/check_es_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import _ from 'lodash';
import semver from 'semver';
import isEsCompatibleWithKibana from './is_es_compatible_with_kibana';

/**
Expand Down Expand Up @@ -36,9 +35,9 @@ module.exports = function checkEsVersion(server, kibanaVersion) {
return incompatibleNodes.push(esNode);
}

// It's acceptable if ES is ahead of Kibana, but we want to prompt users to upgrade Kibana
// to match it.
if (semver.gt(esNode.version, kibanaVersion)) {
// It's acceptable if ES and Kibana versions are not the same so long as
// they are not incompatible, but we should warn about it
if (esNode.version !== kibanaVersion) {
warningNodes.push(esNode);
}
});
Expand All @@ -64,9 +63,9 @@ module.exports = function checkEsVersion(server, kibanaVersion) {
lastWarnedNodesForServer.set(server, warningNodeNames);
server.log(['warning'], {
tmpl: (
`You're running Kibana ${kibanaVersion} with some newer versions of ` +
'Elasticsearch. Update Kibana to the latest version to prevent compatibility issues: ' +
warningNodeNames
`You're running Kibana ${kibanaVersion} with some different versions of ` +
'Elasticsearch. Update Kibana or Elasticsearch to the same ' +
`version to prevent compatibility issues: ${warningNodeNames}`
),
kibanaVersion,
nodes: simplifiedNodes,
Expand Down
17 changes: 0 additions & 17 deletions src/core_plugins/elasticsearch/lib/es_bool.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,5 @@ export default function isEsCompatibleWithKibana(esVersion, kibanaVersion) {
return false;
}

// Reject older patch versions of ES.
if (esVersionNumbers.patch < kibanaVersionNumbers.patch) {
return false;
}

return true;
}
2 changes: 1 addition & 1 deletion src/core_plugins/metric_vis/public/metric_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function MetricVisProvider(Private) {
name: 'metric',
title: 'Metric',
description: 'One big number for all of your one big number needs. Perfect for showing ' +
'a count of hits, or the exact average a numeric field.',
'a count of hits, or the exact average of a numeric field.',
icon: 'fa-calculator',
template: metricVisTemplate,
params: {
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/table_vis/public/table_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function TableVisTypeProvider(Private) {
title: 'Data table',
icon: 'fa-table',
description: 'The data table provides a detailed breakdown, in tabular format, of the results of a composed ' +
'aggregation. Tip, a data table is available from many other charts by clicking grey bar at the bottom of the chart.',
'aggregation. Tip, a data table is available from many other charts by clicking the grey bar at the bottom of the chart.',
template: tableVisTemplate,
params: {
defaults: {
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/timelion/public/vis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function TimelionVisProvider(Private) {
title: 'Timeseries',
icon: 'fa-clock-o',
description: 'Create timeseries charts using the timelion expression language. ' +
'Perfect for computing and combining timeseries set with functions suchs as derivatives and moving averages',
'Perfect for computing and combining timeseries sets with functions such as derivatives and moving averages',
template: require('plugins/timelion/vis/timelion_vis.html'),
params: {
editor: require('plugins/timelion/vis/timelion_vis_params.html')
Expand Down
24 changes: 12 additions & 12 deletions src/ui/public/url/__tests__/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ describe('kbnUrl', function () {
});

it('should call replace on $location', function () {
sinon.stub(kbnUrl, '_shouldAutoReload').returns(false);
sinon.stub(kbnUrl, '_shouldForceReload').returns(false);
sinon.stub($location, 'replace');

expect($location.replace.callCount).to.be(0);
Expand Down Expand Up @@ -403,7 +403,7 @@ describe('kbnUrl', function () {
});

it('should call replace on $location', function () {
sinon.stub(kbnUrl, '_shouldAutoReload').returns(false);
sinon.stub(kbnUrl, '_shouldForceReload').returns(false);
sinon.stub($location, 'replace');

expect($location.replace.callCount).to.be(0);
Expand All @@ -412,7 +412,7 @@ describe('kbnUrl', function () {
});
});

describe('_shouldAutoReload', function () {
describe('_shouldForceReload', function () {
let next;
let prev;

Expand All @@ -430,22 +430,22 @@ describe('kbnUrl', function () {

it('returns false if the passed url doesn\'t match the current route', function () {
next.path = '/not current';
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false);
});

describe('if the passed url does match the route', function () {
describe('and the route reloads on search', function () {
describe('and the path is the same', function () {
describe('and the search params are the same', function () {
it('returns true', function () {
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(true);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(true);
});
});
describe('but the search params are different', function () {
it('returns false', function () {
next.search = {};
prev.search = { q: 'search term' };
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false);
});
});
});
Expand All @@ -457,14 +457,14 @@ describe('kbnUrl', function () {

describe('and the search params are the same', function () {
it('returns false', function () {
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false);
});
});
describe('but the search params are different', function () {
it('returns false', function () {
next.search = {};
prev.search = { q: 'search term' };
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false);
});
});
});
Expand All @@ -478,14 +478,14 @@ describe('kbnUrl', function () {
describe('and the path is the same', function () {
describe('and the search params are the same', function () {
it('returns true', function () {
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(true);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(true);
});
});
describe('but the search params are different', function () {
it('returns true', function () {
next.search = {};
prev.search = { q: 'search term' };
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(true);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(true);
});
});
});
Expand All @@ -497,14 +497,14 @@ describe('kbnUrl', function () {

describe('and the search params are the same', function () {
it('returns false', function () {
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false);
});
});
describe('but the search params are different', function () {
it('returns false', function () {
next.search = {};
prev.search = { q: 'search term' };
expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false);
expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false);
});
});
});
Expand Down
12 changes: 8 additions & 4 deletions src/ui/public/url/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) {
if ($injector.has('$route')) {
const $route = $injector.get('$route');

if (self._shouldAutoReload(next, prev, $route)) {
if (self._shouldForceReload(next, prev, $route)) {
const appState = Private(AppStateProvider).getAppState();
if (appState) appState.destroy();

Expand All @@ -179,17 +179,21 @@ function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) {
}
};

self._shouldAutoReload = function (next, prev, $route) {
// determine if the router will automatically reload the route
self._shouldForceReload = function (next, prev, $route) {
if (reloading) return false;

const route = $route.current && $route.current.$$route;
if (!route) return false;

if (next.path !== prev.path) return false;
// for the purposes of determining whether the router will
// automatically be reloading, '' and '/' are equal
const nextPath = next.path || '/';
const prevPath = prev.path || '/';
if (nextPath !== prevPath) return false;

const reloadOnSearch = route.reloadOnSearch;
const searchSame = _.isEqual(next.search, prev.search);

return (reloadOnSearch && searchSame) || !reloadOnSearch;
};
}
Expand Down
20 changes: 0 additions & 20 deletions src/ui/public/utils/es_bool.js

This file was deleted.

26 changes: 13 additions & 13 deletions src/ui/public/vislib/visualizations/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,21 +253,21 @@ export default function MapFactory(Private, tilemap, $sanitize) {

const southEast = bounds.getSouthEast();
const northWest = bounds.getNorthWest();
let SouthEastLng = southEast.lng;
if (SouthEastLng > 180) {
SouthEastLng -= 360;
let southEastLng = southEast.lng;
if (southEastLng > 180) {
southEastLng -= 360;
}
let NorthWestLng = northWest.lng;
if (NorthWestLng < -180) {
NorthWestLng += 360;
let northWestLng = northWest.lng;
if (northWestLng < -180) {
northWestLng += 360;
}

const SouthEastLat = southEast.lat;
const NorthWestLat = northWest.lat;
const southEastLat = southEast.lat;
const northWestLat = northWest.lat;

//Bounds cannot be created unless they form a box with larger than 0 dimensions
//Invalid areas are rejected by ES.
if (SouthEastLat === NorthWestLat || SouthEastLng === NorthWestLng) {
if (southEastLat === northWestLat || southEastLng === northWestLng) {
return;
}

Expand All @@ -276,12 +276,12 @@ export default function MapFactory(Private, tilemap, $sanitize) {
chart: self._chartData,
bounds: {
bottom_right: {
lat: SouthEastLat,
lon: SouthEastLng
lat: southEastLat,
lon: southEastLng
},
top_left: {
lat: NorthWestLat,
lon: NorthWestLng
lat: northWestLat,
lon: northWestLng
}
}
});
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/vislib/visualizations/pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default function PieChartFactory(Private) {
return Math.max(0, Math.min(2 * Math.PI, x(d.x)));
})
.endAngle(function (d) {
if (d.dx < 1e-8) return x(d.x);
return Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx)));
})
.innerRadius(function (d) {
Expand Down
Loading

0 comments on commit 11eaad5

Please sign in to comment.