LP#1816475: (follow-up) ensure that manage reservations grid refreshes
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 6 Sep 2019 15:04:48 +0000 (11:04 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 6 Sep 2019 15:04:48 +0000 (11:04 -0400)
This applies the changes from LP#1823041 to make editing a record
refresh the grid.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/booking/reservations-grid.component.ts

index b14a811..72b2d04 100644 (file)
@@ -141,7 +141,7 @@ export class ReservationsGridComponent implements OnInit {
         this.editSelected = (idlThings: IdlObject[]) => {
             const editOneThing = (thing: IdlObject) => {
                 if (!thing) { return; }
-                this.showEditDialog(thing).subscribe(
+                this.showEditDialog(thing).then(
                     () => editOneThing(idlThings.shift()));
             };
            editOneThing(idlThings.shift()); };
@@ -283,12 +283,16 @@ export class ReservationsGridComponent implements OnInit {
     showEditDialog(idlThing: IdlObject) {
         this.editDialog.recId = idlThing.id();
         this.editDialog.timezone = idlThing['timezone'];
-        return this.editDialog.open({size: 'lg'}).pipe(tap(
-            () => {
-                this.toast.success('Reservation successfully updated'); // TODO: needs i18n, pluralization
-                this.grid.reload();
-            }
-        ));
+        return new Promise((resolve, reject) => {
+            this.editDialog.open({size: 'lg'}).subscribe(
+                ok => {
+                    this.toast.success('Reservation successfully updated'); // TODO: needs i18n, pluralization
+                    this.grid.reload();
+                    resolve(ok)
+                },
+                rejection => {}
+            );
+        });
     }
 
     filterByResourceBarcode(barcode: string) {