mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge pull request #2113 from CrisGuzmanS/issues/1998
avoiding error when user unselect a filter option
This commit is contained in:
@@ -7,6 +7,7 @@ import { SearchService } from '../../../../core/shared/search/search.service';
|
||||
import { currentPath } from '../../../utils/route.utils';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
import { stripOperatorFromFilterValue } from '../../search.utils';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-search-label',
|
||||
@@ -83,7 +84,8 @@ export class SearchLabelComponent implements OnInit {
|
||||
normalizeFilterValue(value: string) {
|
||||
// const pattern = /,[^,]*$/g;
|
||||
const pattern = /,authority*$/g;
|
||||
return value.replace(pattern, '');
|
||||
value = value.replace(pattern, '');
|
||||
return stripOperatorFromFilterValue(value);
|
||||
}
|
||||
|
||||
private getFilterName(): string {
|
||||
|
@@ -4,7 +4,6 @@ import { Observable } from 'rxjs';
|
||||
import { Params, Router } from '@angular/router';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { stripOperatorFromFilterValue } from '../search.utils';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-search-labels',
|
||||
@@ -37,7 +36,7 @@ export class SearchLabelsComponent {
|
||||
const labels = {};
|
||||
Object.keys(params)
|
||||
.forEach((key) => {
|
||||
labels[key] = [...params[key].map((value) => stripOperatorFromFilterValue(value))];
|
||||
labels[key] = [...params[key].map((value) => value)];
|
||||
});
|
||||
return labels;
|
||||
})
|
||||
|
Reference in New Issue
Block a user