parent
9d48bcd0f1
commit
dcebd61dde
2 changed files with 13 additions and 2 deletions
|
@ -27,8 +27,8 @@
|
|||
<!-- Full Commit Information -->
|
||||
<div class="tbd-content" ng-switch-when="fullcommit">
|
||||
<div class="commit-message">
|
||||
<span class="anchor" is-only-text="!TriggerService.getFullLinkTemplate(build, 'commit')"
|
||||
ng-safenewtab href="{{ TriggerService.getFullLinkTemplate(build, 'commit').replace('{sha}', TriggerService.getCommitSHA(build.trigger_metadata)) }}">
|
||||
<span class="anchor" is-only-text="!TriggerService.getCommitUrl(build)"
|
||||
ng-safenewtab href="{{ TriggerService.getCommitUrl(build) }}">
|
||||
{{ getMessageSummary(build.trigger_metadata.commit_info.message) }}
|
||||
</span>
|
||||
<span class="long-description-toggle"
|
||||
|
|
|
@ -135,6 +135,17 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
});
|
||||
};
|
||||
|
||||
triggerService.getCommitUrl = function(build) {
|
||||
// Check for a predefined URL first.
|
||||
if (build.trigger_metadata && build.trigger_metadata.commit_info &&
|
||||
build.trigger_metadata.commit_info.url) {
|
||||
return build.trigger_metadata.commit_info.url;
|
||||
}
|
||||
|
||||
return triggerService.getFullLinkTemplate(build, 'commit')
|
||||
.replace('{sha}', triggerService.getCommitSHA(build.trigger_metadata))
|
||||
};
|
||||
|
||||
triggerService.getFullLinkTemplate = function(build, templateName) {
|
||||
var name = build.trigger.service;
|
||||
var type = triggerTypes[name];
|
||||
|
|
Reference in a new issue