diff --git a/bower.json b/bower.json index 368d64876ab51c..621e43b79c019b 100644 --- a/bower.json +++ b/bower.json @@ -30,7 +30,7 @@ "angular-ui-select": "~0.9.3", "async": "~0.2.10", "bluebird": "~2.1.3", - "bootstrap": "~3.1.1", + "bootstrap": "~3.3.1", "d3": "~3.4.8", "elasticsearch": "elasticsearch/bower-elasticsearch-js#prerelease", "Faker": "~1.1.0", diff --git a/src/kibana/components/agg_table/agg_table.html b/src/kibana/components/agg_table/agg_table.html index bb2c632248d92c..a807370585eca9 100644 --- a/src/kibana/components/agg_table/agg_table.html +++ b/src/kibana/components/agg_table/agg_table.html @@ -5,8 +5,12 @@ per-page="perPage">
- - Export + Export:   + + Raw +     + + Formatted
diff --git a/src/kibana/components/agg_table/agg_table.js b/src/kibana/components/agg_table/agg_table.js index 3698a925c70db5..24d8af3cc7490c 100644 --- a/src/kibana/components/agg_table/agg_table.js +++ b/src/kibana/components/agg_table/agg_table.js @@ -33,15 +33,14 @@ define(function (require) { quoteValues: config.get('csv:quoteValues') }; - self.exportAsCsv = function () { - var csv = new Blob([self.toCsv()], { type: 'text/plain' }); + self.exportAsCsv = function (formatted) { + var csv = new Blob([self.toCsv(formatted)], { type: 'text/plain' }); self._saveAs(csv, self.csv.filename); }; - - self.toCsv = function () { - var rows = $scope.table.rows; - var columns = $scope.table.columns; + self.toCsv = function (formatted) { + var rows = formatted ? $scope.formattedRows : $scope.table.rows; + var columns = formatted ? $scope.formattedColumns : $scope.table.columns; var nonAlphaNumRE = /[^a-zA-Z0-9]/; var allDoubleQuoteRE = /"/g; diff --git a/src/kibana/components/courier/courier.js b/src/kibana/components/courier/courier.js index 5f7e000d5d413a..b9620555b83473 100644 --- a/src/kibana/components/courier/courier.js +++ b/src/kibana/components/courier/courier.js @@ -7,7 +7,7 @@ define(function (require) { require('components/index_patterns/index_patterns'); require('modules').get('kibana/courier') - .service('courier', function ($rootScope, Private, Promise, indexPatterns) { + .service('courier', function ($rootScope, Private, Promise, indexPatterns, Notifier) { function Courier() { var self = this; @@ -32,7 +32,6 @@ define(function (require) { self.SearchSource = SearchSource; var HastyRefresh = errors.HastyRefresh; - var Abort = errors.Abort; /** * update the time between automatic search requests @@ -50,6 +49,7 @@ define(function (require) { */ self.start = function () { searchLooper.start(); + docLooper.start(); return this; }; @@ -108,10 +108,7 @@ define(function (require) { searchLooper.stop(); docLooper.stop(); - [].concat(requestQueue.splice(0), errorHandlers.splice(0)) - .forEach(function (req) { - req.defer.reject(new Abort()); - }); + _.invoke(requestQueue, 'abort'); if (requestQueue.length) { throw new Error('Aborting all pending requests failed.'); @@ -128,6 +125,10 @@ define(function (require) { self.fetchInterval(0); } }); + + var onFatalDefer = Promise.defer(); + onFatalDefer.promise.then(self.close); + Notifier.fatalCallbacks.push(onFatalDefer.resolve); } return new Courier(); diff --git a/src/kibana/components/courier/fetch/_call_client.js b/src/kibana/components/courier/fetch/_call_client.js index 8c30b5ef9d35ad..4e8b985d691571 100644 --- a/src/kibana/components/courier/fetch/_call_client.js +++ b/src/kibana/components/courier/fetch/_call_client.js @@ -77,6 +77,7 @@ define(function (require) { return (esPromise = es[strategy.clientMethod]({ timeout: configFile.shard_timeout, + ignore_unavailable: true, preference: sessionId, body: body })); diff --git a/src/kibana/components/courier/fetch/_call_response_handlers.js b/src/kibana/components/courier/fetch/_call_response_handlers.js index bf24d74b26ff80..b0ccd164ab7f76 100644 --- a/src/kibana/components/courier/fetch/_call_response_handlers.js +++ b/src/kibana/components/courier/fetch/_call_response_handlers.js @@ -19,8 +19,21 @@ define(function (require) { notify.warning(new SearchTimeout()); } + function progress() { + if (req.isIncomplete()) { + return INCOMPLETE; + } + + req.complete(); + return resp; + } + if (resp.error) { - return req.handleFailure(new RequestFailure(null, resp)); + if (req.filterError(resp)) { + return progress(); + } else { + return req.handleFailure(new RequestFailure(null, resp)); + } } return Promise.try(function () { @@ -30,14 +43,7 @@ define(function (require) { resp = arguments[0]; return req.handleResponse(resp); }) - .then(function () { - if (req.isIncomplete()) { - return INCOMPLETE; - } - - req.complete(); - return resp; - }); + .then(progress); }); } diff --git a/src/kibana/components/courier/fetch/request/doc.js b/src/kibana/components/courier/fetch/request/doc.js index 29cb01df120fa1..6f224e0be3c21f 100644 --- a/src/kibana/components/courier/fetch/request/doc.js +++ b/src/kibana/components/courier/fetch/request/doc.js @@ -2,16 +2,16 @@ define(function (require) { return function DocRequestProvider(Private) { var _ = require('lodash'); - var strategy = Private(require('components/courier/fetch/strategy/doc')); + var docStrategy = Private(require('components/courier/fetch/strategy/doc')); var AbstractRequest = Private(require('components/courier/fetch/request/request')); _(DocRequest).inherits(AbstractRequest); function DocRequest(source, defer) { DocRequest.Super.call(this, source, defer); - } - DocRequest.prototype.type = 'doc'; - DocRequest.prototype.strategy = strategy; + this.type = 'doc'; + this.strategy = docStrategy; + } DocRequest.prototype.canStart = function () { var parent = DocRequest.Super.prototype.canStart.call(this); diff --git a/src/kibana/components/courier/fetch/request/request.js b/src/kibana/components/courier/fetch/request/request.js index 215828837ee86e..2d9cbe32c30de9 100644 --- a/src/kibana/components/courier/fetch/request/request.js +++ b/src/kibana/components/courier/fetch/request/request.js @@ -49,6 +49,10 @@ define(function (require) { return resp; }; + AbstractReq.prototype.filterError = function (resp) { + return false; + }; + AbstractReq.prototype.handleResponse = function (resp) { this.success = true; this.resp = resp; diff --git a/src/kibana/components/courier/fetch/request/segmented.js b/src/kibana/components/courier/fetch/request/segmented.js index a6422418d7297f..02565cacaba571 100644 --- a/src/kibana/components/courier/fetch/request/segmented.js +++ b/src/kibana/components/courier/fetch/request/segmented.js @@ -21,11 +21,19 @@ define(function (require) { this._remainingSize = false; this._direction = 'desc'; this._handle = new SegmentedHandle(this); + // prevent the source from changing between requests + this._getFlattenedSource = _.once(this._getFlattenedSource); // give the request consumer a chance to receive each segment and set // parameters via the handle if (_.isFunction(initFn)) initFn(this._handle); + } + + /********* + ** SearchReq overrides + *********/ + SegmentedReq.prototype.start = function () { this._createQueue(); this._all = this._queue.slice(0); this._complete = []; @@ -41,20 +49,9 @@ define(function (require) { } }; - // prevent the source from changing between requests - this._getFlattenedSource = _.once(this._getFlattenedSource); - - // send out the initial status + // Send the initial fetch status this._reportStatus(); - } - /********* - ** SearchReq overrides - *********/ - - SegmentedReq.prototype.start = function () { - // update the status on every iteration - this._reportStatus(); return SearchReq.prototype.start.call(this); }; @@ -84,6 +81,13 @@ define(function (require) { return this._consumeSegment(resp); }; + SegmentedReq.prototype.filterError = function (resp) { + if (/ClusterBlockException.*index\sclosed/.test(resp.error)) { + this._consumeSegment(false); + return true; + } + }; + SegmentedReq.prototype.isIncomplete = function () { return this._queue.length > 0; }; @@ -136,13 +140,16 @@ define(function (require) { }; SegmentedReq.prototype._consumeSegment = function (seg) { - this._segments.push(seg); var index = this._active; - var first = this._segments.length === 1; + var first = this._segments.length === 0; this._complete.push(index); + if (!seg) return; // segment was ignored/filtered, don't store it + + this._segments.push(seg); + if (this._remainingSize !== false) { this._remainingSize -= seg.hits.hits.length; } diff --git a/src/kibana/components/courier/looper/_looper.js b/src/kibana/components/courier/looper/_looper.js index 6f5eb3d8589f62..b660c5ebc0658a 100644 --- a/src/kibana/components/courier/looper/_looper.js +++ b/src/kibana/components/courier/looper/_looper.js @@ -18,6 +18,9 @@ define(function (require) { */ looper.ms = function (ms) { _ms = ms; + + if (!_started) return; + if (_ms) { looper.restart(); } else { diff --git a/src/kibana/components/courier/looper/doc.js b/src/kibana/components/courier/looper/doc.js index 7090fee4077aa2..5021c36c5a0743 100644 --- a/src/kibana/components/courier/looper/doc.js +++ b/src/kibana/components/courier/looper/doc.js @@ -9,7 +9,7 @@ define(function (require) { */ var docLooper = new Looper(1500, function () { fetch.docs(); - }).start(); + }); return docLooper; }; diff --git a/src/kibana/components/index_patterns/_get_ids.js b/src/kibana/components/index_patterns/_get_ids.js index 757ecdb705679f..3d0b91d4a5c0cd 100644 --- a/src/kibana/components/index_patterns/_get_ids.js +++ b/src/kibana/components/index_patterns/_get_ids.js @@ -20,7 +20,7 @@ define(function (require) { fields: [], body: { query: { match_all: {} }, - size: 10000 + size: 2147483647 } }) .then(function (resp) { diff --git a/src/kibana/components/notify/notify.js b/src/kibana/components/notify/notify.js index 24c609e07b45df..fedcde19e91f7d 100644 --- a/src/kibana/components/notify/notify.js +++ b/src/kibana/components/notify/notify.js @@ -20,16 +20,9 @@ define(function (require) { return Notifier; }); - module.run(function ($timeout, Promise, courier) { + module.run(function ($timeout) { // provide alternate methods for setting timeouts, which will properly trigger digest cycles Notifier.setTimerFns($timeout, $timeout.cancel); - - var onFatalDefer = Promise.defer(); - onFatalDefer.promise.then(function () { - courier.close(); - }); - - Notifier.fatalCallbacks.push(onFatalDefer.resolve); }); /** diff --git a/src/kibana/components/vis/_agg_config.js b/src/kibana/components/vis/_agg_config.js index d0b492a17aa11e..c090014d5ff881 100644 --- a/src/kibana/components/vis/_agg_config.js +++ b/src/kibana/components/vis/_agg_config.js @@ -100,7 +100,8 @@ define(function (require) { * @return {object} the new params object */ AggConfig.prototype.resetParams = function () { - return this.fillDefaults({}); + // We need to ensure that row doesn't get overriden. + return this.fillDefaults(_.pick(this.params, 'row')); }; AggConfig.prototype.write = function () { diff --git a/src/kibana/plugins/dashboard/index.html b/src/kibana/plugins/dashboard/index.html index 03543f689818e6..56d173d341cb64 100644 --- a/src/kibana/plugins/dashboard/index.html +++ b/src/kibana/plugins/dashboard/index.html @@ -1,7 +1,7 @@
-
{{hits || 0}} hits
- - -
-
-

No results found

- -

- Unfortunately I could not find any results matching your search. I tried really hard. I looked all over the place and frankly, I just couldn't find anything good. Help me, help you. Here's some ideas: -

- -
-

Shard Failures

-

The following shard failures ocurred:

-
    -
  • Index: {{failure.index}} Shard: {{failure.shard}} Reason: {{failure.reason}}
  • -
- Show More - Show Less -
- -
-

-

Expand your time range

-

I see you are looking at an index with a date field. It is possible your query does not match anything in the current time range, or that there is not data at all in the currently selected time range. Click the button below to open the time picker. For future reference you can open the time picker by clicking the time picker in the top right corner of your screen. -

-
- -

Refine your query

-

- The search bar at the top allows Kibana uses Elasticsearch's support for Lucene Query String syntax. Let's say we're searching web server logs that have been parsed into a few fields. -

- -

- -

Examples:

- Find requests that contain the number 200, in any field: -
200
- - Or we can search in a specific field. Find 200 in the status field: -
status:200
- - Find all status codes between 400-499: -
status:[400 TO 499]
- - Find status codes 400-499 with the extension php: -
status:[400 TO 499] AND extension:PHP
+
- Or HTML -
status:[400 TO 499] AND (extension:php OR extension:html)
-

+
+ + + + + {{(hits || 0) | number:0}} hits +
+
+ +
+
+ +

No results found

+ +

+ Unfortunately I could not find any results matching your search. I tried really hard. I looked all over the place and frankly, I just couldn't find anything good. Help me, help you. Here's some ideas: +

+ +
+

Shard Failures

+

The following shard failures ocurred:

+
    +
  • Index: {{failure.index}} Shard: {{failure.shard}} Reason: {{failure.reason}}
  • +
+ Show More + Show Less +
+ +
+

+

Expand your time range

+

I see you are looking at an index with a date field. It is possible your query does not match anything in the current time range, or that there is not data at all in the currently selected time range. Click the button below to open the time picker. For future reference you can open the time picker by clicking the time picker in the top right corner of your screen. +

+
+ +

Refine your query

+

+ The search bar at the top allows Kibana uses Elasticsearch's support for Lucene Query String syntax. Let's say we're searching web server logs that have been parsed into a few fields. +

+ +

+

Examples:

+ Find requests that contain the number 200, in any field: +
200
+ + Or we can search in a specific field. Find 200 in the status field: +
status:200
+ + Find all status codes between 400-499: +
status:[400 TO 499]
+ + Find status codes 400-499 with the extension php: +
status:[400 TO 499] AND extension:PHP
+ + Or HTML +
status:[400 TO 499] AND (extension:php OR extension:html)
+

+ +
-
- - -
-
-

Searching

-
-
{{fetchStatus.complete}}/{{fetchStatus.total}}
-
-
- -
-

- - -

-
-
- {{timeRange.from | moment}} - {{timeRange.to | moment}} - - -
- -
-
+ +
+
+

Searching

+
+
{{fetchStatus.complete}}/{{fetchStatus.total}}
+
- -
+ +
+
+
+ {{timeRange.from | moment}} - {{timeRange.to | moment}} + + +
+ +
+
+
+ + +
-
- - - - -
diff --git a/src/kibana/plugins/discover/partials/table_header.html b/src/kibana/plugins/discover/partials/table_header.html index e1a7c8aa6fc4c7..f1767a839be4fb 100644 --- a/src/kibana/plugins/discover/partials/table_header.html +++ b/src/kibana/plugins/discover/partials/table_header.html @@ -1,13 +1,13 @@ - Time + Time - + {{name | shortDots}} - - + + \ No newline at end of file diff --git a/src/kibana/plugins/discover/styles/main.less b/src/kibana/plugins/discover/styles/main.less index 5aea5f2b6ced2b..87ee1ebf78a190 100644 --- a/src/kibana/plugins/discover/styles/main.less +++ b/src/kibana/plugins/discover/styles/main.less @@ -6,117 +6,139 @@ overflow-x: hidden; } -.discover-timechart { - margin-bottom: 20px; - display: block; - position: relative; +.discover { + + &-wrapper { + padding-right: 0px !important; + } - visualize { - height: 200px; - max-height: 600px; + &-content { + padding-right: @padding-base-horizontal; + clear: both; + } + + &-timechart { + margin-bottom: 20px; + display: block; + position: relative; - &.only-spy { - height: auto; + visualize { + height: 200px; + max-height: 600px; - .visualize-table { + &.only-spy { height: auto; + + .visualize-table { + height: auto; + } } } + + .chartwrapper { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + + &.vis-overlay { + display: flex; + align-items: center; + } } - .chartwrapper { + &-overlay { position: absolute; top: 0; left: 0; - width: 100%; - height: 100%; - } -} + bottom: 0; + right: 0; + z-index: 20; -.shard-failures { - color: @brand-danger; - background-color: lighten(@brand-danger, 40%) !important; - border: 1px solid @brand-danger; - border-radius: @border-radius-base; - padding: 0 20px 20px; - li { - padding-bottom: 5px; + opacity: 0.75; + text-align: center; + background-color: #ffffff; + + // spinner and prorgess counter + > div { + text-align: center; + } } -} -.discover-overlay { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - z-index: 20; + &-info { + background-color: @well-bg; + float: right; + padding: 5px 10px; + border-bottom-left-radius: @border-radius-base; - opacity: 0.75; - text-align: center; - background-color: #ffffff; + text-align: right; - // spinner and prorgess counter - > div { - text-align: center; + &-title { + font-weight: bold; + margin-right: 10px; + } } - &.vis-overlay { - display: flex; - align-items: center; - } -} + &-table { + overflow-y: auto; + overflow-x: auto; + padding-left: 0px !important; + padding-right: 0px !important; -.discover-hits { - background-color: @well-bg; - float: right; - padding: 5px 10px; - border-bottom-left-radius: @border-radius-base; -} + tbody { + font-family: "Lucida Console", Monaco, monospace; + } -.discover-table { - overflow-y: auto; - overflow-x: auto; - padding-left: 0px !important; - padding-right: 0px !important; + &-footer { + background-color: @well-bg; + padding: 5px 10px; + } - tbody { - font-family: "Lucida Console", Monaco, monospace; - } + &-details-toggle { + margin-bottom: 3px; + } - &-timefield { - white-space: nowrap; - } + &-timefield { + white-space: nowrap; + } - &-open-icon { - // when switching between open and closed, the toggle changes size - // slightly which is a problem because it forces the entire table to - // re-render which is SLOW - width: 7px; + &-open-icon { + // when switching between open and closed, the toggle changes size + // slightly which is a problem because it forces the entire table to + // re-render which is SLOW + width: 7px; + } } -} -.discover-table-footer { - background-color: @well-bg; - padding: 5px 10px; -} + &-field { + &-filter { + background-color: @well-bg; + margin-right: 10px; -.discover-table-details-toggle { - margin-bottom: 3px; -} + .form-group { + margin-bottom: 0px; + } -.discover-field-filter { - background-color: @well-bg; - margin-right: 10px; + } - .form-group { - margin-bottom: 0px; + &-toggle { + color: @btn-success-color; + font-size: 9px; + } } } -.discover-field-filter-toggle { - color: @btn-success-color; - font-size: 9px; +.shard-failures { + color: @brand-danger; + background-color: lighten(@brand-danger, 40%) !important; + border: 1px solid @brand-danger; + border-radius: @border-radius-base; + padding: 0 20px 20px; + li { + padding-bottom: 5px; + } } .sidebar-item button.discover-field-toggle { @@ -132,47 +154,47 @@ display: block; } -.discover-field-details-close { - text-align: center; - border-top: 1px solid @well-border; - background-color: @well-bg; - - &:hover { - background-color: @sidebar-hover-bg; - color: @sidebar-hover-color; - } -} - .discover-field-details { border-top: 1px solid @well-border; padding: 5px 10px; background-color: @body-bg; color: @text-color; - .discover-field-details-count { - white-space: nowrap; - } + &-close { + text-align: center; + border-top: 1px solid @well-border; + background-color: @well-bg; - a { - color: @link-color !important; + &:hover { + background-color: @sidebar-hover-bg; + color: @sidebar-hover-color; + } } - a.btn { - color: @text-color !important; + &-count { + white-space: nowrap; } - .discover-field-details-error { + &-error { margin-top: 5px; } - .discover-field-details-item { + &-item { margin-top: 5px; } - .discover-field-details-filter { + &-filter { cursor: pointer; } + a { + color: @link-color !important; + } + + a.btn { + color: @text-color !important; + } + .progress { margin-bottom: 0px; diff --git a/src/kibana/plugins/visualize/editor/editor.html b/src/kibana/plugins/visualize/editor/editor.html index 313edbd5a90da7..4d933ed742185c 100644 --- a/src/kibana/plugins/visualize/editor/editor.html +++ b/src/kibana/plugins/visualize/editor/editor.html @@ -96,6 +96,7 @@
+
-

+
+
+ +
+
+
diff --git a/src/kibana/plugins/visualize/editor/styles/editor.less b/src/kibana/plugins/visualize/editor/styles/editor.less index d324377851ff41..500881273c9f4e 100644 --- a/src/kibana/plugins/visualize/editor/styles/editor.less +++ b/src/kibana/plugins/visualize/editor/styles/editor.less @@ -22,6 +22,13 @@ color: white; text-align: center; padding-top: 6px; + + // Don't overflow container + padding-left: 20px; + padding-right: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; .user-select(none); } diff --git a/src/kibana/plugins/visualize/styles/main.less b/src/kibana/plugins/visualize/styles/main.less index d7e961a4065760..a42dac8a4885c0 100644 --- a/src/kibana/plugins/visualize/styles/main.less +++ b/src/kibana/plugins/visualize/styles/main.less @@ -20,4 +20,19 @@ font-size: 1.2em; } +.visualize-info { + align-self: flex-end; + + &-tab { + background-color: @well-bg; + padding: 5px 10px; + margin-left: @padding-base-horizontal; + border-bottom-left-radius: @border-radius-base; + text-align: right; + font-weight: bold; + } + + +} + @import "../editor/styles/editor.less"; diff --git a/src/kibana/styles/theme/_variables.less b/src/kibana/styles/theme/_variables.less index abf3301ba91fe8..8b2b3a5d9e7e6e 100644 --- a/src/kibana/styles/theme/_variables.less +++ b/src/kibana/styles/theme/_variables.less @@ -35,8 +35,14 @@ @link-color: #1F6B7A; //** Link hover color set via `darken()` function. @link-hover-color: lighten(@link-color, 10%); +@link-hover-decoration: none; +@dl-horizontal-offset: @component-offset-horizontal; + +//** Disabled cursor for form controls and buttons. +@cursor-disabled: not-allowed; + //== Typography // //## Font, line-height, and color for body text, headings, and more. @@ -180,8 +186,15 @@ @input-color: @text-color; //** `` border color @input-border: @gray-lighter; -//** `` border radius + +// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4 +//** Default `.form-control` border radius @input-border-radius: @border-radius-base; +//** Large `.form-control` border radius +@input-border-radius-large: @border-radius-large; +//** Small `.form-control` border radius +@input-border-radius-small: @border-radius-small; + //** Border color for inputs on focus @input-border-focus: @gray-light; @@ -635,6 +648,9 @@ //** Progress bar text color @progress-bar-color: #fff; +//** Variable for setting rounded corners on progress bar. +@progress-border-radius: @border-radius-base; + //** Default progress bar color @progress-bar-bg: @brand-primary; //** Success progress bar color @@ -654,21 +670,30 @@ //** Background color on `.list-group-item` @list-group-bg: #fff; //** `.list-group-item` border color -@list-group-border: @gray-lighter; +@list-group-border: #ddd; //** List group border radius @list-group-border-radius: @border-radius-base; -//** Background color of single list elements on hover -@list-group-hover-bg: @gray-lighter; -//** Text color of active list elements -@list-group-active-color: @component-active-color; -//** Background color of active list elements +//** Background color of single list items on hover +@list-group-hover-bg: #f5f5f5; +//** Text color of active list items +@list-group-active-color: @text-color; +//** Background color of active list items @list-group-active-bg: @component-active-bg; //** Border color of active list elements @list-group-active-border: @list-group-active-bg; +//** Text color for content within active list items @list-group-active-text-color: lighten(@list-group-active-bg, 40%); +//** Text color of disabled list items +@list-group-disabled-color: @gray-light; +//** Background color of disabled list items +@list-group-disabled-bg: @gray-lighter; +//** Text color for content within disabled list items +@list-group-disabled-text-color: @list-group-disabled-color; + @list-group-link-color: #555; +@list-group-link-hover-color: @list-group-link-color; @list-group-link-heading-color: #333; @@ -678,15 +703,17 @@ @panel-bg: #fff; @panel-body-padding: 15px; +@panel-heading-padding: 10px 15px; +@panel-footer-padding: @panel-heading-padding; @panel-border-radius: @border-radius-base; //** Border color for elements within panels -@panel-inner-border: @gray-lighter; -@panel-footer-bg: @gray-lighter; +@panel-inner-border: #ddd; +@panel-footer-bg: #f5f5f5; -@panel-default-text: @text-color; -@panel-default-border: @gray-lighter; -@panel-default-heading-bg: @gray-lighter; +@panel-default-text: @gray-dark; +@panel-default-border: #ddd; +@panel-default-heading-bg: #f5f5f5; @panel-primary-text: #fff; @panel-primary-border: @brand-primary; diff --git a/test/unit/index.html b/test/unit/index.html index 8f42ce75b9e3c3..2bbdf80c88efd7 100644 --- a/test/unit/index.html +++ b/test/unit/index.html @@ -87,6 +87,10 @@ var deps = JSON.parse(specListJson); deps.unshift('sinon/sinon'); deps.unshift('kibana'); + + sessionStorage.clear(); + localStorage.clear(); + require(deps, bootstrap); } diff --git a/test/unit/specs/apps/discover/directives/table.js b/test/unit/specs/apps/discover/directives/table.js index 111ed933bfd4ea..8a99966946ce65 100644 --- a/test/unit/specs/apps/discover/directives/table.js +++ b/test/unit/specs/apps/discover/directives/table.js @@ -116,26 +116,30 @@ define(function (require) { }); it('should sort asc by default, then by desc if already sorting', function (done) { - var field = 'bytes'; + var fields = ['bytes', '@timestamp']; // Should not be sorted at first expect($scope.sorting).to.eql(undefined); - expect($scope.headerClass(field)).to.contain('fa-sort'); + expect($scope.headerClass(fields[0])).to.contain('fa-sort-up'); - $scope.sort(field); - expect($scope.sorting).to.eql([field, 'asc']); - expect($scope.headerClass(field)).to.contain('fa-sort-up'); + $scope.sort(fields[0]); + expect($scope.sorting).to.eql([fields[0], 'asc']); + expect($scope.headerClass(fields[0])).to.contain('fa-sort-up'); - $scope.sort(field); - expect($scope.sorting).to.eql([field, 'desc']); - expect($scope.headerClass(field)).to.contain('fa-sort-down'); + $scope.sort(fields[0]); + expect($scope.sorting).to.eql([fields[0], 'desc']); + expect($scope.headerClass(fields[0])).to.contain('fa-sort-down'); - $scope.sort(field); - expect($scope.sorting).to.eql([field, 'asc']); - expect($scope.headerClass(field)).to.contain('fa-sort-up'); + $scope.sort(fields[0]); + expect($scope.sorting).to.eql([fields[0], 'asc']); + expect($scope.headerClass(fields[0])).to.contain('fa-sort-up'); - // Should show the default sort for any other field - expect($scope.headerClass('@timestamp')).to.contain('fa-sort'); + $scope.sort(fields[1]); + expect($scope.sorting).to.eql([fields[1], 'asc']); + expect($scope.headerClass(fields[1])).to.contain('fa-sort-up'); + + // Should show the default sort for any other fields[0] + expect($scope.headerClass(fields[0])).to.contain('fa-sort-up'); done(); }); diff --git a/test/unit/specs/components/courier/fetch/fetch.tests.js b/test/unit/specs/components/courier/fetch/fetch.tests.js deleted file mode 100644 index b5abf2f54fb985..00000000000000 --- a/test/unit/specs/components/courier/fetch/fetch.tests.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function (require) { - describe('Courier Fetch', function () { - run(require('specs/components/courier/fetch/strategy/_segmented')); - run(require('specs/components/courier/fetch/_segmented_state')); - function run(mod) { describe(mod[0], mod[1]); } - }); -}); \ No newline at end of file diff --git a/test/unit/specs/components/doc_title/doc_title.js b/test/unit/specs/components/doc_title/doc_title.js index 8bd6c9c486ad13..8777449a845d52 100644 --- a/test/unit/specs/components/doc_title/doc_title.js +++ b/test/unit/specs/components/doc_title/doc_title.js @@ -34,19 +34,15 @@ define(function (require) { describe('setup', function () { it('resets the title when a route change begins', function () { - var call; var spy = $rootScope.$on; - for (var i = 0; i < spy.callCount; i++) { - if (spy.args[i][0] === '$routeChangeStart') { - call = spy.getCall(i); - break; - } - } - if (!call) throw new Error('$rootScope.$on not called'); + var found = spy.args.some(function (args) { + return args[0] === '$routeChangeStart' && args[1] === docTitle.reset; + }); - expect(call.args[0]).to.be('$routeChangeStart'); - expect(call.args[1]).to.be(docTitle.reset); + if (!found) { + throw new Error('$rootScope.$on not called'); + } }); }); diff --git a/test/unit/specs/directives/timepicker.js b/test/unit/specs/directives/timepicker.js index b1ee1d481e829f..205a78385973b3 100644 --- a/test/unit/specs/directives/timepicker.js +++ b/test/unit/specs/directives/timepicker.js @@ -85,14 +85,14 @@ define(function (require) { var $courier; beforeEach(function () { init(); - // Inject courier object - inject(function (courier) { + inject(function (courier, $rootScope) { $courier = courier; + $rootScope.$apply(); }); }); it('should contain a list of options', function (done) { - expect($elem.find('.kbn-refresh-list').length).to.be(1); + expect($elem.find('.kbn-refresh-section').length).to.be.greaterThan(0); done(); }); @@ -131,14 +131,14 @@ define(function (require) { }); it('should highlight the right mode', function (done) { - expect($elem.find('.kbn-timepicker-modes .active').text()).to.be('quick'); + expect($elem.find('.kbn-timepicker-modes .active').text().trim()).to.be('quick'); // Each of the 3 modes var modes = ['absolute', 'relative', 'quick']; _.each(modes, function (mode) { $scope.setMode(mode); $scope.$digest(); - expect($elem.find('.kbn-timepicker-modes .active').text()).to.be(mode); + expect($elem.find('.kbn-timepicker-modes .active').text().trim()).to.be(mode); }); done(); diff --git a/test/unit/specs/factories/events.js b/test/unit/specs/factories/events.js index 3ed79969ed8857..b730c83201bfbf 100644 --- a/test/unit/specs/factories/events.js +++ b/test/unit/specs/factories/events.js @@ -4,7 +4,7 @@ define(function (require) { var sinon = require('test_utils/auto_release_sinon'); require('services/private'); - describe.only('Events', function () { + describe('Events', function () { require('test_utils/no_digest_promises').activateForSuite(); var $rootScope;