LP1816475: Put the resource barcodes in order
authorJane Sandberg <sandbej@linnbenton.edu>
Mon, 26 Aug 2019 22:18:34 +0000 (15:18 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 6 Sep 2019 14:13:01 +0000 (10:13 -0400)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Christine Burns <christine.burns@bc.libraries.coop>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts

index 1b25f41..7461a6c 100644 (file)
@@ -272,7 +272,11 @@ export class CreateReservationComponent implements OnInit, AfterViewInit, OnDest
         }
 
         resources$.pipe(
-            tap((resource) => this.resources.push(resource)),
+            tap((resource) =>  {
+                this.resources.push(resource);
+                this.resources.sort((a,b) =>
+                    (a.barcode() > b.barcode()) ? 1 : ((b.barcode() > a.barcode()) ? -1 : 0));
+            }),
             takeLast(1),
             switchMap(() => {
                 let range = {startTime: Moment(), endTime: Moment()};