From c42023dc8649a44fcca4ea0c7f230c37a18fe624 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 8 Apr 2021 16:56:22 -0400 Subject: [PATCH] LP1904036 lint Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../app/staff/circ/patron/barcodes.component.ts | 2 +- .../src/app/staff/circ/patron/edit.component.ts | 44 +++++++++++----------- .../circ/patron/hold-notify-update.component.ts | 8 ++-- .../app/staff/circ/patron/messages.component.ts | 10 ++--- .../src/app/staff/circ/patron/perms.component.ts | 2 +- .../staff/share/buckets/bucket-dialog.component.ts | 2 +- .../staff/share/patron/merge-dialog.component.ts | 4 +- .../src/app/staff/share/patron/patron.service.ts | 4 +- .../src/app/staff/share/patron/search.component.ts | 2 +- 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/barcodes.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/barcodes.component.ts index 913e760603..d7067e35c4 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/barcodes.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/barcodes.component.ts @@ -58,7 +58,7 @@ export class PatronBarcodesDialogComponent PERMS.forEach(p => { this.myPerms[p] = perms[p].includes(this.patron.home_ou()); }); - }) + }); return super.open(ops); } diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index f224d121de..617436ad4a 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -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); } diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/hold-notify-update.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/hold-notify-update.component.ts index d8a3544a0e..505db4ee23 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/hold-notify-update.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/hold-notify-update.component.ts @@ -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({ diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts index 8680f64191..203b2baa62 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts @@ -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]; } diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/perms.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/perms.component.ts index ebaf12a321..aba79b1d7e 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/perms.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/perms.component.ts @@ -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'; }); }); diff --git a/Open-ILS/src/eg2/src/app/staff/share/buckets/bucket-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/buckets/bucket-dialog.component.ts index 478c3a941e..c16c926ce5 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/buckets/bucket-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/buckets/bucket-dialog.component.ts @@ -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. diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/merge-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/merge-dialog.component.ts index e5dfee1b94..b5f9a1c2ac 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/merge-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/merge-dialog.component.ts @@ -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); }); } diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts index 3e6f635da8..26d3d13256 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/patron.service.ts @@ -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; - }) + }); } } diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts index b75f868781..67b7369728 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts @@ -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); } } }); -- 2.11.0