refactor(ui): switch library and shelf menu to app-menu (#2057)

This commit is contained in:
Alex
2026-07-30 20:47:24 +01:00
committed by GitHub
parent 134e97f028
commit 0acd8bcb1e
22 changed files with 631 additions and 845 deletions
@@ -28,19 +28,24 @@
}
</div>
@if (userService.currentUser(); as currentUser) {
@if (entityType !== EntityType.ALL_BOOKS && entityType !== EntityType.UNSHELVED &&
(currentUser.permissions.admin || currentUser.permissions.canManageLibrary)) {
<div class="entity-menu-wrapper">
<p-button
icon="pi pi-ellipsis-v"
@if (entityMenuTarget(); as menuTarget) {
<div class="entity-menu-wrapper">
<app-library-shelf-menu
#entityMenu
[target]="menuTarget"
[ariaLabel]="'common.moreActionsFor' | transloco: {label: menuTarget.entity.name}" />
@if (entityMenu.available()) {
<button
pButton
type="button"
[rounded]="true"
[text]="true"
(click)="entitymenu.toggle($event)">
</p-button>
<p-menu #entitymenu [model]="entityOptions()" [popup]="true" appendTo="body"></p-menu>
</div>
}
[attr.aria-label]="'common.moreActionsFor' | transloco: {label: menuTarget.entity.name}"
[appMenuTriggerFor]="entityMenu.menu()">
<i class="pi pi-ellipsis-v" aria-hidden="true"></i>
</button>
}
</div>
}
}
</div>