Merge pull request #7112 from wenottingham/scm-labels

Adjust SCM labels based on SCM type.
This commit is contained in:
Bill Nottingham
2017-07-21 10:02:22 -04:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
if ($scope.scm_type) { if ($scope.scm_type) {
$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 = i18n._('SCM Branch');
// Dynamically update popover values // Dynamically update popover values
if ($scope.scm_type.value) { if ($scope.scm_type.value) {
if(($scope.lookupType === 'insights_credential' && $scope.scm_type.value !== 'insights') || ($scope.lookupType === 'scm_credential' && $scope.scm_type.value === 'insights')) { if(($scope.lookupType === 'insights_credential' && $scope.scm_type.value !== 'insights') || ($scope.lookupType === 'scm_credential' && $scope.scm_type.value === 'insights')) {
@@ -134,6 +134,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
'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>');
$scope.credRequired = false; $scope.credRequired = false;
$scope.lookupType = 'scm_credential'; $scope.lookupType = 'scm_credential';
$scope.scmBranchLabel = i18n._('SCM Branch/Tag/Commit');
break; break;
case 'svn': case 'svn':
$scope.credentialLabel = "SCM Credential"; $scope.credentialLabel = "SCM Credential";
@@ -142,6 +143,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
'<li>svn+ssh://servername.example.com/path</li></ul>'; '<li>svn+ssh://servername.example.com/path</li></ul>';
$scope.credRequired = false; $scope.credRequired = false;
$scope.lookupType = 'scm_credential'; $scope.lookupType = 'scm_credential';
$scope.scmBranchLabel = i18n._('Revision #');
break; break;
case 'hg': case 'hg':
$scope.credentialLabel = "SCM Credential"; $scope.credentialLabel = "SCM Credential";
@@ -153,6 +155,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '<strong>', '</strong>'); 'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '<strong>', '</strong>');
$scope.credRequired = false; $scope.credRequired = false;
$scope.lookupType = 'scm_credential'; $scope.lookupType = 'scm_credential';
$scope.scmBranchLabel = i18n._('SCM Branch/Tag/Revision');
break; break;
case 'insights': case 'insights':
$scope.pathRequired = false; $scope.pathRequired = false;

View File

@@ -245,7 +245,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
if ($scope.scm_type) { if ($scope.scm_type) {
$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 = i18n._('SCM Branch');
// Dynamically update popover values // Dynamically update popover values
if ($scope.scm_type.value) { if ($scope.scm_type.value) {
@@ -263,6 +263,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
'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>');
$scope.credRequired = false; $scope.credRequired = false;
$scope.lookupType = 'scm_credential'; $scope.lookupType = 'scm_credential';
$scope.scmBranchLabel = i18n._('SCM Branch/Tag/Commit');
break; break;
case 'svn': case 'svn':
$scope.credentialLabel = "SCM Credential"; $scope.credentialLabel = "SCM Credential";
@@ -271,6 +272,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
'<li>svn+ssh://servername.example.com/path</li></ul>'; '<li>svn+ssh://servername.example.com/path</li></ul>';
$scope.credRequired = false; $scope.credRequired = false;
$scope.lookupType = 'scm_credential'; $scope.lookupType = 'scm_credential';
$scope.scmBranchLabel = i18n._('Revision #');
break; break;
case 'hg': case 'hg':
$scope.credentialLabel = "SCM Credential"; $scope.credentialLabel = "SCM Credential";
@@ -282,6 +284,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '<strong>', '</strong>'); 'If using Bitbucket and SSH, do not supply your Bitbucket username.'), '<strong>', '</strong>');
$scope.credRequired = false; $scope.credRequired = false;
$scope.lookupType = 'scm_credential'; $scope.lookupType = 'scm_credential';
$scope.scmBranchLabel = i18n._('SCM Branch/Tag/Revision');
break; break;
case 'insights': case 'insights':
$scope.pathRequired = false; $scope.pathRequired = false;