Implement new book details dialog/tab
This commit is contained in:
@@ -36,6 +36,14 @@
|
||||
</div>
|
||||
</li>
|
||||
<p-divider layout="vertical" />
|
||||
|
||||
<li>
|
||||
<a class="topbar-item">
|
||||
<i class="pi pi-book text-surface-700 dark:text-surface-100" (click)="openBookDetailsDialog()"
|
||||
pTooltip="Book Details" tooltipPosition="top"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="topbar-item">
|
||||
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100" (click)="openLibraryCreatorDialog()"
|
||||
|
||||
@@ -16,6 +16,7 @@ import {Button} from 'primeng/button';
|
||||
import {AppConfiguratorComponent} from '../configurator/configurator.component';
|
||||
import {StyleClass} from 'primeng/styleclass';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {BookInfoTabsComponent} from '../../../book-info-tabs/book-info-tabs.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-topbar',
|
||||
@@ -39,7 +40,7 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
items!: MenuItem[];
|
||||
ref: DynamicDialogRef | undefined;
|
||||
|
||||
latestEvent: LogNotification = { message: 'No recent notifications...' };
|
||||
latestEvent: LogNotification = {message: 'No recent notifications...'};
|
||||
eventHighlight: boolean = false;
|
||||
showEvents: boolean = false;
|
||||
eventTimeout: any;
|
||||
@@ -76,6 +77,22 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
this.showEvents = !this.showEvents;
|
||||
}
|
||||
|
||||
|
||||
openBookDetailsDialog(): void {
|
||||
this.ref = this.dialogService.open(BookInfoTabsComponent, {
|
||||
header: 'Open book details',
|
||||
modal: true,
|
||||
closable: true,
|
||||
width: '1000px',
|
||||
height: '835px',
|
||||
showHeader: false,
|
||||
closeOnEscape: true,
|
||||
data: {
|
||||
bookId: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openLibraryCreatorDialog(): void {
|
||||
this.ref = this.dialogService.open(LibraryCreatorComponent, {
|
||||
header: 'Create New Library',
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
export interface BookMetadataForm {
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
authors: Array<string>;
|
||||
categories: Array<string>;
|
||||
publisher: string;
|
||||
publishedDate: string;
|
||||
isbn10: string;
|
||||
isbn13: string;
|
||||
asin: string;
|
||||
description?: string;
|
||||
pageCount: number;
|
||||
language: string;
|
||||
googleBookId: string;
|
||||
}
|
||||
@@ -17,6 +17,8 @@ export interface BookMetadata {
|
||||
publisher: string;
|
||||
publishedDate: string;
|
||||
isbn10: string;
|
||||
isbn13: string;
|
||||
asin: string;
|
||||
description?: string;
|
||||
pageCount: number;
|
||||
language: string;
|
||||
|
||||
@@ -4,6 +4,7 @@ import {HttpClient} from '@angular/common/http';
|
||||
import {catchError, map, switchMap, tap} from 'rxjs/operators';
|
||||
import {Book, BookMetadata, BookSetting, FetchedMetadata} from '../model/book.model';
|
||||
import {BookState} from '../model/state/book-state.model';
|
||||
import {BookMetadataForm} from '../model/book-metadata-form';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -202,4 +203,9 @@ export class BookService {
|
||||
updateMetadata(bookId: number, updateMedata: FetchedMetadata): Observable<BookMetadata> {
|
||||
return this.http.put<BookMetadata>(`${this.url}/${bookId}/source/AMAZON/metadata`, updateMedata);
|
||||
}
|
||||
|
||||
updateMetadataV2(bookId: number, bookMetadataForm: BookMetadataForm): Observable<BookMetadata> {
|
||||
return this.http.put<BookMetadata>(`${this.url}/${bookId}/metadata`, bookMetadataForm);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user