Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into implement/str…
Browse files Browse the repository at this point in the history
…eam-utils
  • Loading branch information
spalger committed Feb 10, 2017
2 parents 8566549 + 133e160 commit a93df5a
Show file tree
Hide file tree
Showing 76 changed files with 1,514 additions and 618 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ config/*
coverage
selenium
.babelcache.json
.webpack.babelcache
*.swp
*.swo
*.out
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const camelCase = require('lodash').camelCase;
require('babel/register')(require('./src/optimize/babel_options').node);
require('./src/optimize/babel/register');

module.exports = function (grunt) {
// set the config once before calling load-grunt-config
Expand Down
2 changes: 0 additions & 2 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ startup. Your Kibana users still need to authenticate with Elasticsearch, which
`server.ssl.certificate:` and `server.ssl.key:`:: Paths to the PEM-format SSL certificate and SSL key files, respectively.
`server.ssl.keyPassphrase`:: The passphrase that will be used to decrypt the private key. This value is optional as the key may not be encrypted.
`server.ssl.certificateAuthorities`:: List of paths to PEM encoded certificate files that should be trusted.
`server.ssl.clientAuthentication`:: *Default: none* Controls Kibana's server behavior in regard to requesting a certificate from client connections. Valid values are `required`,
and `none`. `required` forces a client to present a certificate, while `none` does not.
`server.ssl.supportedProtocols`:: *Default: TLSv1, TLSv1.1, TLSv1.2* Supported protocols with versions. Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2`
`server.ssl.cipherSuites`:: *Default: ECDHE-RSA-AES128-GCM-SHA256, ECDHE-ECDSA-AES128-GCM-SHA256, ECDHE-RSA-AES256-GCM-SHA384, ECDHE-ECDSA-AES256-GCM-SHA384, DHE-RSA-AES128-GCM-SHA256, ECDHE-RSA-AES128-SHA256, DHE-RSA-AES128-SHA256, ECDHE-RSA-AES256-SHA384, DHE-RSA-AES256-SHA384, ECDHE-RSA-AES256-SHA256, DHE-RSA-AES256-SHA256, HIGH,!aNULL, !eNULL, !EXPORT, !DES, !RC4, !MD5, !PSK, !SRP, !CAMELLIA*. Details on the format, and the valid options, are available via the [OpenSSL cipher list format documentation](https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-LIST-FORMAT)
`elasticsearch.ssl.cert:` and `elasticsearch.ssl.key:`:: Optional settings that provide the paths to the PEM-format SSL
Expand Down
22 changes: 15 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,18 @@
"ansicolors": "0.3.2",
"autoprefixer": "6.5.4",
"autoprefixer-loader": "2.0.0",
"babel": "5.8.38",
"babel-core": "5.8.38",
"babel-loader": "5.3.2",
"babel-runtime": "5.8.38",
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-loader": "6.2.10",
"babel-plugin-add-module-exports": "0.2.1",
"babel-polyfill": "6.20.0",
"babel-preset-env": "1.1.8",
"babel-preset-es2015": "6.22.0",
"babel-preset-es2015-node": "6.1.1",
"babel-preset-react": "6.22.0",
"babel-preset-stage-1": "6.22.0",
"babel-register": "6.18.0",
"babel-runtime": "6.20.0",
"bluebird": "2.9.34",
"body-parser": "1.12.0",
"boom": "2.8.0",
Expand Down Expand Up @@ -188,7 +196,7 @@
"faker": "1.1.0",
"grunt": "1.0.1",
"grunt-aws-s3": "0.14.5",
"grunt-babel": "5.0.1",
"grunt-babel": "6.0.0",
"grunt-cli": "0.1.13",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-copy": "0.8.1",
Expand All @@ -215,13 +223,13 @@
"keymirror": "0.1.1",
"license-checker": "5.1.2",
"load-grunt-config": "0.19.2",
"makelogs": "3.2.0",
"makelogs": "3.2.2",
"marked-text-renderer": "0.1.0",
"mocha": "2.5.3",
"murmurhash3js": "3.0.1",
"ncp": "2.0.0",
"node-sass": "3.8.0",
"nock": "8.0.0",
"node-sass": "3.8.0",
"npm": "3.10.10",
"portscanner": "1.0.0",
"proxyquire": "1.7.10",
Expand Down
5 changes: 1 addition & 4 deletions src/cli/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
// load the babel options seperately so that they can modify the process.env
// before calling babel/register
const babelOptions = require('../optimize/babel_options').node;
require('babel/register')(babelOptions);
require('../optimize/babel/register');
require('./cli');
5 changes: 1 addition & 4 deletions src/cli_plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
// load the babel options seperately so that they can modify the process.env
// before calling babel/register
const babelOptions = require('../optimize/babel_options').node;
require('babel/register')(babelOptions);
require('../optimize/babel/register');
require('./cli');
6 changes: 5 additions & 1 deletion src/cli_plugin/lib/errors.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export class UnsupportedProtocolError extends Error {}
export function UnsupportedProtocolError() {
Error.call(this, 'Unsupported protocol');
}

UnsupportedProtocolError.prototype = Object.create(Error.prototype);
6 changes: 3 additions & 3 deletions src/core_plugins/dev_mode/public/vis_debug_spy_panel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import visDebugSpyPanelTemplate from 'plugins/dev_mode/vis_debug_spy_panel.html';
// register the spy mode or it won't show up in the spys
require('ui/registry/spy_modes').register(VisDetailsSpyProvider);
import spyModesRegistry from 'ui/registry/spy_modes';

function VisDetailsSpyProvider(Notifier, $filter, $rootScope, config) {
return {
Expand All @@ -16,4 +15,5 @@ function VisDetailsSpyProvider(Notifier, $filter, $rootScope, config) {
};
}

export default VisDetailsSpyProvider;
// register the spy mode or it won't show up in the spys
spyModesRegistry.register(VisDetailsSpyProvider);
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import visTypes from 'ui/registry/vis_types';
visTypes.register(require('plugins/kbn_vislib_vis_types/histogram'));
visTypes.register(require('plugins/kbn_vislib_vis_types/line'));
visTypes.register(require('plugins/kbn_vislib_vis_types/pie'));
visTypes.register(require('plugins/kbn_vislib_vis_types/area'));
visTypes.register(require('plugins/kbn_vislib_vis_types/tile_map'));
visTypes.register(require('plugins/kbn_vislib_vis_types/heatmap'));

import histogramVisTypeProvider from 'plugins/kbn_vislib_vis_types/histogram';
import lineVisTypeProvider from 'plugins/kbn_vislib_vis_types/line';
import pieVisTypeProvider from 'plugins/kbn_vislib_vis_types/pie';
import areaVisTypeProvider from 'plugins/kbn_vislib_vis_types/area';
import tileMapVisTypeProvider from 'plugins/kbn_vislib_vis_types/tile_map';
import heatmapVisTypeProvider from 'plugins/kbn_vislib_vis_types/heatmap';

visTypes.register(histogramVisTypeProvider);
visTypes.register(lineVisTypeProvider);
visTypes.register(pieVisTypeProvider);
visTypes.register(areaVisTypeProvider);
visTypes.register(tileMapVisTypeProvider);
visTypes.register(heatmapVisTypeProvider);
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ describe('dashboard panels', function () {
style="width: 600px; height: 600px;"
ng-if="!hasExpandedPanel()"
on-panel-removed="onPanelRemoved"
panels="state.panels"
get-vis-click-handler="filterBarClickHandler(state)"
get-vis-brush-handler="brushEvent(state)"
panels="panels"
get-vis-click-handler="filterBarClickHandler"
get-vis-brush-handler="brushEvent"
save-state="saveState"
toggle-expand="toggleExpandPanel"
create-child-ui-state="createChildUiState"
Expand All @@ -38,7 +38,7 @@ describe('dashboard panels', function () {
}

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

beforeEach(() => {
Expand All @@ -56,7 +56,7 @@ describe('dashboard panels', function () {
dash.init();
compile(dash);
});
expect($scope.state.panels.length).to.be(0);
expect($scope.panels.length).to.be(0);
});

it('loads one vizualization', function () {
Expand All @@ -66,7 +66,7 @@ describe('dashboard panels', function () {
dash.panelsJSON = `[{"col":3,"id":"foo1","row":1,"size_x":2,"size_y":2,"type":"visualization"}]`;
compile(dash);
});
expect($scope.state.panels.length).to.be(1);
expect($scope.panels.length).to.be(1);
});

it('loads vizualizations in correct order', function () {
Expand All @@ -92,7 +92,7 @@ describe('dashboard panels', function () {
{"col":1,"id":"foo17","row":3,"size_x":4,"size_y":3,"type":"visualization"}]`;
compile(dash);
});
expect($scope.state.panels.length).to.be(16);
expect($scope.panels.length).to.be(16);
const foo8Panel = findPanelWithVisualizationId('foo8');
expect(foo8Panel).to.not.be(null);
expect(foo8Panel.row).to.be(8);
Expand All @@ -108,7 +108,7 @@ describe('dashboard panels', function () {
{"col":5,"id":"foo2","row":1,"size_x":5,"size_y":9,"type":"visualization"}]`;
compile(dash);
});
expect($scope.state.panels.length).to.be(2);
expect($scope.panels.length).to.be(2);
const foo1Panel = findPanelWithVisualizationId('foo1');
expect(foo1Panel).to.not.be(null);
expect(foo1Panel.size_x).to.be(DEFAULT_PANEL_WIDTH);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import ngMock from 'ng_mock';
import expect from 'expect.js';

import { DashboardState } from '../dashboard_state';

describe('DashboardState', function () {
let AppState;
let dashboardState;
let savedDashboard;
let SavedDashboard;
let timefilter;
let quickTimeRanges;

function initDashboardState() {
dashboardState = new DashboardState(savedDashboard, timefilter, true, quickTimeRanges, AppState);
}

beforeEach(ngMock.module('kibana'));
beforeEach(ngMock.inject(function ($injector) {
timefilter = $injector.get('timefilter');
quickTimeRanges = $injector.get('quickRanges');
AppState = $injector.get('AppState');
SavedDashboard = $injector.get('SavedDashboard');
savedDashboard = new SavedDashboard();
}));

describe('timefilter', function () {

describe('when timeRestore is true', function () {
it('syncs quick time', function () {
savedDashboard.timeRestore = true;
savedDashboard.timeFrom = 'now/w';
savedDashboard.timeTo = 'now/w';

timefilter.time.from = '2015-09-19 06:31:44.000';
timefilter.time.to = '2015-09-29 06:31:44.000';
timefilter.time.mode = 'absolute';

initDashboardState();

expect(timefilter.time.mode).to.equal('quick');
expect(timefilter.time.to).to.equal('now/w');
expect(timefilter.time.from).to.equal('now/w');
});

it('syncs relative time', function () {
savedDashboard.timeRestore = true;
savedDashboard.timeFrom = 'now-13d';
savedDashboard.timeTo = 'now';

timefilter.time.from = '2015-09-19 06:31:44.000';
timefilter.time.to = '2015-09-29 06:31:44.000';
timefilter.time.mode = 'absolute';

initDashboardState();

expect(timefilter.time.mode).to.equal('relative');
expect(timefilter.time.to).to.equal('now');
expect(timefilter.time.from).to.equal('now-13d');
});

it('syncs absolute time', function () {
savedDashboard.timeRestore = true;
savedDashboard.timeFrom = '2015-09-19 06:31:44.000';
savedDashboard.timeTo = '2015-09-29 06:31:44.000';

timefilter.time.from = 'now/w';
timefilter.time.to = 'now/w';
timefilter.time.mode = 'quick';

initDashboardState();

expect(timefilter.time.mode).to.equal('absolute');
expect(timefilter.time.to).to.equal(savedDashboard.timeTo);
expect(timefilter.time.from).to.equal(savedDashboard.timeFrom);
});
});

it('is not synced when timeRestore is false', function () {
savedDashboard.timeRestore = false;
savedDashboard.timeFrom = 'now/w';
savedDashboard.timeTo = 'now/w';

timefilter.time.timeFrom = '2015-09-19 06:31:44.000';
timefilter.time.timeTo = '2015-09-29 06:31:44.000';
timefilter.time.mode = 'absolute';

initDashboardState();

expect(timefilter.time.mode).to.equal('absolute');
expect(timefilter.time.timeFrom).to.equal('2015-09-19 06:31:44.000');
expect(timefilter.time.timeTo).to.equal('2015-09-29 06:31:44.000');
});
});
});
12 changes: 6 additions & 6 deletions src/core_plugins/kibana/public/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
parse-query
input-focus
kbn-typeahead-input
ng-model="state.query"
ng-model="model.query"
placeholder="Filter..."
aria-label="Filter input"
type="text"
Expand Down Expand Up @@ -63,9 +63,9 @@ <h2>This dashboard is empty. Let's fill it up!</h2>
<dashboard-grid
ng-show="!hasExpandedPanel()"
on-panel-removed="onPanelRemoved"
panels="state.panels"
get-vis-click-handler="filterBarClickHandler(state)"
get-vis-brush-handler="brushEvent(state)"
panels="panels"
get-vis-click-handler="getFilterBarClickHandler"
get-vis-brush-handler="getBrushEvent"
save-state="saveState"
toggle-expand="toggleExpandPanel"
create-child-ui-state="createChildUiState"
Expand All @@ -76,8 +76,8 @@ <h2>This dashboard is empty. Let's fill it up!</h2>
panel="expandedPanel"
is-full-screen-mode="!chrome.getVisible()"
is-expanded="true"
get-vis-click-handler="filterBarClickHandler(state)"
get-vis-brush-handler="brushEvent(state)"
get-vis-click-handler="getFilterBarClickHandler"
get-vis-brush-handler="getBrushEvent"
save-state="saveState"
create-child-ui-state="createChildUiState"
toggle-expand="toggleExpandPanel(expandedPanel.panelIndex)">
Expand Down
Loading

0 comments on commit a93df5a

Please sign in to comment.