From: Bill Erickson Date: Thu, 25 Feb 2021 17:32:42 +0000 (-0500) Subject: LP1904036 Move precat dialog to shared circ service X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=66a96573f923d880bc3b892e6e2297193c9efc13;p=working%2FEvergreen.git LP1904036 Move precat dialog to shared circ service Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts index bbb1998e64..b1c73caa29 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts @@ -16,7 +16,7 @@ import {GridComponent} from '@eg/share/grid/grid.component'; import {Pager} from '@eg/share/util/pager'; import {StoreService} from '@eg/core/store.service'; import {ServerStoreService} from '@eg/core/server-store.service'; -import {PrecatCheckoutDialogComponent} from './precat-dialog.component'; +import {PrecatCheckoutDialogComponent} from '@eg/staff/share/circ/precat-dialog.component'; import {AudioService} from '@eg/share/util/audio.service'; import {CopyAlertsDialogComponent } from '@eg/staff/share/holdings/copy-alerts-dialog.component'; @@ -167,7 +167,6 @@ export class CheckoutComponent implements OnInit, AfterViewInit { switch (result.evt.textcode) { case 'ITEM_NOT_CATALOGED': - this.audio.play('error.checkout.no_cataloged'); this.handlePrecat(result); break; } diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts index 1cc7dcbd6e..b459def2dd 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts @@ -15,7 +15,6 @@ import {HoldsComponent} from './holds.component'; import {EditComponent} from './edit.component'; import {EditToolbarComponent} from './edit-toolbar.component'; import {BcSearchComponent} from './bcsearch.component'; -import {PrecatCheckoutDialogComponent} from './precat-dialog.component'; import {BarcodesModule} from '@eg/staff/share/barcodes/barcodes.module'; import {ItemsComponent} from './items.component'; @@ -28,8 +27,7 @@ import {ItemsComponent} from './items.component'; EditComponent, EditToolbarComponent, BcSearchComponent, - ItemsComponent, - PrecatCheckoutDialogComponent + ItemsComponent ], imports: [ StaffCommonModule, diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/precat-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/precat-dialog.component.html deleted file mode 100644 index 5d1182cd35..0000000000 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/precat-dialog.component.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/precat-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/precat-dialog.component.ts deleted file mode 100644 index 3b9ce8fea5..0000000000 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/precat-dialog.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {Component, OnInit, Input} from '@angular/core'; -import {Observable} from 'rxjs'; -import {DialogComponent} from '@eg/share/dialog/dialog.component'; -import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; -import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; -import {PermService} from '@eg/core/perm.service'; - -/** - * Precat checkout dialog - */ - -@Component({ - selector: 'eg-precat-checkout-dialog', - templateUrl: 'precat-dialog.component.html' -}) - -export class PrecatCheckoutDialogComponent extends DialogComponent implements OnInit { - - @Input() barcode = ''; - - circModifier: ComboboxEntry; - hasPerm = false; - - values = { - dummy_title: null, - dummy_author: null, - dummy_isbn: null, - circ_modifier: null - }; - - constructor( - private perm: PermService, - private modal: NgbModal) { - super(modal); - } - - ngOnInit() { - this.onOpen$.subscribe(_ => { - this.perm.hasWorkPermHere('CREATE_PRECAT') - .then(perms => this.hasPerm = perms['CREATE_PRECAT']); - - setTimeout(() => { - const node = document.getElementById('precat-title-input'); - if (node) { node.focus(); } - }); - }); - } -} - - - diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.module.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.module.ts index af4904f8a0..714cf654bd 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.module.ts @@ -4,18 +4,21 @@ import {HoldingsModule} from '@eg/staff/share/holdings/holdings.module'; import {CircService} from './circ.service'; import {CircGridComponent} from './grid.component'; import {DueDateDialogComponent} from './due-date-dialog.component'; +import {PrecatCheckoutDialogComponent} from './precat-dialog.component'; @NgModule({ declarations: [ CircGridComponent, - DueDateDialogComponent + DueDateDialogComponent, + PrecatCheckoutDialogComponent ], imports: [ StaffCommonModule, HoldingsModule ], exports: [ - CircGridComponent + CircGridComponent, + PrecatCheckoutDialogComponent ], providers: [ CircService 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 027bfd6d33..c7d3d8c2a9 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 @@ -156,6 +156,7 @@ export class CircService { switch (evt.textcode) { case 'ITEM_NOT_CATALOGED': + this.audio.play('error.checkout.no_cataloged'); // alert, etc. } diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.html new file mode 100644 index 0000000000..5d1182cd35 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.html @@ -0,0 +1,50 @@ + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts new file mode 100644 index 0000000000..3b9ce8fea5 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts @@ -0,0 +1,51 @@ +import {Component, OnInit, Input} from '@angular/core'; +import {Observable} from 'rxjs'; +import {DialogComponent} from '@eg/share/dialog/dialog.component'; +import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; +import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; +import {PermService} from '@eg/core/perm.service'; + +/** + * Precat checkout dialog + */ + +@Component({ + selector: 'eg-precat-checkout-dialog', + templateUrl: 'precat-dialog.component.html' +}) + +export class PrecatCheckoutDialogComponent extends DialogComponent implements OnInit { + + @Input() barcode = ''; + + circModifier: ComboboxEntry; + hasPerm = false; + + values = { + dummy_title: null, + dummy_author: null, + dummy_isbn: null, + circ_modifier: null + }; + + constructor( + private perm: PermService, + private modal: NgbModal) { + super(modal); + } + + ngOnInit() { + this.onOpen$.subscribe(_ => { + this.perm.hasWorkPermHere('CREATE_PRECAT') + .then(perms => this.hasPerm = perms['CREATE_PRECAT']); + + setTimeout(() => { + const node = document.getElementById('precat-title-input'); + if (node) { node.focus(); } + }); + }); + } +} + + +