Update multi select bottom bar for library.

This commit is contained in:
aditya.chandel
2024-12-30 10:01:11 -07:00
parent ad7688af68
commit 1e4d24036d
3 changed files with 31 additions and 21 deletions
@@ -53,11 +53,12 @@
</div>
<div class="book-browser-footer" *ngIf="selectedBooks.size > 0">
<div class="footer-items-container">
<p-button *ngIf="(entityType$ | async) === 'Library'" icon="pi pi-ellipsis-v" label="Options" severity="info" (click)="menu.toggle($event)"></p-button>
<!--<p-button *ngIf="(entityType$ | async) === 'Library'" icon="pi pi-ellipsis-v" label="Options" severity="info" (click)="menu.toggle($event)"></p-button>-->
<p-button *ngIf="(entityType$ | async) === 'Library'" icon="pi pi-book" label="Assign Shelf" severity="info" (onClick)="openShelfAssigner()"></p-button>
<p-button *ngIf="(entityType$ | async) === 'Shelf'" icon="pi pi-minus-circle" label="Unshelf" severity="info" (click)="unshelfBooks()"></p-button>
<p-button icon="pi pi-times" label="Deselect" severity="warn" (click)="deselectAllBooks()"></p-button>
</div>
<p-menu #menu [model]="multiSelectItems" [popup]="true" appendTo="body"></p-menu>
<!--<p-menu #menu [model]="multiSelectItems" [popup]="true" appendTo="body"></p-menu>-->
</div>
</div>
@@ -78,7 +78,7 @@ export class BookBrowserComponent implements OnInit {
this.bookTitle = '';
});
this.setupMenu();
//this.setupMenu();
}
private getRouteParams(): Observable<{ libraryId: number; shelfId: number }> {
@@ -230,7 +230,30 @@ export class BookBrowserComponent implements OnInit {
this.bookTitle$.next(newTitle);
}
setupMenu(): void {
openShelfAssigner() {
this.ref = this.dialogService.open(ShelfAssignerComponent, {
header: `Update Books Shelves`,
modal: true,
closable: true,
width: '30%',
height: '60%',
contentStyle: {overflow: 'auto'},
baseZIndex: 10,
style: {
position: 'absolute',
top: '15%',
},
data: {
isMultiBooks: true,
bookIds: this.selectedBooks
},
});
this.ref.onClose.subscribe(() => {
this.selectedBooks.clear();
});
}
/*setupMenu(): void {
this.multiSelectItems = [
{
label: 'Options',
@@ -239,27 +262,13 @@ export class BookBrowserComponent implements OnInit {
label: 'Edit shelf',
icon: 'pi pi-folder',
command: () => {
this.ref = this.dialogService.open(ShelfAssignerComponent, {
header: `Update Books Shelves`,
modal: true,
width: '30%',
height: '70%',
contentStyle: {overflow: 'auto'},
baseZIndex: 10,
data: {
isMultiBooks: true,
bookIds: this.selectedBooks
},
});
this.ref.onClose.subscribe(() => {
this.selectedBooks.clear();
});
}
}
],
},
];
}
}*/
private initializeLibraryMenuItems(): void {
this.entityOptions = [
@@ -9,7 +9,7 @@
[title]="primaryColor.name"
(click)="updateColors($event, 'primary', primaryColor)"
[ngClass]="{ 'active-color': primaryColor.name === selectedPrimaryColor() }"
[style]="{ 'background-color': primaryColor.name === 'noir' ? 'var(--text-color)' : primaryColor.palette?.['500'] || 'transparent' }"
[style]="{ 'background-color': primaryColor.name === 'noir' ? 'var(--text-color)' : primaryColor.palette['500'] || 'transparent' }"
></button>
}
</div>