diff --git a/static/directives/trigger-description.html b/static/directives/trigger-description.html index b0a5da331..4e7521760 100644 --- a/static/directives/trigger-description.html +++ b/static/directives/trigger-description.html @@ -14,7 +14,7 @@
Dockerfile: - //{{ trigger.config.subdir }}/Dockerfile + //{{ TriggerService.trimSubdir(trigger.config.subdir) }}/Dockerfile //Dockerfile
@@ -25,7 +25,7 @@
Dockerfile: - //{{ trigger.config.subdir }}/Dockerfile + //{{ TriggerService.trimSubdir(trigger.config.subdir) }}/Dockerfile //Dockerfile
diff --git a/static/js/services/trigger-service.js b/static/js/services/trigger-service.js index 9793fa980..66675cce1 100644 --- a/static/js/services/trigger-service.js +++ b/static/js/services/trigger-service.js @@ -95,6 +95,11 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K return type['get_redirect_url'](namespace, repository); }; + // Helper to remove the prefix and suffix /s on subdir paths. + triggerService.trimSubdir = function(subdir) { + return subdir.replace(new RegExp('(^\/+|\/+$)'), ''); + }; + triggerService.getTitle = function(name) { var type = triggerTypes[name]; if (!type) {