From 5b763c01abc75984ba005706369fe5a10cb2149d Mon Sep 17 00:00:00 2001 From: "aditya.chandel" <> Date: Wed, 25 Dec 2024 22:52:58 -0700 Subject: [PATCH] Fix --- .../books-browser.component.html | 4 +-- .../books-browser/books-browser.component.ts | 35 +++++-------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/booklore-ui/src/app/book/component/books-browser/books-browser.component.html b/booklore-ui/src/app/book/component/books-browser/books-browser.component.html index 32e6ad407..f00ab8b3a 100644 --- a/booklore-ui/src/app/book/component/books-browser/books-browser.component.html +++ b/booklore-ui/src/app/book/component/books-browser/books-browser.component.html @@ -2,7 +2,7 @@

{{ (entityType$ | async) }}: {{ (entity$ | async)?.name }}

- +
diff --git a/booklore-ui/src/app/book/component/books-browser/books-browser.component.ts b/booklore-ui/src/app/book/component/books-browser/books-browser.component.ts index f74115179..e800e301d 100644 --- a/booklore-ui/src/app/book/component/books-browser/books-browser.component.ts +++ b/booklore-ui/src/app/book/component/books-browser/books-browser.component.ts @@ -28,7 +28,8 @@ export class BooksBrowserComponent implements OnInit { entity: Library | Shelf | null = null; entityType: string = ''; - items: MenuItem[] | undefined; + speedDialItems: MenuItem[] | undefined; + multiSelectItems: MenuItem[] | undefined; selectedBooks: Set = new Set(); selectedSort: SortOption | null = null; sortOptions: SortOption[] = []; @@ -182,7 +183,7 @@ export class BooksBrowserComponent implements OnInit { } setupMenu(): void { - this.items = [ + this.multiSelectItems = [ { label: 'Options', items: [ @@ -210,7 +211,7 @@ export class BooksBrowserComponent implements OnInit { } private initializeLibraryMenuItems(): void { - this.items = [ + this.speedDialItems = [ { icon: 'pi pi-trash', tooltipOptions: { @@ -229,19 +230,10 @@ export class BooksBrowserComponent implements OnInit { this.libraryService.deleteLibrary(this.entity?.id!).subscribe({ complete: () => { this.router.navigate(['/']); - this.messageService.add({ - severity: 'info', - summary: 'Success', - detail: 'Library was deleted' - }); + this.messageService.add({severity: 'info', summary: 'Success', detail: 'Library was deleted'}); }, error: () => { - this.messageService.add({ - severity: 'error', - summary: 'Failed', - detail: 'Failed to delete library', - life: 3000 - }); + this.messageService.add({severity: 'error', summary: 'Failed', detail: 'Failed to delete library', life: 3000}); } }); } @@ -252,7 +244,7 @@ export class BooksBrowserComponent implements OnInit { } private initializeShelfMenuItems(): void { - this.items = [ + this.speedDialItems = [ { icon: 'pi pi-trash', tooltipOptions: { @@ -271,19 +263,10 @@ export class BooksBrowserComponent implements OnInit { this.shelfService.deleteShelf(this.entity?.id!).subscribe({ complete: () => { this.router.navigate(['/']); - this.messageService.add({ - severity: 'info', - summary: 'Success', - detail: 'Shelf was deleted' - }); + this.messageService.add({severity: 'info', summary: 'Success', detail: 'Shelf was deleted'}); }, error: () => { - this.messageService.add({ - severity: 'error', - summary: 'Failed', - detail: 'Failed to delete shelf', - life: 3000 - }); + this.messageService.add({severity: 'error', summary: 'Failed', detail: 'Failed to delete shelf', life: 3000}); } }); }