mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02: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:
@@ -235,15 +235,15 @@ function SmartSearchController (
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.clearAllTerms = () => {
|
$scope.clearAllTerms = () => {
|
||||||
const cleared = {};
|
_.forOwn(defaults, (value, key) => {
|
||||||
|
// preserve the `credential_type` queryset param if it exists
|
||||||
_.forOwn(defaults, function(value, key) {
|
if (key === 'credential_type') {
|
||||||
if (key !== "page") {
|
defaults[key] = queryset[key];
|
||||||
cleared[key] = _.has(queryset, key) ? queryset[key] : value;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const cleared = _(defaults).omit(_.isNull).value();
|
||||||
queryset = _(cleared).omit(_.isNull).value();
|
delete cleared.page;
|
||||||
|
queryset = cleared;
|
||||||
|
|
||||||
if (!$scope.querySet) {
|
if (!$scope.querySet) {
|
||||||
$state.go('.', { [searchKey]: queryset });
|
$state.go('.', { [searchKey]: queryset });
|
||||||
|
|||||||
Reference in New Issue
Block a user