From: Bill Erickson Date: Mon, 26 Nov 2018 18:20:47 +0000 (+0000) Subject: LP1803787 Grid toolbar action separators X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2cf218476cbac30b9f9e55a698a4bc48eda7557a;p=working%2FEvergreen.git LP1803787 Grid toolbar action separators Add support for "separator" toolbar actions so the action menu may be divided into groups. Signed-off-by: Bill Erickson --- 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 0a3337633d..b03695fd9a 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 @@ -18,6 +18,9 @@ export class GridToolbarActionComponent implements OnInit { // (default behavior), the action will be enabled. @Input() disableOnRows: (rows: any[]) => boolean; + // If true, render a separator bar only, no action link. + @Input() separator: boolean; + // get a reference to our container grid. constructor(@Host() private grid: GridComponent) {} @@ -31,6 +34,7 @@ export class GridToolbarActionComponent implements OnInit { const action = new GridToolbarAction(); action.label = this.label; action.action = this.action; + action.separator = this.separator; action.disableOnRows = this.disableOnRows; this.grid.context.toolbarActions.push(action); 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 5eaa81ff62..11a4c876b1 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 @@ -35,11 +35,17 @@ class="material-icons mat-icon-in-button">playlist_add_check 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 b591d8a7b5..1c575be810 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -882,6 +882,7 @@ export class GridContext { // Actions apply to specific rows export class GridToolbarAction { label: string; + separator: boolean; action: (rows: any[]) => any; disableOnRows: (rows: any[]) => boolean; }