1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #150 from marshmalien/fix/6479-DuplicateDefaultSCMInvChoice

Remove duplicate "Choose a [sic] inventory file" dropdown option
This commit is contained in:
Marliana Lara 2017-08-02 13:10:19 -04:00 committed by GitHub
commit 2f07c0a2e5
2 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,7 @@ return {
inventory_file: {
label: i18n._('Inventory File'),
type:'select',
defaultText: 'Choose an inventory file',
ngOptions: 'file for file in inventory_files track by file',
ngShow: "source && source.value === 'scm'",
ngDisabled: "!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd) || disableInventoryFileBecausePermissionDenied",

View File

@ -659,6 +659,9 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
$(element).on('select2:select', (e) => {
scope[model] = e.params.data.text;
scope[selectOptions] = _.cloneDeep(original_options);
if (e.params.data.id === "") {
return;
}
if (scope[selectOptions].indexOf(e.params.data.text) === -1) {
scope[selectOptions].push(e.params.data.text);
}