LP1904036 ng lint continued
authorBill Erickson <berickxx@gmail.com>
Thu, 29 Sep 2022 14:41:17 +0000 (07:41 -0700)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:43 +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>

17 files changed:
Open-ILS/src/eg2/src/app/staff/circ/patron/alerts.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/barcodes.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/bill-statement.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/edit-toolbar.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/holds.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/surveys.component.ts
Open-ILS/src/eg2/src/app/staff/share/barcodes/barcode-select.component.ts
Open-ILS/src/eg2/src/app/staff/share/billing/credit-card-dialog.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/open-circ-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alert-manager.component.html
Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alert-manager.component.ts
Open-ILS/src/eg2/src/app/staff/share/patron/search.component.html

index ec52008..10f6389 100644 (file)
@@ -10,7 +10,7 @@ import {PatronContextService} from './patron.service';
   templateUrl: 'alerts.component.html',
   selector: 'eg-patron-alerts'
 })
-export class PatronAlertsComponent implements OnInit {
+export class PatronAlertsComponent {
 
     constructor(
         private org: OrgService,
@@ -19,9 +19,6 @@ export class PatronAlertsComponent implements OnInit {
         public context: PatronContextService
     ) {}
 
-    ngOnInit() {
-    }
-
     alerts(): PatronAlerts {
         return this.context.summary ? this.context.summary.alerts : null;
     }
index d7067e3..94d2ea3 100644 (file)
@@ -23,8 +23,7 @@ const PERMS = ['UPDATE_PATRON_ACTIVE_CARD', 'UPDATE_PATRON_PRIMARY_CARD'];
   templateUrl: 'barcodes.component.html'
 })
 
-export class PatronBarcodesDialogComponent
-    extends DialogComponent implements OnInit {
+export class PatronBarcodesDialogComponent extends DialogComponent {
 
     @Input() patron: IdlObject;
     primaryCard: number;
@@ -43,9 +42,6 @@ export class PatronBarcodesDialogComponent
         private context: PatronContextService
     ) { super(modal); }
 
-    ngOnInit() {
-    }
-
     open(ops: NgbModalOptions): Observable<any> {
         this.patron.cards().some(card => {
             if (card.id() === this.patron.card().id()) {
index cc06c8f..46158a7 100644 (file)
@@ -63,7 +63,7 @@
     <div class="col-lg-2" i18n>Renewal?</div>
     <div class="col-lg-1">
       <ng-container *ngIf="statement.xact.circulation()">
-        <eg-bool [value]="statement.xact.circulation().parent_circ() != null">
+        <eg-bool [value]="statement.xact.circulation().parent_circ() !== null">
         </eg-bool>
       </ng-container>
     </div>
index f6ed477..170562a 100644 (file)
@@ -35,7 +35,7 @@
         </div>
         <input type="text" class="form-control" id="barcode-input"
           [placeholder]="checkoutNoncat ? '' : 'Barcode...'" i18n-placeholder
-          [(ngModel)]="checkoutBarcode" [disabled]="checkoutNoncat != null"
+          [(ngModel)]="checkoutBarcode" [disabled]="checkoutNoncat !== null"
           i18n-aria-label aria-label="Barcode Input" (keydown.enter)="checkout()" />
         <div class="input-group-append">
           <button class="btn btn-outline-dark" (keydown.enter)="checkout()" 
@@ -46,7 +46,7 @@
     <div class="flex-1"></div>
     <div ngbDropdown>
       <button ngbDropdownToggle class="btn mr-2" [ngClass]="{
-          'btn-outline-dark': dueDateOptions == 0,
+          'btn-outline-dark': dueDateOptions === 0,
           'btn-outline-success': dueDateOptions > 0
         }"
         i18n>Date Options</button>
         <button ngbDropdownItem (click)="toggleDateOptions(1)">
           <span *ngIf="dueDateOptions > 0" 
             class="badge badge-success">&#x2713;</span>  
-          <span *ngIf="dueDateOptions == 0" 
+          <span *ngIf="dueDateOptions === 0" 
             class="badge badge-warning">&#x2717;</span> 
           <span class="pl-2" i18n>Specific Due Date</span>
         </button>
         <button ngbDropdownItem (click)="toggleDateOptions(2)">
-          <span *ngIf="dueDateOptions == 2" 
+          <span *ngIf="dueDateOptions === 2" 
             class="badge badge-success">&#x2713;</span>  
           <span *ngIf="dueDateOptions < 2" 
             class="badge badge-warning">&#x2717;</span> 
@@ -68,7 +68,7 @@
       </div>
     </div>
     <eg-datetime-select [initialIso]="dueDate" 
-      [readOnly]="dueDateOptions == 0" (onChangeAsIso)="setDueDate($event)">
+      [readOnly]="dueDateOptions === 0" (onChangeAsIso)="setDueDate($event)">
     </eg-datetime-select>
   </div>
 </div>
index b72e5f8..a801fa9 100644 (file)
@@ -3,13 +3,13 @@
   <div class="col-lg-6">
     <span class="font-weight-bold" i18n>Show:</span>
     <button class="btn btn-sm btn-outline-dark ml-2" 
-      [disabled]="visibilityLevel == 2"
+      [disabled]="visibilityLevel === 2"
       (click)="changeFields(2)" i18n>Required Fields</button>
     <button class="btn btn-sm btn-outline-dark ml-2" 
-      [disabled]="visibilityLevel == 1"
+      [disabled]="visibilityLevel === 1"
       (click)="changeFields(1)" i18n>Suggested Fields</button>
     <button class="btn btn-sm btn-outline-dark ml-2" 
-      [disabled]="visibilityLevel == 0"
+      [disabled]="visibilityLevel === 0"
       (click)="changeFields(0)" i18n>All Fields</button>
   </div>
 
index 82dff2d..95f9246 100644 (file)
     <div class="row pt-1 pb-1 mt-1" 
       *ngFor="let waiver of patron.waiver_entries(); let index = index">
       <div class="col-lg-3">
-        <span *ngIf="index == 0" i18n>Allow others to use my account</span>
+        <span *ngIf="index === 0" i18n>Allow others to use my account</span>
       </div>
       <div class="col-lg-3">
         <input type="text" class="form-control" [ngModel]="waiver.name()"
             <span class="text-danger material-icons">delete</span>
           </button>
         </div>
-        <div class="ml-2" *ngIf="index == patron.waiver_entries().length - 1">
+        <div class="ml-2" *ngIf="index === patron.waiver_entries().length - 1">
           <button class="btn btn-success material-icon-button" 
           (click)="addWaiver()" i18n-title title="Add Privacy Waiver">
             <span class="text-success material-icons">add</span>
             <div class="form-check form-check-inline mr-2">
               <input class="form-check-input" type="checkbox" 
                 name="addr-{{addr.id()}}-mailing" id="addr-{{addr.id()}}-mailing" 
-                [ngModel]="patron.mailing_address() && addr.id() == patron.mailing_address().id()"
+                [ngModel]="patron.mailing_address() && addr.id() === patron.mailing_address().id()"
                 (ngModelChange)="setAddrType('mailing', addr, $event)"/>
               <label class="form-check-label" 
                 for="addr-{{addr.id()}}-mailing" i18n>Mailing</label>
             <div class="form-check form-check-inline mr-2">
               <input class="form-check-input" type="checkbox" 
                 name="addr-{{addr.id()}}-billing" id="addr-{{addr.id()}}-billing" 
-                [ngModel]="patron.billing_address() && addr.id() == patron.billing_address().id()"
+                [ngModel]="patron.billing_address() && addr.id() === patron.billing_address().id()"
                 (ngModelChange)="setAddrType('billing', addr, $event)"/>
               <label class="form-check-label" 
                 for="addr-{{addr.id()}}-billing" i18n>Physical</label>
         domId="asc-{{stat.cat.id()}}-input"
         name="asc-{{stat.cat.id()}}-input"
         [entries]="stat.entries"
-        [required]="stat.cat.required() == 1"
-        [allowFreeText]="stat.cat.allow_freetext() == 1"
+        [required]="stat.cat.required() === 1"
+        [allowFreeText]="stat.cat.allow_freetext() === 1"
         [(ngModel)]="userStatCats[stat.cat.id()]"
         (onChange)="userStatCatChange(stat.cat, $event)">
       </eg-combobox>
index 62ca796..145cfca 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, OnInit, AfterViewInit, Input, ViewChild} from '@angular/core';
+import {Component, OnInit, Input, ViewChild} from '@angular/core';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
 import {empty, from} from 'rxjs';
 import {concatMap, tap} from 'rxjs/operators';
@@ -113,7 +113,7 @@ interface StatCat {
   selector: 'eg-patron-edit',
   styleUrls: ['edit.component.css']
 })
-export class EditComponent implements OnInit, AfterViewInit {
+export class EditComponent implements OnInit {
 
     @Input() patronId: number = null;
     @Input() cloneId: number = null;
@@ -243,9 +243,6 @@ export class EditComponent implements OnInit, AfterViewInit {
         this.load();
     }
 
-    ngAfterViewInit() {
-    }
-
     load(): Promise<any> {
         this.loading = true;
         this.showForm = false;
index ffa5be1..40623b0 100644 (file)
@@ -13,7 +13,7 @@ const HOLD_FOR_PATRON_KEY = 'eg.circ.patron_hold_target';
   templateUrl: 'holds.component.html',
   selector: 'eg-patron-holds'
 })
-export class HoldsComponent implements OnInit {
+export class HoldsComponent {
 
     constructor(
         private router: Router,
@@ -24,9 +24,6 @@ export class HoldsComponent implements OnInit {
         public context: PatronContextService
     ) {}
 
-    ngOnInit() {
-    }
-
     newHold() {
 
         this.store.setLoginSessionItem(HOLD_FOR_PATRON_KEY,
index 41f43fe..f6876eb 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, OnInit, AfterViewInit, Input, ViewChild} from '@angular/core';
+import {Component, OnInit, Input, ViewChild} from '@angular/core';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
 import {Observable, empty, of, from} from 'rxjs';
 import {tap, switchMap} from 'rxjs/operators';
@@ -25,7 +25,7 @@ import {CircGridComponent, CircGridEntry} from '@eg/staff/share/circ/grid.compon
   templateUrl: 'items.component.html',
   selector: 'eg-patron-items'
 })
-export class ItemsComponent implements OnInit, AfterViewInit {
+export class ItemsComponent implements OnInit {
 
     // Note we can get the patron id from this.context.patron.id(), but
     // on a new page load, this requires us to wait for the arrival of
@@ -64,9 +64,6 @@ export class ItemsComponent implements OnInit, AfterViewInit {
         this.load(true);
     }
 
-    ngAfterViewInit() {
-    }
-
     load(firstLoad?: boolean): Promise<any> {
         this.loading = true;
 
index 90e6d84..ff2acfe 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, ViewChild, OnInit, AfterViewInit, HostListener} from '@angular/core';
+import {Component, ViewChild, OnInit, HostListener} from '@angular/core';
 import {Router, ActivatedRoute, ParamMap, RoutesRecognized} from '@angular/router';
 import {Location} from '@angular/common';
 import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap';
@@ -27,7 +27,7 @@ const MAIN_TABS =
   templateUrl: 'patron.component.html',
   styleUrls: ['patron.component.css']
 })
-export class PatronComponent implements OnInit, AfterViewInit {
+export class PatronComponent implements OnInit {
 
     patronId: number;
     patronTab = 'search';
@@ -177,9 +177,6 @@ export class PatronComponent implements OnInit, AfterViewInit {
         });
     }
 
-    ngAfterViewInit() {
-    }
-
     // Navigate, opening new tabs when requested via control-click.
     // NOTE: The nav items have routerLinks, but for some reason,
     // control-click on the links does not open them in a new tab.
index 94727dc..1739aae 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core';
+import {Component, Input, OnInit, ViewChild} from '@angular/core';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
 import {from, empty, range} from 'rxjs';
 import {concatMap, tap, takeLast} from 'rxjs/operators';
@@ -16,7 +16,7 @@ import {PatronContextService} from './patron.service';
   templateUrl: 'surveys.component.html',
   selector: 'eg-patron-survey-responses'
 })
-export class PatronSurveyResponsesComponent implements OnInit, AfterViewInit {
+export class PatronSurveyResponsesComponent implements OnInit {
 
     @Input() patronId: number;
     surveys: IdlObject[] = [];
@@ -75,7 +75,4 @@ export class PatronSurveyResponsesComponent implements OnInit, AfterViewInit {
             }
         );
     }
-
-    ngAfterViewInit() {
-    }
 }
index 6f2f847..e0b331a 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, Input, Output, OnInit, ViewChild} from '@angular/core';
+import {Component, Input, Output, ViewChild} from '@angular/core';
 import {Observable} from 'rxjs';
 import {map, mergeMap} from 'rxjs/operators';
 import {IdlObject} from '@eg/core/idl.service';
@@ -37,7 +37,7 @@ export interface BarcodeSelectResult {
   templateUrl: './barcode-select.component.html',
 })
 
-export class BarcodeSelectComponent extends DialogComponent implements OnInit {
+export class BarcodeSelectComponent extends DialogComponent {
 
     matches: BarcodeSelectResult[];
     selected: BarcodeSelectResult;
@@ -52,9 +52,6 @@ export class BarcodeSelectComponent extends DialogComponent implements OnInit {
         private auth: AuthService
     ) { super(modal); }
 
-    ngOnInit() {
-    }
-
     selectionChanged() {
         const id = Object.keys(this.inputs).map(i => Number(i))
             .filter(i => this.inputs[i] === true)[0];
index d54eff2..583d032 100644 (file)
@@ -24,7 +24,7 @@
             </select>
           </div>
         </div>
-        <ng-container *ngIf="args.where_process == 1">
+        <ng-container *ngIf="args.where_process === 1">
           <div class="row mt-2">
             <div class="col-lg-4"><label i18n>Credit Card Number</label></div>
             <div class="col-lg-8">
@@ -33,7 +33,7 @@
             </div>
           </div>
         </ng-container>
-        <ng-container *ngIf="args.where_process == 0">
+        <ng-container *ngIf="args.where_process === 0">
           <div class="row mt-2">
             <div class="col-lg-4"><label i18n>Expire Month</label></div>
             <div class="col-lg-8">
@@ -75,7 +75,7 @@
           </div>
         </div>
 
-        <ng-container *ngIf="args.where_process == 0">
+        <ng-container *ngIf="args.where_process === 0">
           <div class="row mt-2">
             <div class="col-lg-4"><label i18n>Address</label></div>
             <div class="col-lg-8">
index 4960473..93858bb 100644 (file)
@@ -18,8 +18,7 @@ import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
   templateUrl: 'open-circ-dialog.component.html'
 })
 
-export class OpenCircDialogComponent
-    extends DialogComponent implements OnInit {
+export class OpenCircDialogComponent extends DialogComponent {
 
     @Input() sameUser: boolean;
     @Input() circDate: string; // iso
@@ -34,6 +33,4 @@ export class OpenCircDialogComponent
         private auth: AuthService) {
         super(modal); // required for subclassing
     }
-
-    ngOnInit() {}
 }
index f94bda5..633a728 100644 (file)
@@ -77,7 +77,7 @@
       *ngIf="mode === 'checkin' && nextStatuses.length > 0; let index = index">
       <div class="col-lg-4" i18n>Next item status:</div>
       <div class="col-lg-5">
-        <ng-container *ngIf="nextStatuses.length == 1">
+        <ng-container *ngIf="nextStatuses.length === 1">
           {{nextStatuses[0].name()}}
         </ng-container>
         <ng-container *ngIf="nextStatuses.length > 1">
index df0698e..9c564f3 100644 (file)
@@ -25,8 +25,7 @@ import {HoldingsService} from './holdings.service';
   styles: ['.acknowledged {text-decoration: line-through }']
 })
 
-export class CopyAlertManagerDialogComponent
-    extends DialogComponent implements OnInit {
+export class CopyAlertManagerDialogComponent extends DialogComponent {
 
     mode: string;
     alerts: IdlObject[];
@@ -45,8 +44,6 @@ export class CopyAlertManagerDialogComponent
         private holdings: HoldingsService
     ) { super(modal); }
 
-    ngOnInit() {}
-
     open(ops?: NgbModalOptions): Observable<any> {
 
         this.nextStatus = null;
index 45a4f9d..9a5dfec 100644 (file)
     [showDeclaredFieldsOnly]="true"> 
 
     <eg-grid-toolbar-button label="Add to Bucket" i18n-label 
-      [disabled]="getSelected().length == 0"
+      [disabled]="getSelected().length === 0"
       (onClick)="addSelectedToBucket($event)"></eg-grid-toolbar-button>
     <eg-grid-toolbar-button label="Merge Patrons" i18n-label 
       [disabled]="getSelected().length !== 2"