mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 19:35:02 -02:30
Merge pull request #7161 from jlmitch5/credTypeSelectUpdates
only show cloud and network in select for custom cred types
This commit is contained in:
@@ -17,6 +17,14 @@ export default ['Rest', 'Wait',
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
|
// for add, don't show ssh
|
||||||
|
$scope.$on('loadCredentialKindOptions', function() {
|
||||||
|
$scope.credential_kind_options = $scope.credential_kind_options
|
||||||
|
.filter(val => val.value === 'net' ||
|
||||||
|
val.value === 'cloud');
|
||||||
|
});
|
||||||
|
|
||||||
// Load the list of options for Kind
|
// Load the list of options for Kind
|
||||||
$scope.$parent.optionsDefer.promise
|
$scope.$parent.optionsDefer.promise
|
||||||
.then(function(options) {
|
.then(function(options) {
|
||||||
@@ -25,7 +33,8 @@ export default ['Rest', 'Wait',
|
|||||||
url: url,
|
url: url,
|
||||||
field: 'kind',
|
field: 'kind',
|
||||||
variable: 'credential_kind_options',
|
variable: 'credential_kind_options',
|
||||||
options: options
|
options: options,
|
||||||
|
callback: 'loadCredentialKindOptions'
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!options.actions.POST) {
|
if (!options.actions.POST) {
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ export default ['Rest', 'Wait',
|
|||||||
}
|
}
|
||||||
$scope.removeChoicesReady = $scope.$on('choicesReadyCredentialTypes',
|
$scope.removeChoicesReady = $scope.$on('choicesReadyCredentialTypes',
|
||||||
function() {
|
function() {
|
||||||
|
if (!resourceData.data.managed_by_tower) {
|
||||||
|
$scope.credential_kind_options = $scope.credential_kind_options
|
||||||
|
.filter(val => val.value === 'net' ||
|
||||||
|
val.value === 'cloud');
|
||||||
|
}
|
||||||
|
|
||||||
$scope.credential_type = credential_typeData;
|
$scope.credential_type = credential_typeData;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user