From 105201c514c6db685b32ee60ea8f45ffcb146dc5 Mon Sep 17 00:00:00 2001 From: Peter Pisljar Date: Tue, 3 Oct 2017 08:54:20 +0200 Subject: [PATCH] don't show spy panel with tsvb or timelion (#14090) * don't show spy panel with tsvb or timelion * adding shouldShowSpyPanel function --- src/ui/public/visualize/visualization.html | 2 +- src/ui/public/visualize/visualization.js | 4 ++++ src/ui/public/visualize/visualize.js | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ui/public/visualize/visualization.html b/src/ui/public/visualize/visualization.html index b2b9725dc2dc9..a6da0ee3dfdf5 100644 --- a/src/ui/public/visualize/visualization.html +++ b/src/ui/public/visualize/visualization.html @@ -21,4 +21,4 @@

No results found

class="visualize-chart"> - + diff --git a/src/ui/public/visualize/visualization.js b/src/ui/public/visualize/visualization.js index d37f2b57b7232..d3f19fbf57c5a 100644 --- a/src/ui/public/visualize/visualization.js +++ b/src/ui/public/visualize/visualization.js @@ -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'); diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index 54f61097b12f6..7a6c5abbf94cc 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -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);