stackviz/app/js/directives/subunit-failures.js
Tim Buckley b2fedac4fe Add service to summarize different artifact types
Currently, the home page has a hard-coded summary panel specifically
for displaying overviews of subunit artifacts, which makes it
impossible to show information on other types of artifacts. This adds
a new 'summaryService' and associated 'artifact-summary' directive
that can dynamically create summary panels depending on artifact type.

Additionally, since the summary service allows many summary panels per
type per named artifact, we can have multiple (priority-ordered)
panels for each artifact. As an example of this, the existing subunit
summary has been split into simpler 'subunit-summary' and
'subunit-errors' panels.

Change-Id: I0d075dfcb86c6aef8c697896d1728e970b62600f
2016-04-28 13:14:58 -06:00

32 lines
640 B
JavaScript

'use strict';
var directivesModule = require('./_index.js');
/**
* @ngInject
*/
function subunitFailures() {
/**
* @ngInject
*/
var controller = function($scope, $attrs, datasetService) {
$scope.$watch('artifactName', function(artifactName) {
datasetService.artifact(artifactName, 'subunit-stats').then(function(response) {
$scope.stats = response.data;
});
});
};
return {
restrict: 'EA',
scope: {
'artifactName': '='
},
controller: controller,
templateUrl: 'directives/subunit-failures.html'
};
}
directivesModule.directive('subunitFailures', subunitFailures);