mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Fixed scm type js error
This commit is contained in:
@@ -116,48 +116,47 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
|
|||||||
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
||||||
$scope.scmRequired = ($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';
|
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch';
|
||||||
}
|
|
||||||
|
|
||||||
// Dynamically update popover values
|
// Dynamically update popover values
|
||||||
if ($scope.scm_type.value) {
|
if ($scope.scm_type.value) {
|
||||||
switch ($scope.scm_type.value) {
|
switch ($scope.scm_type.value) {
|
||||||
case 'git':
|
case 'git':
|
||||||
$scope.credentialLabel = "SCM Credential";
|
$scope.credentialLabel = "SCM Credential";
|
||||||
$scope.urlPopover = '<p>' +
|
$scope.urlPopover = '<p>' +
|
||||||
i18n._('Example URLs for GIT SCM include:') +
|
i18n._('Example URLs for GIT SCM include:') +
|
||||||
'</p><ul class=\"no-bullets\"><li>https://github.com/ansible/ansible.git</li>' +
|
'</p><ul class=\"no-bullets\"><li>https://github.com/ansible/ansible.git</li>' +
|
||||||
'<li>git@github.com:ansible/ansible.git</li><li>git://servername.example.com/ansible.git</li></ul>' +
|
'<li>git@github.com:ansible/ansible.git</li><li>git://servername.example.com/ansible.git</li></ul>' +
|
||||||
'<p>' + i18n.sprintf(i18n._('%sNote:%s When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' +
|
'<p>' + 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 ' +
|
'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.'), '<strong>', '</strong>');
|
'SSH. GIT read only protocol (git://) does not use username or password information.'), '<strong>', '</strong>');
|
||||||
|
break;
|
||||||
|
case 'svn':
|
||||||
|
$scope.credentialLabel = "SCM Credential";
|
||||||
|
$scope.urlPopover = '<p>' + i18n._('Example URLs for Subversion SCM include:') + '</p>' +
|
||||||
|
'<ul class=\"no-bullets\"><li>https://github.com/ansible/ansible</li><li>svn://servername.example.com/path</li>' +
|
||||||
|
'<li>svn+ssh://servername.example.com/path</li></ul>';
|
||||||
|
break;
|
||||||
|
case 'hg':
|
||||||
|
$scope.credentialLabel = "SCM Credential";
|
||||||
|
$scope.urlPopover = '<p>' + i18n._('Example URLs for Mercurial SCM include:') + '</p>' +
|
||||||
|
'<ul class=\"no-bullets\"><li>https://bitbucket.org/username/project</li><li>ssh://hg@bitbucket.org/username/project</li>' +
|
||||||
|
'<li>ssh://server.example.com/path</li></ul>' +
|
||||||
|
'<p>' + 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.'), '<strong>', '</strong>');
|
||||||
|
break;
|
||||||
|
case 'insights':
|
||||||
|
$scope.pathRequired = false;
|
||||||
|
$scope.scmRequired = false;
|
||||||
|
$scope.credRequired = true;
|
||||||
|
$scope.credentialLabel = "Credential";
|
||||||
break;
|
break;
|
||||||
case 'svn':
|
default:
|
||||||
$scope.credentialLabel = "SCM Credential";
|
$scope.credentialLabel = "SCM Credential";
|
||||||
$scope.urlPopover = '<p>' + i18n._('Example URLs for Subversion SCM include:') + '</p>' +
|
$scope.urlPopover = '<p> ' + i18n._('URL popover text') + '</p>';
|
||||||
'<ul class=\"no-bullets\"><li>https://github.com/ansible/ansible</li><li>svn://servername.example.com/path</li>' +
|
}
|
||||||
'<li>svn+ssh://servername.example.com/path</li></ul>';
|
|
||||||
break;
|
|
||||||
case 'hg':
|
|
||||||
$scope.credentialLabel = "SCM Credential";
|
|
||||||
$scope.urlPopover = '<p>' + i18n._('Example URLs for Mercurial SCM include:') + '</p>' +
|
|
||||||
'<ul class=\"no-bullets\"><li>https://bitbucket.org/username/project</li><li>ssh://hg@bitbucket.org/username/project</li>' +
|
|
||||||
'<li>ssh://server.example.com/path</li></ul>' +
|
|
||||||
'<p>' + 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.'), '<strong>', '</strong>');
|
|
||||||
break;
|
|
||||||
case 'insights':
|
|
||||||
$scope.pathRequired = false;
|
|
||||||
$scope.scmRequired = false;
|
|
||||||
$scope.credRequired = true;
|
|
||||||
$scope.credentialLabel = "Credential";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$scope.credentialLabel = "SCM Credential";
|
|
||||||
$scope.urlPopover = '<p> ' + i18n._('URL popover text') + '</p>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
$scope.formCancel = function() {
|
$scope.formCancel = function() {
|
||||||
$state.go('projects');
|
$state.go('projects');
|
||||||
|
|||||||
@@ -248,43 +248,43 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
|
|||||||
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
||||||
$scope.scmRequired = ($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');
|
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? i18n._('Revision #') : i18n._('SCM Branch');
|
||||||
}
|
|
||||||
|
|
||||||
// Dynamically update popover values
|
// Dynamically update popover values
|
||||||
if ($scope.scm_type.value) {
|
if ($scope.scm_type.value) {
|
||||||
switch ($scope.scm_type.value) {
|
switch ($scope.scm_type.value) {
|
||||||
case 'git':
|
case 'git':
|
||||||
$scope.credentialLabel = "SCM Credential";
|
$scope.credentialLabel = "SCM Credential";
|
||||||
$scope.urlPopover = '<p>' + i18n._('Example URLs for GIT SCM include:') + '</p><ul class=\"no-bullets\"><li>https://github.com/ansible/ansible.git</li>' +
|
$scope.urlPopover = '<p>' + i18n._('Example URLs for GIT SCM include:') + '</p><ul class=\"no-bullets\"><li>https://github.com/ansible/ansible.git</li>' +
|
||||||
'<li>git@github.com:ansible/ansible.git</li><li>git://servername.example.com/ansible.git</li></ul>' +
|
'<li>git@github.com:ansible/ansible.git</li><li>git://servername.example.com/ansible.git</li></ul>' +
|
||||||
'<p>' + i18n.sprintf(i18n._('%sNote:%s When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' +
|
'<p>' + 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 ' +
|
'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.'), '<strong>', '</strong>');
|
'SSH. GIT read only protocol (git://) does not use username or password information.'), '<strong>', '</strong>');
|
||||||
|
break;
|
||||||
|
case 'svn':
|
||||||
|
$scope.credentialLabel = "SCM Credential";
|
||||||
|
$scope.urlPopover = '<p>' + i18n._('Example URLs for Subversion SCM include:') + '</p>' +
|
||||||
|
'<ul class=\"no-bullets\"><li>https://github.com/ansible/ansible</li><li>svn://servername.example.com/path</li>' +
|
||||||
|
'<li>svn+ssh://servername.example.com/path</li></ul>';
|
||||||
|
break;
|
||||||
|
case 'hg':
|
||||||
|
$scope.credentialLabel = "SCM Credential";
|
||||||
|
$scope.urlPopover = '<p>' + i18n._('Example URLs for Mercurial SCM include:') + '</p>' +
|
||||||
|
'<ul class=\"no-bullets\"><li>https://bitbucket.org/username/project</li><li>ssh://hg@bitbucket.org/username/project</li>' +
|
||||||
|
'<li>ssh://server.example.com/path</li></ul>' +
|
||||||
|
'<p>' + 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.'), '<strong>', '</strong>');
|
||||||
|
break;
|
||||||
|
case 'insights':
|
||||||
|
$scope.pathRequired = false;
|
||||||
|
$scope.scmRequired = false;
|
||||||
|
$scope.credRequired = true;
|
||||||
|
$scope.credentialLabel = "Credential";
|
||||||
break;
|
break;
|
||||||
case 'svn':
|
default:
|
||||||
$scope.credentialLabel = "SCM Credential";
|
$scope.credentialLabel = "SCM Credential";
|
||||||
$scope.urlPopover = '<p>' + i18n._('Example URLs for Subversion SCM include:') + '</p>' +
|
$scope.urlPopover = '<p> ' + i18n._('URL popover text');
|
||||||
'<ul class=\"no-bullets\"><li>https://github.com/ansible/ansible</li><li>svn://servername.example.com/path</li>' +
|
}
|
||||||
'<li>svn+ssh://servername.example.com/path</li></ul>';
|
|
||||||
break;
|
|
||||||
case 'hg':
|
|
||||||
$scope.credentialLabel = "SCM Credential";
|
|
||||||
$scope.urlPopover = '<p>' + i18n._('Example URLs for Mercurial SCM include:') + '</p>' +
|
|
||||||
'<ul class=\"no-bullets\"><li>https://bitbucket.org/username/project</li><li>ssh://hg@bitbucket.org/username/project</li>' +
|
|
||||||
'<li>ssh://server.example.com/path</li></ul>' +
|
|
||||||
'<p>' + 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.'), '<strong>', '</strong>');
|
|
||||||
break;
|
|
||||||
case 'insights':
|
|
||||||
$scope.pathRequired = false;
|
|
||||||
$scope.scmRequired = false;
|
|
||||||
$scope.credRequired = true;
|
|
||||||
$scope.credentialLabel = "Credential";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$scope.credentialLabel = "SCM Credential";
|
|
||||||
$scope.urlPopover = '<p> ' + i18n._('URL popover text');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user