Skip to content

Commit

Permalink
adding scope appy back (#14269)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored and chrisronline committed Oct 4, 2017
1 parent 44a7107 commit 51b6b51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
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,7 +6,7 @@
ui-state="uiState"
class="vis-editor-content"
search-source="savedObj.searchSource"
show-spy-panel="showSpyPanel"
show-spy-panel="shouldShowSpyPanel()"
/>
<visualization
ng-if="editorMode==false"
Expand All @@ -15,6 +15,6 @@
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

0 comments on commit 51b6b51

Please sign in to comment.