Merge pull request #2872 from leigh-johnson/2865

Clear job list labels column if no label results are found
This commit is contained in:
Leigh Johnson 2016-07-08 15:25:51 -04:00 committed by GitHub
commit 90466ea69e

View File

@ -74,13 +74,17 @@ export default
});
};
scope.$watch(scope.$parent.list.iterator+".summary_fields.labels.results", function() {
scope.$watchCollection(scope.$parent.list.iterator, function() {
// To keep the array of labels fresh, we need to set up a watcher - otherwise, the
// array will get set initially and then never be updated as labels are removed
if (scope[scope.$parent.list.iterator].summary_fields.labels){
scope.labels = scope[scope.$parent.list.iterator].summary_fields.labels.results;
scope.count = scope[scope.$parent.list.iterator].summary_fields.labels.count;
}
else{
scope.labels = null;
scope.count = null;
}
});
}
};