1 import {Component, OnInit, Input, Output, ViewChild, EventEmitter} from '@angular/core';
2 import {Observable, Observer, of} from 'rxjs';
3 import {tap} from 'rxjs/operators';
4 import {IdlObject, IdlService} from '@eg/core/idl.service';
5 import {NetService} from '@eg/core/net.service';
6 import {PcrudService} from '@eg/core/pcrud.service';
7 import {OrgService} from '@eg/core/org.service';
8 import {AuthService} from '@eg/core/auth.service';
9 import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap';
10 import {DialogComponent} from '@eg/share/dialog/dialog.component';
12 /** New hold note dialog */
15 selector: 'eg-hold-note-dialog',
16 templateUrl: 'note-dialog.component.html'
18 export class HoldNoteDialogComponent extends DialogComponent {
24 @Input() holdId: number;
27 private modal: NgbModal,
28 private idl: IdlService,
29 private pcrud: PcrudService
33 const note = this.idl.create('ahrn');
35 note.hold(this.holdId);
36 note.title(this.title);
38 note.slip(this.slip ? 't' : 'f');
39 note.pub(this.pub ? 't' : 'f');
41 this.pcrud.create(note).toPromise().then(
42 resp => this.close(resp), // new note object
43 err => console.error('Could not create note', err)