From ac5a49f7a6f2c3287d732f7075a53082991fcf18 Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Tue, 14 Mar 2023 21:09:57 +0000 Subject: [PATCH] move basic classes out of callback Signed-off-by: Stephanie Leary --- .../eg2/src/app/share/grid/grid-body-cell.component.html | 14 ++++++-------- .../src/eg2/src/app/share/grid/grid-body.component.html | 6 +++--- .../src/app/share/grid/grid-filter-control.component.html | 2 +- Open-ILS/src/eg2/src/app/share/grid/grid.component.ts | 10 +++------- .../app/staff/admin/local/standing-penalty.component.ts | 4 ++-- .../src/eg2/src/app/staff/circ/patron/bills.component.ts | 2 +- 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html index 912615bf6f..6992aae988 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-body-cell.component.html @@ -1,9 +1,8 @@ - + triggers="mouseenter:mouseleave"> --> @@ -12,16 +11,15 @@ {{context.getRowColumnValue(row, column)}} - - --> + - + diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-body.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-body.component.html index e9a27f3505..f59dd139cd 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-body.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-body.component.html @@ -9,7 +9,7 @@ *ngFor="let row of context.dataSource.getPageOfRows(context.pager); let idx = index"> - + - + {{context.pager.rowNumber(idx)}} @@ -41,7 +41,7 @@ - Filter - filter_list + filter_alt create 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 f36dd1c67b..0f8dc55393 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 @@ -207,10 +207,6 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy { this.context.cellClassCallback = this.cellClassCallback || function (row: any, col: GridColumn) { - const classNames = ['eg-grid-type-'+col.datatype, 'eg-grid-class-'+col.idlClass, 'eg-grid-col-'+col.name]; - if (col.path) - classNames.push('eg-grid-path-'+col.path); - if (col.datatype === 'money') { // get raw value let val; @@ -220,11 +216,11 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy { val = this.getObjectFieldValue(row, col.name); } if (Number(val) < 0) { - classNames.push('negative-money-amount'); + return 'negative-money-amount'; } } - return classNames.join(' '); - }; + return ''; + } this.context.rowSelector.selectionChange.subscribe( keys => this.rowSelectionChange.emit(keys) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/standing-penalty.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/standing-penalty.component.ts index 3bd1d7550b..87f567d474 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/standing-penalty.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/standing-penalty.component.ts @@ -74,7 +74,7 @@ export class StandingPenaltyComponent implements OnInit { this.cspRowFlairCallback = (row: any): GridRowFlairEntry => { const flair = {icon: null, title: null}; - if (row.id() < 100) { + if (row && (row.id() < 100)) { flair.icon = 'not_interested'; flair.title = this.cspFlairTooltip.text; } @@ -111,7 +111,7 @@ export class StandingPenaltyComponent implements OnInit { } cspGridCellClassCallback = (row: any, col: GridColumn): string => { - if (col.name === 'id' && row.a[0] < 100) { + if (row && col.name === 'id' && row.a[0] < 100) { return 'text-danger'; } return ''; diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts index 3f8b11def0..a116ef032a 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts @@ -12,7 +12,7 @@ import {AuthService} from '@eg/core/auth.service'; import {ServerStoreService} from '@eg/core/server-store.service'; import {PatronService} from '@eg/staff/share/patron/patron.service'; import {PatronContextService} from './patron.service'; -import {GridDataSource, GridColumn, GridCellTextGenerator, GridRowFlairEntry} from '@eg/share/grid/grid'; +import {GridContext, GridDataSource, GridColumn, GridCellTextGenerator, GridRowFlairEntry} from '@eg/share/grid/grid'; import {GridComponent} from '@eg/share/grid/grid.component'; import {Pager} from '@eg/share/util/pager'; import {CircService, CircDisplayInfo} from '@eg/staff/share/circ/circ.service'; -- 2.11.0