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

Click to filter values in Discover doc table and Visualize data table #9989

Merged
merged 14 commits into from Jan 31, 2017

Conversation

Bargs
Copy link
Contributor

@Bargs Bargs commented Jan 20, 2017

Fixes #3432
Replaces #5344

This PR extends the filter icons implemented in #5344 to the data table visualization.

screen shot 2017-01-20 at 5 59 17 pm

></span>
</span>
</td>`
);
Copy link
Member

Choose a reason for hiding this comment

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

Could you move this into its own template file?

if ($(event.target).is('a')) return; // Don't add filter if a link was clicked
clickHandler({ point: { aggConfigResult: aggConfigResult } });
clickHandler({ point: { aggConfigResult: aggConfigResult }, negate: negate });
Copy link
Member

Choose a reason for hiding this comment

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

The style guide suggests using the property value shorthand syntax (simply negate instead of negate: negate).

@jimmyjones2
Copy link
Contributor

This is awsome @Bargs, thanks!

Two minor inconsistencies between discover and the data table - whole row in data table is highlighted on mouseover and magnifying glass shown at the top of the row.

@Bargs
Copy link
Contributor Author

Bargs commented Jan 22, 2017

Thanks for the input @jimmyjones2! The cell/row highlighting was an existing style of the data table. Perhaps you're right we should remove it now. What do you think @cjcenizal?

Could you provide a screenshot of the positioning inconsistency you mentioned? From what I could tell the doc table also put the magnifying icon at the top of the row but I may have missed something.

@jimmyjones2
Copy link
Contributor

@Bargs Sorry I wasn't very clear - in the header of the data table there is a magnifying glass as a cue for filtering, but not in the doc table.

@cjcenizal
Copy link
Contributor

This looks good from a UX perspective, except for one weird thing I found. If I tried to filter on a value, sometimes it tried to apply a filter for every value in the row, instead of just the value of the cell I clicked on. When this happened, it prompted me to verify that I want to filter. If I selected a different cell, this behavior didn't occur, and instead the filter was applied for just the cell I clicked on. From a UX perspective, I couldn't figure out why this was happening. Any idea what's going on here?

data_table_filters

formatted: _displayField(row, column, true)
formatted: _displayField(row, column, true),
filterable: isFilterable,
column: column
Copy link
Contributor

Choose a reason for hiding this comment

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

This can also just be column, similar to @lukasolson's comment.

@Bargs
Copy link
Contributor Author

Bargs commented Jan 23, 2017

@cjcenizal this is the way the current filtering works in the data table ¯_(ツ)_/¯

@cjcenizal
Copy link
Contributor

@Bargs Gotcha thanks. I dug into this a bit and created a ticket for improving this UX: #10024

I agree that we should remove the hover highlight, since we no longer need it to signify that the cell is clickable.

@ppisljar
Copy link
Member

use hover to highlight whole row then ?

@cjcenizal
Copy link
Contributor

@ppisljar I'm open to trying that out. What do you think the biggest benefit(s) of that is for the user?

@ppisljar
Copy link
Member

with multiple columns its hard to see which value matches to the row you are looking to, highlighting the row makes it obvious.

@Bargs
Copy link
Contributor Author

Bargs commented Jan 25, 2017

@lukasolson @cjcenizal @ppisljar Just pushed some updates:

  • Data table now only highlights row on hover, not individual cell
  • Fixed filter icon colors in dark theme
  • Extracted filter html to a template
  • Use object shorthand in a couple of places
  • Removed outdated filter tool tip at the top of data table columns

Please take another look.

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!

@Bargs
Copy link
Contributor Author

Bargs commented Jan 27, 2017

jenkins, test this

@lukasolson
Copy link
Member

Hmm, how complicated would it be to centralize this logic into a directive and re-use it in both places? That way we wouldn't have the HTML duplicated in two different places... What do you think?

@Bargs
Copy link
Contributor Author

Bargs commented Jan 30, 2017

@lukasolson I think a bit of it could be DRYed up, but not a ton. The way the filters are built is quite different in each context, so it would really just be the html that gets de-duplicated. I don't mind doing it, but I also know @ppisljar is working on some major changes to the data table so it might be best to avoid sharing this logic for now.

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

LGTM

@Bargs Bargs merged commit 4da7d8a into elastic:master Jan 31, 2017
Bargs added a commit to Bargs/kibana that referenced this pull request Jan 31, 2017
…elastic#9989)

Adds + and - icons on hover in the doc table and data table, allowing users to drill down with more options and fewer clicks. Previously in the doc table a user had to expand the row in order to filter on a document value. In the data table a user could filter simply by clicking a cell, but there was no way to create a negative filter. This commit brings feature parity between the data table and doc table.
Bargs added a commit that referenced this pull request Jan 31, 2017
…#9989) (#10123)

Adds + and - icons on hover in the doc table and data table, allowing users to drill down with more options and fewer clicks. Previously in the doc table a user had to expand the row in order to filter on a document value. In the data table a user could filter simply by clicking a cell, but there was no way to create a negative filter. This commit brings feature parity between the data table and doc table.
@@ -128,7 +147,7 @@ module.directive('kbnTableRow', function ($compile) {
// rebuild cells since we modified the children
$cells = $el.children();

if (i === 0 && !reuse) {
if (!reuse) {
$toggleScope = $scope.$new();
$compile($target)($toggleScope);
Copy link

@marenas marenas Feb 3, 2017

Choose a reason for hiding this comment

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

@Bargs : Sorry for the late and random comment, but doesn't this $compile($target)($toggleScope); on all "newHtmls" elements for each row introduce some performance degradation when showing many rows ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marenas I haven't personally seen any slowdown with this change. The template for each cell is pretty minimal.

Copy link

Choose a reason for hiding this comment

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

makes sense, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants