From 52379c385e6e056b3f4f35698f9e7ab80dd04310 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 9 Mar 2021 10:42:29 -0500 Subject: [PATCH] LP#1846354: update Angular new penalty dialog This patch ensures that the new Angular missing pieces interface can continue to create penalties. Additional work will be required on the Angular dialog to match the other changes. Signed-off-by: Galen Charlton Signed-off-by: Chris Sharp --- .../app/staff/share/patron/penalty-dialog.component.html | 9 ++++++++- .../app/staff/share/patron/penalty-dialog.component.ts | 16 +++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.html index b66e562b85..ca82d472a3 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.html @@ -39,7 +39,14 @@
- + +
+
+
+
+
diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts index 12cdb5f559..4112f3ba4f 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/penalty-dialog.component.ts @@ -43,6 +43,7 @@ export class PatronPenaltyDialogComponent dataLoaded = false; requireInitials = false; initials: string; + title = ''; noteText = ''; @ViewChild('successMsg', {static: false}) successMsg: StringComponent; @@ -92,13 +93,18 @@ export class PatronPenaltyDialogComponent apply() { const pen = this.idl.create('ausp'); + const msg = { + title: this.title, + message: this.noteText ? this.noteText : '' + }; pen.usr(this.patronId); pen.org_unit(this.auth.user().ws_ou()); pen.set_date('now'); pen.staff(this.auth.user().id()); - pen.note(this.initials ? - `${this.noteText} [${this.initials}]` : this.noteText); + if (this.initials) { + msg.message = `${this.noteText} [${this.initials}]`; + } pen.standing_penalty( this.penaltyTypeFromSelect || this.penaltyTypeFromButton); @@ -106,15 +112,15 @@ export class PatronPenaltyDialogComponent this.net.request( 'open-ils.actor', 'open-ils.actor.user.penalty.apply', - this.auth.token(), pen + this.auth.token(), pen, msg ).subscribe(resp => { const e = this.evt.parse(resp); if (e) { - this.errorMsg.current().then(msg => this.toast.danger(msg)); + this.errorMsg.current().then(m => this.toast.danger(m)); this.error(e, true); } else { // resp == penalty ID on success - this.successMsg.current().then(msg => this.toast.success(msg)); + this.successMsg.current().then(m => this.toast.success(m)); this.close(resp); } }); -- 2.11.0