LP#1904244: AdminPageComponent: move onRowActivate subscription to markup
authorGalen Charlton <gmc@equinoxOLI.org>
Mon, 19 Apr 2021 21:21:39 +0000 (17:21 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 12 Aug 2021 19:29:26 +0000 (15:29 -0400)
This allows extenders of this interface to set their own non-default
handlers.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/admin/local/admin-carousel.component.html
Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts

index 45867e9..a56294f 100644 (file)
@@ -43,6 +43,7 @@
 <eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" 
     [sortable]="true" persistKey="{{persistKey}}"
     [cellTextGenerator]="cellTextGenerator"
+    (onRowActivate)="showEditDialog($event)"
     [stickyHeader]="true">
   <eg-grid-toolbar-button [disabled]="!canCreate" 
     label="New {{idlClassDef.label}}" i18n-label [action]="createNew">
index 66084e5..2b14ac4 100644 (file)
@@ -9,7 +9,8 @@
 <eg-string #deleteSuccessString i18n-text 
   text="Delete of Floating Group succeeded"></eg-string>
 
-<eg-grid #grid idlClass="cfg" [dataSource]="gridDataSource" [sortable]="true">
+<eg-grid #grid idlClass="cfg" [dataSource]="gridDataSource" [sortable]="true"
+  (onRowActivate)="showEditDialog($event)">
   <eg-grid-toolbar-button
     label="New Floating Group" i18n-label (onClick)="createNew()">
   </eg-grid-toolbar-button>
index 8a3ef47..d55a91d 100644 (file)
@@ -54,6 +54,7 @@
 
 <eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" hideFields="{{hideGridFields}}"
     [sortable]="true" persistKey="{{persistKey}}" autoGeneratedColumnOrder="{{fieldOrder}}"
+    (onRowActivate)="showEditDialog($event)"
     [filterable]="true" [stickyHeader]="true">
   <eg-grid-toolbar-button [disabled]="!canCreate" 
     label="New {{idlClassDef.label}}" i18n-label (onClick)="createNew()">
index d9242bd..9dda8f5 100644 (file)
@@ -226,11 +226,6 @@ export class AdminPageComponent implements OnInit {
         if (!this.dataSource) {
             this.initDataSource();
         }
-
-        // TODO: pass the row activate handler via the grid markup
-        this.grid.onRowActivate.subscribe(
-            (idlThing: IdlObject) => this.showEditDialog(idlThing)
-        );
     }
 
     checkCreatePerms() {