Skip to content

Commit

Permalink
Merge commit '10f7880' into discover-context-app
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed Dec 13, 2016
2 parents 4730c77 + 10f7880 commit 2054287
Show file tree
Hide file tree
Showing 279 changed files with 4,561 additions and 8,845 deletions.
10 changes: 7 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/optimize
/src/fixtures/vislib/mock_data
/src/ui/public/angular-bootstrap
/test/fixtures/scenarios
/src/core_plugins/console/public/webpackShims
/src/core_plugins/console/public/tests/webpackShims
/src/core_plugins/timelion/bower_components
/src/core_plugins/timelion/vendor_components
test/fixtures/scenarios
optimize
test/fixtures/scenarios
/src/ui/public/utils/decode_geo_hash.js
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
---
extends: '@elastic/kibana'
rules:
no-unused-vars: off
no-var: off
prefer-const: off
no-extra-semi: off
quotes: off
12 changes: 0 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ module.exports = function (grunt) {
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= package.author.company %>;' +
' Licensed <%= package.license %> */\n'
},

lintThese: [
'Gruntfile.js',
'<%= root %>/tasks/**/*.js',
'<%= root %>/test/**/*.js',
'<%= src %>/**/*.js',
'!<%= src %>/ui/public/angular-bootstrap/**/*.js',
'!<%= src %>/core_plugins/timelion/bower_components/**/*.js',
'!<%= src %>/core_plugins/timelion/vendor_components/**/*.js',
'!<%= src %>/fixtures/**/*.js',
'!<%= root %>/test/fixtures/scenarios/**/*.js'
]
};

grunt.config.merge(config);
Expand Down
2 changes: 1 addition & 1 deletion docs/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ to open *Management/Kibana/Saved Objects/Dashboards*.
[[sharing-dashboards]]
== Sharing a Dashboard

You can can share a direct link to a Kibana dashboard with another user,
You can either share a direct link to a Kibana dashboard with another user,
or embed the dashboard in a web page. Users must have Kibana access
to view embedded dashboards.

Expand Down
11 changes: 10 additions & 1 deletion docs/migration/migrate_6_0.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[[breaking-changes-6.0]]
== Breaking changes in 6.0

There are not yet any breaking changes in Kibana 6.0
This section discusses the changes that you need to be aware of when migrating
your application to Kibana 6.0.

[float]
=== Removed option to use unsupported scripting languages
*Details:* Kibana 5.x allowed users to create scripted fields using any scripting language enabled in Elasticsearch.
Kibana 6.0 will only support Painless and Lucene expression based scripts.


*Impact:* You will need to migrate your groovy, python, javascript, etc. scripted fields to Painless or Lucene expressions.
4 changes: 2 additions & 2 deletions docs/setup/connect-to-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ sophisticated date parsing APIs that Kibana uses to determine date information,
specify dates in the index pattern name.
+
. Click *Create* to add the index pattern. This first pattern is automatically configured as the default.
When you have more than one index pattern, you can designate which one to use as the default from
*Settings > Indices*.
When you have more than one index pattern, you can designate which one to use as the default by clicking
on the star icon above the index pattern title from *Management > Index Patterns*.

All done! Kibana is now connected to your Elasticsearch data. Kibana displays a read-only list of fields
configured for the matching index.
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@bigfunger/decompress-zip": "0.2.0-stripfix3",
"@bigfunger/jsondiffpatch": "0.1.38-webpack",
"@elastic/datemath": "2.3.0",
"@elastic/kibana-ui-framework": "0.0.11",
"@elastic/kibana-ui-framework": "0.0.13",
"@spalger/filesaver": "1.1.2",
"@spalger/leaflet-draw": "0.2.3",
"@spalger/leaflet-heat": "0.1.3",
Expand Down Expand Up @@ -165,17 +165,17 @@
"wreck": "6.2.0"
},
"devDependencies": {
"@elastic/eslint-config-kibana": "0.0.3",
"@elastic/eslint-config-kibana": "0.2.1",
"angular-mocks": "1.4.7",
"auto-release-sinon": "1.0.3",
"babel-eslint": "4.1.8",
"babel-eslint": "6.1.2",
"chai": "3.5.0",
"cheerio": "0.22.0",
"chokidar": "1.6.0",
"chromedriver": "2.24.1",
"elasticdump": "2.1.1",
"eslint": "1.10.3",
"eslint-plugin-mocha": "1.1.0",
"eslint": "3.11.1",
"eslint-plugin-mocha": "4.7.0",
"event-stream": "3.3.2",
"expect.js": "0.3.1",
"faker": "1.1.0",
Expand All @@ -189,7 +189,6 @@
"grunt-karma": "2.0.0",
"grunt-run": "0.6.0",
"grunt-simple-mocha": "0.4.0",
"gruntify-eslint": "1.0.1",
"gulp-sourcemaps": "1.7.3",
"handlebars": "4.0.5",
"husky": "0.8.1",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cluster/__tests__/_mock_cluster_fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class MockClusterFork extends EventEmitter {
dead = true;
this.emit('exit');
cluster.emit('exit', this, this.exitCode || 0);
}());
})();
}),
},
isDead: sinon.spy(() => dead),
Expand All @@ -39,6 +39,6 @@ export default class MockClusterFork extends EventEmitter {
await wait();
dead = false;
this.emit('online');
}());
})();
}
}
23 changes: 10 additions & 13 deletions src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,16 @@ module.exports = class ClusterManager {
const chokidar = require('chokidar');
const fromRoot = require('../../utils/from_root');

const watchPaths = uniq(
[
fromRoot('src/core_plugins'),
fromRoot('src/server'),
fromRoot('src/ui'),
fromRoot('src/utils'),
fromRoot('config'),
...extraPaths
]
.map(path => resolve(path))
);

this.watcher = chokidar.watch(watchPaths, {
const watchPaths = [
fromRoot('src/core_plugins'),
fromRoot('src/server'),
fromRoot('src/ui'),
fromRoot('src/utils'),
fromRoot('config'),
...extraPaths
].map(path => resolve(path));

this.watcher = chokidar.watch(uniq(watchPaths), {
cwd: fromRoot('.'),
ignored: /[\\\/](\..*|node_modules|bower_components|public|__tests__)[\\\/]/
});
Expand Down
60 changes: 31 additions & 29 deletions src/core_plugins/console/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
---

root: true
extends: '@elastic/kibana'
extends: '../../../.eslintrc'

rules:
block-scoped-var: [0]
camelcase: [0]
curly: [0]
dot-location: [0]
dot-notation: [0]
eqeqeq: [0]
guard-for-in: [0]
indent: [0]
max-len: [0]
new-cap: [0]
no-caller: [0]
no-empty: [0]
no-extend-native: [0]
no-loop-func: [0]
no-multi-str: [0]
no-nested-ternary: [0]
no-proto: [0]
no-sequences: [0]
no-undef: [0]
no-use-before-define: [0]
one-var: [0]
quotes: [0]
space-before-blocks: [0]
space-in-parens: [0]
space-infix-ops: [0]
semi: [0]
strict: [0]
wrap-iife: [0]
block-scoped-var: off
camelcase: off
curly: off
dot-location: off
dot-notation: off
eqeqeq: off
guard-for-in: off
indent: off
max-len: off
new-cap: off
no-caller: off
no-empty: off
no-extend-native: off
no-loop-func: off
no-multi-str: off
no-nested-ternary: off
no-proto: off
no-sequences: off
no-undef: off
no-use-before-define: off
one-var: off
quotes: off
space-before-blocks: off
space-in-parens: off
space-infix-ops: off
semi: off
strict: off
wrap-iife: off
no-var: off
prefer-const: off
4 changes: 1 addition & 3 deletions src/core_plugins/kbn_vislib_vis_types/public/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function HistogramVisType(Private) {
'effect on the series above it.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand All @@ -27,8 +26,7 @@ export default function HistogramVisType(Private) {
times: [],
addTimeMarker: false,
defaultYExtents: false,
setYExtents: false,
yAxis: {}
setYExtents: false
},
legendPositions: [{
value: 'left',
Expand Down
4 changes: 1 addition & 3 deletions src/core_plugins/kbn_vislib_vis_types/public/histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function HistogramVisType(Private) {
'exact numbers or percentages. If you are not sure which chart you need, you could do worse than to start here.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand All @@ -23,8 +22,7 @@ export default function HistogramVisType(Private) {
times: [],
addTimeMarker: false,
defaultYExtents: false,
setYExtents: false,
yAxis: {}
setYExtents: false
},
legendPositions: [{
value: 'left',
Expand Down
4 changes: 1 addition & 3 deletions src/core_plugins/kbn_vislib_vis_types/public/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function HistogramVisType(Private) {
'Be careful with sparse sets as the connection between points can be misleading.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand All @@ -27,8 +26,7 @@ export default function HistogramVisType(Private) {
times: [],
addTimeMarker: false,
defaultYExtents: false,
setYExtents: false,
yAxis: {}
setYExtents: false
},
legendPositions: [{
value: 'left',
Expand Down
1 change: 0 additions & 1 deletion src/core_plugins/kbn_vislib_vis_types/public/pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function HistogramVisType(Private) {
'Pro Tip: Pie charts are best used sparingly, and with no more than 7 slices per pie.',
params: {
defaults: {
shareYAxis: true,
addTooltip: true,
addLegend: true,
legendPosition: 'right',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import angular from 'angular';
import expect from 'expect.js';
import ngMock from 'ng_mock';
import 'plugins/kibana/dashboard/services/_saved_dashboard';
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../components/panel/lib/panel_state';

describe('dashboard panels', function () {
let $scope;
let $el;

const compile = (dashboard) => {
function compile(dashboard) {
ngMock.inject(($rootScope, $controller, $compile, $route) => {
$scope = $rootScope.$new();
$route.current = {
Expand All @@ -19,12 +20,16 @@ describe('dashboard panels', function () {
$el = angular.element(`
<dashboard-app>
<dashboard-grid style="width: 600px; height: 600px;"></dashboard-grid>
</<dashboard-app>`);
</dashboard-app>`);
$compile($el)($scope);
$scope.$digest();
});
};

function findPanelWithVisualizationId(id) {
return $scope.state.panels.find((panel) => { return panel.id === id; });
}

beforeEach(() => {
ngMock.module('kibana');
});
Expand Down Expand Up @@ -77,10 +82,30 @@ describe('dashboard panels', function () {
compile(dash);
});
expect($scope.state.panels.length).to.be(16);
const foo8Panel = $scope.state.panels.find(
(panel) => { return panel.id === 'foo8'; });
const foo8Panel = findPanelWithVisualizationId('foo8');
expect(foo8Panel).to.not.be(null);
expect(foo8Panel.row).to.be(8);
expect(foo8Panel.col).to.be(1);
});

it('initializes visualizations with the default size', function () {
ngMock.inject((SavedDashboard) => {
let dash = new SavedDashboard();
dash.init();
dash.panelsJSON = `[
{"col":3,"id":"foo1","row":1,"type":"visualization"},
{"col":5,"id":"foo2","row":1,"size_x":5,"size_y":9,"type":"visualization"}]`;
compile(dash);
});
expect($scope.state.panels.length).to.be(2);
const foo1Panel = findPanelWithVisualizationId('foo1');
expect(foo1Panel).to.not.be(null);
expect(foo1Panel.size_x).to.be(DEFAULT_PANEL_WIDTH);
expect(foo1Panel.size_y).to.be(DEFAULT_PANEL_HEIGHT);

const foo2Panel = findPanelWithVisualizationId('foo2');
expect(foo2Panel).to.not.be(null);
expect(foo2Panel.size_x).to.be(5);
expect(foo2Panel.size_y).to.be(9);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export const DEFAULT_PANEL_WIDTH = 3;
export const DEFAULT_PANEL_HEIGHT = 2;

/**
* Represents a panel on a grid. Keeps track of position in the grid and what visualization it
* contains.
*
* @typedef {Object} PanelState
* @property {number} id - Id of the visualization contained in the panel.
* @property {Element} $el - A reference to the gridster widget holding this panel. Used to
* update the size and column attributes. TODO: move out of panel state as this couples state to ui.
* @property {string} type - Type of the visualization in the panel.
* @property {number} panelId - Unique id to represent this panel in the grid.
* @property {number} size_x - Width of the panel.
* @property {number} size_y - Height of the panel.
* @property {number} col - Column index in the grid.
* @property {number} row - Row index in the grid.
*/

/**
* Creates and initializes a basic panel state.
* @param {number} id
* @param {string} type
* @param {number} panelId
* @return {PanelState}
*/
export function createPanelState(id, type, panelId) {
return {
size_x: DEFAULT_PANEL_WIDTH,
size_y: DEFAULT_PANEL_HEIGHT,
panelId: panelId,
type: type,
id: id
};
}
Loading

0 comments on commit 2054287

Please sign in to comment.