Fixing toggle in Discover tab

This commit is contained in:
Manuel 2017-05-29 17:05:47 +02:00
parent 863d7ad404
commit 9abebc3f09
3 changed files with 14 additions and 6 deletions

View File

@ -41,7 +41,7 @@ import uiModules from 'ui/modules';
import indexTemplate from 'plugins/wazuh/templates/directives/dis-template.html';
import StateProvider from 'ui/state_management/state';
import stateMonitorFactory from 'ui/state_management/state_monitor_factory';
import * as columnActions from 'ui/doc_table/actions/columns';
import 'ui/debounce';
import 'plugins/kibana/discover/saved_searches/saved_searches';
import 'plugins/kibana/discover/directives/no_results';
@ -94,6 +94,14 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
$scope.stateQuery = $scope.disFilter;
$scope.chrome = {};
$scope.removeColumn = function removeColumn(columnName) {
$scope.indexPattern.popularizeField(columnName, 1);
columnActions.removeColumn($scope.state.columns, columnName);
};
$scope.addColumn = function addColumn(columnName) {
$scope.indexPattern.popularizeField(columnName, 1);
columnActions.addColumn($scope.state.columns, columnName);
};
$scope.chrome.getVisible = function() {
return true;
}
@ -612,4 +620,4 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
});
});
});

View File

@ -115,7 +115,7 @@
<div class="discover-table" fixed-scroll ng-style="{ 'height': tableHeight }" ng-if="state.sort && state.columns">
<doc-table hits="rows" index-pattern="indexPattern" sorting="state.sort" columns="state.columns" infinite-scroll="infiniteScroll"
filter="filterQuery">
filter="filterQuery" on-add-column="addColumn" on-remove-column="removeColumn">
</doc-table>
<div ng-if="rows.length == opts.sampleSize" class="discover-table-footer">

View File

@ -52,8 +52,8 @@
</div>
<div class="discover-table" fixed-scroll ng-style="{ 'height': tableHeight }">
<doc-table hits="rows" index-pattern="indexPattern" sorting="state.sort" columns="state.columns" infinite-scroll="infiniteScroll"
filter="filterQuery">
<doc-table hits="rows" index-pattern="indexPattern" sorting="state.sort" columns="state.columns" infinite-scroll="true"
filter="filterQuery" on-add-column="addColumn" on-remove-column="removeColumn">
</doc-table>
<div ng-if="rows.length == opts.sampleSize" class="discover-table-footer">
@ -67,4 +67,4 @@
</div>
</div>
</div>
</div>
</div>