From 4c0a0f7936479f1400bab85dbfeb3d4a3dbd522f Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 7 Jul 2016 12:00:19 -0700 Subject: [PATCH] Searching for disabled hosts was searching for enabled hosts The API can only search hosts by "enabled": yes or no (t/f). However on the UI we want to search by "disabled" so needed to override the boolean values for this particular search --- awx/ui/client/src/lists/InventoryHosts.js | 4 ++++ awx/ui/client/src/search/tagSearch.service.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/lists/InventoryHosts.js b/awx/ui/client/src/lists/InventoryHosts.js index 16c8989832..f0cc803fe5 100644 --- a/awx/ui/client/src/lists/InventoryHosts.js +++ b/awx/ui/client/src/lists/InventoryHosts.js @@ -54,6 +54,10 @@ export default label: 'Disabled?', searchSingleValue: true, searchType: 'boolean', + typeOptions: [ + {label: "Yes", value: false}, + {label: "No", value: true} + ], searchValue: 'false', searchOnly: true }, diff --git a/awx/ui/client/src/search/tagSearch.service.js b/awx/ui/client/src/search/tagSearch.service.js index fbc87c4e52..777c4c6441 100644 --- a/awx/ui/client/src/search/tagSearch.service.js +++ b/awx/ui/client/src/search/tagSearch.service.js @@ -25,7 +25,7 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu typeOptions = field.searchOptions || []; } else if (field.searchType === 'boolean') { type = 'select'; - typeOptions = [{label: "Yes", value: true}, + typeOptions = field.typeOptions || [{label: "Yes", value: true}, {label: "No", value: false}]; } else { type = 'text';