LP1888723 Add/Manage item notes from catalog holdings
authorBill Erickson <berickxx@gmail.com>
Thu, 24 Sep 2020 19:53:16 +0000 (15:53 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Sun, 15 Aug 2021 23:55:42 +0000 (19:55 -0400)
Adds an entry point for adding and managing Item Notes from the Angular
staff catalog holdings view.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.html
Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts

index 48bece5..958ecbb 100644 (file)
@@ -48,6 +48,7 @@
 <eg-mark-missing-dialog #markMissingDialog></eg-mark-missing-dialog>
 <eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
 <eg-copy-tags-dialog #copyTagsDialog></eg-copy-tags-dialog>
+<eg-copy-notes-dialog #copyNotesDialog></eg-copy-notes-dialog>
 <eg-replace-barcode-dialog #replaceBarcode></eg-replace-barcode-dialog>
 <eg-delete-holding-dialog #deleteHolding></eg-delete-holding-dialog>
 <eg-bucket-dialog #bucketDialog></eg-bucket-dialog>
     </eg-grid-toolbar-action>
 
     <eg-grid-toolbar-action
+      i18n-group group="Add" i18n-label label="Add/Manage Item Notes"
+      (onClick)="openItemNotes($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
       i18n-group group="Add" i18n-label label="Add Items To Bucket"
       (onClick)="openBucketDialog($event)">
     </eg-grid-toolbar-action>
     
     <eg-grid-toolbar-action
       i18n-group group="Edit" i18n-label label="Edit Item Alerts"
-      (onClick)="openItemNotes($event, 'manage')">
+      (onClick)="openItemAlerts($event, 'manage')">
     </eg-grid-toolbar-action>
 
     <eg-grid-toolbar-action
index 58809b6..37103a3 100644 (file)
@@ -25,6 +25,8 @@ import {CopyAlertsDialogComponent
     } from '@eg/staff/share/holdings/copy-alerts-dialog.component';
 import {CopyTagsDialogComponent
     } from '@eg/staff/share/holdings/copy-tags-dialog.component';
+import {CopyNotesDialogComponent
+    } from '@eg/staff/share/holdings/copy-notes-dialog.component';
 import {ReplaceBarcodeDialogComponent
     } from '@eg/staff/share/holdings/replace-barcode-dialog.component';
 import {DeleteHoldingDialogComponent
@@ -110,6 +112,8 @@ export class HoldingsMaintenanceComponent implements OnInit {
         private copyAlertsDialog: CopyAlertsDialogComponent;
     @ViewChild('copyTagsDialog', {static: false})
         private copyTagsDialog: CopyTagsDialogComponent;
+    @ViewChild('copyNotesDialog', {static: false})
+        private copyNotesDialog: CopyNotesDialogComponent;
     @ViewChild('replaceBarcode', { static: true })
         private replaceBarcode: ReplaceBarcodeDialogComponent;
     @ViewChild('deleteHolding', { static: true })
@@ -895,7 +899,7 @@ export class HoldingsMaintenanceComponent implements OnInit {
         }
     }
 
-    openItemNotes(rows: HoldingsEntry[], mode: string) {
+    openItemAlerts(rows: HoldingsEntry[], mode: string) {
         const copyIds = this.selectedCopyIds(rows);
         if (copyIds.length === 0) { return; }
 
@@ -924,6 +928,20 @@ export class HoldingsMaintenanceComponent implements OnInit {
         );
     }
 
+    openItemNotes(rows: HoldingsEntry[]) {
+        const copyIds = this.selectedCopyIds(rows);
+        if (copyIds.length === 0) { return; }
+
+        this.copyNotesDialog.copyIds = copyIds;
+        this.copyNotesDialog.open({size: 'lg'}).subscribe(
+            modified => {
+                if (modified) {
+                    this.hardRefresh();
+                }
+            }
+        );
+    }
+
     openReplaceBarcodeDialog(rows: HoldingsEntry[]) {
         const ids = this.selectedCopyIds(rows);
         if (ids.length === 0) { return; }