fix: Consistent dialogs (#1842)
* fix/consistent-dialogs * fix: enforce consistent mobile dialog width * fix: cover search dialog image size
This commit is contained in:
@@ -9,10 +9,10 @@ import {ShelfService} from '../../../../features/book/service/shelf.service';
|
||||
import {BookService} from '../../../../features/book/service/book.service';
|
||||
import {LibraryShelfMenuService} from '../../../../features/book/service/library-shelf-menu.service';
|
||||
import {AppVersion, VersionService} from '../../../service/version.service';
|
||||
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {VersionChangelogDialogComponent} from './version-changelog-dialog/version-changelog-dialog.component';
|
||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {UserService} from '../../../../features/settings/user-management/user.service';
|
||||
import {MagicShelfService, MagicShelfState} from '../../../../features/magic-shelf/service/magic-shelf.service';
|
||||
import {DialogLauncherService} from '../../../services/dialog-launcher.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
@@ -34,7 +34,7 @@ export class AppMenuComponent implements OnInit {
|
||||
private bookService = inject(BookService);
|
||||
private versionService = inject(VersionService);
|
||||
private libraryShelfMenuService = inject(LibraryShelfMenuService);
|
||||
private dialogService = inject(DialogService);
|
||||
private dialogLauncherService = inject(DialogLauncherService);
|
||||
private userService = inject(UserService);
|
||||
private magicShelfService = inject(MagicShelfService);
|
||||
|
||||
@@ -198,20 +198,7 @@ export class AppMenuComponent implements OnInit {
|
||||
}
|
||||
|
||||
openChangelogDialog() {
|
||||
const isMobile = window.innerWidth <= 768;
|
||||
this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, {
|
||||
header: 'What’s New',
|
||||
modal: true,
|
||||
closable: true,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '10%',
|
||||
bottom: '10%',
|
||||
width: isMobile ? '90vw' : '800px',
|
||||
maxWidth: isMobile ? '90vw' : '800px',
|
||||
minWidth: isMobile ? '90vw' : '800px',
|
||||
},
|
||||
});
|
||||
this.dialogLauncherService.openVersionChangelogDialog();
|
||||
}
|
||||
|
||||
getVersionUrl(version: string | undefined): string {
|
||||
|
||||
@@ -155,13 +155,13 @@ export class AppMenuitemComponent implements OnInit, OnDestroy {
|
||||
|
||||
openDialog(item: any) {
|
||||
if (item.type === 'library' && this.canManipulateLibrary) {
|
||||
this.dialogLauncher.openLibraryCreatorDialog();
|
||||
this.dialogLauncher.openLibraryCreateDialog();
|
||||
}
|
||||
if (item.type === 'magicShelf') {
|
||||
this.dialogLauncher.openMagicShelfDialog();
|
||||
this.dialogLauncher.openMagicShelfCreateDialog();
|
||||
}
|
||||
if (item.type === 'shelf') {
|
||||
this.bookDialogHelperService.openShelfCreator();
|
||||
this.bookDialogHelperService.openShelfCreatorDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Component, ElementRef, OnDestroy, ViewChild} from '@angular/core';
|
||||
import {MenuItem} from 'primeng/api';
|
||||
import {LayoutService} from '../layout-main/service/app.layout.service';
|
||||
import {Router, RouterLink} from '@angular/router';
|
||||
import {DialogService as PrimeDialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {TooltipModule} from 'primeng/tooltip';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {InputTextModule} from 'primeng/inputtext';
|
||||
@@ -72,7 +72,6 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
|
||||
constructor(
|
||||
public layoutService: LayoutService,
|
||||
public dialogService: PrimeDialogService,
|
||||
private notificationService: NotificationEventService,
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
@@ -120,7 +119,7 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
openLibraryCreatorDialog(): void {
|
||||
this.dialogLauncher.openLibraryCreatorDialog();
|
||||
this.dialogLauncher.openLibraryCreateDialog();
|
||||
}
|
||||
|
||||
openFileUploadDialog(): void {
|
||||
|
||||
Reference in New Issue
Block a user