de-lint
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 16 Jan 2020 22:15:33 +0000 (17:15 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 16 Jan 2020 22:15:33 +0000 (17:15 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts
Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-clone-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-create-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-delete-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-merge-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts

index fc71497..fd4bfa5 100644 (file)
@@ -18,7 +18,7 @@ export class AcqSearchComponent implements OnInit, AfterViewInit {
     selectedSearchTerm: String;
     selectedSearchOp: String;
 
-    hints = ["jub", "acqpl", "acqpo", "acqinv", "acqlid"];
+    hints = ['jub', 'acqpl', 'acqpo', 'acqinv', 'acqlid'];
     availableSearchTerms = {};
     searchTermDatatypes = {};
     searchType = '';
@@ -36,7 +36,7 @@ export class AcqSearchComponent implements OnInit, AfterViewInit {
     ) {}
 
     ngOnInit() {
-        var self = this;
+        const self = this;
         this.selectedSearchTerm = '';
         this.selectedSearchOp = '';
 
@@ -59,7 +59,7 @@ export class AcqSearchComponent implements OnInit, AfterViewInit {
 
         this.hints.forEach(
             function(hint) {
-                var o = {};
+                const o = {};
                 o['__label'] = self.idl.classes[hint].label;
                 o['__fields'] = [];
                 self.idl.classes[hint].fields.forEach(
@@ -67,9 +67,10 @@ export class AcqSearchComponent implements OnInit, AfterViewInit {
                         if (!field.virtual) {
                             o['__fields'].push(field.name);
                             o[field.name] = {
-                                "label": field.label, "datatype": field.datatype
+                                label: field.label,
+                                datatype: field.datatype
                             };
-                            self.searchTermDatatypes[hint+':'+field.name] = field.datatype;
+                            self.searchTermDatatypes[hint + ':' + field.name] = field.datatype;
                         }
                     }
                 );
@@ -78,15 +79,15 @@ export class AcqSearchComponent implements OnInit, AfterViewInit {
         );
 
         this.hints.push('acqlia');
-        this.availableSearchTerms['acqlia'] = {"__label": this.idl.classes.acqlia.label, "__fields": []};
-        this.pcrud.retrieveAll("acqliad", {"order_by": {"acqliad": "id"}})
+        this.availableSearchTerms['acqlia'] = {'__label': this.idl.classes.acqlia.label, '__fields': []};
+        this.pcrud.retrieveAll('acqliad', {'order_by': {'acqliad': 'id'}})
         .subscribe(liad => {
-            this.availableSearchTerms['acqlia']['__fields'].push(''+liad.id());
+            this.availableSearchTerms['acqlia']['__fields'].push('' + liad.id());
             this.availableSearchTerms['acqlia'][liad.id()] = {
-                "label": liad.description(),
-                "datatype": "text"
+                label: liad.description(),
+                datatype: 'text'
             };
-            this.searchTermDatatypes['acqlia:'+liad.id()] = 'text';
+            this.searchTermDatatypes['acqlia:' + liad.id()] = 'text';
         });
 
     }
index 4b7adc3..97ead98 100644 (file)
@@ -62,15 +62,15 @@ const searchOptions = {
 };
 
 const operatorMap = {
-    "!=": "__not",
-    ">": "__gte",
-    ">=": "__gte",
-    "<=": "__lte",
-    "<": "__lte",
-    "startswith": "__starts",
-    "endswith": "__ends",
-    "like": "__fuzzy",
-}
+    '!=': '__not',
+    '>': '__gte',
+    '>=': '__gte',
+    '<=': '__lte',
+    '<': '__lte',
+    'startswith': '__starts',
+    'endswith': '__ends',
+    'like': '__fuzzy',
+};
 
 @Injectable()
 export class AcqSearchService {
@@ -92,24 +92,24 @@ export class AcqSearchService {
         Object.keys(filters).forEach(filterField => {
             filters[filterField].forEach(condition => {
                 const searchTerm: Object = {};
-                let filterOp = "=";
-                let filterVal = "";
-                if (Object.keys(condition).some(x => x === "-not")) {
-                    filterOp = Object.keys(condition["-not"][filterField])[0];
-                    filterVal = condition["-not"][filterField][filterOp];
-                    searchTerm["__not"] = true;
+                let filterOp = '=';
+                let filterVal = '';
+                if (Object.keys(condition).some(x => x === '-not')) {
+                    filterOp = Object.keys(condition['-not'][filterField])[0];
+                    filterVal = condition['-not'][filterField][filterOp];
+                    searchTerm['__not'] = true;
                 } else {
                     filterOp = Object.keys(condition[filterField])[0];
                     filterVal = condition[filterField][filterOp];
-                    if (filterOp === "like" && filterVal.length > 1) {
-                        if (filterVal[0] === "%" && filterVal[filterVal.length - 1] === "%") {
+                    if (filterOp === 'like' && filterVal.length > 1) {
+                        if (filterVal[0] === '%' && filterVal[filterVal.length - 1] === '%') {
                             filterVal = filterVal.slice(1, filterVal.length - 1);
-                        } else if (filterVal[filterVal.length - 1] === "%") {
+                        } else if (filterVal[filterVal.length - 1] === '%') {
                             filterVal = filterVal.slice(0, filterVal.length - 1);
-                            filterOp = "startswith";
-                        } else if (filterVal[0] === "%") {
+                            filterOp = 'startswith';
+                        } else if (filterVal[0] === '%') {
                             filterVal = filterVal.slice(1);
-                            filterOp = "endswith";
+                            filterOp = 'endswith';
                         }
                     }
                 }
index 20a6011..19e157b 100644 (file)
@@ -42,10 +42,10 @@ export class InvoiceResultsComponent implements OnInit {
     }
 
     printSelectedInvoices(rows: IdlObject[]) {
-      var that = this;
-      var html = "<style type='text/css'>.acq-invoice-" +
-        "voucher {page-break-after:always;}" +
-        "</style>\n";
+      const that = this;
+      let html = '<style type="text/css">.acq-invoice-' +
+        'voucher {page-break-after:always;}' +
+        '</style>\n';
       this.net.request(
         'open-ils.acq',
         'open-ils.acq.invoice.print.html',
index 27aef6c..e2b23d3 100644 (file)
@@ -46,8 +46,8 @@ export class PicklistCloneDialogComponent
 
   cloneList() {
     const picklist = this.idl.create('acqpl');
-    picklist.owner(this.auth.user().id())
-    picklist.name(this.selectionListName)
+    picklist.owner(this.auth.user().id());
+    picklist.name(this.selectionListName);
     this.net.request(
       'open-ils.acq',
       'open-ils.acq.picklist.clone',
index 97aee85..9a5a8da 100644 (file)
@@ -43,8 +43,8 @@ export class PicklistCreateDialogComponent
 
   createList() {
     const picklist = this.idl.create('acqpl');
-    picklist.owner(this.auth.user().id())
-    picklist.name(this.selectionListName)
+    picklist.owner(this.auth.user().id());
+    picklist.name(this.selectionListName);
     this.net.request(
       'open-ils.acq',
       'open-ils.acq.picklist.create',
index e1e3b60..401937e 100644 (file)
@@ -49,8 +49,8 @@ export class PicklistDeleteDialogComponent
   }
 
   deleteLists() {
-    var that = this;
-    var observables = [];
+    const that = this;
+    const observables = [];
     this.grid.context.getSelectedRows().forEach(function(r) {
       observables.push( that.deleteList(r) );
     });
index d2b6755..a7d7643 100644 (file)
@@ -43,12 +43,12 @@ export class PicklistMergeDialogComponent
   }
 
   mergeLists() {
-    var that = this;
+    const that = this;
     this.net.request(
       'open-ils.acq',
       'open-ils.acq.picklist.merge',
       this.auth.token(), this.leadList,
-      this.selectedLists.map( list => list.id() ).filter(function(p) { return p != that.leadList; })
+      this.selectedLists.map( list => list.id() ).filter(function(p) { return p !== that.leadList; })
     ).subscribe(
       (res) => {
         if (this.evt.parse(res)) {
index 059772c..2dba18c 100644 (file)
@@ -58,7 +58,7 @@ export class PicklistResultsComponent implements OnInit {
     ngOnInit() {
         this.gridSource = this.acqSearch.getAcqSearchDataSource('picklist');
 
-        this.perm.hasWorkPermHere(['CREATE_PICKLIST','UPDATE_PICKLIST','VIEW_PICKLIST']).
+        this.perm.hasWorkPermHere(['CREATE_PICKLIST', 'UPDATE_PICKLIST', 'VIEW_PICKLIST']).
           then(perms => this.permissions = perms);
 
         this.noSelectedRows = (rows: IdlObject[]) => (rows.length === 0);