Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix advanced search reset #4193

Merged
merged 5 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/client/specs/search_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('search', () => {
rawTextbox.clear();
rawTextbox.sendKeys('type:text AND (item1 OR item4)');
globalSearch.goButton.click();
globalSearch.waitForItemCount(3);
globalSearch.waitForItemCount(0);
globalSearch.closeFilterPanel();

// search spiked content
Expand Down
9 changes: 5 additions & 4 deletions scripts/apps/search/directives/SaveSearch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {create, clone, each} from 'lodash';
import {create, clone} from 'lodash';
import {saveOrUpdateSavedSearch} from '../SavedSearch';
import {gettext} from 'core/utils';
import {isEmptyString} from 'core/helpers/utils';
Expand Down Expand Up @@ -51,9 +51,10 @@ export function SaveSearch($location, asset, api, notify, $rootScope) {
scope.clear = function() {
scope.editingSearch = false;
scope.edit = null;
each($location.search(), (_item, key) => {
if (key !== 'repo') {
$location.search(key, null);
$location.search('');
Object.keys(scope.repo).forEach((key) => {
if (key !== 'search') {
scope.repo[key] = true;
}
});
$rootScope.$broadcast('tag:removed');
Expand Down