Add a shelf creation button to the left menu bar and improve the layout of the shelf creation page (#1617)

This commit is contained in:
Aditya Chandel
2025-11-24 08:42:07 -07:00
committed by GitHub
parent 1dbf214199
commit 4d9362a1b4
10 changed files with 1036 additions and 91 deletions
@@ -178,7 +178,7 @@ export class AppMenuComponent implements OnInit {
type: 'shelf',
label: 'Shelves',
hasDropDown: true,
hasCreate: false,
hasCreate: true,
items,
},
];
@@ -10,6 +10,8 @@ import {Button} from 'primeng/button';
import {Menu} from 'primeng/menu';
import {UserService} from '../../../../features/settings/user-management/user.service';
import {DialogLauncherService} from '../../../services/dialog-launcher.service';
import {ShelfCreatorComponent} from '../../../../features/book/components/shelf-creator/shelf-creator.component';
import {BookDialogHelperService} from '../../../../features/book/components/book-browser/BookDialogHelperService';
@Component({
selector: '[app-menuitem]',
@@ -56,7 +58,8 @@ export class AppMenuitemComponent implements OnInit, OnDestroy {
public router: Router,
private menuService: MenuService,
private userService: UserService,
private dialogLauncher: DialogLauncherService
private dialogLauncher: DialogLauncherService,
private bookDialogHelperService: BookDialogHelperService
) {
this.userService.userState$.subscribe(userState => {
if (userState?.user) {
@@ -151,6 +154,9 @@ export class AppMenuitemComponent implements OnInit, OnDestroy {
if (item.type === 'magicShelf') {
this.dialogLauncher.openMagicShelfDialog();
}
if (item.type === 'shelf') {
this.bookDialogHelperService.openShelfCreator();
}
}
triggerLink() {