Skip to content

Commit

Permalink
don't show spy panel with tsvb or timelion (elastic#14090)
Browse files Browse the repository at this point in the history
* don't show spy panel with tsvb or timelion

* adding shouldShowSpyPanel function
  • Loading branch information
ppisljar committed Oct 3, 2017
1 parent 8869ef0 commit 105201c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/public/visualize/visualization.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ <h4>No results found</h4>
class="visualize-chart"></div>
<visualize-legend aria-hidden="{{!vis.type.isAccessible}}" ng-if="addLegend"></visualize-legend>
</div>
<visualize-spy ng-if="vis.type.requiresSearch && showSpyPanel"></visualize-spy>
<visualize-spy ng-if="shouldShowSpyPanel()"></visualize-spy>
4 changes: 4 additions & 0 deletions src/ui/public/visualize/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ uiModules

$scope.addLegend = false;

$scope.shouldShowSpyPanel = () => {
return $scope.vis.type.requiresSearch && $scope.showSpyPanel;
};

// Show no results message when isZeroHits is true and it requires search
$scope.showNoResultsMessage = function () {
const requiresSearch = _.get($scope, 'vis.type.requiresSearch');
Expand Down
5 changes: 5 additions & 0 deletions src/ui/public/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ uiModules
});
}

// spy panel is supported only with courier request handler
if (!$scope.vis.type.requestHandler !== 'courier') $scope.showSpyPanel = false;

if (!$scope.appState) $scope.appState = getAppState();

const requestHandler = getHandler(requestHandlers, $scope.vis.type.requestHandler);
const responseHandler = getHandler(responseHandlers, $scope.vis.type.responseHandler);

Expand Down

0 comments on commit 105201c

Please sign in to comment.