mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 10:27:34 -02:30
Only pass host filter param to smart inv shortcut form
This commit is contained in:
@@ -86,20 +86,7 @@ function HostsList($scope, HostsList, $rootScope, GetBasePath,
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.smartInventory = function() {
|
$scope.smartInventory = function() {
|
||||||
// Gather up search terms and pass them to the add smart inventory form
|
$state.go('inventories.addSmartInventory', {hostfilter: JSON.stringify({"host_filter":`${$state.params.host_search.host_filter}`})});
|
||||||
let stateParamsCopy = angular.copy($state.params.host_search);
|
|
||||||
let defaults = _.find($state.$current.path, (step) => {
|
|
||||||
if(step && step.params && step.params.hasOwnProperty(`host_search`)){
|
|
||||||
return step.params.hasOwnProperty(`host_search`);
|
|
||||||
}
|
|
||||||
}).params[`host_search`].config.value;
|
|
||||||
|
|
||||||
// Strip defaults out of the state params copy
|
|
||||||
angular.forEach(Object.keys(defaults), function(value) {
|
|
||||||
delete stateParamsCopy[value];
|
|
||||||
});
|
|
||||||
|
|
||||||
$state.go('inventories.addSmartInventory', {hostfilter: JSON.stringify(stateParamsCopy)});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.editInventory = function(host) {
|
$scope.editInventory = function(host) {
|
||||||
|
|||||||
Reference in New Issue
Block a user