Merge pull request #4955 from GabrielInTheWorld/hotfixSuperSearch

Hotfix for global search
This commit is contained in:
Emanuel Schütze 2019-08-28 09:23:07 +02:00 committed by GitHub
commit 899eedf403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -213,7 +213,9 @@ export class SearchService {
.filter(model => .filter(model =>
dedicatedId dedicatedId
? model.id === dedicatedId ? model.id === dedicatedId
: model.formatForSearch().searchValue.some(text => text.toLowerCase().indexOf(query) !== -1) : model
.formatForSearch()
.searchValue.some(text => text && text.toLowerCase().indexOf(query) !== -1)
) )
.sort((a, b) => { .sort((a, b) => {
switch (sortingProperty) { switch (sortingProperty) {

View File

@ -304,6 +304,7 @@ export class SuperSearchComponent implements OnInit {
* @param event KeyboardEvent to listen to keyboard-inputs. * @param event KeyboardEvent to listen to keyboard-inputs.
*/ */
@HostListener('document:keydown', ['$event']) public onKeyNavigation(event: KeyboardEvent): void { @HostListener('document:keydown', ['$event']) public onKeyNavigation(event: KeyboardEvent): void {
if (!!this.selectedModel) {
if (event.key === 'Enter') { if (event.key === 'Enter') {
this.viewResult(this.selectedModel); this.viewResult(this.selectedModel);
} }
@ -313,6 +314,7 @@ export class SuperSearchComponent implements OnInit {
if (event.key === 'ArrowDown') { if (event.key === 'ArrowDown') {
this.selectNextResult(false); this.selectNextResult(false);
} }
}
if (event.altKey && event.shiftKey && event.key === 'V') { if (event.altKey && event.shiftKey && event.key === 'V') {
this.showPreview = !this.showPreview; this.showPreview = !this.showPreview;
} }