mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #4670 from jaredevantabor/lookup-modal-search-tags
Hiding default search param as a search tag
This commit is contained in:
commit
258405aefe
@ -27,7 +27,20 @@ export default ['$stateParams', '$scope', '$state', 'QuerySet', 'GetBasePath', '
|
||||
// setting the default value of a term to null in a state definition is a very explicit way to ensure it will NEVER generate a search tag, even with a non-default value
|
||||
return defaults[key] !== value && key !== 'order_by' && key !== 'page' && key !== 'page_size' && defaults[key] !== null;
|
||||
});
|
||||
return _(stripped).map(qs.decodeParam).flatten().value();
|
||||
let strippedCopy = _.cloneDeep(stripped);
|
||||
if(_.keys(_.pick(defaults, _.keys(strippedCopy))).length > 0){
|
||||
for (var key in strippedCopy) {
|
||||
if (strippedCopy.hasOwnProperty(key)) {
|
||||
let value = strippedCopy[key];
|
||||
if(_.isArray(value)){
|
||||
let index = _.indexOf(value, defaults[key]);
|
||||
value = value.splice(index, 1)[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
stripped = strippedCopy;
|
||||
}
|
||||
return _(strippedCopy).map(qs.decodeParam).flatten().value();
|
||||
}
|
||||
|
||||
// searchable relationships
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user