Skip to content

Commit

Permalink
search: fix query with trailing and leading space
Browse files Browse the repository at this point in the history
* Adds a property to set to remove trailing and leading spaces of search
text.
* Removes previous fix that is useless now.
* Closes #213.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger committed Apr 1, 2020
1 parent 86a20f0 commit cecf8cb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
[placeholder]="placeholder | translate"
[searchText]="searchText"
(search)="searchValueUpdated($event)"
[focus]="searchInputFocus"></ng-core-search-input>
[focus]="searchInputFocus"
[trimQueryString]="trimSearchText">
</ng-core-search-input>
</div>
<div class="col col-md-6 mb-4">
<admin-circulation-patron-detailed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export class CheckinComponent implements OnInit {
/** Focus attribute of the search input */
searchInputFocus = false;

/** Trim search text if true */
trimSearchText = true;

/** Constructor
* @param _userService: User Service
* @param _recordService: Record Service
Expand Down Expand Up @@ -86,7 +89,6 @@ export class CheckinComponent implements OnInit {
if (!searchText) {
return null;
}
this.searchText = searchText.trim();
this.getPatronOrItem(this.searchText);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
[searchText]="searchText"
(search)="searchValueUpdated($event)"
[focus]="searchInputFocus"
[trimQueryString]="trimSearchText"
></ng-core-search-input>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export class MainRequestComponent implements OnInit {
/** Focus attribute of the search input */
searchInputFocus = false;

/** Trim search text if true */
trimSearchText = true;

/** Constructor
* @param userService: User Service
* @param itemsService: Items Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
[searchText]="searchText"
(search)="searchValueUpdated($event)"
[focus]="searchInputFocus"
[trimQueryString]="trimSearchText"
></ng-core-search-input>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export class LoanComponent implements OnInit {
/** Focus attribute of the search input */
searchInputFocus = false;

/** Trim search text if true */
trimSearchText = true;

/** Library PID of the logged user */
currentLibraryPid: string;

Expand Down Expand Up @@ -92,7 +95,6 @@ export class LoanComponent implements OnInit {
if (!searchText) {
return null;
}
this.searchText = searchText.trim();
this.getItem(this.searchText);
}

Expand Down

0 comments on commit cecf8cb

Please sign in to comment.