FIx: obliquely trim spaces from global search (#8484)

This commit is contained in:
shamoon 2024-12-13 07:39:16 -08:00 committed by GitHub
parent af67dbe523
commit ea514a7ed8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 8 deletions

View File

@ -1050,7 +1050,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/app-frame/global-search/global-search.component.ts</context>
<context context-type="linenumber">104</context>
<context context-type="linenumber">103</context>
</context-group>
</trans-unit>
<trans-unit id="2818183879511244335" datatype="html">
@ -3067,22 +3067,22 @@
<source>Successfully updated object.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/app-frame/global-search/global-search.component.ts</context>
<context context-type="linenumber">193</context>
<context context-type="linenumber">192</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/app-frame/global-search/global-search.component.ts</context>
<context context-type="linenumber">231</context>
<context context-type="linenumber">230</context>
</context-group>
</trans-unit>
<trans-unit id="1801333259018423190" datatype="html">
<source>Error occurred saving object.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/app-frame/global-search/global-search.component.ts</context>
<context context-type="linenumber">196</context>
<context context-type="linenumber">195</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/app-frame/global-search/global-search.component.ts</context>
<context context-type="linenumber">234</context>
<context context-type="linenumber">233</context>
</context-group>
</trans-unit>
<trans-unit id="8700121026680200191" datatype="html">

View File

@ -8,7 +8,7 @@ import {
} from '@angular/core'
import { Router } from '@angular/router'
import { NgbDropdown, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
import { Subject, debounceTime, distinctUntilChanged, filter, map } from 'rxjs'
import { Subject, debounceTime, distinctUntilChanged, filter } from 'rxjs'
import { DataType } from 'src/app/data/datatype'
import {
FILTER_FULLTEXT_QUERY,
@ -89,7 +89,6 @@ export class GlobalSearchComponent implements OnInit {
this.queryDebounce
.pipe(
debounceTime(400),
map((query) => query?.trim()),
filter((query) => !query?.length || query?.length > 2),
distinctUntilChanged()
)
@ -109,7 +108,7 @@ export class GlobalSearchComponent implements OnInit {
private search(query: string) {
this.loading = true
this.searchService.globalSearch(query).subscribe((results) => {
this.searchService.globalSearch(query.trim()).subscribe((results) => {
this.searchResults = results
this.loading = false
this.resultsDropdown.open()