-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Indicate search results are limited to the sample size in a saved search on dashboard #10827
Indicate search results are limited to the sample size in a saved search on dashboard #10827
Conversation
bd6a2bb
to
2bd57fa
Compare
Jenkins failure: (
jenkins, test this |
2bd57fa
to
8f5a148
Compare
@@ -20,6 +20,12 @@ | |||
class="discover-table-row"></tr> | |||
</tbody> | |||
</table> | |||
<div ng-if="hits.length === sampleSize && page.last" class="discover-table-footer"> | |||
<center> |
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.
@cjcenizal I'm tempted to say we shouldn't use <center>
tags, do you agree?
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.
Ah, yes definitely. Centering should be done in CSS, preferably with flexbox, but using text-align: center
is also an option. In this case, I'd check the .discover-table-footer
class to see if it makes sense to add these styles to that class. If there are situations where we don't want to center it's content, then create a new class, e.g..discover-table-footer-prompt
, and apply the style there. The updated markup would look like this:
<div ng-if="hits.length === sampleSize && page.last" class="discover-table-footer">
<div class="discover-table-footer-prompt">
These are the first {{sampleSize}} documents matching
your search, refine your search to see others.
</div>
</div>
Eventually we'll want to replace these styles with UI Framework components, of course.
@@ -20,6 +20,12 @@ | |||
class="discover-table-row"></tr> | |||
</tbody> | |||
</table> | |||
<div ng-if="hits.length === sampleSize && page.last" class="discover-table-footer"> |
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.
In discover, $scope.hits
is the total number of results. Maybe we should pass that to the doc_table and it should use that to determine if this should be shown (which means it could also tell the user how many rows are hidden).
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.
We can't tell the user how many rows are hidden when using this from dashboard because we don't have the total number of results in that case, we are only passing searchSource.
Discover won't ever show this part because it uses infiniteScroll and passes hits instead of using searchSource & setting hits. I agree it's unintuitive that hits
is two different things depending on infiniteScroll and searchSource, but I don't want to get into a refactor since this is a Mend it Monday low fruit
issue and if I make larger modifications it should probably go through testing. Thoughts?
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.
Oh the other thing is that in the discover footer now, there is a back to top
link where the logic is in discover, not in doc table. I got rid of that, since it doesn't make sense esp if this error message goes on top, not on the bottom.
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.
Forgot that this is used outside of discover
The other issue in #4161 was that on the first page you don't know that the results have been limited. Could there be some kind of indication on the pager perhaps, or at the top of the first page? |
23d0d62
to
e361825
Compare
Took into account @jimmyjones2 feedback and moved the warning back to the first page, on top. Split out the styles since it's no longer a footer, and was never part of discover anyhow. And got rid of the center tag. @cjcenizal @snide I went back to the first page, on top ^^ |
@stacey-gammon, one minor problem I have is that it takes up a lot of space on the first page. I have several dashboards that have multiple discover searches on it. I'd like to see as much data as possible but now with this warning and with the pagination, I see a lot less than I did which requires either scrolling or increasing the panel sizes. |
Could the warning be inline with the pager, so doesn't consume vertical space? Would just "limited to first 500 results" suffice? |
e361825
to
ca1cc4a
Compare
Hmm, I think it does look better on the right side. I think we can declutter the UI by hiding the warning message behind a tooltip. @snide @uboness thoughts? @stacey-gammon If we go this route, we'll need to add a custom class to the Bar element here, which adds |
+1 on right alignment regarding the message, not sure if the tooltip will be too hidden. We could have a "calmer" text showing closer to the nav control... not sure... need to see it in action.. might be that a tooltip is good enough |
Right alignment is good. I'd use whatever our light gray text color is and make the text more succinct to keep it from being so heavy. "Limited to 500 results. Refine your search." should get the point across. |
@snide - Good suggestions, I'll add them shortly. |
++
++ |
@snide Good suggestions! Let's do it. |
@stacey-gammon Looks good, but the order should go [Limited message] [Result count] [Buttons], to retain as close a pattern to what we currently use: |
jenkins test this |
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.
LGTM
@cjcenizal Does |
Just the screenshot. I can do a code review too if you want. |
@cjcenizal I do need a second reviewer so that would be great, but can tag someone else if you are busy! |
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.
src/ui/public/doc_table/doc_table.js
Outdated
|
||
return $scope.searchSource.onResults().then(onResults); | ||
}).catch(notify.fatal); | ||
|
||
$scope.searchSource.onError(notify.error).catch(notify.fatal); | ||
})); | ||
|
||
const limitTo = $filter('limitTo'); | ||
const calculateItemsOnPage = () => { |
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.
How about moving limitTo
and calculateItemsOnPage
up to line 53 where the other non-scope variables are? This way the non-scope and scope variables/methods will be grouped together, and you can remove the eslint-disable-line
annotation on 111.
background-color: @doc-table-warning-bg; | ||
padding: 5px 10px; | ||
text-align: center; | ||
} |
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.
Is this class being used anywhere?
ng-class="{ loading: searchSource.activeFetchCount > 0 }" | ||
> | ||
<div ng-if="!infiniteScroll"> | ||
<div class="kuiBar"> |
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.
I updated UI Framework with a new treatment for making the text gray. Can you rebase and update the markup to this:
<div class="kuiBar docTableBar">
<div class="kuiBarSection">
<div
ng-if="shouldShowLimitedResultsWarning()"
class="kuiToolBarText kuiSubduedText">
{{ limitedResultsWarning }}
</div>
@@ -8,6 +8,16 @@ doc-table { | |||
flex: 1 1 100%; | |||
flex-direction: column; /* 1 */ | |||
|
|||
.docTablePagerInfoMessage { |
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.
Can you delete this class and add this new one instead? And can you unnest it and put it on line 3, outside of doc-table
?
.docTableBar {
margin: 5px 5px 0;
}
@@ -20,7 +40,27 @@ | |||
class="discover-table-row"></tr> | |||
</tbody> | |||
</table> | |||
</paginate> | |||
<!-- ToolBarFooter --> | |||
<div class="kuilBar"> |
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.
And this can be updated too:
<div class="kuilBar docTableBar">
<div class="kuiBarSection">
<div
ng-if="shouldShowLimitedResultsWarning()"
class="kuiToolBarText kuiSubduedText">
{{ limitedResultsWarning }}
</div>
@@ -41,6 +41,7 @@ | |||
|
|||
@discover-table-footer-bg: @well-bg; | |||
@discover-field-filter-bg: @well-bg; | |||
@doc-table-warning-bg: @well-bg; |
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.
You can delete this.
@@ -46,10 +45,6 @@ module.directive('filterBar', function (Private, Promise, getAppState) { | |||
|
|||
$scope.state = getAppState(); | |||
|
|||
// Don't show filter "pinnability" when in embedded mode, as it doesn't make sense in that context | |||
// as there will be no cross app navigation for which the filter should persist. | |||
$scope.showFilterPin = () => chrome.getVisible(); |
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.
Can you explain the context behind these changes? At first glance they don't seem related to the other changes in this PR.
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.
Weird. I had another PR that accidentally got merged into this one, so I reverted it, hence the commit history on this one was a little weird: 1) merge unrelated PR. 2) Do actual work. 3) Notice mistake and revert PR.
But now that original PR is merged for real, and I guess the revert is making this show up as actually removing that code.
Anyway, good catch, I'll add it back in.
8690e14
to
14a0aa4
Compare
Showing the message only on the last page, at the bottom of the search results.
14a0aa4
to
95f836e
Compare
@cjcenizal Feedback addressed, lmk if there is anything else! |
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.
Awesome! I found a couple more minor things and then we're good to go.
<div class="kuiBarSection"> | ||
<div | ||
ng-if="shouldShowLimitedResultsWarning()" | ||
class="kuiToolBarText kuiSubduedText"> |
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 closing bracket should be on the next line.
<div class="kuiBarSection"> | ||
<div | ||
ng-if="shouldShowLimitedResultsWarning()" | ||
class="kuiToolBarText kuiSubduedText"> |
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.
Same here re closing bracket.
ng-class="{ loading: searchSource.activeFetchCount > 0 }" | ||
> | ||
<div ng-if="!infiniteScroll"> | ||
<div class="kuilBar docTableBar"> |
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.
Looks like a typo here: kuilBar
should be kuiBar
.
@@ -23,7 +45,29 @@ | |||
></tr> | |||
</tbody> | |||
</table> | |||
</paginate> | |||
<!-- ToolBarFooter --> | |||
<div class="kuilBar docTableBar"> |
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.
kuilBar
should be kuiBar
.
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.
LGTM
…rch on dashboard (elastic#10827) * Indicate results are limited to 500 in a saved search on dashboard Showing the message only on the last page, at the bottom of the search results. * Put warning on top, not on bottom, separate styles * Use landing page style pager buttons and show the correct total hit count * Move back to the right, shorten error message, lighten text * swap order of pager buttons and numbers * Address code review comments * Code review comments part 2
…rch on dashboard (#10827) (#11075) * Indicate results are limited to 500 in a saved search on dashboard Showing the message only on the last page, at the bottom of the search results. * Put warning on top, not on bottom, separate styles * Use landing page style pager buttons and show the correct total hit count * Move back to the right, shorten error message, lighten text * swap order of pager buttons and numbers * Address code review comments * Code review comments part 2
Fixes #4161