From: Bill Erickson Date: Fri, 19 Jun 2020 18:11:31 +0000 (-0400) Subject: LPXXX Angular Volcopy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8857128e42be5b18b164b996583d5b14b5341d4b;p=working%2FEvergreen.git LPXXX Angular Volcopy Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html index 789f6572d2..3086135ac2 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.html @@ -336,7 +336,7 @@
-
Item Alerts
+
Add Item Alerts
+
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/actions.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/actions.component.ts index 52e89bee6b..687066fa2d 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/actions.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/actions.component.ts @@ -98,7 +98,8 @@ export class RecordActionsComponent implements OnInit { // TODO: Support adding like call numbers by getting selected // call numbers from the holdings grid. addHoldings() { - this.holdings.spawnAddHoldingsUi(this.recId); + // -1 == create new call number + this.holdings.spawnAddHoldingsUi(this.recId, null, [{callnumber: -1}]); } } diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.ts index 439c5468c5..06951b8473 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alerts-dialog.component.ts @@ -41,6 +41,11 @@ export class CopyAlertsDialogComponent return this._mode; } + // If true, no attempt is made to save the new alerts to the + // database. It's assumed this takes place in the calling code. + // This is useful for creating alerts for new copies. + @Input() inPlaceMode = false; + // In 'create' mode, we may be adding notes to multiple copies. copies: IdlObject[]; // In 'manage' mode we only handle a single copy. @@ -78,7 +83,7 @@ export class CopyAlertsDialogComponent this.newAlert = this.idl.create('aca'); this.newAlert.create_staff(this.auth.user().id()); - if (this.copyIds.length === 0) { + if (this.copyIds.length === 0 && !this.inPlaceMode) { return throwError('copy ID required'); } @@ -117,6 +122,9 @@ export class CopyAlertsDialogComponent } getCopies(): Promise { + + if (this.inPlaceMode) { return Promise.resolve(); } + return this.pcrud.search('acp', {id: this.copyIds}, {}, {atomic: true}) .toPromise().then(copies => { this.copies = copies; @@ -149,6 +157,11 @@ export class CopyAlertsDialogComponent addNew() { if (!this.newAlert.alert_type()) { return; } + if (this.inPlaceMode) { + this.close(this.newAlert); + return; + } + const alerts: IdlObject[] = []; this.copies.forEach(c => { const a = this.idl.clone(this.newAlert); diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.service.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.service.ts index ccfd79bd81..f907b3bfbc 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/holdings.service.ts @@ -62,7 +62,8 @@ export class HoldingsService { return; } setTimeout(() => { - const url = `/eg2/staff/cat/volcopy/edit/session/${key}`; + const tab = hideVols ? 'attrs' : 'holdings'; + const url = `/eg2/staff/cat/volcopy/${tab}/session/${key}`; window.open(url, '_blank'); }); });