1 import {Component, OnInit, OnDestroy, Input, ViewChild,
2 Renderer2} from '@angular/core';
3 import {Subscription} from 'rxjs';
4 import {IdlObject} from '@eg/core/idl.service';
5 import {NetService} from '@eg/core/net.service';
6 import {EventService} from '@eg/core/event.service';
7 import {PcrudService} from '@eg/core/pcrud.service';
8 import {ToastService} from '@eg/share/toast/toast.service';
9 import {AuthService} from '@eg/core/auth.service';
10 import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap';
11 import {DialogComponent} from '@eg/share/dialog/dialog.component';
12 import {StringComponent} from '@eg/share/string/string.component';
15 * Dialog for making items bookable
19 selector: 'eg-make-bookable-dialog',
20 templateUrl: 'make-bookable-dialog.component.html'
22 export class MakeBookableDialogComponent
23 extends DialogComponent implements OnInit, OnDestroy {
25 // Note copyIds must refer to copies that belong to a single
27 @Input() copyIds: number[];
32 updateComplete: boolean;
34 onOpenSub: Subscription;
36 @ViewChild('successMsg') private successMsg: StringComponent;
37 @ViewChild('errorMsg') private errorMsg: StringComponent;
40 private modal: NgbModal, // required for passing to parent
41 private toast: ToastService,
42 private net: NetService,
43 private pcrud: PcrudService,
44 private evt: EventService,
45 private renderer: Renderer2,
46 private auth: AuthService) {
47 super(modal); // required for subclassing
51 this.onOpenSub = this.onOpen$.subscribe(async () => {
52 this.numSucceeded = 0;
54 this.updateComplete = false;
59 this.onOpenSub.unsubscribe();