From 7d9665dfbd23b047e98554db48bf02e3b266a7f3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 8 Jul 2022 15:10:51 -0400 Subject: [PATCH] LP1955065 Item note dialog close value repairs Handle cases where the copy note dialog is closed via Cancel actions and emits no data. Also be sure the dialog emits consistently shaped data when it does emit data. Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts | 2 ++ Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts | 1 + .../src/eg2/src/app/staff/share/holdings/copy-notes-dialog.component.ts | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 4abf63b2a3..41adfb5c36 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -470,6 +470,8 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { this.copyNotesDialog.copyIds = this.context.copyList().map(c => c.id()); this.copyNotesDialog.open({size: 'lg'}).subscribe(changes => { + if (!changes) { return; } + if ((!changes.newNotes || changes.newNotes.length === 0) && (!changes.delNotes || changes.delNotes.length === 0) ) { diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts index 57b9981a48..62fa86f237 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts @@ -971,6 +971,7 @@ export class HoldingsMaintenanceComponent implements OnInit { this.copyNotesDialog.copyIds = copyIds; this.copyNotesDialog.open({size: 'lg'}).subscribe( changes => { + if (!changes) { return; } if (changes.newNotes.length > 0 || changes.delNotes.length > 0) { this.hardRefresh(); } diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-notes-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-notes-dialog.component.ts index a62dd4f4be..a5fffd0a68 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-notes-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-notes-dialog.component.ts @@ -168,7 +168,7 @@ export class CopyNotesDialogComponent } }).then(_ => { this.successMsg.current().then(msg => this.toast.success(msg)); - this.close(this.newNotes.length > 0 || this.delNotes.length > 0); + this.close({ newNotes: this.newNotes, delNotes: this.delNotes }); }); } } -- 2.11.0