-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix timepicker button behavior in "No Results" page for timeseries data #6543
Merged
bevacqua
merged 9 commits into
elastic:master
from
bevacqua:bugfix/no-results-timepicker
Jun 2, 2016
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
348a939
[bugfix] Fix timepicker button behavior in "No Results" page. Fixes #…
bevacqua 4036c46
[test/functional] Functional tests covering new "No Results" partial …
bevacqua bc0278f
[test/functional] Add test case for expand/collapse timepicker from d…
bevacqua 7ff2a35
Merge branch 'master' into bugfix/no-results-timepicker
bevacqua 912e2c8
[merge] Merge with master
bevacqua 17c1ce4
Merge branch 'master' into bugfix/no-results-timepicker
bevacqua 50581a8
[test] Fix test cases for No Results page.
bevacqua b3b3128
[test] Return all the Promises.
bevacqua 496b8a9
[test] Fix test fixtures.
bevacqua File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/plugins/kibana/public/discover/directives/no_results.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,13 @@ | ||
import _ from 'lodash'; | ||
import $ from 'jquery'; | ||
import uiModules from 'ui/modules'; | ||
import noResultsTemplate from '../partials/no_results.html'; | ||
|
||
uiModules | ||
.get('apps/discover') | ||
.directive('discoverNoResults', function () { | ||
return { | ||
restrict: 'E', | ||
template: noResultsTemplate | ||
}; | ||
}); |
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
51 changes: 51 additions & 0 deletions
51
src/plugins/kibana/public/discover/partials/no_results.html
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,51 @@ | ||
<div data-test-subj="discoverNoResults"> | ||
<div class="col-md-10 col-md-offset-1"> | ||
|
||
<h1>No results found <i aria-hidden="true" class="fa fa-meh-o"></i></h1> | ||
|
||
<p> | ||
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 are some ideas: | ||
</p> | ||
|
||
<div class="shard-failures" ng-show="failures"> | ||
<h3>Shard Failures</h3> | ||
<p>The following shard failures ocurred:</p> | ||
<ul> | ||
<li ng-repeat="failure in failures | limitTo: failuresShown"><strong>Index:</strong> {{failure.index}} <strong>Shard:</strong> {{failure.shard}} <strong>Reason:</strong> {{failure.reason}} </li> | ||
</ul> | ||
<a ng-click="showAllFailures()" ng-if="failures.length > failuresShown" title="Show More">Show More</a> | ||
<a ng-click="showLessFailures()" ng-if="failures.length === failuresShown && failures.length > 5" title="Show Less">Show Less</a> | ||
</div> | ||
|
||
<div ng-show="opts.timefield"> | ||
<p> | ||
<h3>Expand your time range</h3> | ||
<p>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 no 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 on the <a class="btn btn-xs navbtn" ng-click="configTemplate.toggle('filter')" aria-expanded="configTemplate.is('filter')" aria-label="time picker" data-test-subj="discoverNoResultsTimefilter"><i aria-hidden="true" class="fa fa-clock-o"></i> time picker</a> button in the top right corner of your screen. | ||
</p> | ||
</div> | ||
|
||
<h3>Refine your query</h3> | ||
<p> | ||
The search bar at the top uses Elasticsearch's support for Lucene <a href="http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax" target="_blank">Query String syntax</a>. Let's say we're searching web server logs that have been parsed into a few fields. | ||
</p> | ||
|
||
<p> | ||
<h4>Examples:</h4> | ||
Find requests that contain the number 200, in any field: | ||
<pre>200</pre> | ||
|
||
Or we can search in a specific field. Find 200 in the status field: | ||
<pre>status:200</pre> | ||
|
||
Find all status codes between 400-499: | ||
<pre>status:[400 TO 499]</pre> | ||
|
||
Find status codes 400-499 with the extension php: | ||
<pre>status:[400 TO 499] AND extension:PHP</pre> | ||
|
||
Or HTML | ||
<pre>status:[400 TO 499] AND (extension:php OR extension:html)</pre> | ||
</p> | ||
|
||
</div> | ||
</div> |
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 |
---|---|---|
|
@@ -241,6 +241,11 @@ import { | |
.catch(common.handleError(this)); | ||
}); | ||
|
||
bdd.it('should not show "no results"', () => { | ||
discoverPage.hasNoResults().then(visible => { | ||
expect(visible).to.be(false); | ||
}); | ||
}); | ||
|
||
function verifyChartData(expectedBarChartData) { | ||
return common.tryForTime(20 * 1000, function tryingForTime() { | ||
|
@@ -270,6 +275,50 @@ import { | |
} | ||
|
||
}); | ||
|
||
|
||
bdd.describe('query #2, which has an empty time range', function () { | ||
var fromTime = '1999-06-11 09:22:11.000'; | ||
var toTime = '1999-06-12 11:21:04.000'; | ||
|
||
bdd.before(() => { | ||
common.debug('setAbsoluteRangeForAnotherQuery'); | ||
return headerPage | ||
.setAbsoluteRange(fromTime, toTime) | ||
.catch(common.handleError(this)); | ||
}); | ||
|
||
bdd.it('should show "no results"', () => { | ||
discoverPage.hasNoResults().then(visible => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. return the promise, more below |
||
expect(visible).to.be(true); | ||
}) | ||
.catch(common.handleError(this)); | ||
}); | ||
|
||
bdd.it('should suggest a new time range is picked', () => { | ||
discoverPage.hasNoResultsTimepicker().then(visible => { | ||
expect(visible).to.be(true); | ||
}) | ||
.catch(common.handleError(this)); | ||
}); | ||
|
||
bdd.it('should open and close the time picker', () => { | ||
isTimepickerOpen(false) | ||
.click() | ||
.then(() => isTimepickerOpen(true)) | ||
.click() | ||
.then(() => isTimepickerOpen(false)) | ||
.catch(common.handleError(this)); | ||
|
||
function isTimepickerOpen(expected) { | ||
return headerPage.isTimepickerOpen().then(shown => { | ||
expect(shown).to.be(expected); | ||
return discoverPage.getNoResultsTimepicker(); | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
}); | ||
}()); | ||
}()); |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to return a promise