LP#1775466 Grid vert expand fixes; lint updates
authorBill Erickson <berickxx@gmail.com>
Wed, 11 Jul 2018 14:35:05 +0000 (10:35 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 11 Jul 2018 14:35:05 +0000 (10:35 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/core/format.service.ts
Open-ILS/src/eg2/src/app/share/catalog/marc-html.component.ts
Open-ILS/src/eg2/src/app/share/combobox/combobox-entry.component.ts
Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts
Open-ILS/src/eg2/src/app/share/grid/grid.component.css
Open-ILS/src/eg2/src/app/share/grid/grid.component.ts
Open-ILS/src/eg2/src/app/share/grid/grid.ts
Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts
Open-ILS/src/eg2/src/app/staff/login.component.ts
Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts

index f8bf0d9..e384f22 100644 (file)
@@ -36,7 +36,7 @@ export class FormatService {
         // not available in PhantomJS for unit testing.
         // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
         if (!Number.isNaN) {
-            // "The following works because NaN is the only value 
+            // "The following works because NaN is the only value
             // in javascript which is not equal to itself."
             Number.isNaN = (value: any) => {
                 return value !== value;
index 0f78221..38b1da7 100644 (file)
@@ -43,7 +43,7 @@ export class MarcHtmlComponent implements OnInit {
 
         let service = 'open-ils.search';
         let method = 'open-ils.search.biblio.record.html';
-        let params: any[] = [this.recId];
+        const params: any[] = [this.recId];
 
         switch (this.recType) {
 
@@ -79,7 +79,7 @@ export class MarcHtmlComponent implements OnInit {
         // remove reference to nonexistant CSS file
         html = html.replace(/<link(.*?)\/>/, '');
 
-        // there shouldn't be any, but while we're at it, 
+        // there shouldn't be any, but while we're at it,
         // kill any embedded script tags
         html = html.replace(/<script(.*?)<\/script>/, '');
 
index 059a439..26015b7 100644 (file)
@@ -5,7 +5,7 @@ import {ComboboxComponent} from './combobox.component';
   selector: 'eg-combobox-entry',
   template: '<ng-template></ng-template>'
 })
-export class ComboboxEntryComponent implements OnInit{
+export class ComboboxEntryComponent implements OnInit {
 
     @Input() entryId: any;
     @Input() entryLabel: string;
index 9e5dce7..39e9b59 100644 (file)
@@ -53,7 +53,7 @@ export class ComboboxComponent implements OnInit {
     @Input() allowFreeText = false;
 
     // Add a 'required' attribute to the input
-    isRequired: boolean
+    isRequired: boolean;
     @Input() set required(r: boolean) {
         this.isRequired = r;
     }
@@ -87,7 +87,7 @@ export class ComboboxComponent implements OnInit {
     // When the UI value is cleared, null is emitted.
     @Output() onChange: EventEmitter<ComboboxEntry>;
 
-    // Useful for massaging the match string prior to comparison 
+    // Useful for massaging the match string prior to comparison
     // and display.  Default version trims leading/trailing spaces.
     formatDisplayString: (ComboboxEntry) => string;
 
@@ -119,10 +119,10 @@ export class ComboboxComponent implements OnInit {
     // Apply a default selection where needed
     applySelection() {
 
-        if (this.startId && 
+        if (this.startId &&
             this.entrylist && !this.defaultSelectionApplied) {
 
-            const entry = 
+            const entry =
                 this.entrylist.filter(e => e.id === this.startId)[0];
 
             if (entry) {
@@ -155,7 +155,7 @@ export class ComboboxComponent implements OnInit {
                     id: null,
                     label: this.selected,
                     freetext: true
-                }
+                };
 
             } else {
 
@@ -184,9 +184,9 @@ export class ComboboxComponent implements OnInit {
 
         return new Observable(observer => {
             this.asyncDataSource(term).subscribe(
-                (entry: ComboboxEntry) => { 
-                    if (!this.asyncIds[''+entry.id]) {
-                        this.asyncIds[''+entry.id] = true;
+                (entry: ComboboxEntry) => {
+                    if (!this.asyncIds['' + entry.id]) {
+                        this.asyncIds['' + entry.id] = true;
                         this.addEntry(entry);
                     }
                 },
@@ -195,7 +195,7 @@ export class ComboboxComponent implements OnInit {
                     observer.next(term);
                     observer.complete();
                 }
-            )
+            );
         });
     }
 
@@ -206,7 +206,7 @@ export class ComboboxComponent implements OnInit {
 
             // Merge click actions in with the stream of text entry
             merge(
-                // Inject a specifier indicating the source of the 
+                // Inject a specifier indicating the source of the
                 // action is a user click instead of a text entry.
                 // This tells the filter to show all values in sync mode.
                 this.click$.pipe(filter(() =>
@@ -230,7 +230,7 @@ export class ComboboxComponent implements OnInit {
 
                 // Filter entrylist whose labels substring-match the
                 // text entered.
-                return this.entrylist.filter(entry => 
+                return this.entrylist.filter(entry =>
                     entry.label.toLowerCase().indexOf(term.toLowerCase()) > -1
                 );
             })
index ecf305c..a16bb4e 100644 (file)
     overflow: hidden;
 }
 
+/* in overflow mode, allow white space to wrap so the 
+ * full contents of the cell can be seen inline.  leaving 
+ * text-overflow and overlow as-is means long strings with
+ * no space will still be truncated with ellipses to avoid
+ * inconsistent grid column widths
+ */
 .eg-grid-cell-overflow {
     white-space: normal;
-    text-overflow: inherit;
-    overflow: inherit;
 }
 
 .eg-grid-body-cell {
index fb8b92d..06522f6 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, Input, Output, OnInit, AfterViewInit, EventEmitter, 
+import {Component, Input, Output, OnInit, AfterViewInit, EventEmitter,
     OnDestroy, HostListener, ViewEncapsulation} from '@angular/core';
 import {Subscription} from 'rxjs/Subscription';
 import {IdlService} from '@eg/core/idl.service';
index bed200c..8b2f7b2 100644 (file)
@@ -240,7 +240,9 @@ export class GridColumnSet {
             if (this.defaultHiddenFields) {
                 this.defaultHiddenFields.forEach(name => {
                     const col = this.getColByName(name);
-                    if (col) col.visible = false;
+                    if (col) {
+                        col.visible = false;
+                    }
                 });
             }
 
index 83c616d..539b2fe 100644 (file)
@@ -144,13 +144,13 @@ export class OrgSelectComponent implements OnInit {
             debounceTime(200),
             distinctUntilChanged(),
             merge(
-                // Inject a specifier indicating the source of the 
+                // Inject a specifier indicating the source of the
                 // action is a user click
                 this.click$.pipe(filter(() => !this.instance.isPopupOpen()))
                 .pipe(mapTo('_CLICK_'))
             ),
             map(term => {
-                
+
                 let orgs = this.org.list().filter(org =>
                     this.hidden.filter(id => org.id() === id).length === 0
                 );
@@ -165,7 +165,7 @@ export class OrgSelectComponent implements OnInit {
 
                     });
                 }
-                
+
                 return orgs.map(org => this.formatForDisplay(org));
             })
         );
index d33bf0b..3413ea2 100644 (file)
@@ -62,8 +62,8 @@ export class StaffLoginComponent implements OnInit {
         // prevent sending the user back to the login page or looping
         // back to the workstation removal page.
         if (url.startsWith('/staff/login') ||
-            url.startsWith('/staff/admin/workstation/workstations/remove/')) { 
-            url = '/staff/splash'; 
+            url.startsWith('/staff/admin/workstation/workstations/remove/')) {
+            url = '/staff/splash';
         }
 
         const workstation: string = this.args.workstation;
index c415f8f..9314e70 100644 (file)
@@ -71,21 +71,21 @@ export class SandboxComponent implements OnInit {
             {name: 'The Tick', state: 'TX'}
         ];
 
-        this.pcrud.retrieveAll('cmrcfld', {order_by:{cmrcfld: 'name'}})
+        this.pcrud.retrieveAll('cmrcfld', {order_by: {cmrcfld: 'name'}})
         .subscribe(format => {
             if (!this.cbEntries) { this.cbEntries = []; }
-            this.cbEntries.push({id: format.id(), label: format.name()})
+            this.cbEntries.push({id: format.id(), label: format.name()});
         });
 
         this.cbAsyncSource = term => {
             return this.pcrud.search(
-                'cmrcfld', 
+                'cmrcfld',
                 {name: {'ilike': `%${term}%`}}, // could -or search on label
                 {order_by: {cmrcfld: 'name'}}
             ).pipe(map(marcField => {
                 return {id: marcField.id(), label: marcField.name()};
             }));
-        }
+        };
 
         this.btSource.getRows = (pager: Pager, sort: any[]) => {