Skip to content

Commit

Permalink
cleanup based on review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Bargs committed Feb 7, 2019
1 parent 0ee6136 commit 04752cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,7 @@ function discoverController(
$scope.$listen(queryFilter, 'fetch', $scope.fetch);

$scope.$watch('opts.timefield', function (timefield) {
if (!!timefield) {
$scope.enableTimeRangeSelector = true;
} else {
$scope.enableTimeRangeSelector = false;
}
$scope.enableTimeRangeSelector = !!timefield;
});

$scope.$watch('state.interval', function () {
Expand Down
10 changes: 2 additions & 8 deletions src/legacy/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,18 @@ function VisEditor(
], function ([index, requiresTimePicker, requiresQueryBar]) {
const showTimeFilter = Boolean((!index || index.timeFieldName) && requiresTimePicker);

if (showTimeFilter && requiresQueryBar) {
if (requiresQueryBar) {
timefilter.disableTimeRangeSelector();
timefilter.disableAutoRefreshSelector();
$scope.enableQueryBarTimeRangeSelector = true;
$scope.showAutoRefreshOnlyInQueryBar = false;
$scope.showAutoRefreshOnlyInQueryBar = !showTimeFilter;
}
else if (showTimeFilter) {
timefilter.enableTimeRangeSelector();
timefilter.enableAutoRefreshSelector();
$scope.enableQueryBarTimeRangeSelector = false;
$scope.showAutoRefreshOnlyInQueryBar = false;
}
else if (requiresQueryBar) {
timefilter.disableTimeRangeSelector();
timefilter.disableAutoRefreshSelector();
$scope.enableQueryBarTimeRangeSelector = true;
$scope.showAutoRefreshOnlyInQueryBar = true;
}
else {
timefilter.disableTimeRangeSelector();
timefilter.enableAutoRefreshSelector();
Expand Down

0 comments on commit 04752cb

Please sign in to comment.