From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Fri, 13 Dec 2024 15:39:16 +0000 (-0800)
Subject: FIx: obliquely trim spaces from global search (#8484)
X-Git-Tag: v2.14.0~1^2~47
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea514a7ed847c0fb4eeef020c13605db56294e83;p=thirdparty%2Fpaperless-ngx.git
FIx: obliquely trim spaces from global search (#8484)
---
diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf
index f181c53c7b..a4dc5cc4f6 100644
--- a/src-ui/messages.xlf
+++ b/src-ui/messages.xlf
@@ -1050,7 +1050,7 @@
src/app/components/app-frame/global-search/global-search.component.ts
- 104
+ 103
@@ -3067,22 +3067,22 @@
Successfully updated object.
src/app/components/app-frame/global-search/global-search.component.ts
- 193
+ 192
src/app/components/app-frame/global-search/global-search.component.ts
- 231
+ 230
Error occurred saving object.
src/app/components/app-frame/global-search/global-search.component.ts
- 196
+ 195
src/app/components/app-frame/global-search/global-search.component.ts
- 234
+ 233
diff --git a/src-ui/src/app/components/app-frame/global-search/global-search.component.ts b/src-ui/src/app/components/app-frame/global-search/global-search.component.ts
index 682d4e81b8..1254cfe30e 100644
--- a/src-ui/src/app/components/app-frame/global-search/global-search.component.ts
+++ b/src-ui/src/app/components/app-frame/global-search/global-search.component.ts
@@ -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()