From 30977573194977313c6e3cec94ee5e15cfd2b194 Mon Sep 17 00:00:00 2001 From: Galen Charlton <gmc@equinoxOLI.org> Date: Mon, 19 Apr 2021 17:21:39 -0400 Subject: [PATCH] LP#1904244: AdminPageComponent: move onRowActivate subscription to markup 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> --- .../src/eg2/src/app/staff/admin/local/admin-carousel.component.html | 1 + .../staff/admin/server/floating-group/floating-group.component.html | 3 ++- .../src/eg2/src/app/staff/share/admin-page/admin-page.component.html | 1 + .../src/eg2/src/app/staff/share/admin-page/admin-page.component.ts | 5 ----- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/admin-carousel.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/admin-carousel.component.html index 45867e9103..a56294fd43 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/admin-carousel.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/admin-carousel.component.html @@ -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"> diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html index 66084e5686..2b14ac42bc 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html @@ -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> diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html index 8a3ef475b5..d55a91d34c 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html @@ -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()"> diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts index d9242bdf7b..9dda8f5fe8 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts @@ -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() { -- 2.11.0