Work in progress: UI fixes for the new trigger type
This commit is contained in:
parent
5a8093bbea
commit
de29a441c8
14 changed files with 160 additions and 144 deletions
|
@ -12,9 +12,33 @@ angular.module('quay').directive('triggeredBuildDescription', function () {
|
|||
'build': '=build'
|
||||
},
|
||||
controller: function($scope, $element, KeyService, TriggerService) {
|
||||
$scope.getGitHubRepoURL = function(build) {
|
||||
return KeyService['githubTriggerEndpoint'] + build.trigger.config.build_source + '/';
|
||||
};
|
||||
$scope.$watch('build', function(build) {
|
||||
if (!build) { return; }
|
||||
|
||||
var jobConfig = build.job_config || {};
|
||||
var triggerMetadata = jobConfig.trigger_metadata || {};
|
||||
|
||||
if (!build.trigger && !jobConfig.manual_user) {
|
||||
$scope.infoDisplay = 'manual';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!build.trigger && jobConfig.manual_user) {
|
||||
$scope.infoDisplay = 'manual+user';
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggerMetadata.commit_info) {
|
||||
$scope.infoDisplay = 'fullcommit';
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggerMetadata.commit_sha) {
|
||||
$scope.infoDisplay = 'commitsha';
|
||||
}
|
||||
|
||||
$scope.infoDisplay = 'source';
|
||||
});
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
|
|
Reference in a new issue