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

Don't prevent filterable rows from being filterable #11628

Merged
merged 5 commits into from
May 9, 2017
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ui/public/directives/rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ module.directive('kbnRows', function ($compile, $rootScope, getAppState, Private
let $cellContent;

if (contents instanceof AggConfigResult) {
const field = contents.aggConfig.getField();
const isCellContentFilterable =
contents.type === 'bucket'
&& contents.aggConfig.getField()
&& contents.aggConfig.getField().filterable;
_.get(contents, 'aggConfig.type.createFilter')
&& (!field || field.filterable);

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd consider moving this check to the AggConfig type instead. Then you could do something like if (aggConfig.isFilterable()), and we don't need to ducktype this here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@lukasolson lemme know if you wanna take a crack at this, if so I'll hold off on giving it another look. Otherwise I'll do another review first thing tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Bargs Just fixed this. Feel free to take a look now. Thanks!

if (isCellContentFilterable) {
$cell = createFilterableCell(contents);
Expand Down