Skip to content

Commit

Permalink
uiState should trigger normal reload path
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jul 12, 2017
1 parent deaf3ed commit 9a08034
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function VisEditor($scope, $route, timefilter, AppState, $window, kbnUrl, courie
key: 'refresh',
description: 'Refresh',
run: function () {
vis.emit('reload');
vis.forceReload();
},
testId: 'visualizeRefreshButton',
}];
Expand Down
4 changes: 4 additions & 0 deletions src/ui/public/vis/vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export function VisProvider(Private, indexPatterns, timefilter, getAppState) {
this.setCurrentState(this._state);
}

forceReload() {
this.emit('reload');
}

getCurrentState(includeDisabled) {
return {
title: this.title,
Expand Down
6 changes: 2 additions & 4 deletions src/ui/public/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {

uiModules
.get('kibana/directive', ['ngSanitize'])
.directive('visualize', function (Notifier, Private, timefilter, getAppState, $timeout) {
.directive('visualize', function (Notifier, Private, timefilter, getAppState) {
const notify = new Notifier({ location: 'Visualize' });
const requestHandlers = Private(VisRequestHandlersRegistryProvider);
const responseHandlers = Private(VisResponseHandlersRegistryProvider);
Expand Down Expand Up @@ -106,9 +106,7 @@ uiModules
// current visualizations uiState changed.
if (!oldUiState || oldUiState !== JSON.stringify($scope.uiState.toJSON())) {
oldUiState = JSON.stringify($scope.uiState.toJSON());
$timeout(() => {
$scope.$broadcast('render');
});
$scope.fetch();
}
}
});
Expand Down

0 comments on commit 9a08034

Please sign in to comment.