diff --git a/awx/ui/client/src/projects/add/projects-add.controller.js b/awx/ui/client/src/projects/add/projects-add.controller.js index a458e1c51e..6ab9fc43de 100644 --- a/awx/ui/client/src/projects/add/projects-add.controller.js +++ b/awx/ui/client/src/projects/add/projects-add.controller.js @@ -116,54 +116,53 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm', $scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false; $scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false; $scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch'; - } - // Dynamically update popover values - if ($scope.scm_type.value) { - switch ($scope.scm_type.value) { - case 'git': - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + - i18n._('Example URLs for GIT SCM include:') + - '

' + - '

' + i18n.sprintf(i18n._('%sNote:%s When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' + - 'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' + - 'SSH. GIT read only protocol (git://) does not use username or password information.'), '', ''); + // Dynamically update popover values + if ($scope.scm_type.value) { + switch ($scope.scm_type.value) { + case 'git': + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + + i18n._('Example URLs for GIT SCM include:') + + '

' + + '

' + i18n.sprintf(i18n._('%sNote:%s When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' + + 'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' + + 'SSH. GIT read only protocol (git://) does not use username or password information.'), '', ''); + break; + case 'svn': + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('Example URLs for Subversion SCM include:') + '

' + + ''; + break; + case 'hg': + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('Example URLs for Mercurial SCM include:') + '

' + + '' + + '

' + i18n.sprintf(i18n._('%sNote:%s Mercurial does not support password authentication for SSH. ' + + 'Do not put the username and key in the URL. ' + + 'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '', ''); + break; + case 'insights': + $scope.pathRequired = false; + $scope.scmRequired = false; + $scope.credRequired = true; + $scope.credentialLabel = "Credential"; break; - case 'svn': - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('Example URLs for Subversion SCM include:') + '

' + - ''; - break; - case 'hg': - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('Example URLs for Mercurial SCM include:') + '

' + - '' + - '

' + i18n.sprintf(i18n._('%sNote:%s Mercurial does not support password authentication for SSH. ' + - 'Do not put the username and key in the URL. ' + - 'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '', ''); - break; - case 'insights': - $scope.pathRequired = false; - $scope.scmRequired = false; - $scope.credRequired = true; - $scope.credentialLabel = "Credential"; - break; - default: - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('URL popover text') + '

'; + default: + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('URL popover text') + '

'; + } } - } - + } }; $scope.formCancel = function() { $state.go('projects'); }; $scope.lookupCredential = function(){ - // Perform a lookup on the credential_type. Git, Mercurial, and Subversion + // Perform a lookup on the credential_type. Git, Mercurial, and Subversion // all use SCM as their credential type. let credType = _.filter(CredentialTypes, function(credType){ return ($scope.scm_type.value !== "insights" && credType.kind === "scm" || diff --git a/awx/ui/client/src/projects/edit/projects-edit.controller.js b/awx/ui/client/src/projects/edit/projects-edit.controller.js index be0890de12..ea9b5622be 100644 --- a/awx/ui/client/src/projects/edit/projects-edit.controller.js +++ b/awx/ui/client/src/projects/edit/projects-edit.controller.js @@ -248,43 +248,43 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest', $scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false; $scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false; $scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? i18n._('Revision #') : i18n._('SCM Branch'); - } - // Dynamically update popover values - if ($scope.scm_type.value) { - switch ($scope.scm_type.value) { - case 'git': - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('Example URLs for GIT SCM include:') + '

' + - '

' + i18n.sprintf(i18n._('%sNote:%s When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' + - 'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' + - 'SSH. GIT read only protocol (git://) does not use username or password information.'), '', ''); + // Dynamically update popover values + if ($scope.scm_type.value) { + switch ($scope.scm_type.value) { + case 'git': + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('Example URLs for GIT SCM include:') + '

' + + '

' + i18n.sprintf(i18n._('%sNote:%s When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' + + 'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' + + 'SSH. GIT read only protocol (git://) does not use username or password information.'), '', ''); + break; + case 'svn': + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('Example URLs for Subversion SCM include:') + '

' + + ''; + break; + case 'hg': + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('Example URLs for Mercurial SCM include:') + '

' + + '' + + '

' + i18n.sprintf(i18n._('%sNote:%s Mercurial does not support password authentication for SSH. ' + + 'Do not put the username and key in the URL. ' + + 'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '', ''); + break; + case 'insights': + $scope.pathRequired = false; + $scope.scmRequired = false; + $scope.credRequired = true; + $scope.credentialLabel = "Credential"; break; - case 'svn': - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('Example URLs for Subversion SCM include:') + '

' + - ''; - break; - case 'hg': - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('Example URLs for Mercurial SCM include:') + '

' + - '' + - '

' + i18n.sprintf(i18n._('%sNote:%s Mercurial does not support password authentication for SSH. ' + - 'Do not put the username and key in the URL. ' + - 'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '', ''); - break; - case 'insights': - $scope.pathRequired = false; - $scope.scmRequired = false; - $scope.credRequired = true; - $scope.credentialLabel = "Credential"; - break; - default: - $scope.credentialLabel = "SCM Credential"; - $scope.urlPopover = '

' + i18n._('URL popover text'); + default: + $scope.credentialLabel = "SCM Credential"; + $scope.urlPopover = '

' + i18n._('URL popover text'); + } } } };