Skip to content

Commit

Permalink
Bug 1347732 - Fix interpretation of "context" for taskcluster actions (
Browse files Browse the repository at this point in the history
  • Loading branch information
wlach committed Mar 16, 2017
1 parent 9ff7e98 commit 584bc84
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ui/js/controllers/tcjobactions.js
Expand Up @@ -75,11 +75,12 @@ treeherder.controller('TCJobActionsCtrl', [
// only display actions which should be displayed
// in this task's context
$scope.actions = response.data.actions.filter(function(action) {
return action.kind === 'task' && _.every((action.context || []).map(function(actionContext) {
return _.every(_.map(actionContext, function(v, k) {
return (originalTask.tags[k] === v);
}));
}));
return action.kind === 'task' && (
!action.context.length || _.some((action.context).map(function(actionContext) {
return !Object.keys(actionContext).length || _.every(_.map(actionContext, function(v, k) {
return (originalTask.tags[k] === v);
}));
})));
});
$scope.input.selectedAction = $scope.actions[0];
$scope.updateSelectedAction();
Expand Down

0 comments on commit 584bc84

Please sign in to comment.