Skip to content

Commit

Permalink
[ML] Only trigger a swimlane update if the props are valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Sep 22, 2018
1 parent 0993274 commit db4b60b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/ml/public/explorer/explorer_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,15 +502,15 @@ module.controller('MlExplorerController', function (
$scope.viewByLoadedForTimeFormatted = moment(timerange.earliestMs).format('MMMM Do YYYY, HH:mm');
}

// pass influencers on to loadDataForCharts(),
// it will take care of calling loadTopInfluencers() in this case.
mlExplorerDashboardService.swimlaneDataChange.changed(mapScopeToSwimlaneProps(SWIMLANE_TYPE.OVERALL));
mlExplorerDashboardService.swimlaneDataChange.changed(mapScopeToSwimlaneProps(SWIMLANE_TYPE.VIEW_BY));

if (influencers.length === 0) {
loadTopInfluencers(jobIds, timerange.earliestMs, timerange.latestMs);
loadDataForCharts(jobIds, timerange.earliestMs, timerange.latestMs);
} else {
// pass influencers on to loadDataForCharts(),
// it will take care of calling loadTopInfluencers() in this case.
loadDataForCharts(jobIds, timerange.earliestMs, timerange.latestMs, influencers);
}
loadAnomaliesTableData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import { ExplorerSwimlane } from './explorer_swimlane';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');

module.directive('mlExplorerSwimlane', function ($compile, Private, mlExplorerDashboardService) {
module.directive('mlExplorerSwimlane', function (mlExplorerDashboardService) {

function link(scope, element) {
function swimlaneDataChangeListener(props) {
if (
props.swimlaneType !== scope.swimlaneType ||
props.swimlaneData === undefined
props.swimlaneData === undefined ||
props.startTime === undefined ||
props.endTime === undefined
) {
return;
}
Expand Down

0 comments on commit db4b60b

Please sign in to comment.