From 5a86c12dffcb9a37978d7f8dffc87d3834cee65c Mon Sep 17 00:00:00 2001 From: Zita Nemeckova Date: Fri, 16 Jun 2017 16:14:45 +0200 Subject: [PATCH] Allow user@user typo of git URL --- app/assets/javascripts/directives/url_validation.js | 2 +- app/views/ansible_repository/_repository_form.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/directives/url_validation.js b/app/assets/javascripts/directives/url_validation.js index 3604e52a64e0..f02568716b9d 100644 --- a/app/assets/javascripts/directives/url_validation.js +++ b/app/assets/javascripts/directives/url_validation.js @@ -10,7 +10,7 @@ ManageIQ.angular.app.directive('urlValidation', function() { }; var validUrl = function(s) { - return s.substring(0, 8) === 'https://' || s.substring(0, 7) === 'http://' || s.substring(0, 4) === 'git@'; + return s.substring(0, 8) === 'https://' || s.substring(0, 7) === 'http://' || s.match(/^[\w:]+@.*:/); }; } } diff --git a/app/views/ansible_repository/_repository_form.html.haml b/app/views/ansible_repository/_repository_form.html.haml index a3003a759cce..a78ab9a3f18c 100644 --- a/app/views/ansible_repository/_repository_form.html.haml +++ b/app/views/ansible_repository/_repository_form.html.haml @@ -53,7 +53,7 @@ %span.help-block{"ng-show" => "angularForm.scm_url.$error.required"} = _("Required") %span.help-block{"ng-show" => "angularForm.scm_url.$error.urlValidation"} - = _("URL must include a protocol (http://, https:// or git@)") + = _("URL must include a protocol (http:// or https://) or be a valid SSH path (user@server:path)") .form-group %label.col-md-2.control-label = _('SCM credentials')