mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
CST-6056 changes for filter result not working while lookup from text input
This commit is contained in:
@@ -250,8 +250,7 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
|||||||
this.filter = '';
|
this.filter = '';
|
||||||
}
|
}
|
||||||
this.filterSearchResults = observableOf([]);
|
this.filterSearchResults = observableOf([]);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
[name]="filterConfig.paramName"
|
[name]="filterConfig.paramName"
|
||||||
[(ngModel)]="filter"
|
[(ngModel)]="filter"
|
||||||
(submitSuggestion)="onSubmit($event)"
|
(submitSuggestion)="onSubmit($event)"
|
||||||
(clickSuggestion)="onClick($event)"
|
(clickSuggestion)="onSubmit($event)"
|
||||||
(findSuggestions)="findSuggestions($event)"
|
(findSuggestions)="findSuggestions($event)"
|
||||||
ngDefaultControl
|
ngDefaultControl
|
||||||
></ds-filter-input-suggestions>
|
></ds-filter-input-suggestions>
|
||||||
|
@@ -3,6 +3,7 @@ import { FilterType } from '../../../models/filter-type.model';
|
|||||||
import { renderFacetFor } from '../search-filter-type-decorator';
|
import { renderFacetFor } from '../search-filter-type-decorator';
|
||||||
import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component';
|
import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component';
|
||||||
import { addOperatorToFilterValue } from '../../../search.utils';
|
import { addOperatorToFilterValue } from '../../../search.utils';
|
||||||
|
import { InputSuggestion } from '../../../../input-suggestions/input-suggestions.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search-hierarchy-filter',
|
selector: 'ds-search-hierarchy-filter',
|
||||||
@@ -22,6 +23,8 @@ export class SearchHierarchyFilterComponent extends SearchFacetFilterComponent i
|
|||||||
* @param data The string from the input field
|
* @param data The string from the input field
|
||||||
*/
|
*/
|
||||||
onSubmit(data: any) {
|
onSubmit(data: any) {
|
||||||
super.onSubmit(addOperatorToFilterValue(data, 'query'));
|
this.filterSearchResults.subscribe((filterSearchResults: InputSuggestion[]) => {
|
||||||
|
super.onSubmit(addOperatorToFilterValue(data, filterSearchResults.length ? 'equals' : 'query'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
[name]="filterConfig.paramName"
|
[name]="filterConfig.paramName"
|
||||||
[(ngModel)]="filter"
|
[(ngModel)]="filter"
|
||||||
(submitSuggestion)="onSubmit($event)"
|
(submitSuggestion)="onSubmit($event)"
|
||||||
(clickSuggestion)="onClick($event)"
|
(clickSuggestion)="onSubmit($event)"
|
||||||
(findSuggestions)="findSuggestions($event)"
|
(findSuggestions)="findSuggestions($event)"
|
||||||
ngDefaultControl></ds-filter-input-suggestions>
|
ngDefaultControl></ds-filter-input-suggestions>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -3,6 +3,7 @@ import { FilterType } from '../../../models/filter-type.model';
|
|||||||
import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component';
|
import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component';
|
||||||
import { renderFacetFor } from '../search-filter-type-decorator';
|
import { renderFacetFor } from '../search-filter-type-decorator';
|
||||||
import { addOperatorToFilterValue, } from '../../../search.utils';
|
import { addOperatorToFilterValue, } from '../../../search.utils';
|
||||||
|
import { InputSuggestion } from '../../../../input-suggestions/input-suggestions.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders a simple item page.
|
* This component renders a simple item page.
|
||||||
@@ -28,6 +29,8 @@ export class SearchTextFilterComponent extends SearchFacetFilterComponent implem
|
|||||||
* @param data The string from the input field
|
* @param data The string from the input field
|
||||||
*/
|
*/
|
||||||
onSubmit(data: any) {
|
onSubmit(data: any) {
|
||||||
super.onSubmit(addOperatorToFilterValue(data, 'query'));
|
this.filterSearchResults.subscribe((filterSearchResults: InputSuggestion[]) => {
|
||||||
|
super.onSubmit(addOperatorToFilterValue(data, filterSearchResults.length ? 'equals' : 'query'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user