UI fixes for all the new trigger stuff
This commit is contained in:
parent
de29a441c8
commit
b7317f894b
25 changed files with 260 additions and 149 deletions
|
@ -54,6 +54,14 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
'templates': {
|
||||
'credentials': '/static/directives/trigger/githost/credentials.html',
|
||||
'trigger-description': '/static/directives/trigger/github/trigger-description.html'
|
||||
},
|
||||
'repository_url': function(build) {
|
||||
return KeyService['githubTriggerEndpoint'] + build.trigger.build_source;
|
||||
},
|
||||
'link_templates': {
|
||||
'commit': '/commit/{sha}',
|
||||
'branch': '/tree/{branch}',
|
||||
'tag': '/releases/tag/{tag}',
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -85,6 +93,14 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
'templates': {
|
||||
'credentials': '/static/directives/trigger/githost/credentials.html',
|
||||
'trigger-description': '/static/directives/trigger/bitbucket/trigger-description.html'
|
||||
},
|
||||
'repository_url': function(build) {
|
||||
return 'https://bitbucket.org/' + build.trigger.build_source;
|
||||
},
|
||||
'link_templates': {
|
||||
'commit': '/commits/{sha}',
|
||||
'branch': '/branch/{branch}',
|
||||
'tag': '/commits/tag/{tag}',
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -125,6 +141,26 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
});
|
||||
};
|
||||
|
||||
triggerService.getFullLinkTemplate = function(build, templateName) {
|
||||
var name = build.trigger.service;
|
||||
var type = triggerTypes[name];
|
||||
if (!type) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var repositoryUrl = type.repository_url;
|
||||
if (!repositoryUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var linkTemplate = type.link_templates;
|
||||
if (!linkTemplate || !linkTemplate[templateName]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return repositoryUrl(build) + linkTemplate[templateName];
|
||||
};
|
||||
|
||||
triggerService.supportsFullListing = function(name) {
|
||||
var type = triggerTypes[name];
|
||||
if (!type) {
|
||||
|
|
Reference in a new issue