Merge pull request #5721 from jaredevantabor/insights-project

Making Insights credential required on projects form
This commit is contained in:
Jared Tabor
2017-03-14 13:55:36 -07:00
committed by GitHub
2 changed files with 13 additions and 2 deletions

View File

@@ -348,6 +348,7 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log,
});
$scope.scmRequired = false;
$scope.credRequired = false;
master.scm_type = $scope.scm_type;
});
@@ -408,6 +409,7 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log,
if ($scope.scm_type) {
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
$scope.credRequired = ($scope.scm_type.value === 'insights') ? true : false;
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch';
}
@@ -442,7 +444,8 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log,
case 'insights':
$scope.pathRequired = false;
$scope.scmRequired = false;
$scope.credentialLabel = "Red Hat Insights";
$scope.credRequired = true;
$scope.credentialLabel = "Credential";
break;
default:
$scope.credentialLabel = "SCM Credential";
@@ -518,6 +521,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
$scope.credRequired = ($scope.scm_type.value === 'insights') ? true : false;
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch';
Wait('stop');
@@ -706,6 +710,7 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
if ($scope.scm_type) {
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
$scope.credRequired = ($scope.scm_type.value === 'insights') ? true : false;
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? i18n._('Revision #') : i18n._('SCM Branch');
}
@@ -738,7 +743,8 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log,
case 'insights':
$scope.pathRequired = false;
$scope.scmRequired = false;
$scope.credentialLabel = "Red Hat Insights";
$scope.credRequired = true;
$scope.credentialLabel = "Credential";
break;
default:
$scope.credentialLabel = "SCM Credential";

View File

@@ -136,6 +136,11 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
search: {
kind: 'scm'
},
autopopulateLookup: false,
awRequiredWhen: {
reqExpression: "credRequired",
init: false
},
ngShow: "scm_type && scm_type.value !== 'manual'",
sourceModel: 'credential',
awLookupType: 'scm_credential',