Merge pull request #3078 from quay/joseph.schorr/QUAY-855/trigger-history
Fix display of triggered builds if their trigger has been deleted
This commit is contained in:
commit
7878435805
3 changed files with 14 additions and 17 deletions
|
@ -13,6 +13,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="triggered-build-description" build="build" ng-if="build.trigger"></div>
|
||||
<div ng-if="!build.trigger">Manually Started Build</div>
|
||||
<div class="triggered-build-description" build="build" ng-if="build.trigger || build.trigger_metadata"></div>
|
||||
<div ng-if="!build.trigger && !build.trigger_metadata">Manually Started Build</div>
|
||||
</div>
|
||||
|
|
|
@ -46,23 +46,17 @@ angular.module('quay').directive('triggeredBuildDescription', function () {
|
|||
if (!build) { return; }
|
||||
|
||||
var triggerMetadata = build.trigger_metadata || {};
|
||||
|
||||
if (!build.trigger && !build.manual_user) {
|
||||
$scope.infoDisplay = 'manual';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!build.trigger && build.manual_user) {
|
||||
$scope.infoDisplay = 'manual+user';
|
||||
return;
|
||||
}
|
||||
|
||||
if (build.trigger && triggerMetadata.commit_info) {
|
||||
if (triggerMetadata.commit_info) {
|
||||
$scope.infoDisplay = 'fullcommit';
|
||||
return;
|
||||
}
|
||||
|
||||
if (build.trigger && build.trigger.build_source && TriggerService.getCommitSHA(triggerMetadata)) {
|
||||
if (!build.trigger) {
|
||||
$scope.infoDisplay = build.manual_user ? 'manual+user' : 'manual';
|
||||
return;
|
||||
}
|
||||
|
||||
if (build.trigger.build_source && TriggerService.getCommitSHA(triggerMetadata)) {
|
||||
$scope.infoDisplay = 'commitsha';
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -147,8 +147,11 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
};
|
||||
|
||||
triggerService.getFullLinkTemplate = function(build, templateName) {
|
||||
var name = build.trigger.service;
|
||||
var type = triggerTypes[name];
|
||||
if (!build.trigger) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var type = triggerTypes[build.trigger.service];
|
||||
if (!type) {
|
||||
return null;
|
||||
}
|
||||
|
|
Reference in a new issue