-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:elastic/kibana into implement/str…
…eam-utils
- Loading branch information
Showing
76 changed files
with
1,514 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ config/* | |
coverage | ||
selenium | ||
.babelcache.json | ||
.webpack.babelcache | ||
*.swp | ||
*.swo | ||
*.out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 14 additions & 6 deletions
20
src/core_plugins/kbn_vislib_vis_types/public/kbn_vislib_vis_types.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
src/core_plugins/kibana/public/dashboard/__tests__/dashboard_state.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.