From bb744216e59a8fd7a0b7afdca8daf1ecb431eece Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 4 Mar 2019 11:11:24 -0500 Subject: [PATCH] LP1818288 Grid checkboxes emit events Modify the grid toolbar checkbox onClick handler to emit events instead of requesting a reference to a function. This is more consistent with other event-handling code. Signed-off-by: Bill Erickson Signed-off-by: Dan Wells --- .../grid/grid-toolbar-checkbox.component.ts | 8 +-- .../share/grid/grid-toolbar.component.html | 50 +++++++++---------- Open-ILS/src/eg2/src/app/share/grid/grid.ts | 2 +- .../cat/vandelay/queue-items.component.html | 4 +- .../cat/vandelay/queue-items.component.ts | 10 ++-- .../staff/cat/vandelay/queue.component.html | 27 +++++----- .../app/staff/cat/vandelay/queue.component.ts | 31 ++++++------ 7 files changed, 65 insertions(+), 67 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-checkbox.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-checkbox.component.ts index f078797525..8765917ceb 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-checkbox.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-checkbox.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnInit, Host, TemplateRef} from '@angular/core'; +import {Component, Input, OnInit, Host, Output, EventEmitter} from '@angular/core'; import {GridToolbarCheckbox} from './grid'; import {GridComponent} from './grid.component'; @@ -15,10 +15,12 @@ export class GridToolbarCheckboxComponent implements OnInit { // This is an input instead of an Output because the handler is // passed off to the grid context for maintenance -- events // are not fired directly from this component. - @Input() onChange: (checked: boolean) => void; + @Output() onChange: EventEmitter; // get a reference to our container grid. - constructor(@Host() private grid: GridComponent) {} + constructor(@Host() private grid: GridComponent) { + this.onChange = new EventEmitter(); + } ngOnInit() { diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html index c5afb48796..52c3ae1099 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html @@ -5,7 +5,7 @@
-
-
@@ -31,7 +31,7 @@
- - - @@ -85,7 +85,7 @@
- @@ -108,31 +108,31 @@
- - diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-items.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-items.component.ts index 7340e3d719..cae7c54a8e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-items.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-items.component.ts @@ -18,7 +18,6 @@ export class QueueItemsComponent { queueType: string; queueId: number; filterImportErrors: boolean; - limitToImportErrors: (checked: boolean) => void; gridSource: GridDataSource; @ViewChild('itemsGrid') itemsGrid: GridComponent; @@ -49,11 +48,12 @@ export class QueueItemsComponent { } ); }; + } - this.limitToImportErrors = (checked: boolean) => { - this.filterImportErrors = checked; - this.itemsGrid.reload(); - }; + limitToImportErrors(checked: boolean) { + this.filterImportErrors = checked; + this.itemsGrid.reload(); } + } diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.html index 5584700eed..e4ef84565b 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.html @@ -4,7 +4,7 @@ - @@ -117,11 +117,11 @@ {{row.imported_as}} - + -