Merge pull request #6166 from jimmyjones2/filter-exists

Add field exists filter button to doc table
This commit is contained in:
Rashid Khan 2016-05-04 08:16:06 -07:00
commit ea2f94f779
2 changed files with 13 additions and 0 deletions

View file

@ -106,6 +106,8 @@ describe('docViews', function () {
expect($scope.filter.calledOnce).to.be(true);
cell.find('.fa-search-minus').first().click();
expect($scope.filter.calledTwice).to.be(true);
cell.find('.fa-asterisk').first().click();
expect($scope.filter.calledThrice).to.be(true);
});
it('should NOT apply a filter when clicking non-filterable fields', function () {
@ -115,6 +117,8 @@ describe('docViews', function () {
expect($scope.filter.calledOnce).to.be(false);
cell.find('.fa-search-minus').first().click();
expect($scope.filter.calledTwice).to.be(false);
cell.find('.fa-asterisk').first().click();
expect($scope.filter.calledOnce).to.be(true);
});
});

View file

@ -27,6 +27,15 @@
tooltip-append-to-body="1"
class="fa fa-columns"></i>
</span>
<span ng-if="!indexPattern.metaFields.includes(field)">
<i ng-click="filter('_exists_', field, '+')"
tooltip="Filter for field present"
tooltip-append-to-body="1"
class="fa fa-asterisk"></i>
</span>
<span ng-if="indexPattern.metaFields.includes(field)" tooltip="Unable to filter for presence of meta fields">
<i class="fa fa-asterisk text-muted"></i>
</span>
</td>
<td>