mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 04:31:21 -03:30
Fix failing test by only preserving credential_type
- Reset `defaults` object’s own `credential_type` value to that of `queryset`’s.
This commit is contained in:
parent
99ea28c3fd
commit
b344eb9af0
@ -235,15 +235,15 @@ function SmartSearchController (
|
||||
};
|
||||
|
||||
$scope.clearAllTerms = () => {
|
||||
const cleared = {};
|
||||
|
||||
_.forOwn(defaults, function(value, key) {
|
||||
if (key !== "page") {
|
||||
cleared[key] = _.has(queryset, key) ? queryset[key] : value;
|
||||
_.forOwn(defaults, (value, key) => {
|
||||
// preserve the `credential_type` queryset param if it exists
|
||||
if (key === 'credential_type') {
|
||||
defaults[key] = queryset[key];
|
||||
}
|
||||
});
|
||||
|
||||
queryset = _(cleared).omit(_.isNull).value();
|
||||
const cleared = _(defaults).omit(_.isNull).value();
|
||||
delete cleared.page;
|
||||
queryset = cleared;
|
||||
|
||||
if (!$scope.querySet) {
|
||||
$state.go('.', { [searchKey]: queryset });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user