From 3623738b0596c61e4ec1be1aa5a92e8ebcc274ce Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Tue, 11 Jul 2017 11:54:34 -0400 Subject: [PATCH] Filter out projects that have never been updated when user is creating/changing to scm inventory source --- .../inventories/related/sources/add/sources-add.controller.js | 2 +- .../inventories/related/sources/edit/sources-edit.controller.js | 2 +- .../related/sources/lookup/sources-lookup-project.route.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js index 198e5cbd6b..d62933314b 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js @@ -113,7 +113,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition', } if (source === 'scm') { - $scope.projectBasePath = GetBasePath('projects'); + $scope.projectBasePath = GetBasePath('projects') + '?not__status=never updated'; $scope.overwrite_vars = true; $scope.inventory_source_form.inventory_file.$setPristine(); } else { diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js index 8075977ccf..acef7d2c82 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js @@ -16,7 +16,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', Wait, Rest, Alert) { function init() { - $scope.projectBasePath = GetBasePath('projects'); + $scope.projectBasePath = GetBasePath('projects') + '?not__status=never updated'; $scope.canAdd = inventorySourcesOptions.actions.POST; // instantiate expected $scope values from inventorySourceData _.assign($scope, diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-project.route.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-project.route.js index 14614b24d1..53869691a7 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-project.route.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/lookup/sources-lookup-project.route.js @@ -4,6 +4,7 @@ export default { value: { page_size:"5", order_by:"name", + not__status:"never updated", role_level:"use_role", }, dynamic:true,