1 import {Injectable} from '@angular/core';
2 import {Router, Resolve, RouterStateSnapshot,
3 ActivatedRouteSnapshot} from '@angular/router';
4 import {ServerStoreService} from '@eg/core/server-store.service';
5 import {NetService} from '@eg/core/net.service';
6 import {OrgService} from '@eg/core/org.service';
7 import {AuthService} from '@eg/core/auth.service';
8 import {PatronContextService} from './patron.service';
12 export class PatronResolver implements Resolve<Promise<any[]>> {
15 private store: ServerStoreService,
16 private context: PatronContextService
20 route: ActivatedRouteSnapshot,
21 state: RouterStateSnapshot): Promise<any[]> {
22 return this.fetchSettings();
25 fetchSettings(): Promise<any> {
27 // Some of these are used by the shared circ services.
28 // Precache them since we're making the call anyway.
29 return this.store.getItemBatch([
30 'eg.circ.patron.summary.collapse',
31 'circ.do_not_tally_claims_returned',
33 'ui.staff.require_initials.patron_standing_penalty',
34 'ui.admin.work_log.max_entries',
35 'ui.admin.patron_log.max_entries',
36 'circ.staff_client.do_not_auto_attempt_print',
37 'circ.clear_hold_on_checkout',
38 'ui.circ.suppress_checkin_popups',
39 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
40 'ui.circ.billing.amount_warn',
41 'ui.circ.billing.amount_limit',
42 'circ.staff_client.do_not_auto_attempt_print',
43 'circ.disable_patron_credit',
44 'credit.processor.default'
46 this.context.noTallyClaimsReturned =
47 settings['circ.do_not_tally_claims_returned'];
48 this.context.tallyLost = settings['circ.tally_lost'];