Support multi select for metadata
This commit is contained in:
@@ -7,6 +7,8 @@ import {ProgressSpinner} from 'primeng/progressspinner';
|
||||
import {BookService} from '../../service/book.service';
|
||||
import {Rating} from 'primeng/rating';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {BookMetadataCenterComponent} from '../../../book-metadata-center/book-metadata-center.component';
|
||||
import {DialogService} from 'primeng/dynamicdialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-book-table',
|
||||
@@ -25,11 +27,38 @@ import {FormsModule} from '@angular/forms';
|
||||
export class BookTableComponent {
|
||||
bookState$: Observable<BookState>;
|
||||
|
||||
constructor(private bookService: BookService) {
|
||||
constructor(private bookService: BookService, private dialogService: DialogService) {
|
||||
this.bookState$ = this.bookService.bookState$;
|
||||
}
|
||||
|
||||
getBookCoverUrl(bookId: number): string {
|
||||
return this.bookService.getBookCoverUrl(bookId);
|
||||
}
|
||||
|
||||
openMetadataCenter(id: number) {
|
||||
this.openBookDetailsDialog(id);
|
||||
}
|
||||
|
||||
openBookDetailsDialog(bookId: number): void {
|
||||
this.bookService.getBookByIdFromAPI(bookId, true).subscribe(({
|
||||
next: (book) => {
|
||||
this.dialogService.open(BookMetadataCenterComponent, {
|
||||
header: 'Open book details',
|
||||
modal: true,
|
||||
closable: true,
|
||||
width: '1200px',
|
||||
height: '835px',
|
||||
showHeader: false,
|
||||
closeOnEscape: true,
|
||||
dismissableMask: true,
|
||||
data: {
|
||||
book: book
|
||||
}
|
||||
});
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error fetching book:', error);
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user