LP1983628: Add editor for item notes
[evergreen-equinox.git] / Open-ILS / src / eg2 / src / app / staff / share / holdings / copy-notes-dialog.component.ts
index cf8b8ba..ccfaec0 100644 (file)
@@ -32,7 +32,7 @@ export class CopyNotesDialogComponent
     // If there is only one copyId, then notes may be applied or removed.
     @Input() copyIds: number[] = [];
 
-    mode: string; // create | manage
+    mode: string; // create | manage | edit
 
     // If true, no attempt is made to save the new notes to the
     // database.  It's assumed this takes place in the calling code.
@@ -52,6 +52,8 @@ export class CopyNotesDialogComponent
 
     autoId = -1;
 
+    idToEdit: number;
+
     @ViewChild('successMsg', { static: true }) private successMsg: StringComponent;
     @ViewChild('errorMsg', { static: true }) private errorMsg: StringComponent;
 
@@ -112,6 +114,18 @@ export class CopyNotesDialogComponent
         });
     }
 
+    editNote(note: IdlObject) {
+        this.idToEdit = note.id();
+        this.mode = 'edit';
+    }
+
+    returnToManage() {
+        this.getCopies().then(() => {
+            this.idToEdit = null;
+            this.mode = 'manage';
+        })
+    }
+
     removeNote(note: IdlObject) {
         this.newNotes = this.newNotes.filter(t => t.id() !== note.id());