[ML] Fixes retaining the swimlane selection on a timefilter refresh.

This commit is contained in:
Walter Rafelsberger 2019-08-22 16:48:56 +02:00
parent c9a870bc43
commit 3d1c43d331
2 changed files with 5 additions and 8 deletions

View file

@ -267,6 +267,7 @@ export const Explorer = injectI18n(injectObservablesAsProps(
stateUpdate.indexPattern = indexPattern; stateUpdate.indexPattern = indexPattern;
this.updateExplorer(stateUpdate, true); this.updateExplorer(stateUpdate, true);
return;
} }
// Listen for changes to job selection. // Listen for changes to job selection.
@ -313,17 +314,20 @@ export const Explorer = injectI18n(injectObservablesAsProps(
} }
this.updateExplorer(stateUpdate, true); this.updateExplorer(stateUpdate, true);
return;
} }
// RELOAD reloads full Anomaly Explorer and clears the selection. // RELOAD reloads full Anomaly Explorer and clears the selection.
if (action === EXPLORER_ACTION.RELOAD) { if (action === EXPLORER_ACTION.RELOAD) {
this.props.appStateHandler(APP_STATE_ACTION.CLEAR_SELECTION); this.props.appStateHandler(APP_STATE_ACTION.CLEAR_SELECTION);
this.updateExplorer({ ...payload, ...getClearedSelectedAnomaliesState() }, true); this.updateExplorer({ ...payload, ...getClearedSelectedAnomaliesState() }, true);
return;
} }
// REDRAW reloads Anomaly Explorer and tries to retain the selection. // REDRAW reloads Anomaly Explorer and tries to retain the selection.
if (action === EXPLORER_ACTION.REDRAW) { if (action === EXPLORER_ACTION.REDRAW) {
this.updateExplorer({}, false); this.updateExplorer({}, false);
return;
} }
} else if (this.previousSwimlaneLimit !== this.props.swimlaneLimit) { } else if (this.previousSwimlaneLimit !== this.props.swimlaneLimit) {
this.previousSwimlaneLimit = this.props.swimlaneLimit; this.previousSwimlaneLimit = this.props.swimlaneLimit;

View file

@ -198,7 +198,7 @@ module.controller('MlExplorerController', function (
subscriptions.add(mlTimefilterRefresh$.subscribe(() => { subscriptions.add(mlTimefilterRefresh$.subscribe(() => {
if ($scope.jobSelectionUpdateInProgress === false) { if ($scope.jobSelectionUpdateInProgress === false) {
explorer$.next({ action: EXPLORER_ACTION.RELOAD }); explorer$.next({ action: EXPLORER_ACTION.REDRAW });
} }
})); }));
@ -209,13 +209,6 @@ module.controller('MlExplorerController', function (
} }
}); });
// Add a watcher for auto-refresh of the time filter to refresh all the data.
subscriptions.add(mlTimefilterRefresh$.subscribe(() => {
if ($scope.jobSelectionUpdateInProgress === false) {
explorer$.next({ action: EXPLORER_ACTION.RELOAD });
}
}));
subscriptions.add(subscribeAppStateToObservable(AppState, 'mlShowCharts', showCharts$, () => $rootScope.$applyAsync())); subscriptions.add(subscribeAppStateToObservable(AppState, 'mlShowCharts', showCharts$, () => $rootScope.$applyAsync()));
subscriptions.add(subscribeAppStateToObservable(AppState, 'mlSelectInterval', interval$, () => $rootScope.$applyAsync())); subscriptions.add(subscribeAppStateToObservable(AppState, 'mlSelectInterval', interval$, () => $rootScope.$applyAsync()));
subscriptions.add(subscribeAppStateToObservable(AppState, 'mlSelectSeverity', severity$, () => $rootScope.$applyAsync())); subscriptions.add(subscribeAppStateToObservable(AppState, 'mlSelectSeverity', severity$, () => $rootScope.$applyAsync()));