LP1942220: follow-up: ng lint fixes
authorJane Sandberg <js7389@princeton.edu>
Sun, 2 Oct 2022 13:52:29 +0000 (06:52 -0700)
committerJane Sandberg <js7389@princeton.edu>
Sun, 2 Oct 2022 15:02:50 +0000 (08:02 -0700)
Signed-off-by: Jane Sandberg <js7389@princeton.edu>

Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem-list.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem.component.ts
Open-ILS/src/eg2/src/app/staff/acq/lineitem/notes.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/notes.component.ts
Open-ILS/src/eg2/src/app/staff/acq/picklist/summary.component.ts
Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts
Open-ILS/src/eg2/src/app/staff/acq/po/notes.component.html
Open-ILS/src/eg2/src/app/staff/acq/po/notes.component.ts
Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html

index 2d8ce9d..758c965 100644 (file)
   <ng-container *ngIf="!embedded && !gatherParamsOnly">
     <div class="flex-2 p-1 pr-2 pl-2">
       <ng-container *ngIf="!batchMode">
-        <ng-container *ngIf="disposition() == 'pre-order'">
+        <ng-container *ngIf="disposition() === 'pre-order'">
           <button
             class="btn btn-outline-danger material-icon-button"
             (click)="deleteRequested.emit(copy)" title="Delete Item" i18n-title>
             <span class="material-icons">delete</span>
           </button>
         </ng-container>
-        <ng-container *ngIf="disposition() == 'on-order' || disposition() == 'delayed'">
+        <ng-container *ngIf="disposition() === 'on-order' || disposition() === 'delayed'">
           <a href="javascript:;" (click)="receiveRequested.emit(copy)" i18n>Mark Received</a>
         </ng-container>
-        <ng-container *ngIf="disposition() == 'received'">
+        <ng-container *ngIf="disposition() === 'received'">
           <a href="javascript:;" (click)="unReceiveRequested.emit(copy)" i18n>Un-Receive</a>
         </ng-container>
-        <ng-container *ngIf="disposition() == 'on-order'">
+        <ng-container *ngIf="disposition() === 'on-order'">
           <a href="javascript:;" class="ml-2" (click)="cancelRequested.emit(copy)" i18n>Cancel</a>
         </ng-container>
-        <ng-container *ngIf="disposition() == 'delayed'">
+        <ng-container *ngIf="disposition() === 'delayed'">
           &nbsp;<a href="javascript:;" (click)="cancelRequested.emit(copy)" i18n>Cancel</a>
         </ng-container>
-        <ng-container *ngIf="disposition() == 'delayed'">
+        <ng-container *ngIf="disposition() === 'delayed'">
           <span class="font-italic ml-2" title="{{copy.cancel_reason().description()}}">
             {{copy.cancel_reason().label()}}
           </span>
         </ng-container>
-        <ng-container *ngIf="disposition() == 'canceled'">
+        <ng-container *ngIf="disposition() === 'canceled'">
           <span class="font-italic" title="{{copy.cancel_reason().description()}}">
             {{copy.cancel_reason().label()}}
           </span>
index a67193a..f1dcc08 100644 (file)
             class="form-control">
             <option i18n value="">is</option>
             <option i18n value="__not">is NOT</option>
-            <option i18n value="__fuzzy" [hidden]="searchTermDatatypes[filterField] != 'text'">contains</option>
+            <option i18n value="__fuzzy" [hidden]="searchTermDatatypes[filterField] !== 'text'">contains</option>
             <option i18n value="__not,__fuzzy" [hidden]="searchTermDatatypes[filterField]">does NOT contain</option>
-            <option i18n value="__starts" [hidden]="searchTermDatatypes[filterField] != 'text'">STARTS with</option>
-            <option i18n value="__ends" [hidden]="searchTermDatatypes[filterField] != 'text'">ENDS with</option>
-            <option i18n value="__lte" [hidden]="searchTermDatatypes[filterField] != 'timestamp' && !dateLikeSearchFields[filterField]">is on or BEFORE</option>
-            <option i18n value="__gte" [hidden]="searchTermDatatypes[filterField] != 'timestamp' && !dateLikeSearchFields[filterField]">is on or AFTER</option>
-            <option i18n value="__between" [hidden]="searchTermDatatypes[filterField] != 'timestamp'">is BETWEEN</option>
-            <option i18n value="__age" [hidden]="searchTermDatatypes[filterField] != 'timestamp'">age (relative date)</option>
-            <option i18n value="__gte" [hidden]="searchTermDatatypes[filterField] != 'number'">is greater than or equal</option>
-            <option i18n value="__lte" [hidden]="searchTermDatatypes[filterField] != 'number'">is less than or equal</option>
+            <option i18n value="__starts" [hidden]="searchTermDatatypes[filterField] !== 'text'">STARTS with</option>
+            <option i18n value="__ends" [hidden]="searchTermDatatypes[filterField] !== 'text'">ENDS with</option>
+            <option i18n value="__lte" [hidden]="searchTermDatatypes[filterField] !== 'timestamp' && !dateLikeSearchFields[filterField]">is on or BEFORE</option>
+            <option i18n value="__gte" [hidden]="searchTermDatatypes[filterField] !== 'timestamp' && !dateLikeSearchFields[filterField]">is on or AFTER</option>
+            <option i18n value="__between" [hidden]="searchTermDatatypes[filterField] !== 'timestamp'">is BETWEEN</option>
+            <option i18n value="__age" [hidden]="searchTermDatatypes[filterField] !== 'timestamp'">age (relative date)</option>
+            <option i18n value="__gte" [hidden]="searchTermDatatypes[filterField] !== 'number'">is greater than or equal</option>
+            <option i18n value="__lte" [hidden]="searchTermDatatypes[filterField] !== 'number'">is less than or equal</option>
 <!-- TODO
             <option i18n value="__isnotnull" [hidden]="searchTermDatatypes[filterField] == 'id'">exists</option>
             <option i18n value="__isnull" [hidden]="searchTermDatatypes[filterField] == 'id'">does NOT exist</option>
             <option i18n value="__in">matches a term from a file</option>
 -->
           </select> 
-          <input *ngIf="searchTermDatatypes[filterField] != 'state'" type="text" class="form-control" name="filter-value-input" id="filter-value-input" [(ngModel)]="filterValue">
-          <eg-combobox *ngIf="searchTermDatatypes[filterField] == 'state'"
+          <input *ngIf="searchTermDatatypes[filterField] !== 'state'" type="text" class="form-control" name="filter-value-input" id="filter-value-input" [(ngModel)]="filterValue">
+          <eg-combobox *ngIf="searchTermDatatypes[filterField] === 'state'"
             [asyncSupportsEmptyTermClick]="true"
             idlClass="jubstlbl"
             [selectedId]="filterValue"
                   <button class="btn btn-outline-dark btn-sm" ngbDropdownToggle 
                     title="Order Identifier Type" i18n-title [disabled]="!canEditIdent(li)"
                     [ngClass]="{'btn-warning': !selectedIdent(li)}">
-                    <ng-container *ngIf="orderIdentTypes[li.id()]=='isbn'" i18n>ISBN</ng-container>
-                    <ng-container *ngIf="orderIdentTypes[li.id()]=='issn'" i18n>ISSN</ng-container>
-                    <ng-container *ngIf="orderIdentTypes[li.id()]=='upc'" i18n>UPC</ng-container>
+                    <ng-container *ngIf="orderIdentTypes[li.id()]==='isbn'" i18n>ISBN</ng-container>
+                    <ng-container *ngIf="orderIdentTypes[li.id()]==='issn'" i18n>ISSN</ng-container>
+                    <ng-container *ngIf="orderIdentTypes[li.id()]==='upc'" i18n>UPC</ng-container>
                   </button>
                   <div ngbDropdownMenu>
                     <button class="btn-sm" ngbDropdownItem
               <div ngbDropdown>
                 <button class="btn btn-info btn-sm" ngbDropdownToggle i18n>Actions</button>
                 <div ngbDropdownMenu>
-                  <button ngbDropdownItem [disabled]="li.state() != 'on-order' && lineitemDisposition(li) != 'delayed'"
+                  <button ngbDropdownItem [disabled]="li.state() !== 'on-order' && lineitemDisposition(li) !== 'delayed'"
                     (click)="markReceived([li.id()])" i18n>Mark Received</button>
-                  <button ngbDropdownItem [disabled]="li.state() != 'received'"
+                  <button ngbDropdownItem [disabled]="li.state() !== 'received'"
                     (click)="markUnReceived([li.id()])" i18n>Mark Un-Received</button>
                   <button ngbDropdownItem [disabled]="!liHasRealCopies(li)"
                     (click)="editHoldings(li)" i18n>Update Barcodes</button>
     </div>
   </div>
 
-  <div class="row" *ngIf="showNotesFor == li.id()">
+  <div class="row" *ngIf="showNotesFor === li.id()">
     <div class="col-lg-10 offset-lg-1 p-2 mt-2">
       <eg-lineitem-notes [lineitem]="li" (closeRequested)="showNotesFor = null">
       </eg-lineitem-notes>
index 7d7c2d5..0851c00 100644 (file)
@@ -1,9 +1,8 @@
-import {Component, OnInit} from '@angular/core';
+import {Component} from '@angular/core';
 
 @Component({
   templateUrl: 'lineitem.component.html'
 })
-export class LineitemComponent implements OnInit {
-    ngOnInit() {}
+export class LineitemComponent {
 }
 
index c4b32c2..68358d8 100644 (file)
@@ -31,7 +31,7 @@
   <div *ngFor="let note of lineitem.lineitem_notes()">
     <div class="d-flex m-1 p-2 border">
       <div class="flex-1 p-1">
-        <ng-container *ngIf="note.vendor_public() == 't'">
+        <ng-container *ngIf="note.vendor_public() === 't'">
           <div class="text-primary" i18n>VENDOR PUBLIC</div>
         </ng-container>
         <ng-container *ngIf="note.alert_text()">
index 14f82e6..ad84bac 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, OnInit, AfterViewInit, Input, Output, EventEmitter} from '@angular/core';
+import {Component, AfterViewInit, Input, Output, EventEmitter} from '@angular/core';
 import {Observable} from 'rxjs';
 import {IdlObject, IdlService} from '@eg/core/idl.service';
 import {NetService} from '@eg/core/net.service';
@@ -10,7 +10,7 @@ import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
   templateUrl: 'notes.component.html',
   selector: 'eg-lineitem-notes'
 })
-export class LineitemNotesComponent implements OnInit, AfterViewInit {
+export class LineitemNotesComponent implements AfterViewInit {
 
     @Input() lineitem: IdlObject;
     noteText: string;
@@ -27,9 +27,6 @@ export class LineitemNotesComponent implements OnInit, AfterViewInit {
         private net: NetService
     ) {}
 
-    ngOnInit() {
-    }
-
     ngAfterViewInit() {
         const node = document.getElementById('note-text-input');
         if (node) { node.focus(); }
index 9ee226c..a552f28 100644 (file)
@@ -1,6 +1,4 @@
-import {Component, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core';
-import {of, Observable} from 'rxjs';
-import {tap, take, map} from 'rxjs/operators';
+import {Component, Input, OnInit} from '@angular/core';
 import {IdlObject, IdlService} from '@eg/core/idl.service';
 import {NetService} from '@eg/core/net.service';
 import {FormatService} from '@eg/core/format.service';
@@ -9,11 +7,8 @@ import {OrgService} from '@eg/core/org.service';
 import {PcrudService} from '@eg/core/pcrud.service';
 import {StoreService} from '@eg/core/store.service';
 import {ServerStoreService} from '@eg/core/server-store.service';
-import {ComboboxEntry, ComboboxComponent} from '@eg/share/combobox/combobox.component';
-import {ProgressDialogComponent} from '@eg/share/dialog/progress.component';
 import {EventService} from '@eg/core/event.service';
 import {HoldingsService} from '@eg/staff/share/holdings/holdings.service';
-import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
 import {BroadcastService} from '@eg/share/util/broadcast.service';
 
 
@@ -21,7 +16,7 @@ import {BroadcastService} from '@eg/share/util/broadcast.service';
   templateUrl: 'summary.component.html',
   selector: 'eg-acq-picklist-summary'
 })
-export class PicklistSummaryComponent implements OnInit, AfterViewInit {
+export class PicklistSummaryComponent implements OnInit {
 
     private _picklistId: number;
     @Input() set picklistId(id: number) {
@@ -60,9 +55,6 @@ export class PicklistSummaryComponent implements OnInit, AfterViewInit {
         this.load().then(_ => this.initDone = true);
     }
 
-    ngAfterViewInit() {
-    }
-
     load(): Promise<any> {
         this.picklist = null;
         if (!this.picklistId) { return Promise.resolve(); }
index a27da98..17f1f75 100644 (file)
@@ -1,7 +1,6 @@
-import {Component, OnInit, AfterViewInit, Input,
+import {Component, AfterViewInit, Input,
     ViewChild, OnDestroy} from '@angular/core';
 import {Router} from '@angular/router';
-import {Subject} from 'rxjs';
 import {tap} from 'rxjs/operators';
 import {IdlObject} from '@eg/core/idl.service';
 import {NetService} from '@eg/core/net.service';
@@ -20,7 +19,6 @@ import {ProgressInlineComponent} from '@eg/share/dialog/progress-inline.componen
 import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
 import {ServerStoreService} from '@eg/core/server-store.service';
 import {PicklistUploadService} from './upload.service';
-import {OrgSelectComponent} from '@eg/share/org-select/org-select.component';
 
 
 const TEMPLATE_SETTING_NAME = 'eg.acq.picklist.upload.templates';
@@ -63,7 +61,7 @@ const ORG_SETTINGS = [
   selector: 'eg-acq-upload',
   templateUrl: './upload.component.html'
 })
-export class UploadComponent implements OnInit, AfterViewInit, OnDestroy {
+export class UploadComponent implements AfterViewInit, OnDestroy {
 
     // mode can be one of
     //  upload:          actually upload and process a MARC order file
@@ -205,8 +203,6 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy {
         }
     }
 
-    ngOnInit() {}
-
     ngAfterViewInit() {
         this.loadStartupData();
     }
index 8227a7c..a3f9681 100644 (file)
@@ -21,7 +21,7 @@
   <div *ngFor="let note of po.notes()">
     <div class="d-flex m-1 p-2 border">
       <div class="flex-1 p-1">
-        <ng-container *ngIf="note.vendor_public() == 't'">
+        <ng-container *ngIf="note.vendor_public() === 't'">
           <div class="text-primary" i18n>VENDOR PUBLIC</div>
         </ng-container>
       </div>
index 75bbaaf..d7af8da 100644 (file)
@@ -1,16 +1,15 @@
-import {Component, OnInit, AfterViewInit, Input, Output, EventEmitter} from '@angular/core';
+import {Component, AfterViewInit, Input, Output, EventEmitter} from '@angular/core';
 import {Observable} from 'rxjs';
 import {IdlObject, IdlService} from '@eg/core/idl.service';
 import {NetService} from '@eg/core/net.service';
 import {OrgService} from '@eg/core/org.service';
 import {AuthService} from '@eg/core/auth.service';
-import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
 
 @Component({
   templateUrl: 'notes.component.html',
   selector: 'eg-po-notes'
 })
-export class PoNotesComponent implements OnInit, AfterViewInit {
+export class PoNotesComponent implements AfterViewInit {
 
     @Input() po: IdlObject;
     noteText: string;
@@ -25,9 +24,6 @@ export class PoNotesComponent implements OnInit, AfterViewInit {
         private net: NetService
     ) {}
 
-    ngOnInit() {
-    }
-
     ngAfterViewInit() {
         const node = document.getElementById('note-text-input');
         if (node) { node.focus(); }
index 30bae1d..8d344b3 100644 (file)
@@ -31,8 +31,8 @@
               <eg-progress-inline></eg-progress-inline>
             </div>
 
-            <span *ngIf="po().state() == 'on-order'" i18n>On Order</span>
-            <span *ngIf="po().state() == 'received'" i18n>Received</span>
+            <span *ngIf="po().state() === 'on-order'" i18n>On Order</span>
+            <span *ngIf="po().state() === 'received'" i18n>Received</span>
             <ng-container *ngIf="canActivate">
               <span *ngIf="!activationEvent" i18n>Pending / Activatable</span>
               <span *ngIf="activationEvent" i18n>
@@ -52,7 +52,7 @@
               <span i18n> (Warning: </span>
               <ng-container *ngFor="let evt of activationWarnings">
                 <ng-container 
-                 *ngIf="evt.textcode == 'ACQ_FUND_EXCEEDS_WARN_PERCENT'">
+                 *ngIf="evt.textcode === 'ACQ_FUND_EXCEEDS_WARN_PERCENT'">
                   <span class="bg-warning" i18n>
                     Fund exceeds warning percent: 
                     {{evt.payload.fund.code()}} ({{evt.payload.fund.year()}}).
@@ -65,7 +65,7 @@
             <!-- activation blocks -->
             <div class="text-danger" *ngFor="let evt of activationBlocks">
               <ng-container 
-                *ngIf="evt.textcode == 'ACQ_FUND_EXCEEDS_STOP_PERCENT'; else noPrice">
+                *ngIf="evt.textcode === 'ACQ_FUND_EXCEEDS_STOP_PERCENT'; else noPrice">
                 <span i18n>
                   Fund exceeds stop percent: 
                   {{evt.payload.fund.code()}} ({{evt.payload.fund.year()}}).
               </ng-container>
               <ng-template #noPrice>
                 <ng-container 
-                  *ngIf="evt.textcode == 'ACQ_LINEITEM_NO_PRICE'; else noCopies">
+                  *ngIf="evt.textcode === 'ACQ_LINEITEM_NO_PRICE'; else noCopies">
                   <span i18n>One or more line items have no price.</span>
                 </ng-container>
               </ng-template>
               <ng-template #noCopies>
                 <ng-container 
-                  *ngIf="evt.textcode == 'ACQ_LINEITEM_NO_COPIES'; else noOwner">
+                  *ngIf="evt.textcode === 'ACQ_LINEITEM_NO_COPIES'; else noOwner">
                   <span i18n>One or more line items have no items attached.</span>
                 </ng-container>
               </ng-template>
               <ng-template #noOwner>
                 <ng-container 
-                  *ngIf="evt.textcode == 'ACQ_COPY_NO_OWNING_LIB'; else otherBlock">
+                  *ngIf="evt.textcode === 'ACQ_COPY_NO_OWNING_LIB'; else otherBlock">
                   <span i18n>One or more items have no owning lib.</span>
                 </ng-container>
               </ng-template>
           <div class="flex-4">{{po().lineitem_count()}}</div>
         </div>
         <div class="col-lg-8 d-flex">
-          <div class="form-check form-check-inline" *ngIf="po().state() == 'new' || po().state() == 'pending'">
+          <div class="form-check form-check-inline" *ngIf="po().state() === 'new' || po().state() === 'pending'">
             <input class="ml-0 form-check-input" type="checkbox" (change)="setCanActivate()"
               id="zero-copy-cbox" [(ngModel)]="zeroCopyActivate"/>
             <label class="form-check-label" for="zero-copy-cbox" i18n>
         <span class="material-icons small mr-1">print</span>
         <span i18n>Print</span>
       </a>
-      <ng-container *ngIf="po().state() == 'on-order'">
+      <ng-container *ngIf="po().state() === 'on-order'">
         <span class="pl-2 pr-2" i18n> | </span>
         <button class="btn btn-sm btn-danger" (click)="cancelPo()" i18n>Cancel Order</button>
       </ng-container>