[ML] Fixes race condition related to view by swimlane update. (#28990)

Fixes a race condition where the view-by swimlane would stay empty after switching the view-by field in the dropdown.
This commit is contained in:
Walter Rafelsberger 2019-01-31 11:22:38 +01:00 committed by GitHub
parent 8cc8679355
commit d819e3347a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -84,7 +84,6 @@
<div
class="ml-explorer-swimlane euiText"
ng-if="showViewBySwimlane"
ng-mouseenter="setSwimlaneSelectActive(true)"
ng-mouseleave="setSwimlaneSelectActive(false)"
>

View file

@ -376,6 +376,7 @@ module.controller('MlExplorerController', function (
return {
chartWidth: $scope.swimlaneWidth,
MlTimeBuckets: TimeBuckets,
showViewBySwimlane: $scope.showViewBySwimlane,
swimlaneData: getSwimlaneData(swimlaneType),
swimlaneType,
selection: $scope.appState.mlExplorerSwimlane

View file

@ -20,6 +20,8 @@ const module = uiModules.get('apps/ml');
import { mlExplorerDashboardService } from './explorer_dashboard_service';
import { SWIMLANE_TYPE } from './explorer_constants';
module.directive('mlExplorerSwimlane', function () {
function link(scope, element) {
@ -33,6 +35,13 @@ module.directive('mlExplorerSwimlane', function () {
return;
}
if (
scope.swimlaneType === SWIMLANE_TYPE.VIEW_BY &&
props.showViewBySwimlane === false
) {
return;
}
ReactDOM.render(
React.createElement(ExplorerSwimlane, props),
element[0]