Tidying Up Grid
authorKyle Huckins <khuckins@catalyte.io>
Thu, 7 Nov 2019 18:38:04 +0000 (18:38 +0000)
committerJane Sandberg <sandbej@linnbenton.edu>
Sat, 8 Aug 2020 15:20:32 +0000 (08:20 -0700)
- Remove RowFlair and ClassCallback from Course Reserves
Grid.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/eg2/src/app/staff/admin/server/course-reserves/course-list.component.html
modified:   Open-ILS/src/eg2/src/app/staff/admin/server/course-reserves/course-list.component.ts

Open-ILS/src/eg2/src/app/staff/admin/server/course-reserves/course-list.component.html
Open-ILS/src/eg2/src/app/staff/admin/server/course-reserves/course-list.component.ts

index 471a94e..345197c 100644 (file)
@@ -10,9 +10,6 @@
 <div class="w-100 mt-2 mb-2">
   <eg-grid #grid idlClass={{idl_class}}
     [dataSource]="grid_source"
-    [rowFlairIsEnabled]="true"
-    [rowFlairCallback]="rowFlairCallback"
-    [cellClassCallback]="gridCellClassCallback"
     [sortable]="true">
     <eg-grid-toolbar-button
       label="Create {{table_name}}" (onClick)="createNew()" i18n-label>
index 9e4bb40..05fe7c9 100644 (file)
@@ -3,7 +3,7 @@ import {IdlObject} from '@eg/core/idl.service';
 import {PcrudService} from '@eg/core/pcrud.service';
 import {GridComponent} from '@eg/share/grid/grid.component';
 import {Pager} from '@eg/share/util/pager';
-import {GridDataSource, GridColumn, GridRowFlairEntry} from '@eg/share/grid/grid';
+import {GridDataSource, GridColumn} from '@eg/share/grid/grid';
 import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component';
 import {StringComponent} from '@eg/share/string/string.component';
 import {ToastService} from '@eg/share/toast/toast.service';
@@ -22,8 +22,6 @@ export class CourseListComponent implements OnInit {
     @ViewChild('updateFailedString', { static: false }) updateFailedString: StringComponent;
     @ViewChild('deleteFailedString', { static: true }) deleteFailedString: StringComponent;
     @ViewChild('deleteSuccessString', { static: true }) deleteSuccessString: StringComponent;
-    @ViewChild('flairTooltip', { static: true }) private flairTooltip: StringComponent;
-    rowFlairCallback: (row: any) => GridRowFlairEntry;
     @Input() sort_field: string;
     @Input() idl_class = "acmc";
     @Input() dialog_size: 'sm' | 'lg' = 'lg';
@@ -38,7 +36,6 @@ export class CourseListComponent implements OnInit {
 
     ngOnInit() {
         this.getSource();
-        this.rowFlair();
     }
 
     /**
@@ -63,24 +60,6 @@ export class CourseListComponent implements OnInit {
         };
     }
 
-    rowFlair() {
-        this.rowFlairCallback = (row: any): GridRowFlairEntry => {
-            const flair = {icon: null, title: null};
-            if (row.id() < 100) {
-                flair.icon = 'not_interested';
-                flair.title = this.flairTooltip.text;
-            }
-            return flair;
-        };
-    }
-
-    gridCellClassCallback = (row: any, col: GridColumn): string => {
-        if (col.name === 'id' && row.a[0] < 100) {
-            return 'text-danger';
-        }
-        return '';
-    }
-
     showEditDialog(standingPenalty: IdlObject): Promise<any> {
         this.editDialog.mode = 'update';
         this.editDialog.recordId = standingPenalty['id']();