Skip to content
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

Merged

Conversation

stacey-gammon
Copy link
Contributor

screen shot 2017-03-21 at 8 46 12 am

Fixes #4161

@stacey-gammon
Copy link
Contributor Author

Jenkins failure: (Fatal error: unexpected end of file�)

Running "esvm:test" (esvm) task
starting up "test" cluster
INFO -  - cluster - Downloading & installing from "master" branch.
Fatal error: unexpected end of file�
runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
runbld>>> DURATION: 234394ms
runbld>>> STDOUT: 81598 bytes
runbld>>> STDERR: 2050 bytes

jenkins, test this

@stacey-gammon stacey-gammon force-pushed the warn-limited-doc-table-view branch from 2bd57fa to 8f5a148 Compare March 23, 2017 12:54
@@ -20,6 +20,12 @@
class="discover-table-row"></tr>
</tbody>
</table>
<div ng-if="hits.length === sampleSize && page.last" class="discover-table-footer">
<center>
Copy link
Contributor

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?

Copy link
Contributor

@cjcenizal cjcenizal Mar 24, 2017

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">
Copy link
Contributor

@spalger spalger Mar 24, 2017

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).

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

@jimmyjones2
Copy link
Contributor

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?

@stacey-gammon stacey-gammon force-pushed the warn-limited-doc-table-view branch 2 times, most recently from 23d0d62 to e361825 Compare March 27, 2017 14:15
@stacey-gammon
Copy link
Contributor Author

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.

screen shot 2017-03-27 at 10 11 09 am

@cjcenizal @snide I went back to the first page, on top ^^

@trevan
Copy link
Contributor

trevan commented Mar 27, 2017

@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.

@jimmyjones2
Copy link
Contributor

Could the warning be inline with the pager, so doesn't consume vertical space? Would just "limited to first 500 results" suffice?

@stacey-gammon stacey-gammon force-pushed the warn-limited-doc-table-view branch from e361825 to ca1cc4a Compare March 29, 2017 19:48
@stacey-gammon
Copy link
Contributor Author

Using the new pager styles:
screen shot 2017-03-29 at 3 43 43 pm

@cjcenizal
Copy link
Contributor

cjcenizal commented Mar 29, 2017

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?

image

image

@stacey-gammon If we go this route, we'll need to add a custom class to the Bar element here, which adds margin: 5px 5px 0 to adjust the spacing.

@uboness
Copy link

uboness commented Mar 30, 2017

+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

@stacey-gammon stacey-gammon added the Feature:Dashboard Dashboard related features label Mar 30, 2017
@snide
Copy link
Contributor

snide commented Mar 30, 2017

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.

@stacey-gammon
Copy link
Contributor Author

@snide - Good suggestions, I'll add them shortly.
@cjcenizal - Note that the warning message only appears on the very last page so I don't think it'll be too intrusive (or at least that's how I have it implemented now). It will only show up after the user pages through 10 times, so I think we want it a little more obvious than the icon (IMO).

@uboness
Copy link

uboness commented Mar 30, 2017

Note that the warning message only appears on the very last page so I don't think it'll be too intrusive (or at least that's how I have it implemented now). It will only show up after the user pages through 10 times, so I think we want it a little more obvious than the icon (IMO).

++

'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.

++

@cjcenizal
Copy link
Contributor

@snide Good suggestions! Let's do it.

@stacey-gammon
Copy link
Contributor Author

Latest iteration:

screen shot 2017-03-30 at 2 11 36 pm

@cjcenizal
Copy link
Contributor

@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:

image

@stacey-gammon
Copy link
Contributor Author

Oh good call, forgot I swapped them earlier. This looks better.

screen shot 2017-03-30 at 2 26 25 pm

@stacey-gammon
Copy link
Contributor Author

jenkins test this

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stacey-gammon stacey-gammon removed the request for review from snide March 31, 2017 12:57
@stacey-gammon
Copy link
Contributor Author

@cjcenizal Does looks good refer only to UI/UX or did you check out the code as well?

@cjcenizal
Copy link
Contributor

Just the screenshot. I can do a code review too if you want.

@stacey-gammon
Copy link
Contributor Author

@cjcenizal I do need a second reviewer so that would be great, but can tag someone else if you are busy!

@stacey-gammon stacey-gammon removed the request for review from weltenwort March 31, 2017 18:38
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I have some suggestions on how to tweak the UI so it looks like this (rows removed for demo purposes):

image

The warning text and pagination text was slightly off-alignment, so I adjust that, and then added some padding around the tool bars.


return $scope.searchSource.onResults().then(onResults);
}).catch(notify.fatal);

$scope.searchSource.onError(notify.error).catch(notify.fatal);
}));

const limitTo = $filter('limitTo');
const calculateItemsOnPage = () => {
Copy link
Contributor

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;
}
Copy link
Contributor

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">
Copy link
Contributor

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 {
Copy link
Contributor

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">
Copy link
Contributor

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;
Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@stacey-gammon stacey-gammon force-pushed the warn-limited-doc-table-view branch 3 times, most recently from 8690e14 to 14a0aa4 Compare April 1, 2017 10:53
@stacey-gammon stacey-gammon force-pushed the warn-limited-doc-table-view branch from 14a0aa4 to 95f836e Compare April 3, 2017 13:06
@stacey-gammon
Copy link
Contributor Author

@cjcenizal Feedback addressed, lmk if there is anything else!

Copy link
Contributor

@cjcenizal cjcenizal left a 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">
Copy link
Contributor

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">
Copy link
Contributor

@cjcenizal cjcenizal Apr 4, 2017

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">
Copy link
Contributor

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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kuilBar should be kuiBar.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stacey-gammon stacey-gammon merged commit a08f0db into elastic:master Apr 6, 2017
stacey-gammon added a commit to stacey-gammon/kibana that referenced this pull request Apr 6, 2017
…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
stacey-gammon added a commit that referenced this pull request Apr 6, 2017
…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
@stacey-gammon stacey-gammon deleted the warn-limited-doc-table-view branch April 6, 2017 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features review v5.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants