From: Jane Sandberg <sandbej@linnbenton.edu> Date: Thu, 10 Oct 2019 03:27:43 +0000 (-0700) Subject: LP1816475: Strip whitespace from patron barcodes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dc9e629df0d08107c12fa0145be08456ca4cdf03;p=evergreen%2Fjoelewis.git LP1816475: Strip whitespace from patron barcodes Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu> Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org> --- diff --git a/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts b/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts index 81d1b159b0..0910bf3ba1 100644 --- a/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts +++ b/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts @@ -19,7 +19,7 @@ export class PatronBarcodeValidator implements AsyncValidator { 'open-ils.actor.get_barcodes', this.auth.token(), this.auth.user().ws_ou(), - 'actor', control.value)); + 'actor', control.value.trim())); } private parseActorCall = (actorCall: Observable<any>) => { diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts index 370e35ae90..82a14bfdbe 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts @@ -104,7 +104,7 @@ export class CreateReservationDialogComponent 'open-ils.booking', 'open-ils.booking.reservations.create', this.auth.token(), - this.patronBarcode.value, + this.patronBarcode.value.trim(), this.selectedTimes, this.pickupLibId, this.targetResourceType.id, @@ -147,7 +147,7 @@ export class CreateReservationDialogComponent 'open-ils.actor.get_barcodes', this.auth.token(), this.auth.user().ws_ou(), - 'actor', this.patronBarcode.value).pipe( + 'actor', this.patronBarcode.value.trim()).pipe( single(), switchMap((result) => { return this.pcrud.retrieve('au', result[0]['id']).pipe( diff --git a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts index 283257eda1..dd3e0ca32f 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts @@ -73,7 +73,7 @@ export class ManageReservationsComponent implements OnInit, OnDestroy { 'open-ils.actor', 'open-ils.actor.get_barcodes', this.auth.token(), this.auth.user().ws_ou(), - 'actor', this.patronBarcode.value).pipe( + 'actor', this.patronBarcode.value.trim()).pipe( single(), tap((response) => this.router.navigate(['/staff', 'booking', 'manage_reservations', 'by_patron', response[0].id]) diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts b/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts index b11626c71d..12fd1e137b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts @@ -16,7 +16,7 @@ export class PatronService { 'open-ils.actor', 'open-ils.actor.get_barcodes', this.auth.token(), this.auth.user().ws_ou(), - 'actor', barcode); + 'actor', barcode.trim()); } }