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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user