LP#1850547: (follow-up) fix 'New Selection List' button
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 2 Sep 2020 15:34:05 +0000 (11:34 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 3 Sep 2020 15:52:40 +0000 (11:52 -0400)
Now that it's a toolbar button rather than a grid action,
the check to see if the button should be active needed to be
adjusted.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.html
Open-ILS/src/eg2/src/app/staff/acq/search/picklist-results.component.ts

index 9bb5d72..3aeb367 100644 (file)
@@ -41,7 +41,7 @@
   idlClass="acqpl" [dataSource]="gridSource">
 
   <eg-grid-toolbar-button label="New Selection List" i18n-label
-    (onClick)="openCreateDialog()" [disableOnRows]="createNotAppropriate">
+    (onClick)="openCreateDialog()" [disabled]="createNotAppropriate()">
   </eg-grid-toolbar-button>
   <eg-grid-toolbar-action label="Clone Selected" i18n-label
     (onClick)="openCloneDialog($event)" [disableOnRows]="cloneNotAppropriate">
index ba5cdb0..899f0ca 100644 (file)
@@ -42,7 +42,7 @@ export class PicklistResultsComponent implements OnInit {
     permissions: {[name: string]: boolean};
     noSelectedRows: (rows: IdlObject[]) => boolean;
     oneSelectedRows: (rows: IdlObject[]) => boolean;
-    createNotAppropriate: (rows: IdlObject[]) => boolean;
+    createNotAppropriate: () => boolean;
     cloneNotAppropriate: (rows: IdlObject[]) => boolean;
     mergeNotAppropriate: (rows: IdlObject[]) => boolean;
     deleteNotAppropriate: (rows: IdlObject[]) => boolean;
@@ -76,7 +76,7 @@ export class PicklistResultsComponent implements OnInit {
 
         this.noSelectedRows = (rows: IdlObject[]) => (rows.length === 0);
         this.oneSelectedRows = (rows: IdlObject[]) => (rows.length === 1);
-        this.createNotAppropriate = (rows: IdlObject[]) => (!this.permissions.CREATE_PICKLIST);
+        this.createNotAppropriate = () => (!this.permissions.CREATE_PICKLIST);
         this.cloneNotAppropriate = (rows: IdlObject[]) => (!this.permissions.CREATE_PICKLIST || !this.oneSelectedRows(rows));
         this.mergeNotAppropriate = (rows: IdlObject[]) => (!this.permissions.UPDATE_PICKLIST || this.noSelectedRows(rows));
         this.deleteNotAppropriate = (rows: IdlObject[]) => (!this.permissions.UPDATE_PICKLIST || this.noSelectedRows(rows));