Pass dashboard state through isolate scope

There are some dependencies on it.

Fixes #9558
This commit is contained in:
Stacey Gammon 2016-12-19 13:42:46 -05:00
parent 1924d28ed8
commit a058976624
2 changed files with 8 additions and 1 deletions

View file

@ -53,7 +53,13 @@ uiModules
* Handles removing this panel from the grid.
* @type {() => void}
*/
remove: '&'
remove: '&',
/**
* We have to pass the dashboard state on through because filter bar click handlers expect it, as well
* as saved searches. We need to remove reliance there before we can break it out here.
* See https://github.com/elastic/kibana/issues/9558 for more information.
*/
state: '='
},
link: function ($scope, element) {
if (!$scope.panel.id || !$scope.panel.type) return;

View file

@ -165,6 +165,7 @@ app.directive('dashboardGrid', function ($compile, Notifier) {
<dashboard-panel remove="removePanelFromState(${panel.panelId})"
panel="getPanelByPanelId(${panel.panelId})"
is-full-screen-mode="!chrome.getVisible()"
state="state"
parent-ui-state="uiState">
</li>`;
panel.$el = $compile(panelHtml)($scope);