Explicitly set the credential lists base path to include the ?kind= param so that future searches will have the correct base path.

This commit is contained in:
Michael Abashian 2016-07-05 11:35:59 -04:00
parent ab0fd8ddb1
commit fcad385bcb
2 changed files with 11 additions and 35 deletions

View File

@ -93,18 +93,10 @@
input_type: "radio"
});
}
else if (source === 'ec2'){
LookUpInit({
scope: $scope,
url: GetBasePath('credentials') + '?kind=aws',
form: form,
list: CredentialList,
field: 'credential',
input_type: "radio"
});
}
// equal to case 'rax' || 'azure' || 'azure_rm' || 'vmware' || 'satellite6' || 'cloudforms' || 'openstack' || 'custom'
// equal to case 'ec2' || 'rax' || 'azure' || 'azure_rm' || 'vmware' || 'satellite6' || 'cloudforms' || 'openstack'
else{
var credentialBasePath = (source === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (source === '' ? '' : '?kind=' + (source));
CredentialList.basePath = credentialBasePath;
LookUpInit({
scope: $scope,
url: GetBasePath('credentials') + (source === '' ? '' : '?kind=' + source),

View File

@ -92,20 +92,12 @@
input_type: "radio"
});
}
else if (source.value === 'ec2'){
LookUpInit({
scope: $scope,
url: GetBasePath('credentials') + '?kind=aws',
form: form,
list: CredentialList,
field: 'credential',
input_type: "radio"
});
}
else{
var credentialBasePath = (source.value === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (source.value === '' ? '' : '?kind=' + (source.value));
CredentialList.basePath = credentialBasePath;
LookUpInit({
scope: $scope,
url: GetBasePath('credentials') + (source.value === '' ? '' : '?kind=' + (source.value)),
url: credentialBasePath,
form: form,
list: CredentialList,
field: 'credential',
@ -260,27 +252,19 @@
$scope = angular.extend($scope, groupData);
// instantiate lookup fields
if (inventorySourceData.source !== 'custom' && inventorySourceData.source !== 'ec2'){
if (inventorySourceData.source !== 'custom'){
var credentialBasePath = (inventorySourceData.source === 'ec2') ? GetBasePath('credentials') + '?kind=aws' : GetBasePath('credentials') + (inventorySourceData.source === '' ? '' : '?kind=' + (inventorySourceData.source));
CredentialList.basePath = credentialBasePath;
LookUpInit({
scope: $scope,
url: GetBasePath('credentials') + (inventorySourceData.source === '' ? '' : '?kind=' + (inventorySourceData.source)),
url: credentialBasePath,
form: form,
list: CredentialList,
field: 'credential',
input_type: "radio"
});
}
else if (inventorySourceData.source === 'ec2'){
LookUpInit({
scope: $scope,
url: GetBasePath('credentials') + '?kind=aws',
form: form,
list: CredentialList,
field: 'credential',
input_type: "radio"
});
}
// equal to case 'rax' || 'azure' || 'azure_rm' || 'vmware' || 'satellite6' || 'cloudforms' || 'openstack' || 'custom'
// equal to case 'custom'
else{
$scope.inventory_script_name = inventorySourceData.summary_fields.source_script.name;
LookUpInit({