1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #7158 from mabashian/7134-6351

Fix scm inv source credential lookup
This commit is contained in:
Michael Abashian 2017-07-20 10:35:48 -04:00 committed by GitHub
commit f3ba635ba2
4 changed files with 41 additions and 18 deletions

View File

@ -71,14 +71,25 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
}
$scope.lookupCredential = function(){
let kind = ($scope.source.value === "ec2") ? "aws" : $scope.source.value;
$state.go('.credential', {
credential_search: {
kind: kind,
page_size: '5',
page: '1'
}
});
if($scope.source.value !== "scm" && $scope.source.value !== "custom") {
let kind = ($scope.source.value === "ec2") ? "aws" : $scope.source.value;
$state.go('.credential', {
credential_search: {
kind: kind,
page_size: '5',
page: '1'
}
});
}
else {
$state.go('.credential', {
credential_search: {
credential_type__kind: "cloud",
page_size: '5',
page: '1'
}
});
}
};
$scope.lookupProject = function(){

View File

@ -300,14 +300,25 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
};
$scope.lookupCredential = function(){
let kind = ($scope.source.value === "ec2") ? "aws" : $scope.source.value;
$state.go('.credential', {
credential_search: {
kind: kind,
page_size: '5',
page: '1'
}
});
if($scope.source.value !== "scm" && $scope.source.value !== "custom") {
let kind = ($scope.source.value === "ec2") ? "aws" : $scope.source.value;
$state.go('.credential', {
credential_search: {
kind: kind,
page_size: '5',
page: '1'
}
});
}
else {
$state.go('.credential', {
credential_search: {
credential_type__kind: "cloud",
page_size: '5',
page: '1'
}
});
}
};
$scope.formCancel = function() {

View File

@ -5,7 +5,8 @@ export default {
page_size:"5",
order_by:"name",
role_level:"use_role",
kind: null
kind: null,
credential_type__kind: null
},
dynamic:true,
squash:""

View File

@ -71,7 +71,7 @@ return {
type: 'lookup',
list: 'CredentialList',
basePath: 'credentials',
ngShow: "source && source.value !== '' && source.value !== 'custom'",
ngShow: "source && source.value !== ''",
sourceModel: 'credential',
sourceField: 'name',
ngClick: 'lookupCredential()',