LP1830424 Implement Angular "retrieve last bib record"
authorBill Erickson <berickxx@gmail.com>
Wed, 29 May 2019 18:03:38 +0000 (14:03 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 30 Jul 2019 15:27:48 +0000 (11:27 -0400)
Repair the Angular navbar menu entry for "Retrieve Last Bib Record" by
replacing the copy/paste'd ng-click handler with an Angular (click)
handler and local implementation.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/nav.component.html
Open-ILS/src/eg2/src/app/staff/nav.component.ts

index 8034f41..63b2106 100644 (file)
             <span class="material-icons">collections_bookmark</span>
             <span i18n>Retrieve Bib Record by TCN</span>
           </a>
-          <a href="" ng-click="retrieveLastRecord()"
+          <a (click)="retrieveLastRecord()"
             eg-accesskey="shift+f8" 
             eg-accesskey-desc="Retrieve Last Bib Record" class="dropdown-item">
             <span class="material-icons">redo</span>
index 852562c..f143727 100644 (file)
@@ -6,6 +6,7 @@ import {AuthService} from '@eg/core/auth.service';
 import {PcrudService} from '@eg/core/pcrud.service';
 import {LocaleService} from '@eg/core/locale.service';
 import {PrintService} from '@eg/share/print/print.service';
+import {StoreService} from '@eg/core/store.service';
 
 @Component({
     selector: 'eg-staff-nav-bar',
@@ -24,6 +25,7 @@ export class StaffNavComponent implements OnInit {
 
     constructor(
         private router: Router,
+        private store: StoreService,
         private org: OrgService,
         private auth: AuthService,
         private pcrud: PcrudService,
@@ -81,6 +83,14 @@ export class StaffNavComponent implements OnInit {
     reprintLast() {
         this.printer.reprintLast();
     }
+
+    // TODO: Point to Angular catalog when the time comes
+    retrieveLastRecord() {
+        const recId = this.store.getLocalItem('eg.cat.last_record_retrieved');
+        if (recId) {
+            window.location.href = '/eg/staff/cat/catalog/record/' + recId;
+        }
+    }
 }