mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
90768: Prevent empty filters from being added
This commit is contained in:
@@ -230,10 +230,11 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits a new active custom value to the filter from the input field
|
||||
* Submits a new active custom value to the filter from the input field when the input field isn't empty.
|
||||
* @param data The string from the input field
|
||||
*/
|
||||
onSubmit(data: any) {
|
||||
if (data.match(new RegExp(`^.+,(equals|query|authority)$`))) {
|
||||
this.selectedValues$.pipe(take(1)).subscribe((selectedValues) => {
|
||||
if (isNotEmpty(data)) {
|
||||
this.router.navigate(this.getSearchLinkParts(), {
|
||||
@@ -252,6 +253,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* On click, set the input's value to the clicked data
|
||||
|
Reference in New Issue
Block a user