From: Bill Erickson Date: Mon, 21 Jun 2021 15:49:24 +0000 (-0400) Subject: LPXXX Item Status Angular WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e4948c75e89f23463d23091e61100fce6828ceb6;p=working%2FEvergreen.git LPXXX Item Status Angular WIP Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/item.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/item/item.module.ts index 9da299216d..a9e31b1fb8 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/item.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/item.module.ts @@ -7,6 +7,7 @@ import {PatronModule} from '@eg/staff/share/patron/patron.module'; import {MarkItemMissingPiecesComponent} from './missing-pieces.component'; import {ItemStatusComponent} from './status.component'; import {BarcodesModule} from '@eg/staff/share/barcodes/barcodes.module'; +import {CircModule} from '@eg/staff/share/circ/circ.module'; import {ItemSummaryComponent} from './summary.component'; @NgModule({ @@ -21,6 +22,7 @@ import {ItemSummaryComponent} from './summary.component'; ItemRoutingModule, HoldingsModule, BarcodesModule, + CircModule, PatronModule ], providers: [ diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html index 9c91bd7b43..b44b31569a 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html @@ -2,6 +2,9 @@ + + +
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts index 531d1b026d..38f3e1c378 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts @@ -11,6 +11,10 @@ import {PatronPenaltyDialogComponent} from '@eg/staff/share/patron/penalty-dialo import {BarcodeSelectComponent} from '@eg/staff/share/barcodes/barcode-select.component'; import {CatalogService} from '@eg/share/catalog/catalog.service'; import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap'; +import {CopyAlertsDialogComponent + } from '@eg/staff/share/holdings/copy-alerts-dialog.component'; +import {BucketDialogComponent + } from '@eg/staff/share/buckets/bucket-dialog.component'; @Component({ templateUrl: 'status.component.html' @@ -24,7 +28,8 @@ export class ItemStatusComponent implements OnInit, AfterViewInit { item: IdlObject; tab: string; - @ViewChild('barcodeSelect') barcodeSelect: BarcodeSelectComponent; + @ViewChild('barcodeSelect') private barcodeSelect: BarcodeSelectComponent; + @ViewChild('bucketDialog') private bucketDialog: BucketDialogComponent; constructor( private router: Router, diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html index 8be3f98517..f6883172d5 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html @@ -1,3 +1,6 @@ + + +
This item has been marked as Deleted.
@@ -270,7 +273,7 @@
+ (click)="manageItemAlerts()" i18n>Manage
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts index 8f6379e2f8..41cc81ccca 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts @@ -12,6 +12,9 @@ import {PermService} from '@eg/core/perm.service'; import {PatronPenaltyDialogComponent} from '@eg/staff/share/patron/penalty-dialog.component'; import {BarcodeSelectComponent} from '@eg/staff/share/barcodes/barcode-select.component'; import {CatalogService} from '@eg/share/catalog/catalog.service'; +import {CircService} from '@eg/staff/share/circ/circ.service'; +import {CopyAlertsDialogComponent + } from '@eg/staff/share/holdings/copy-alerts-dialog.component'; @Component({ selector: 'eg-item-summary', @@ -29,6 +32,8 @@ export class ItemSummaryComponent implements OnInit { maxHistoryCount: number; loading = false; + @ViewChild('copyAlertsDialog') private copyAlertsDialog: CopyAlertsDialogComponent; + constructor( private router: Router, private route: ActivatedRoute, @@ -41,9 +46,9 @@ export class ItemSummaryComponent implements OnInit { private idl: IdlService, private evt: EventService, private cat: CatalogService, - private holdings: HoldingsService - ) { - } + private holdings: HoldingsService, + private circs: CircService + ) { } ngOnInit() { this.loading = true; @@ -95,24 +100,14 @@ export class ItemSummaryComponent implements OnInit { if (!circ) return Promise.resolve(); - // load the chain for this circ - return this.net.request( - 'open-ils.circ', - 'open-ils.circ.renewal_chain.retrieve_by_circ.summary', - this.auth.token(), this.circ.id() - ).toPromise().then(summary => { + return this.circs.getCircChain(this.circ.id()) + .then(summary => { this.circSummary = summary if (this.maxHistoryCount <= 1) { return; } - // load the chain for the previous circ, plus the user - - return this.net.request( - 'open-ils.circ', - 'open-ils.circ.prev_renewal_chain.retrieve_by_circ.summary', - this.auth.token(), this.circ.id() - - ).toPromise().then(summary => { + return this.circs.getPrevCircChain(this.circ.id()) + .then(summary => { if (!summary) { return; } this.prevCircSummary = summary.summary; @@ -130,10 +125,15 @@ export class ItemSummaryComponent implements OnInit { addItemAlerts() { + this.copyAlertsDialog.copyIds = [this.item.id()]; + this.copyAlertsDialog.mode = 'create'; + this.copyAlertsDialog.open({size: 'lg'}).subscribe(); } manageItemAlerts() { + this.copyAlertsDialog.copyIds = [this.item.id()]; + this.copyAlertsDialog.mode = 'manage'; + this.copyAlertsDialog.open({size: 'lg'}).subscribe(); } - } diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts index ffe0d38b95..882a808f0e 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts @@ -1228,5 +1228,23 @@ export class CircService { return checkDigit; } + + getCircChain(circId: number): Promise { + return this.net.request( + 'open-ils.circ', + 'open-ils.circ.renewal_chain.retrieve_by_circ.summary', + this.auth.token(), circId + ).toPromise(); + } + + getPrevCircChain(circId: number): Promise { + + return this.net.request( + 'open-ils.circ', + 'open-ils.circ.prev_renewal_chain.retrieve_by_circ.summary', + this.auth.token(), circId + + ).toPromise(); + } }