From: Galen Charlton Date: Thu, 16 Jan 2020 22:15:33 +0000 (-0500) Subject: de-lint X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f1c223c5383fe213309a9deff78221ab7a44cace;p=working%2FEvergreen.git de-lint Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts index fc71497942..fd4bfa599e 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts @@ -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'; }); } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts index 4b7adc3024..97ead98903 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts @@ -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'; } } } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts index 20a6011bb6..19e157be45 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/invoice-results.component.ts @@ -42,10 +42,10 @@ export class InvoiceResultsComponent implements OnInit { } printSelectedInvoices(rows: IdlObject[]) { - var that = this; - var html = "\n"; + const that = this; + let html = '\n'; this.net.request( 'open-ils.acq', 'open-ils.acq.invoice.print.html', diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-clone-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-clone-dialog.component.ts index 27aef6cd07..e2b23d39af 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-clone-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-clone-dialog.component.ts @@ -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', diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-create-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-create-dialog.component.ts index 97aee859da..9a5a8da030 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-create-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-create-dialog.component.ts @@ -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', diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-delete-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-delete-dialog.component.ts index e1e3b6091a..401937e10a 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-delete-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-delete-dialog.component.ts @@ -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) ); }); diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-merge-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-merge-dialog.component.ts index d2b67551a3..a7d7643d59 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-merge-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-merge-dialog.component.ts @@ -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)) { diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts index 059772cf5d..2dba18c333 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts @@ -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);