From: Bill Erickson Date: Fri, 18 May 2018 14:47:09 +0000 (-0400) Subject: LP#1626157 ng-lint updates / trailing whitespace X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c6f7f54ec7ec1359f4655c37a52587cf6c492635;p=working%2FEvergreen.git LP#1626157 ng-lint updates / trailing whitespace Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/core/event.spec.ts b/Open-ILS/src/eg2/src/app/core/event.spec.ts index acafe601b7..a0e67ba2be 100644 --- a/Open-ILS/src/eg2/src/app/core/event.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/event.spec.ts @@ -5,12 +5,12 @@ describe('EgEventService', () => { beforeEach(() => {service = new EgEventService();}); const evt = { - ilsevent: "12345", - pid: "12345", + ilsevent: "12345", + pid: "12345", desc: "Test Event Description", - payload: {test : 'xyz'}, + payload: {test : 'xyz'}, textcode: "TEST_EVENT", - servertime: "Wed Nov 6 16:05:50 2013" + servertime: "Wed Nov 6 16:05:50 2013" }; it('should parse an event object', () => { diff --git a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts index bb1fada38c..064e20000c 100644 --- a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts +++ b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.directive.ts @@ -4,11 +4,11 @@ * Access key action is peformed via .click(). hrefs, routerLinks, * and (click) actions are all supported. * - * */ import {Directive, ElementRef, Input, OnInit} from '@angular/core'; @@ -29,7 +29,7 @@ export class EgAccessKeyDirective implements OnInit { // Context info to display in the accesskey info dialog // E.g. "navbar" @Input() keyCtx: string; - + constructor( private elm: ElementRef, private keyService: EgAccessKeyService @@ -44,7 +44,7 @@ export class EgAccessKeyDirective implements OnInit { this.keySpec.split(/ /).forEach(keySpec => { this.keyService.assign({ - key: keySpec, + key: keySpec, desc: this.keyDesc, ctx: this.keyCtx, action: () => {this.elm.nativeElement.click()} diff --git a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts index 1a3dab32c1..3c51963cb5 100644 --- a/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts +++ b/Open-ILS/src/eg2/src/app/share/accesskey/accesskey.service.ts @@ -3,7 +3,7 @@ import {Injectable, EventEmitter, HostListener} from '@angular/core'; export interface EgAccessKeyAssignment { key: string, // keyboard command desc: string, // human-friendly description - ctx: string, // template context + ctx: string, // template context action: Function // handler function }; @@ -21,7 +21,7 @@ export class EgAccessKeyService { } /** - * Compress a set of single-fire keyboard events into single + * Compress a set of single-fire keyboard events into single * string. For example: Control and 't' becomes 'ctrl+t'. */ compressKeys(evt: KeyboardEvent): string { @@ -54,7 +54,7 @@ export class EgAccessKeyService { /** * Returns a simplified key assignment list containing just - * the key spec and the description. Useful for inspecting + * the key spec and the description. Useful for inspecting * without exposing the actions. */ infoIze(): any[] { diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts index 707d44f91e..a71b87413d 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog-url.service.ts @@ -12,11 +12,11 @@ export class EgCatalogUrlService { constructor(private org: EgOrgService) { } /** - * Returns a URL query structure suitable for using with - * router.navigate(..., {queryParams:...}). + * Returns a URL query structure suitable for using with + * router.navigate(..., {queryParams:...}). * No navigation is performed within. */ - toUrlParams(context: CatalogSearchContext): + toUrlParams(context: CatalogSearchContext): {[key: string]: string | string[]} { let params = { @@ -45,7 +45,7 @@ export class EgCatalogUrlService { context.query.forEach((q, idx) => { ['query', 'fieldClass','joinOp','matchOp'].forEach(field => { - // Propagate all array-based fields regardless of + // Propagate all array-based fields regardless of // whether a value is applied to ensure correct // correlation between values. params[field][idx] = context[field][idx]; @@ -54,13 +54,13 @@ export class EgCatalogUrlService { // CCVM filters are encoded as comma-separated lists Object.keys(context.ccvmFilters).forEach(code => { - if (context.ccvmFilters[code] && + if (context.ccvmFilters[code] && context.ccvmFilters[code][0] != '') { params[code] = context.ccvmFilters[code].join(','); } }); - // Each facet is a JSON encoded blob of class, name, and value + // Each facet is a JSON encoded blob of class, name, and value context.facetFilters.forEach(facet => { params.facets.push(JSON.stringify({ c : facet.facetClass, diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts index 8b0483f3e7..f5f69e4334 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts @@ -71,7 +71,7 @@ export class EgCatalogService { return new Promise((resolve, reject) => { this.net.request( 'open-ils.search', method, { - limit : ctx.pager.limit + 1, + limit : ctx.pager.limit + 1, offset : ctx.pager.offset }, fullQuery, true ).subscribe(result => { @@ -97,7 +97,7 @@ export class EgCatalogService { fetchBibSummaries(ctx: CatalogSearchContext): Promise { let promises = []; - let depth = ctx.global ? + let depth = ctx.global ? ctx.org.root().ou_type().depth() : ctx.searchOrg.ou_type().depth(); @@ -125,7 +125,7 @@ export class EgCatalogService { } return new Promise((resolve, reject) => { - this.net.request('open-ils.search', + this.net.request('open-ils.search', 'open-ils.search.facet_cache.retrieve', ctx.result.facet_key ).subscribe(facets => { @@ -163,12 +163,12 @@ export class EgCatalogService { fetchCcvms(): Promise { - if (Object.keys(this.ccvmMap).length) + if (Object.keys(this.ccvmMap).length) return Promise.resolve(); return new Promise((resolve, reject) => { - this.pcrud.search('ccvm', - {ctype : CATALOG_CCVM_FILTERS}, {}, + this.pcrud.search('ccvm', + {ctype : CATALOG_CCVM_FILTERS}, {}, {atomic: true, anonymous: true} ).subscribe(list => { this.compileCcvms(list); @@ -185,7 +185,7 @@ export class EgCatalogService { }); Object.keys(this.ccvmMap).forEach(cType => { - this.ccvmMap[cType] = + this.ccvmMap[cType] = this.ccvmMap[cType].sort((a, b) => { return a.value() < b.value() ? -1 : 1; }); @@ -195,11 +195,11 @@ export class EgCatalogService { fetchCmfs(): Promise { // At the moment, we only need facet CMFs. - if (Object.keys(this.cmfMap).length) + if (Object.keys(this.cmfMap).length) return Promise.resolve(); return new Promise((resolve, reject) => { - this.pcrud.search('cmf', + this.pcrud.search('cmf', {facet_field : 't'}, {}, {atomic: true, anonymous: true} ).subscribe( cmfs => { @@ -218,10 +218,10 @@ export class EgCatalogService { getBibSummary(bibId: number, orgId?: number, depth?: number): Promise { return new Promise((resolve, reject) => { this.unapi.getAsXmlDocument({ - target: 'bre', - id: bibId, - extras: '{bre.extern,holdings_xml,mra}', - format: 'mods32', + target: 'bre', + id: bibId, + extras: '{bre.extern,holdings_xml,mra}', + format: 'mods32', orgId: orgId, depth: depth }).then(xmlDoc => { @@ -235,7 +235,7 @@ export class EgCatalogService { /** * Probably don't want to require navigating the bare UNAPI * blob in the template, plus that's quite a lot of stuff - * to sit in the scope / watch for changes. Translate the + * to sit in the scope / watch for changes. Translate the * UNAPI content into a more digestable form. * TODO: Add display field support */ @@ -251,14 +251,14 @@ export class EgCatalogService { }; Object.keys(MODS_XPATH_AUTO).forEach(key => { - let result = xmlDoc.evaluate(MODS_XPATH_AUTO[key], xmlDoc, + let result = xmlDoc.evaluate(MODS_XPATH_AUTO[key], xmlDoc, resolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null); let node = result.singleNodeValue; if (node) response[key] = node.textContent; }); - let result = xmlDoc.evaluate(MODS_XPATH.extern, xmlDoc, + let result = xmlDoc.evaluate(MODS_XPATH.extern, xmlDoc, resolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null); let node:any = result.singleNodeValue; @@ -269,7 +269,7 @@ export class EgCatalogService { } } - result = xmlDoc.evaluate(MODS_XPATH.attributes, xmlDoc, + result = xmlDoc.evaluate(MODS_XPATH.attributes, xmlDoc, resolver, XPathResult.ANY_TYPE, null); while(node = result.iterateNext()) { @@ -279,12 +279,12 @@ export class EgCatalogService { } } - result = xmlDoc.evaluate(MODS_XPATH.copyCounts, xmlDoc, + result = xmlDoc.evaluate(MODS_XPATH.copyCounts, xmlDoc, resolver, XPathResult.ANY_TYPE, null); while(node = result.iterateNext()) { let counts = {}; - ['type', 'depth', 'org_unit', 'transcendant', + ['type', 'depth', 'org_unit', 'transcendant', 'available', 'count', 'unshadow'].forEach(field => { counts[field] = node.getAttribute(field); }); diff --git a/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts b/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts index 54224ff8c1..d263fcfc3e 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/search-context.ts @@ -68,8 +68,8 @@ export class CatalogSearchContext { let ids = []; for ( let idx = this.pager.offset; - idx < Math.min( - this.pager.offset + this.pager.limit, + idx < Math.min( + this.pager.offset + this.pager.limit, this.pager.resultCount ); idx++ @@ -98,7 +98,7 @@ export class CatalogSearchContext { /** * Return search context to its default state, resetting search * parameters and clearing any cached result data. - * This does not reset global filters like limit-to-available + * This does not reset global filters like limit-to-available * search-global, or search-org. */ reset(): void { @@ -117,7 +117,7 @@ export class CatalogSearchContext { } isSearchable(): boolean { - return this.query.length + return this.query.length && this.query[0] != '' && this.searchOrg != null; } @@ -172,11 +172,11 @@ export class CatalogSearchContext { } stripQuotes(query: string): string { - return query.replace(/"/g, ''); + return query.replace(/"/g, ''); } stripAnchors(query: string): string { - return query.replace(/[\^\$]/g, ''); + return query.replace(/[\^\$]/g, ''); } addQuotes(query: string): string { @@ -210,7 +210,7 @@ export class CatalogSearchContext { query = '^' + this.stripAnchors(query) + '$'; break; case 'starts': - query = this.addQuotes('^' + + query = this.addQuotes('^' + this.stripAnchors(this.stripQuotes(query))); break; } diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts index f203a5bb7e..67db0af783 100644 --- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts @@ -30,7 +30,7 @@ export class EgDateSelectComponent implements OnInit { this.onChangeAsIso = new EventEmitter(); this.onChangeAsYmd = new EventEmitter(); } - + ngOnInit() { if (this.initialYmd) { @@ -44,8 +44,8 @@ export class EgDateSelectComponent implements OnInit { this.initialDate = new Date(); this.current = { - year: this.initialDate.getFullYear(), - month: this.initialDate.getMonth() + 1, + year: this.initialDate.getFullYear(), + month: this.initialDate.getMonth() + 1, day: this.initialDate.getDate() }; } @@ -62,7 +62,7 @@ export class EgDateSelectComponent implements OnInit { // Create a date in the local time zone with selected YMD values. // TODO: Consider moving this to a date service... localDateFromYmd(ymd: string): Date { - var parts = ymd.split('-'); + var parts = ymd.split('-'); return new Date( Number(parts[0]), Number(parts[1]) - 1, Number(parts[2])); } diff --git a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts index e1b3e42103..19374a9d3b 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts @@ -1,11 +1,11 @@ import {Component, Input, OnInit, ViewChild, TemplateRef, EventEmitter} from '@angular/core'; import {NgbModal, NgbModalRef, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; -/** - * Dialog base class. Handles the ngbModal logic. - * Sub-classed component templates must have a #dialogContent selector +/** + * Dialog base class. Handles the ngbModal logic. + * Sub-classed component templates must have a #dialogContent selector * at the root of the template (see EgConfirmDialogComponent). - */ + */ @Component({ selector: 'eg-dialog', @@ -17,11 +17,11 @@ export class EgDialogComponent implements OnInit { @Input() public dialogTitle: string; // Pointer to the dialog content template. - @ViewChild('dialogContent') + @ViewChild('dialogContent') private dialogContent: TemplateRef; // Emitted after open() is called on the ngbModal. - // Note when overriding open(), this will not fire unless also + // Note when overriding open(), this will not fire unless also // called in the overridding method. onOpen$ = new EventEmitter(); diff --git a/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts index 33f80998d4..d9cc60a7a5 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/progress.component.ts @@ -8,7 +8,7 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; }) /** - * Progress Dialog. + * Progress Dialog. * * // assuming a template reference... * @ViewChild('progressDialog') @@ -21,7 +21,7 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; * dialog.close(); * * Each dialog has 2 numbers, 'max' and 'value'. - * The content of these values determines how the dialog displays. + * The content of these values determines how the dialog displays. * * There are 3 flavors: * @@ -38,11 +38,11 @@ import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; * is happening, but we don't know when it will end. * * -- value is unset - * indeterminate: shows a generic value-less with no + * indeterminate: shows a generic value-less with no * clear indication of progress. */ export class EgProgressDialogComponent extends EgDialogComponent { - + max: number; value: number; @@ -60,8 +60,8 @@ export class EgProgressDialogComponent extends EgDialogComponent { } percent(): number { - if (this.hasValue() && - this.hasMax() && + if (this.hasValue() && + this.hasMax() && this.max > 0 && this.value <= this.max) return Math.floor((this.value / this.max) * 100); @@ -70,9 +70,9 @@ export class EgProgressDialogComponent extends EgDialogComponent { // Set the current state of the progress bar. update(args: {[key:string] : number}) { - if (args.max != undefined) + if (args.max != undefined) this.max = args.max; - if (args.value != undefined) + if (args.value != undefined) this.value = args.value; } diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index 3942bd5d31..6e696d2bc8 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, Input, +import {Component, OnInit, Input, Output, EventEmitter, TemplateRef} from '@angular/core'; import {EgIdlService, EgIdlObject} from '@eg/core/idl.service'; import {EgAuthService} from '@eg/core/auth.service'; @@ -8,9 +8,9 @@ import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; interface CustomFieldTemplate { template: TemplateRef, - - // Allow the caller to pass in a free-form context blob to - // be addedto the caller's custom template context, along + + // Allow the caller to pass in a free-form context blob to + // be addedto the caller's custom template context, along // with our stock context. context?: {[fields: string]: any} } @@ -20,7 +20,7 @@ interface CustomFieldContext { record: EgIdlObject, // IDL field definition blob - field: any, + field: any, // additional context values passed via CustomFieldTemplate [fields: string]: any; @@ -30,7 +30,7 @@ interface CustomFieldContext { selector: 'fm-record-editor', templateUrl: './fm-editor.component.html' }) -export class FmRecordEditorComponent +export class FmRecordEditorComponent extends EgDialogComponent implements OnInit { // IDL class hint (e.g. "aou") @@ -55,7 +55,7 @@ export class FmRecordEditorComponent // TODO: allow this to be update in real time by the caller? record: EgIdlObject; - @Input() customFieldTemplates: + @Input() customFieldTemplates: {[fieldName:string] : CustomFieldTemplate} = {}; // list of fields that should not be displayed @@ -69,7 +69,7 @@ export class FmRecordEditorComponent // list of required fields; this supplements what the IDL considers // required @Input() requiredFieldsList: string[] = []; - @Input() requiredFields: string; // comma-separated string version + @Input() requiredFields: string; // comma-separated string version // list of org_unit fields where a default value may be applied by // the org-select if no value is present. @@ -81,7 +81,7 @@ export class FmRecordEditorComponent // name and the record and should return a boolean value. This // supports cases where whether a field is required or not depends // on the current value of another field. - @Input() isRequiredOverride: + @Input() isRequiredOverride: {[field: string] : (field: string, record: EgIdlObject) => boolean}; // IDL record display label. Defaults to the IDL label. @@ -110,10 +110,10 @@ export class FmRecordEditorComponent private modal: NgbModal, // required for passing to parent private idl: EgIdlService, private auth: EgAuthService, - private pcrud: EgPcrudService) { - super(modal) + private pcrud: EgPcrudService) { + super(modal) } - + // Avoid fetching data on init since that may lead to unnecessary // data retrieval. ngOnInit() { @@ -150,7 +150,7 @@ export class FmRecordEditorComponent .toPromise().then(rec => { if (!rec) { - return Promise.reject(`No '${this.idlClass}' + return Promise.reject(`No '${this.idlClass}' record found with id ${this.recId}`); } @@ -158,7 +158,7 @@ export class FmRecordEditorComponent this.convertDatatypesToJs(); return this.getFieldList(); }); - } + } // create a new record from scratch this.pkeyIsEditable = !('pkey_sequence' in this.idlDef); @@ -204,7 +204,7 @@ export class FmRecordEditorComponent private flattenLinkedValues(cls: string, list: EgIdlObject[]): any[] { let idField = this.idl.classes[cls].pkey; - let selector = + let selector = this.idl.classes[cls].field_map[idField].selector || idField; return list.map(item => { @@ -214,25 +214,25 @@ export class FmRecordEditorComponent private getFieldList(): Promise { - this.fields = this.idlDef.fields.filter(f => - f.virtual != 'true' && + this.fields = this.idlDef.fields.filter(f => + f.virtual != 'true' && !this.hiddenFieldsList.includes(f.name) ); let promises = []; this.fields.forEach(field => { - field.readOnly = this.mode == 'view' + field.readOnly = this.mode == 'view' || this.readonlyFieldsList.includes(field.name); - if (this.isRequiredOverride && + if (this.isRequiredOverride && field.name in this.isRequiredOverride) { field.isRequired = () => { return this.isRequiredOverride[field.name](field.name, this.record); } } else { field.isRequired = () => { - return field.required || + return field.required || this.requiredFieldsList.includes(field.name); } } @@ -241,12 +241,12 @@ export class FmRecordEditorComponent promises.push( this.pcrud.retrieveAll(field.class, {}, {atomic : true}) .toPromise().then(list => { - field.linkedValues = + field.linkedValues = this.flattenLinkedValues(field.class, list); }) ); } else if (field.datatype == 'org_unit') { - field.orgDefaultAllowed = + field.orgDefaultAllowed = this.orgDefaultAllowedList.includes(field.name); } @@ -261,7 +261,7 @@ export class FmRecordEditorComponent return Promise.all(promises); } - // Returns a context object to be inserted into a custom + // Returns a context object to be inserted into a custom // field template. customTemplateFieldContext(fieldDef: any): CustomFieldContext { return Object.assign( diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts index e09c86a109..36ffa136bd 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-column-width.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit, Host} from '@angular/core'; -import {EgGridContext, EgGridColumn, EgGridColumnSet, +import {EgGridContext, EgGridColumn, EgGridColumnSet, EgGridDataSource} from './grid'; @Component({ diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts index 89b0c41d76..3c7101b2ac 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-column.component.ts @@ -15,7 +15,7 @@ export class EgGridColumnComponent implements OnInit { @Input() label: string; @Input() flex: number; // is this the index field? - @Input() index: boolean; + @Input() index: boolean; @Input() visible: boolean; @Input() hidden: boolean; @Input() sortable: boolean; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts index 6cb3a8a609..3d5cd8c4bc 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-header.component.ts @@ -1,5 +1,5 @@ import {Component, Input, OnInit} from '@angular/core'; -import {EgGridContext, EgGridColumn, EgGridRowSelector, +import {EgGridContext, EgGridColumn, EgGridRowSelector, EgGridColumnSet, EgGridDataSource} from './grid'; @Component({ @@ -44,7 +44,7 @@ export class EgGridHeaderComponent implements OnInit { this.gridContext.reload(); } - // Returns true if the provided column is sorting in the + // Returns true if the provided column is sorting in the // specified direction. isColumnSorting(col: EgGridColumn, dir: string): boolean { let sort = this.gridContext.dataSource.sort.filter(c => c.name == col.name)[0]; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts index d32fee6db8..68cbd3b7a1 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts @@ -1,7 +1,7 @@ import {Component, Input, OnInit, Host} from '@angular/core'; import {DomSanitizer, SafeUrl} from '@angular/platform-browser'; import {Pager} from '@eg/share/util/pager'; -import {EgGridColumn, EgGridColumnSet, EgGridToolbarButton, +import {EgGridColumn, EgGridColumnSet, EgGridToolbarButton, EgGridToolbarAction, EgGridContext, EgGridDataSource} from '@eg/share/grid/grid'; import {EgGridColumnWidthComponent} from './grid-column-width.component'; @@ -47,19 +47,19 @@ export class EgGridToolbarComponent implements OnInit { // the CSV download attributes / state. setTimeout(() => { this.csvExportUrl = null; - this.csvExportFileName = ''; + this.csvExportFileName = ''; this.csvExportInProgress = false; }, 500 ); return; - } + } this.csvExportInProgress = true; // let the file name describe the grid this.csvExportFileName = ( - this.gridContext.mainLabel || - this.gridContext.persistKey || + this.gridContext.mainLabel || + this.gridContext.persistKey || 'eg_grid_data' ).replace(/\s+/g, '_') + '.csv'; @@ -70,7 +70,7 @@ export class EgGridToolbarComponent implements OnInit { this.csvExportUrl = this.sanitizer.bypassSecurityTrustUrl( (win.URL || win.webkitURL).createObjectURL(blob) ); - + // Fire the 2nd click event now that the browser has // information on how to download the CSV file. setTimeout(() => $event.target.click()); diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts index f2949b380d..26fc21d9b5 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.component.ts @@ -28,14 +28,14 @@ export class EgGridComponent implements OnInit, AfterViewInit, OnDestroy { context: EgGridContext; onRowActivate$: EventEmitter; onRowClick$: EventEmitter; - + constructor( private idl: EgIdlService, private org: EgOrgService, private store: EgStoreService, private format: EgFormatService ) { - this.context = + this.context = new EgGridContext(this.idl, this.org, this.store, this.format); this.onRowActivate$ = new EventEmitter(); this.onRowClick$ = new EventEmitter(); @@ -60,7 +60,7 @@ export class EgGridComponent implements OnInit, AfterViewInit, OnDestroy { this.context.destroy(); } - // Not using @HostListener because it only works globally. + // Not using @HostListener because it only works globally. onGridKeyDown(evt: KeyboardEvent) { switch(evt.key) { case 'ArrowUp': @@ -103,7 +103,7 @@ export class EgGridComponent implements OnInit, AfterViewInit, OnDestroy { if (this.context.disableMultiSelect) { this.context.selectOneRow(index); } else if ($event.ctrlKey || $event.metaKey /* mac command */) { - if (this.context.toggleSelectOneRow(index)) + if (this.context.toggleSelectOneRow(index)) this.context.lastSelectedIndex = index; } else if ($event.shiftKey) { diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts index e863c8a75b..232ad32402 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -38,7 +38,7 @@ export class EgGridContext { constructor( idl: EgIdlService, org: EgOrgService, store: EgStoreService, format: EgFormatService) { - + this.idl = idl; this.org = org; this.store = store; @@ -95,24 +95,24 @@ export class EgGridContext { return this.getRowColumnValue(row, col); } - // Returns the array position of the row-by-index in the + // Returns the array position of the row-by-index in the // dataSource array. getRowPosition(index: any): number { // for-loop for early exit - for (let idx = 0; idx < this.dataSource.data.length; idx++) { + for (let idx = 0; idx < this.dataSource.data.length; idx++) { if (index == this.getRowIndex(this.dataSource.data[idx])) return idx; } } getRowByIndex(index: any): any { - for (let idx = 0; idx < this.dataSource.data.length; idx++) { + for (let idx = 0; idx < this.dataSource.data.length; idx++) { if (index == this.getRowIndex(this.dataSource.data[idx])) return this.dataSource.data[idx]; } } - // Returns all selected rows, regardless of whether they are + // Returns all selected rows, regardless of whether they are // currently visible in the grid display. getSelectedRows(): any[] { let selected = []; @@ -153,7 +153,7 @@ export class EgGridContext { if (this.rowSelector.contains(index)) { this.rowSelector.deselect(index); return false; - } + } this.rowSelector.select(index); return true; @@ -221,7 +221,7 @@ export class EgGridContext { getRowAsFlatText(row: any): any { let flatRow = {}; this.columnSet.displayColumns().forEach(col => { - flatRow[col.name] = + flatRow[col.name] = this.getColumnTextContent(row, col); }); return flatRow; @@ -273,10 +273,10 @@ export class EgGridContext { str = ''+str; if (!str) return ''; str = str.replace(/\n/g, ''); - if (str.match(/\,/) || str.match(/"/)) { + if (str.match(/\,/) || str.match(/"/)) { str = str.replace(/"/g, '""'); - str = '"' + str + '"'; - } + str = '"' + str + '"'; + } return str; } @@ -430,7 +430,7 @@ export class EgGridColumnSet { var srcIdx, targetIdx; this.columns.forEach((c, i) => { - if (c.name == col.name) srcIdx = i + if (c.name == col.name) srcIdx = i }); targetIdx = srcIdx + diff; @@ -446,7 +446,7 @@ export class EgGridColumnSet { // When moving a column (down) causes one or more // visible columns to shuffle forward, our column // moves into the slot of the last visible column. - // Otherwise, put it into the slot directly following + // Otherwise, put it into the slot directly following // the last visible column. targetIdx = srcIdx <= lastVisible ? lastVisible : lastVisible + 1; } @@ -489,8 +489,8 @@ export class EgGridColumnSet { newCols.push(col); }); - // columns which are not expressed within the saved - // configuration are marked as non-visible and + // columns which are not expressed within the saved + // configuration are marked as non-visible and // appended to the end of the new list of columns. this.columns.forEach(c => { if (conf.filter(cf => cf.name == c.name).length == 0) { @@ -527,7 +527,7 @@ export class EgGridRowSelector { let indexes = [].concat(index); for (let i = 0; i < indexes.length; i++) { // early exit if (!this.indexes[indexes[i]]) - return false; + return false; } return true; } @@ -543,7 +543,7 @@ export class EgGridRowSelector { } // Returns the list of selected index values. - // in some contexts (template checkboxes) the value for an index is + // in some contexts (template checkboxes) the value for an index is // set to false to deselect instead of having it removed (via deselect()). selected() { return Object.keys(this.indexes).filter( diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts index ddb5f9d980..76a8655669 100644 --- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts @@ -5,17 +5,17 @@ import {debounceTime} from 'rxjs/operators/debounceTime'; import {distinctUntilChanged} from 'rxjs/operators/distinctUntilChanged'; import {merge} from 'rxjs/operators/merge'; import {filter} from 'rxjs/operators/filter'; -import {Subject} from 'rxjs/Subject'; +import {Subject} from 'rxjs/Subject'; import {EgAuthService} from '@eg/core/auth.service'; import {EgStoreService} from '@eg/core/store.service'; import {EgOrgService} from '@eg/core/org.service'; import {EgIdlObject} from '@eg/core/idl.service'; -import {NgbTypeahead, NgbTypeaheadSelectItemEvent} +import {NgbTypeahead, NgbTypeaheadSelectItemEvent} from '@ng-bootstrap/ng-bootstrap'; -// Use a unicode char for spacing instead of ASCII=32 so the browser +// Use a unicode char for spacing instead of ASCII=32 so the browser // won't collapse the nested display entries down to a single space. -const PAD_SPACE: string = ' '; // U+2007 +const PAD_SPACE: string = ' '; // U+2007 interface OrgDisplay { id: number; @@ -59,13 +59,13 @@ export class EgOrgSelectComponent implements OnInit { if (ids) this.disabled = ids; } - // Apply an org unit value at load time. + // Apply an org unit value at load time. // This will NOT result in an onChange event. @Input() set initialOrg(org: EgIdlObject) { if (org) this.startOrg = org; } - // Apply an org unit value by ID at load time. + // Apply an org unit value by ID at load time. // This will NOT result in an onChange event. @Input() set initialOrgId(id: number) { if (id) this.startOrg = this.org.get(id); @@ -90,9 +90,9 @@ export class EgOrgSelectComponent implements OnInit { constructor( private auth: EgAuthService, private store: EgStoreService, - private org: EgOrgService + private org: EgOrgService ) {} - + ngOnInit() { // Apply a default org unit if desired and possible. @@ -117,7 +117,7 @@ export class EgOrgSelectComponent implements OnInit { formatForDisplay(org: EgIdlObject): OrgDisplay { return { id : org.id(), - label : PAD_SPACE.repeat(org.ou_type().depth()) + label : PAD_SPACE.repeat(org.ou_type().depth()) + org[this.displayField](), disabled : false }; diff --git a/Open-ILS/src/eg2/src/app/share/string/string.component.ts b/Open-ILS/src/eg2/src/app/share/string/string.component.ts index f6a858a64f..ef34f162fa 100644 --- a/Open-ILS/src/eg2/src/app/share/string/string.component.ts +++ b/Open-ILS/src/eg2/src/app/share/string/string.component.ts @@ -35,14 +35,14 @@ export class EgStringComponent implements OnInit { // that does not need interpolation. if (this.key) { this.strings.register({ - key: this.key, + key: this.key, resolver: (ctx:any) => this.current(ctx) }); } } - // Apply the new context if provided, give our container a + // Apply the new context if provided, give our container a // chance to update, then resolve with the current string. // NOTE: talking to the native DOM element is not so great, but // hopefully we can retire the EgString* code entirely once diff --git a/Open-ILS/src/eg2/src/app/share/string/string.service.ts b/Open-ILS/src/eg2/src/app/share/string/string.service.ts index 1af8083a9f..3d9eed5fb2 100644 --- a/Open-ILS/src/eg2/src/app/share/string/string.service.ts +++ b/Open-ILS/src/eg2/src/app/share/string/string.service.ts @@ -17,11 +17,11 @@ export class EgStringService { } interpolate(key: string, ctx?: any): Promise { - if (!this.strings[key]) + if (!this.strings[key]) return Promise.reject('No Such String'); return this.strings[key].resolver(ctx); } } - + diff --git a/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts b/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts index eebe6255f5..bb9cab716d 100644 --- a/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts +++ b/Open-ILS/src/eg2/src/app/share/toast/toast.component.ts @@ -26,7 +26,7 @@ export class EgToastComponent implements OnInit { this.dismiss(this.message); this.message = msg; this.timeout = setTimeout( - () => this.dismiss(this.message), + () => this.dismiss(this.message), EG_TOAST_TIMEOUT ); } diff --git a/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts b/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts index 9692c13e91..6c2f9e3989 100644 --- a/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts +++ b/Open-ILS/src/eg2/src/app/share/toast/toast.service.ts @@ -2,7 +2,7 @@ import {Injectable, EventEmitter} from '@angular/core'; export interface EgToastMessage { text: string, - style: string + style: string }; @Injectable() diff --git a/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts index 69c6f960f3..a73f4f30d1 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts @@ -1,7 +1,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; -const routes: Routes = [{ +const routes: Routes = [{ path: '', children : [ { path: 'workstation', diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.ts index 21d5d45581..9debf571d7 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, ViewChildren, +import {Component, Input, ViewChildren, AfterViewInit, QueryList} from '@angular/core'; @Component({ diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts index 8abab5000d..4628b335a7 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server.module.ts @@ -15,7 +15,7 @@ import {AdminServerSplashComponent} from './admin-server-splash.component'; ] }) -export class EgAdminServerModule { +export class EgAdminServerModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/config/billing_type.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/config/billing_type.component.ts index c529db7be5..00f20110b1 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/config/billing_type.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/config/billing_type.component.ts @@ -46,11 +46,11 @@ export class BillingTypeComponent implements OnInit { let searchOrgs = this.org.fullPath(this.contextOrg, true); let orderBy = {}; - if (sort.length) + if (sort.length) orderBy = {cbt: sort[0].name + ' ' + sort[0].dir}; return this.pcrud.search('cbt', {owner : searchOrgs}, { - offset: pager.offset, + offset: pager.offset, limit: pager.limit, order_by: orderBy }); diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/config/config.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/config/config.module.ts index dcc6ef04d0..0a2b455e63 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/config/config.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/config/config.module.ts @@ -19,7 +19,7 @@ import {HardDueDateComponent} from './hard_due_date.component'; ] }) -export class EgAdminServerConfigModule { +export class EgAdminServerConfigModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/config/hard_due_date.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/config/hard_due_date.component.ts index d2d73f88f2..fdbf7817c0 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/config/hard_due_date.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/config/hard_due_date.component.ts @@ -46,11 +46,11 @@ export class HardDueDateComponent implements OnInit { let searchOrgs = this.org.fullPath(this.contextOrg, true); let orderBy = {}; - if (sort.length) + if (sort.length) orderBy = {chdd: sort[0].name + ' ' + sort[0].dir}; return this.pcrud.search('chdd', {owner : searchOrgs}, { - offset: pager.offset, + offset: pager.offset, limit: pager.limit, order_by: orderBy }); diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts index d79bb9a675..23e485e22e 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts @@ -3,12 +3,12 @@ import {RouterModule, Routes} from '@angular/router'; import {BillingTypeComponent} from './billing_type.component'; import {HardDueDateComponent} from './hard_due_date.component'; -const routes: Routes = [{ +const routes: Routes = [{ path: 'billing_type', - component: BillingTypeComponent + component: BillingTypeComponent }, { path: 'hard_due_date', - component: HardDueDateComponent + component: HardDueDateComponent }]; @NgModule({ diff --git a/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts index d1ae7f2f15..391e01c26c 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/workstation/workstations/workstations.component.ts @@ -55,7 +55,7 @@ export class WorkstationsComponent implements OnInit { .then(noop => this.store.getItem('eg.workstation.default')) .then(defWs => { this.defaultName = defWs; - this.selectedName = this.auth.workstation() || defWs + this.selectedName = this.auth.workstation() || defWs }) .then(noop => { let rm = this.route.snapshot.paramMap.get('remove'); @@ -66,7 +66,7 @@ export class WorkstationsComponent implements OnInit { .then(perms => { // Disable org units that cannot have users and any // that this user does not have work perms for. - this.disableOrgs = + this.disableOrgs = this.org.filterList({canHaveUsers : false}, true) .concat(this.org.filterList( {notInList : perms.REGISTER_WORKSTATION}, true)); @@ -80,7 +80,7 @@ export class WorkstationsComponent implements OnInit { useNow(): void { if (!this.selected()) return; - this.router.navigate(['/staff/login'], + this.router.navigate(['/staff/login'], {queryParams: {workstation: this.selected().name}}); } @@ -101,7 +101,7 @@ export class WorkstationsComponent implements OnInit { this.store.removeItem('eg.workstation.default'); } } - + canDeleteSelected(): boolean { return true; } @@ -143,7 +143,7 @@ export class WorkstationsComponent implements OnInit { 'open-ils.actor', method, this.auth.token(), this.newName, this.newOwner.id() ).subscribe(wsId => { - let evt = this.evt.parse(wsId); + let evt = this.evt.parse(wsId); if (evt) { if (evt.textcode == 'WORKSTATION_NAME_EXISTS') { this.handleCollision().then( @@ -155,7 +155,7 @@ export class WorkstationsComponent implements OnInit { reject(); } } else { - resolve(wsId); + resolve(wsId); } }); }); diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts index 635eec1304..3d3d3132e2 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.module.ts @@ -41,6 +41,6 @@ import {RecordPaginationComponent} from './record/pagination.component'; ] }) -export class EgCatalogModule { +export class EgCatalogModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts index 6cfc715816..84204571fb 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts @@ -19,7 +19,7 @@ export class StaffCatalogService { defaultSearchLimit: number; // TODO: does unapi support pref-lib for result-page copy counts? - prefOrg: EgIdlObject; + prefOrg: EgIdlObject; constructor( private router: Router, @@ -34,7 +34,7 @@ export class StaffCatalogService { // Do this here so the search form and other context data are // applied on every page, not just the search results page. The // search results pages will handle running the actual search. - this.searchContext = + this.searchContext = this.catUrl.fromUrlParams(this.route.snapshot.queryParamMap); this.searchContext.org = this.org; // service, not searchOrg @@ -44,7 +44,7 @@ export class StaffCatalogService { applySearchDefaults(): void { if (!this.searchContext.searchOrg) { - this.searchContext.searchOrg = + this.searchContext.searchOrg = this.defaultSearchOrg || this.org.root(); } @@ -62,7 +62,7 @@ export class StaffCatalogService { if (!this.searchContext.isSearchable()) return; let params = this.catUrl.toUrlParams(this.searchContext); - + // Force a new search every time this method is called, even if // it's the same as the active search. Since router navigation // exits early when the route + params is identical, add a diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts index d4b69571c3..a39095c811 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts @@ -28,7 +28,7 @@ export class CopiesComponent implements OnInit { private staffCat: StaffCatalogService, ) {} - ngOnInit() { + ngOnInit() { this.initDone = true; this.collectData(); } @@ -51,7 +51,7 @@ export class CopiesComponent implements OnInit { // copies from all branches, sorted by search/pref libs. let copy_depth = this.staffCat.searchContext.global ? this.org.root().ou_type().depth() : - this.staffCat.searchContext.searchOrg.ou_type().depth(); + this.staffCat.searchContext.searchOrg.ou_type().depth(); this.net.request( 'open-ils.search', @@ -61,15 +61,15 @@ export class CopiesComponent implements OnInit { copy_depth, this.pager.limit, this.pager.offset, - this.staffCat.prefOrg ? this.staffCat.prefOrg.id() : null + this.staffCat.prefOrg ? this.staffCat.prefOrg.id() : null ).subscribe(copy => { this.copies.push(copy); }); } holdable(copy: any): boolean { - return copy.holdable == 't' - && copy.location_holdable == 't' + return copy.holdable == 't' + && copy.location_holdable == 't' && copy.status_holdable == 't'; } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/pagination.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/pagination.component.ts index 31fee2cde6..9eba7d7c4c 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/pagination.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/pagination.component.ts @@ -31,7 +31,7 @@ export class RecordPaginationComponent implements OnInit { private staffCat: StaffCatalogService, ) {} - ngOnInit() { + ngOnInit() { this.initDone = true; this.setIndex(); } @@ -103,7 +103,7 @@ export class RecordPaginationComponent implements OnInit { findRecordAtIndex(index: number): Promise { // First see if the selected record sits in the current page - // of search results. + // of search results. return new Promise((resolve, reject) => { let id = this.searchContext.resultIdAt(index); if (id) return resolve(id); @@ -111,7 +111,7 @@ export class RecordPaginationComponent implements OnInit { console.debug( 'Record paginator unable to find record at index ' + index); - // If we have to re-run the search to find the record, + // If we have to re-run the search to find the record, // expand the search limit out just enough to find the // requested record plus one more. return this.refreshSearch(index + 2).then( diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts index ec9a30215e..b25f1e7ad4 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts @@ -2,7 +2,7 @@ import {Component, OnInit, Input} from '@angular/core'; import {ActivatedRoute, ParamMap} from '@angular/router'; import {EgPcrudService} from '@eg/core/pcrud.service'; import {EgIdlObject} from '@eg/core/idl.service'; -import {CatalogSearchContext, CatalogSearchState} +import {CatalogSearchContext, CatalogSearchState} from '@eg/share/catalog/search-context'; import {EgCatalogService} from '@eg/share/catalog/catalog.service'; import {StaffCatalogService} from '../catalog.service'; @@ -25,7 +25,7 @@ export class RecordComponent implements OnInit { private staffCat: StaffCatalogService ) {} - ngOnInit() { + ngOnInit() { this.searchContext = this.staffCat.searchContext; // Watch for URL record ID changes @@ -35,17 +35,17 @@ export class RecordComponent implements OnInit { }) } - loadRecord(): void { + loadRecord(): void { this.searchContext = this.staffCat.searchContext; // If a search is encoded in the URL, be sure we have the - // relevant search + // relevant search this.cat.getBibSummary( this.recordId, - this.searchContext.searchOrg.id(), + this.searchContext.searchOrg.id(), this.searchContext.searchOrg.ou_type().depth() - ).then(summary => { + ).then(summary => { this.bibSummary = summary; this.pcrud.search('au', {id: [summary.creator, summary.editor]}) .subscribe(user => { diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts b/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts index 854b93751c..8f1830d6e6 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts @@ -15,7 +15,7 @@ import {StaffCatalogService} from './catalog.service'; export class EgCatalogResolver implements Resolve> { constructor( - private router: Router, + private router: Router, private store: EgStoreService, private org: EgOrgService, private net: EgNetService, @@ -25,7 +25,7 @@ export class EgCatalogResolver implements Resolve> { ) {} resolve( - route: ActivatedRouteSnapshot, + route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise { console.debug('EgCatalogResolver:resolve()'); diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/facets.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/result/facets.component.ts index be689686c4..e07c40975d 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/facets.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/facets.component.ts @@ -30,7 +30,7 @@ export class ResultFacetsComponent implements OnInit { this.facetConfig = FACET_CONFIG; } - ngOnInit() { + ngOnInit() { this.searchContext = this.staffCat.searchContext; } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/pagination.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/result/pagination.component.ts index 189fbced81..88afc30280 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/pagination.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/pagination.component.ts @@ -17,7 +17,7 @@ export class ResultPaginationComponent implements OnInit { private staffCat: StaffCatalogService ) {} - ngOnInit() { + ngOnInit() { this.searchContext = this.staffCat.searchContext; } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts index 14f33e2d79..8abfbaf3b0 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts @@ -26,7 +26,7 @@ export class ResultRecordComponent implements OnInit { private staffCat: StaffCatalogService ) {} - ngOnInit() { + ngOnInit() { this.searchContext = this.staffCat.searchContext; this.fleshHoldCount(); } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.ts index 1f29e85fc8..f16d5b4068 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.ts @@ -18,7 +18,7 @@ export class ResultsComponent implements OnInit { searchContext: CatalogSearchContext; - // Cache record creator/editor since this will likely be a + // Cache record creator/editor since this will likely be a // reasonably small set of data w/ lots of repitition. userCache: {[id:number] : EgIdlObject} = {}; @@ -30,15 +30,15 @@ export class ResultsComponent implements OnInit { private staffCat: StaffCatalogService ) {} - ngOnInit() { + ngOnInit() { this.searchContext = this.staffCat.searchContext; // Our search context is initialized on page load. Once // ResultsComponent is active, it will not be reinitialized, // even if the route parameters changes (unless we change the // route reuse policy). Watch for changes here to pick up new - // searches. - // + // searches. + // // This will also fire on page load. this.route.queryParamMap.subscribe((params: ParamMap) => { diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/catalog/routing.module.ts index 2376f80cb4..068d033a72 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/routing.module.ts @@ -5,7 +5,7 @@ import {ResultsComponent} from './result/results.component'; import {RecordComponent} from './record/record.component'; import {EgCatalogResolver} from './resolver.service'; -const routes: Routes = [{ +const routes: Routes = [{ path: '', component: EgCatalogComponent, resolve: {catResolver : EgCatalogResolver}, diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts index d5f5e7b689..7081eea4d9 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts @@ -2,7 +2,7 @@ import {Component, OnInit, AfterViewInit, Renderer2} from '@angular/core'; import {EgIdlObject} from '@eg/core/idl.service'; import {EgOrgService} from '@eg/core/org.service'; import {EgCatalogService,} from '@eg/share/catalog/catalog.service'; -import {CatalogSearchContext, CatalogSearchState} +import {CatalogSearchContext, CatalogSearchState} from '@eg/share/catalog/search-context'; import {StaffCatalogService} from './catalog.service'; @@ -25,12 +25,12 @@ export class SearchFormComponent implements OnInit, AfterViewInit { private staffCat: StaffCatalogService ) {} - ngOnInit() { + ngOnInit() { this.ccvmMap = this.cat.ccvmMap; this.cmfMap = this.cat.cmfMap; this.searchContext = this.staffCat.searchContext; - // Start with advanced search options open + // Start with advanced search options open // if any filters are active. this.showAdvancedSearch = this.hasAdvancedOptions(); diff --git a/Open-ILS/src/eg2/src/app/staff/common.module.ts b/Open-ILS/src/eg2/src/app/staff/common.module.ts index e7e8b29e2b..86c61ae75a 100644 --- a/Open-ILS/src/eg2/src/app/staff/common.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/common.module.ts @@ -16,12 +16,12 @@ import {EgStringComponent} from '@eg/share/string/string.component'; import {EgStringService} from '@eg/share/string/string.service'; import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; import {EgDateSelectComponent} from '@eg/share/date-select/date-select.component'; -import {EgLinkTableComponent, EgLinkTableLinkComponent} +import {EgLinkTableComponent, EgLinkTableLinkComponent} from '@eg/staff/share/link-table/link-table.component'; /** * Imports the EG common modules and adds modules common to all staff UI's. - */ + */ @NgModule({ declarations: [ @@ -38,7 +38,7 @@ import {EgLinkTableComponent, EgLinkTableLinkComponent} EgOpChangeComponent, FmRecordEditorComponent, EgDateSelectComponent, - EgLinkTableComponent, + EgLinkTableComponent, EgLinkTableLinkComponent ], imports: [ @@ -59,7 +59,7 @@ import {EgLinkTableComponent, EgLinkTableLinkComponent} EgOpChangeComponent, FmRecordEditorComponent, EgDateSelectComponent, - EgLinkTableComponent, + EgLinkTableComponent, EgLinkTableLinkComponent ] }) diff --git a/Open-ILS/src/eg2/src/app/staff/login.component.ts b/Open-ILS/src/eg2/src/app/staff/login.component.ts index c3a62f4a7f..86df59f941 100644 --- a/Open-ILS/src/eg2/src/app/staff/login.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/login.component.ts @@ -25,7 +25,7 @@ export class EgStaffLoginComponent implements OnInit { private ngLocation: Location, private renderer: Renderer2, private auth: EgAuthService, - private store: EgStoreService + private store: EgStoreService ) {} ngOnInit() { @@ -73,9 +73,9 @@ export class EgStaffLoginComponent implements OnInit { [`/staff/admin/workstation/workstations/remove/${workstation}`]); } else { // Force reload of the app after a successful login. - // This allows the route resolver to re-run with a + // This allows the route resolver to re-run with a // valid auth token and workstation. - window.location.href = + window.location.href = this.ngLocation.prepareExternalUrl(url); } }, diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.ts b/Open-ILS/src/eg2/src/app/staff/nav.component.ts index 14db1d8e2b..d36a17a24f 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.ts @@ -31,7 +31,7 @@ export class EgStaffNavComponent implements OnInit { } // Broadcast to all tabs that we're logging out. - // Redirect to the login page, which performs the remaining + // Redirect to the login page, which performs the remaining // logout duties. logout(): void { this.auth.broadcastLogout(); diff --git a/Open-ILS/src/eg2/src/app/staff/resolver.service.ts b/Open-ILS/src/eg2/src/app/staff/resolver.service.ts index 1746e4aaac..8598de5401 100644 --- a/Open-ILS/src/eg2/src/app/staff/resolver.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/resolver.service.ts @@ -25,8 +25,8 @@ export class EgStaffResolver implements Resolve> { observer: Observer; constructor( - private router: Router, - private route: ActivatedRoute, + private router: Router, + private route: ActivatedRoute, private ngLocation: Location, private store: EgStoreService, private org: EgOrgService, @@ -37,7 +37,7 @@ export class EgStaffResolver implements Resolve> { ) {} resolve( - route: ActivatedRouteSnapshot, + route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { console.debug('EgStaffResolver:resolve()'); @@ -52,7 +52,7 @@ export class EgStaffResolver implements Resolve> { let path = state.url.split('?')[0] if (path == '/staff/login') return Observable.of(true); - let observable: Observable + let observable: Observable = Observable.create(o => this.observer = o); this.auth.testAuthToken().then( @@ -67,13 +67,13 @@ export class EgStaffResolver implements Resolve> { }, wsNotOk => this.handleInvalidWorkstation(path) ); - }, + }, hasNotPerms => { this.observer.error( 'User does not have staff permissions'); } ); - }, + }, tokenNotOk => this.handleInvalidToken(state) ); @@ -99,9 +99,9 @@ export class EgStaffResolver implements Resolve> { ); }); } - - // A page that's not the login page was requested without a + + // A page that's not the login page was requested without a // valid auth token. Send the caller back to the login page. handleInvalidToken(state: RouterStateSnapshot): void { console.debug('EgStaffResolver: authtoken is not valid'); @@ -117,7 +117,7 @@ export class EgStaffResolver implements Resolve> { this.observer.complete(); } else { this.router.navigate([WS_MANAGE_PATH]); - this.observer.error(`Auth session linked to no + this.observer.error(`Auth session linked to no workstation or a workstation unknown to this browser`); } } diff --git a/Open-ILS/src/eg2/src/app/staff/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/routing.module.ts index 134140af5c..92f3d0ae00 100644 --- a/Open-ILS/src/eg2/src/app/staff/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/routing.module.ts @@ -6,7 +6,7 @@ import {EgStaffLoginComponent} from './login.component'; import {EgStaffSplashComponent} from './splash.component'; // Not using 'canActivate' because it's called before all resolvers, -// even the parent resolver, but the resolvers parse the IDL, load settings, +// even the parent resolver, but the resolvers parse the IDL, load settings, // etc. Chicken, meet egg. const routes: Routes = [{ diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/routing.module.ts index 0fa4d3e2d1..6d04a399a3 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/routing.module.ts @@ -2,7 +2,7 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {EgSandboxComponent} from './sandbox.component'; -const routes: Routes = [{ +const routes: Routes = [{ path: '', component: EgSandboxComponent }]; diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts index e7addc5b31..05943e4e96 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts @@ -61,7 +61,7 @@ export class EgSandboxComponent implements OnInit { this.btSource.getRows = (pager: Pager) => { return this.pcrud.retrieveAll('cbt', { - offset: pager.offset, + offset: pager.offset, limit: pager.limit, order_by: {cbt: 'name'} }); @@ -86,7 +86,7 @@ export class EgSandboxComponent implements OnInit { // every 250ms emit x*10 for 0-10 Observable.timer(0, 250).pipe( - map(x => x * 10), + map(x => x * 10), take(11) ).subscribe( val => this.progressDialog.update({value: val, max: 100}), diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.module.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.module.ts index ddfae2c8b9..ea1d539afd 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.module.ts @@ -17,6 +17,6 @@ import {EgGridModule} from '@eg/share/grid/grid.module'; ] }) -export class EgSandboxModule { +export class EgSandboxModule { } diff --git a/Open-ILS/src/eg2/src/app/staff/share/bib-summary/bib-summary.component.ts b/Open-ILS/src/eg2/src/app/staff/share/bib-summary/bib-summary.component.ts index c672adda2c..ef64617ba0 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/bib-summary/bib-summary.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/bib-summary/bib-summary.component.ts @@ -29,7 +29,7 @@ export class EgBibSummaryComponent implements OnInit { private pcrud: EgPcrudService ) {} - ngOnInit() { + ngOnInit() { this.initDone = true; if (this.summary) { this.fetchBibCallNumber(); @@ -39,10 +39,10 @@ export class EgBibSummaryComponent implements OnInit { } loadSummary(): void { - this.cat.getBibSummary(this.recordId).then(summary => { + this.cat.getBibSummary(this.recordId).then(summary => { this.summary = summary; this.fetchBibCallNumber(); - + // Flesh the user data this.pcrud.search('au', {id: [summary.creator, summary.editor]}) .subscribe(user => { diff --git a/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.ts b/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.ts index f106b5002d..e290786b97 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.ts @@ -25,7 +25,7 @@ export class EgLinkTableComponent implements AfterViewInit { } ngAfterViewInit() { - // table-ize the links + // table-ize the links let rowCount = Math.ceil(this.links.length / this.columnCount); this.colWidth = Math.floor(12 / this.columnCount); // Bootstrap 12-grid diff --git a/Open-ILS/src/eg2/src/app/staff/share/op-change/op-change.component.ts b/Open-ILS/src/eg2/src/app/staff/share/op-change/op-change.component.ts index 5d0b1127c3..c4fccb7b77 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/op-change/op-change.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/op-change/op-change.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, Input, Renderer2} from '@angular/core'; -import {EgToastService} from '@eg/share/toast/toast.service'; +import {EgToastService} from '@eg/share/toast/toast.service'; import {EgAuthService} from '@eg/core/auth.service'; import {EgDialogComponent} from '@eg/share/dialog/dialog.component'; import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; @@ -9,7 +9,7 @@ import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; templateUrl: 'op-change.component.html' }) -export class EgOpChangeComponent +export class EgOpChangeComponent extends EgDialogComponent implements OnInit { @Input() username: string; @@ -36,12 +36,12 @@ export class EgOpChangeComponent } login(): Promise { - if (!(this.username && this.password)) + if (!(this.username && this.password)) return Promise.reject('Missing Params'); - + return this.auth.login( - { username : this.username, - password : this.password, + { username : this.username, + password : this.password, workstation : this.auth.workstation(), type : this.loginType }, true // isOpChange @@ -65,7 +65,7 @@ export class EgOpChangeComponent ); } - restore(): Promise { + restore(): Promise { return this.auth.undoOpChange().then( ok => this.toast.success(this.successMessage), err => this.toast.danger(this.failMessage) diff --git a/Open-ILS/src/eg2/src/app/staff/share/staff-banner.component.ts b/Open-ILS/src/eg2/src/app/staff/share/staff-banner.component.ts index 3d22b88d57..28fb84fc90 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/staff-banner.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/staff-banner.component.ts @@ -2,7 +2,7 @@ import {Component, OnInit, Input} from '@angular/core'; @Component({ selector: 'eg-staff-banner', - template: + template: '' diff --git a/Open-ILS/src/eg2/src/app/staff/splash.component.ts b/Open-ILS/src/eg2/src/app/staff/splash.component.ts index 190d8c7702..0fdb4e7fc2 100644 --- a/Open-ILS/src/eg2/src/app/staff/splash.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/splash.component.ts @@ -24,7 +24,7 @@ export class EgStaffSplashComponent implements OnInit { if (!this.catSearchQuery) return; this.router.navigate( - ['/staff/catalog/search'], + ['/staff/catalog/search'], {queryParams: {query : this.catSearchQuery}} ); } diff --git a/Open-ILS/src/eg2/src/app/staff/staff.component.ts b/Open-ILS/src/eg2/src/app/staff/staff.component.ts index c8daf732b7..da270e5e3f 100644 --- a/Open-ILS/src/eg2/src/app/staff/staff.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/staff.component.ts @@ -3,7 +3,7 @@ import {Router, ActivatedRoute, NavigationEnd} from '@angular/router'; import {EgAuthService, EgAuthWsState} from '@eg/core/auth.service'; import {EgNetService} from '@eg/core/net.service'; import {EgAccessKeyService} from '@eg/share/accesskey/accesskey.service'; -import {EgAccessKeyInfoComponent} +import {EgAccessKeyInfoComponent} from '@eg/share/accesskey/accesskey-info.component'; const LOGIN_PATH = '/staff/login'; @@ -41,7 +41,7 @@ export class EgStaffComponent implements OnInit { // Redirect to the login page on any auth timeout events. this.net.authExpired$.subscribe(expireEvent => { - // If the expired authtoken was identified locally (i.e. + // If the expired authtoken was identified locally (i.e. // in this browser tab) notify all tabs of imminent logout. if (!expireEvent.viaExternal) this.auth.broadcastLogout(); @@ -73,7 +73,7 @@ export class EgStaffComponent implements OnInit { * Prevent the user from leaving the workstation admin page when * they don't have a valid workstation. * - * This does not verify auth tokens with the server on every route, + * This does not verify auth tokens with the server on every route, * because that would be overkill. This is only here to keep * people boxed in with their authenication state was already * known to be less then 100%. @@ -84,7 +84,7 @@ export class EgStaffComponent implements OnInit { if (url.startsWith(LOGIN_PATH)) return; // We lost our authtoken, go back to the login page. - if (!this.auth.token()) + if (!this.auth.token()) this.router.navigate([LOGIN_PATH]); // No workstation checks needed for workstation admin page. @@ -103,7 +103,7 @@ export class EgStaffComponent implements OnInit { } /* - @ViewChild('egAccessKeyInfo') + @ViewChild('egAccessKeyInfo') private keyComponent: EgAccessKeyInfoComponent; */