Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving shouldShowSpy to visualize (#14269) #14286

Merged
merged 1 commit into from
Oct 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="shouldShowSpyPanel()"></visualize-spy>
<visualize-spy ng-if="showSpyPanel"></visualize-spy>
4 changes: 0 additions & 4 deletions src/ui/public/visualize/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ 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
4 changes: 2 additions & 2 deletions src/ui/public/visualize/visualize.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
ui-state="uiState"
class="vis-editor-content"
search-source="savedObj.searchSource"
show-spy-panel="showSpyPanel"
show-spy-panel="shouldShowSpyPanel()"
/>
<visualization
ng-if="editorMode==false"
vis="vis"
vis-data="visData"
ui-state="uiState"
search-source="savedObj.searchSource"
show-spy-panel="showSpyPanel"
show-spy-panel="shouldShowSpyPanel()"
/>

5 changes: 4 additions & 1 deletion src/ui/public/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ uiModules
}

// spy panel is supported only with courier request handler
if (!$scope.vis.type.requestHandler !== 'courier') $scope.showSpyPanel = false;
$scope.shouldShowSpyPanel = () => {
if ($scope.vis.type.requestHandler !== 'courier') return false;
return $scope.vis.type.requiresSearch && $scope.showSpyPanel;
};

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

Expand Down