From: Bill Erickson Date: Mon, 17 Dec 2018 15:56:36 +0000 (-0500) Subject: LP#1808268 eg2 grid rename action disable option X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9776fd8bcb298aa6c97c0e7bf4ca64ca850269a0;p=Evergreen.git LP#1808268 eg2 grid rename action disable option Rename the "disabled" attribute on toolbar-action to "disabeOnRows" to better clarify the expected input value: function returning bool instead of bool variable. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts index 6b6114ffc9..85211e6868 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts @@ -16,7 +16,7 @@ export class GridToolbarActionComponent implements OnInit { // Optional: add a function that returns true or false. // If true, this action will be disabled; if false // (default behavior), the action will be enabled. - @Input() disabled: (rows: any[]) => boolean; + @Input() disableOnRows: (rows: any[]) => boolean; // get a reference to our container grid. constructor(@Host() private grid: GridComponent) {} @@ -32,8 +32,8 @@ export class GridToolbarActionComponent implements OnInit { action.label = this.label; action.action = this.action; - action.disabled = (this.disabled == null) ? (rows: any[]) => false : this.disabled; - + action.disableOnRows = (this.disableOnRows === null) ? + (rows: any[]) => false : this.disableOnRows; this.grid.context.toolbarActions.push(action); } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts index a13362332f..93df40279b 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.ts @@ -42,7 +42,7 @@ export class GridToolbarComponent implements OnInit { } shouldDisableAction(action: GridToolbarAction) { - return action.disabled(this.gridContext.getSelectedRows()); + return action.disableOnRows(this.gridContext.getSelectedRows()); } printHtml() { diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts index 35ca5429bc..8a777e4b56 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -890,7 +890,7 @@ export class GridContext { export class GridToolbarAction { label: string; action: (rows: any[]) => any; - disabled: (rows: any[]) => boolean; + disableOnRows: (rows: any[]) => boolean; } // Buttons are global actions diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html index 66398fe8cb..8249335155 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html @@ -122,7 +122,8 @@ HERasdfE [rowFlairCallback]="btGridRowFlairCallback" [cellClassCallback]="btGridCellClassCallback" [sortable]="true"> - +