From 857f873f4d1c2e74823747819041ecead64525da Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 1 Jun 2016 14:32:42 -0400 Subject: [PATCH] fix external source and sync failure queries on inv groups/invs --- awx/ui/client/src/lists/Inventories.js | 10 ++++++++-- awx/ui/client/src/lists/InventoryGroups.js | 14 +++++++++----- awx/ui/client/src/search/tagSearch.service.js | 5 ++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/awx/ui/client/src/lists/Inventories.js b/awx/ui/client/src/lists/Inventories.js index 60543239c0..6bb9d6f3fa 100644 --- a/awx/ui/client/src/lists/Inventories.js +++ b/awx/ui/client/src/lists/Inventories.js @@ -74,8 +74,14 @@ export default }, inventory_sources_with_failures: { label: 'Sync failures?', - searchType: 'gtzero', - searchValue: 'true', + searchType: 'select', + searchOptions: [{ + label: 'Yes', + value: 'inventory_sources_with_failures__gt=0' + }, { + label: 'No', + value: 'inventory_sources_with_failures__lte=0' + }], searchOnly: true } }, diff --git a/awx/ui/client/src/lists/InventoryGroups.js b/awx/ui/client/src/lists/InventoryGroups.js index aefbd34a4d..546f9c3f6c 100644 --- a/awx/ui/client/src/lists/InventoryGroups.js +++ b/awx/ui/client/src/lists/InventoryGroups.js @@ -95,11 +95,15 @@ export default }, has_external_source: { label: 'Has external source?', - searchType: 'in', - searchValue: 'ec2,rax,vmware,azure,gce,openstack', - searchOnly: true, - sourceModel: 'inventory_source', - sourceField: 'source' + searchType: 'select', + searchOptions: [{ + label: 'Yes', + value: 'inventory_source__source__in=ec2,rax,vmware,azure,gce,openstack' + }, { + label: 'No', + value: 'not__inventory_source__source__in=ec2,rax,vmware,azure,gce,openstack' + }], + searchOnly: true }, has_active_failures: { label: 'Has failed hosts?', diff --git a/awx/ui/client/src/search/tagSearch.service.js b/awx/ui/client/src/search/tagSearch.service.js index 2ccf3cb7e1..641c48736b 100644 --- a/awx/ui/client/src/search/tagSearch.service.js +++ b/awx/ui/client/src/search/tagSearch.service.js @@ -41,7 +41,7 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu if (type === 'select') { obj.typeOptions = typeOptions; } - + return obj; }; @@ -180,6 +180,9 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu if (tag.type === "text") { tag.url = tag.value + "__icontains=" + textVal; tag.name = textVal; + } else if (selectVal.value.indexOf("=") > 0) { + tag.url = selectVal.value; + tag.name = selectVal.label; } else { tag.url = tag.value + "=" + selectVal.value; tag.name = selectVal.label;