LP1816475: Adding Create New button to the Manage Reservations screen
authorJane Sandberg <sandbej@linnbenton.edu>
Mon, 8 Apr 2019 14:32:00 +0000 (07:32 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Wed, 17 Apr 2019 20:41:53 +0000 (13:41 -0700)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/staff/booking/reservations-grid.component.html
Open-ILS/src/eg2/src/app/staff/booking/reservations-grid.component.ts

index 7728702..0601503 100644 (file)
@@ -7,6 +7,7 @@
   <eg-grid-toolbar-action label="Return Selected" i18n-label [action]="returnSelected" [disableOnRows]="returnNotAppropriate"></eg-grid-toolbar-action>
   <eg-grid-toolbar-action label="View Reservations for This Patron" i18n-label [action]="viewByPatron" [disableOnRows]="notOnePatronSelected"></eg-grid-toolbar-action>
   <eg-grid-toolbar-action label="View Reservations for This Resource" i18n-label [action]="viewByResource" [disableOnRows]="notOneResourceSelected"></eg-grid-toolbar-action>
+  <eg-grid-toolbar-button *ngIf="!status" label="Create New Reservation" i18n-label [action]="redirectToCreate"></eg-grid-toolbar-button>
 
   <eg-grid-column name="id" [hidden]="true" [index]="true" i18n-label label="ID" path="id"></eg-grid-column>
   <eg-grid-column label="Patron username" [hidden]="true" i18n-label path="usr.usrname" [sortable]="false"></eg-grid-column>
index 26af5c3..0582d55 100644 (file)
@@ -61,6 +61,7 @@ export class ReservationsGridComponent implements OnInit {
     endTimeShouldBeAfterStartTime: (fieldName: string, value: Moment, record: IdlObject) => string;
 
     handleRowActivate: (row: IdlObject) => void;
+    redirectToCreate: () => void;
 
     reloadGrid: () => void;
 
@@ -275,6 +276,10 @@ export class ReservationsGridComponent implements OnInit {
                 this.showEditDialog(row);
             }
         };
+
+        this.redirectToCreate = () => {
+            this.router.navigate(['/staff', 'booking', 'create_reservation']);
+        };
     }
 
     showEditDialog(idlThing: IdlObject) {