LP1904036 lint
authorBill Erickson <berickxx@gmail.com>
Thu, 8 Apr 2021 20:56:22 +0000 (16:56 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:30 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/circ/patron/barcodes.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/hold-notify-update.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/perms.component.ts
Open-ILS/src/eg2/src/app/staff/share/buckets/bucket-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/share/patron/merge-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts
Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts

index 913e760..d7067e3 100644 (file)
@@ -58,7 +58,7 @@ export class PatronBarcodesDialogComponent
             PERMS.forEach(p => {
                 this.myPerms[p] = perms[p].includes(this.patron.home_ou());
             });
-        })
+        });
 
         return super.open(ops);
     }
index f224d12..617436a 100644 (file)
@@ -283,7 +283,7 @@ export class EditComponent implements OnInit, AfterViewInit {
 
             const children = profiles.filter(p => p.parent() === grp.id());
             children.forEach(child => traverseTree(child, failed));
-        }
+        };
 
         return this.perms.hasWorkPermAt(appPerms, true).then(orgs => {
             appPerms.forEach(p => {
@@ -325,9 +325,9 @@ export class EditComponent implements OnInit, AfterViewInit {
         .then(_ => {
 
             const requestor = this.stageUser.user.requesting_usr();
-            if (!requestor) return;
-
-            return this.pcrud.retrieve('au', requestor).toPromise();
+            if (requestor) {
+                return this.pcrud.retrieve('au', requestor).toPromise();
+            }
 
         })
         .then(reqr => this.stageUserRequestor = reqr)
@@ -338,7 +338,7 @@ export class EditComponent implements OnInit, AfterViewInit {
         const stageData = this.stageUser;
         const patron = this.patron;
 
-        for (let key in this.idl.classes.stgu.field_map) {
+        Object.keys(this.idl.classes.stgu.field_map).forEach(key => {
             const field = this.idl.classes.au.field_map[key];
             if (field && !field.virtual) {
                 const value = stageData.user[key]();
@@ -346,10 +346,10 @@ export class EditComponent implements OnInit, AfterViewInit {
                     patron[key](value);
                 }
             }
-        };
+        });
 
         // Clear the usrname if it looks like a UUID
-        if (patron.usrname().replace(/-/g,'').match(/[0-9a-f]{32}/)) {
+        if (patron.usrname().replace(/-/g, '').match(/[0-9a-f]{32}/)) {
             patron.usrname('');
         }
 
@@ -372,7 +372,7 @@ export class EditComponent implements OnInit, AfterViewInit {
             this.strings.interpolate('circ.patron.edit.default_addr_type')
             .then(msg => addr.address_type(msg));
 
-            for (let key in this.idl.classes[cls].field_map) {
+            Object.keys(this.idl.classes[cls].field_map).forEach(key => {
                 const field = this.idl.classes.aua.field_map[key];
                 if (field && !field.virtual) {
                     const value = stageAddr[key]();
@@ -380,7 +380,7 @@ export class EditComponent implements OnInit, AfterViewInit {
                         addr[key](value);
                     }
                 }
-            }
+            });
 
             patron.addresses().push(addr);
 
@@ -389,12 +389,12 @@ export class EditComponent implements OnInit, AfterViewInit {
             } else {
                 patron.billing_address(addr);
             }
-        }
+        };
 
         addrFromStage(stageData.mailing_addresses[0]);
         addrFromStage(stageData.billing_addresses[0]);
 
-        if (patron.addresses().length == 1) {
+        if (patron.addresses().length === 1) {
             // Only one address, use it for both purposes.
             const addr = patron.addresses()[0];
             patron.mailing_address(addr);
@@ -423,7 +423,7 @@ export class EditComponent implements OnInit, AfterViewInit {
         const patron = this.patron;
 
         // flesh the home org locally
-        patron.home_ou(clone.home_ou())
+        patron.home_ou(clone.home_ou());
 
         if (!clone.billing_address() &&
             !clone.mailing_address()) {
@@ -452,7 +452,7 @@ export class EditComponent implements OnInit, AfterViewInit {
                 newAddr.valid('t');
                 patron.addresses().push(newAddr);
                 return newAddr;
-            }
+            };
 
             if (billAddr = clone.billing_address()) {
                 patron.billing_address(cloneAddr(billAddr));
@@ -460,7 +460,7 @@ export class EditComponent implements OnInit, AfterViewInit {
 
             if (mailAddr = clone.mailing_address()) {
 
-                if (billAddr && billAddr.id() == mailAddr.id()) {
+                if (billAddr && billAddr.id() === mailAddr.id()) {
                     patron.mailing_address(patron.billing_address());
                 } else {
                     patron.mailing_address(cloneAddr(mailAddr));
@@ -484,7 +484,7 @@ export class EditComponent implements OnInit, AfterViewInit {
 
             if (addr = clone.mailing_address()) {
                 if (patron.billing_address() &&
-                    addr.id() == patron.billing_address().id()) {
+                    addr.id() === patron.billing_address().id()) {
                     // mailing matches billing
                     patron.mailing_address(patron.billing_address());
                 } else {
@@ -658,10 +658,10 @@ export class EditComponent implements OnInit, AfterViewInit {
         this.holdNotifyValues.other_phone = this.patron.other_phone();
         this.holdNotifyValues.evening_phone = this.patron.evening_phone();
 
-        this.patron.settings().forEach(setting => {
-            const value = setting.value();
+        this.patron.settings().forEach(stg => {
+            const value = stg.value();
             if (value !== '' && value !== null) {
-                usets[setting.name()] = JSON.parse(value);
+                usets[stg.name()] = JSON.parse(value);
             }
         });
 
@@ -963,7 +963,7 @@ export class EditComponent implements OnInit, AfterViewInit {
         this.net.request(
             'open-ils.search', 'open-ils.search.zip', postCode
         ).subscribe(resp => {
-            if (!resp) return;
+            if (!resp) { return; }
 
             ['city', 'state', 'county'].forEach(field => {
                 if (resp[field]) {
@@ -1483,8 +1483,8 @@ export class EditComponent implements OnInit, AfterViewInit {
                 newValue = this.patron[field]();
 
             } else if (matches = field.match(/(\w+)_notify/)) {
-                const holdNotify = this.userSettings['opac.hold_notify'] || '';
-                newValue = holdNotify.match(matches[1]) !== null;
+                const notify = this.userSettings['opac.hold_notify'] || '';
+                newValue = notify.match(matches[1]) !== null;
             }
 
             const oldValue = this.holdNotifyValues[field];
@@ -1509,7 +1509,7 @@ export class EditComponent implements OnInit, AfterViewInit {
                         oldValue: oldValue,
                         holds: holds
                     });
-                };
+                }
             }));
         })).toPromise().then(_ => mods);
     }
index d8a3544..505db4e 100644 (file)
@@ -16,10 +16,10 @@ import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
 /* Apply notification changes to affected holds */
 
 export interface HoldNotifyMod {
-    field: string,
-    newValue: any,
-    oldValue: any,
-    holds: any[]
+    field: string;
+    newValue: any;
+    oldValue: any;
+    holds: any[];
 }
 
 @Component({
index 8680f64..203b2ba 100644 (file)
@@ -33,7 +33,7 @@ export class PatronMessagesComponent implements OnInit {
     @ViewChild('mainGrid') private mainGrid: GridComponent;
     @ViewChild('archiveGrid') private archiveGrid: GridComponent;
     @ViewChild('penaltyDialog')
-        private penaltyDialog: PatronPenaltyDialogComponent
+        private penaltyDialog: PatronPenaltyDialogComponent;
 
     constructor(
         private org: OrgService,
@@ -47,7 +47,7 @@ export class PatronMessagesComponent implements OnInit {
 
     ngOnInit() {
 
-               const orgIds = this.org.fullPath(this.auth.user().ws_ou(), true);
+        const orgIds = this.org.fullPath(this.auth.user().ws_ou(), true);
 
         const start = new Date();
         start.setFullYear(start.getFullYear() - 1);
@@ -80,7 +80,7 @@ export class PatronMessagesComponent implements OnInit {
 
             flesh.order_by = orderBy;
             return this.pcrud.search('ausp', query, flesh, {authoritative: true});
-        }
+        };
 
         this.archiveDataSource.getRows = (pager: Pager, sort: any[]) => {
             const orderBy: any = {ausp: 'set_date'};
@@ -98,7 +98,7 @@ export class PatronMessagesComponent implements OnInit {
             flesh.order_by = orderBy;
 
             return this.pcrud.search('ausp', query, flesh, {authoritative: true});
-        }
+        };
     }
 
     dateRange(): string[] {
@@ -106,7 +106,7 @@ export class PatronMessagesComponent implements OnInit {
         let endDate = this.endDateYmd;
         const today = DateUtil.localYmdFromDate();
 
-        if (endDate == today) { endDate = 'now'; }
+        if (endDate === today) { endDate = 'now'; }
 
         return [this.startDateYmd, endDate];
     }
index ebaf12a..aba79b1 100644 (file)
@@ -77,7 +77,7 @@ export class PatronPermsComponent implements OnInit {
                 maps.forEach(m => {
                     this.permsApplied[m.perm()] = true;
                     this.permDepths[m.perm()] = m.depth();
-                    this.permGrantable[m.perm()] = m.grantable() === 't'
+                    this.permGrantable[m.perm()] = m.grantable() === 't';
 
                 });
             });
index 478c3a9..c16c926 100644 (file)
@@ -10,7 +10,7 @@ import {DialogComponent} from '@eg/share/dialog/dialog.component';
 import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
 import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
 import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
-import {StringComponent} from '@eg/share/string/string.component'
+import {StringComponent} from '@eg/share/string/string.component';
 
 /**
  * Dialog for adding bib records to new and existing record buckets.
index e5dfee1..b5f9a1c 100644 (file)
@@ -61,9 +61,9 @@ export class PatronMergeDialogComponent
             this.leadAccount = null;
             this.loadPatron(this.patronIds[0])
             .then(ctx => this.summary1 = ctx)
-            .then(_ => this.loadPatron(this.patronIds[1]))
+            .then(__ => this.loadPatron(this.patronIds[1]))
             .then(ctx => this.summary2 = ctx)
-            .then(_ => this.loading = false);
+            .then(__ => this.loading = false);
         });
     }
 
index 3e6f635..26d3d13 100644 (file)
@@ -276,7 +276,7 @@ export class PatronService {
             return this.net.request(
                 'open-ils.actor',
                 'open-ils.actor.user.opac.vital_stats.authoritative',
-                this.auth.token(), patron.id()).toPromise()
+                this.auth.token(), patron.id()).toPromise();
 
         }).then((stats: PatronStats) => {
 
@@ -352,7 +352,7 @@ export class PatronService {
             }
 
             return alerts;
-        })
+        });
     }
 }
 
index b75f868..67b7369 100644 (file)
@@ -102,7 +102,7 @@ export class PatronSearchComponent implements OnInit, AfterViewInit {
                 try {
                     this.startWithSearch = {search: JSON.parse(search)};
                 } catch (E) {
-                    console.error("Invalid JSON search value", search, E);
+                    console.error('Invalid JSON search value', search, E);
                 }
             }
         });