From c4033b5ac78b3b966452d580bc8859052054b352 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 2 Jun 2020 14:51:35 -0400 Subject: [PATCH] LP#1879983: add Curbside Pickup to the Angular navbar For both the Angular and AngularJS staff interfaces, the Curbside Pickup option in the Circulation menu is displayed only if circ.curbside has been enabled for the workstation library. Sponsored-by: PaILS Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/nav.component.html | 5 +++++ Open-ILS/src/eg2/src/app/staff/nav.component.ts | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.html b/Open-ILS/src/eg2/src/app/staff/nav.component.html index 70ca9f5240..deb6b849fb 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -122,6 +122,11 @@ signal_wifi_off Offline Circulation + + + directions_bus + Curbside Pickup + diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.ts b/Open-ILS/src/eg2/src/app/staff/nav.component.ts index 970277c25b..92860b6610 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.ts @@ -18,6 +18,7 @@ export class StaffNavComponent implements OnInit { // Locales that have Angular staff translations locales: any[]; currentLocale: any; + curbsideEnabled: boolean; constructor( private router: Router, @@ -40,6 +41,15 @@ export class StaffNavComponent implements OnInit { l => l.code() === this.locale.currentLocaleCode())[0]; } ); + + // Avoid attempts to fetch org settings if the user has not yet + // logged in (e.g. this is the login page). + if (this.user()) { + this.org.settings('circ.curbside') + .then(settings => this.curbsideEnabled = + Boolean(settings['circ.curbside'])); + } + } user() { -- 2.11.0