Pass dashboard state through isolate scope (#9559)

There are some dependencies on it.

Fixes #9558
This commit is contained in:
Stacey Gammon 2016-12-20 08:51:22 -05:00 committed by GitHub
parent f0d0004c4c
commit 1822db0c03
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.panelIndex})"
panel="getPanelByPanelIndex(${panel.panelIndex})"
is-full-screen-mode="!chrome.getVisible()"
state="state"
parent-ui-state="uiState">
</li>`;
panel.$el = $compile(panelHtml)($scope);