mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Fix apps to always migrate legacy queries on state change (#33276)
This commit is contained in:
parent
42f97324bb
commit
9637b135b0
3 changed files with 9 additions and 6 deletions
|
@ -227,7 +227,7 @@ app.directive('dashboardApp', function ($injector) {
|
|||
// a reload, since no state changes will cause it.
|
||||
dashboardStateManager.requestReload();
|
||||
} else {
|
||||
$scope.model.query = migrateLegacyQuery(query);
|
||||
$scope.model.query = query;
|
||||
dashboardStateManager.applyFilters($scope.model.query, filterBar.getFilters());
|
||||
}
|
||||
$scope.refresh();
|
||||
|
@ -242,7 +242,8 @@ app.directive('dashboardApp', function ($injector) {
|
|||
$scope.indexPatterns = dashboardStateManager.getPanelIndexPatterns();
|
||||
};
|
||||
|
||||
$scope.$watch('model.query', (query) => {
|
||||
$scope.$watch('model.query', (newQuery) => {
|
||||
const query = migrateLegacyQuery(newQuery);
|
||||
$scope.updateQueryAndFetch({ query });
|
||||
});
|
||||
|
||||
|
|
|
@ -515,7 +515,8 @@ function discoverController(
|
|||
}
|
||||
});
|
||||
|
||||
$scope.$watch('state.query', (query) => {
|
||||
$scope.$watch('state.query', (newQuery) => {
|
||||
const query = migrateLegacyQuery(newQuery);
|
||||
$scope.updateQueryAndFetch({ query });
|
||||
});
|
||||
|
||||
|
@ -636,7 +637,7 @@ function discoverController(
|
|||
};
|
||||
|
||||
$scope.updateQueryAndFetch = function ({ query }) {
|
||||
$state.query = migrateLegacyQuery(query);
|
||||
$state.query = query;
|
||||
$scope.fetch();
|
||||
};
|
||||
|
||||
|
|
|
@ -309,7 +309,8 @@ function VisEditor(
|
|||
$appStatus.dirty = status.dirty || !savedVis.id;
|
||||
});
|
||||
|
||||
$scope.$watch('state.query', (query) => {
|
||||
$scope.$watch('state.query', (newQuery) => {
|
||||
const query = migrateLegacyQuery(newQuery);
|
||||
$scope.updateQueryAndFetch({ query });
|
||||
});
|
||||
|
||||
|
@ -386,7 +387,7 @@ function VisEditor(
|
|||
}
|
||||
|
||||
$scope.updateQueryAndFetch = function ({ query }) {
|
||||
$state.query = migrateLegacyQuery(query);
|
||||
$state.query = query;
|
||||
$scope.fetch();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue