Dialog refactor 2 (#2321)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2026-01-18 02:36:24 -07:00
committed by GitHub
co-authored by acx10
parent fda76eead7
commit 1889a04bac
51 changed files with 2206 additions and 1018 deletions
@@ -1,9 +1,27 @@
<div class="p-fluid px-4 py-2 rounded-xl flex flex-col h-full">
<div class="file-mover-container">
<div class="panel-header">
<div class="header-icon-wrapper">
<i class="pi pi-folder-open header-icon"></i>
</div>
<div class="header-text">
<h2 class="panel-title">Move & Organize Files</h2>
<p class="panel-description">{{ books.length }} book{{ books.length !== 1 ? 's' : '' }} selected</p>
</div>
<p-button
icon="pi pi-times"
[rounded]="true"
[text]="true"
severity="secondary"
(click)="ref.close()"
styleClass="close-button">
</p-button>
</div>
<div class="px-4 mx-2 mb-4 py-3 rounded-lg border border-[var(--border-color)] transition-all">
<p class="text-[var(--primary-color)] font-semibold mb-1">
File Organization Preview
</p>
<div class="dialog-content">
<div class="px-4 mx-2 mb-4 py-3 rounded-lg border border-[var(--border-color)] transition-all">
<p class="text-[var(--primary-color)] font-semibold mb-1">
File Organization Preview
</p>
<div class="text-sm text-gray-300 space-y-3">
<p>
Your files will be automatically renamed, organized, and can be moved between libraries based on your preferences.
@@ -157,9 +175,9 @@
</p-table>
</div>
<p-divider></p-divider>
</div>
<div class="flex justify-end items-center gap-4 flex-shrink-0 px-4 pt-4">
<div class="dialog-footer">
@if (movedFileCount > 0) {
<span class="text-green-500 flex items-center font-semibold drop-shadow-sm select-none">
{{ movedFileCount }} file{{ movedFileCount > 1 ? 's' : '' }} successfully moved
@@ -182,7 +200,8 @@
<p-button
label="Cancel"
icon="pi pi-times"
severity="danger"
severity="secondary"
[text]="true"
(click)="cancel()"
></p-button>
} @else {
@@ -1,3 +1,42 @@
@use '../../styles/panel-shared' as panel;
:host {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}
.file-mover-container {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}
.panel-header {
@include panel.panel-header;
flex-shrink: 0;
}
.dialog-content {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: auto;
min-height: 0;
padding: 1rem;
background: var(--card-background);
border: 1px solid var(--border-color);
border-top: none;
border-bottom: none;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.dialog-footer {
@include panel.dialog-footer;
}
:host ::ng-deep .p-datatable-tbody > tr > td {
padding: 0.5rem 1rem !important;
}
@@ -2,7 +2,6 @@ import {Component, inject, OnDestroy} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {Button} from 'primeng/button';
import {TableModule} from 'primeng/table';
import {Divider} from 'primeng/divider';
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
import {MessageService} from 'primeng/api';
import {filter, take, takeUntil} from 'rxjs/operators';
@@ -36,13 +35,13 @@ interface FilePreview {
@Component({
selector: 'app-file-mover-component',
standalone: true,
imports: [Button, FormsModule, TableModule, Divider, Select],
imports: [Button, FormsModule, TableModule, Select],
templateUrl: './file-mover-component.html',
styleUrl: './file-mover-component.scss'
})
export class FileMoverComponent implements OnDestroy {
private config = inject(DynamicDialogConfig);
private ref = inject(DynamicDialogRef);
ref = inject(DynamicDialogRef);
private bookService = inject(BookService);
private libraryService = inject(LibraryService);
private fileOperationsService = inject(FileOperationsService);
@@ -1,58 +1,78 @@
<div class="support-dialog-container">
<div class="header-section">
<span class="badge">
Open Source & Community Driven
</span>
<h2 class="title">
Booklore
</h2>
<p class="description">
A modern platform crafted to help you curate, organize, and cherish your personal library with elegance and simplicity.
</p>
<div class="panel-header">
<div class="header-icon-wrapper">
<i class="pi pi-heart header-icon"></i>
</div>
<div class="header-text">
<h2 class="panel-title">Support Booklore</h2>
<p class="panel-description">Help us grow and improve</p>
</div>
<p-button
icon="pi pi-times"
[rounded]="true"
[text]="true"
severity="secondary"
(click)="close()"
styleClass="close-button">
</p-button>
</div>
<div class="actions-section">
<a href="https://github.com/booklore-app/booklore" target="_blank" rel="noopener noreferrer">
<p-button
label="Star on GitHub"
icon="pi pi-github"
outlined
severity="success"
styleClass="action-button">
</p-button>
</a>
<a href="https://opencollective.com/booklore" target="_blank" rel="noopener noreferrer">
<p-button
label="Support via Open Collective"
icon="pi pi-heart"
severity="info"
outlined
styleClass="action-button">
</p-button>
</a>
</div>
<div class="footer-section">
<div class="support-info">
<p>
Starring the project on <span class="highlight github">GitHub</span> increases visibility, helps Booklore reach more book lovers, and motivates ongoing development.
</p>
<p>
Financial contributions through <span class="highlight open-collective">Open Collective</span> directly support hosting infrastructure, feature development, and long-term sustainability.
</p>
<p class="final-message">
Every form of support, stars, feedback, or contributions, helps keep Booklore thriving and accessible for all book enthusiasts.
<div class="dialog-content">
<div class="header-section">
<span class="badge">
Open Source & Community Driven
</span>
<h2 class="title">
Booklore
</h2>
<p class="description">
A modern platform crafted to help you curate, organize, and cherish your personal library with elegance and simplicity.
</p>
</div>
<p class="commitment">
Booklore is and will always remain free for everyone.
</p>
</div>
<div class="message-section">
<p class="message">
Your support and engagement fuel Booklore's continuous evolution and inspire meaningful improvements.
</p>
<p class="author">- Aditya, Creator & Maintainer</p>
<div class="actions-section">
<a href="https://github.com/booklore-app/booklore" target="_blank" rel="noopener noreferrer">
<p-button
label="Star on GitHub"
icon="pi pi-github"
outlined
severity="success"
styleClass="action-button">
</p-button>
</a>
<a href="https://opencollective.com/booklore" target="_blank" rel="noopener noreferrer">
<p-button
label="Support via Open Collective"
icon="pi pi-heart"
severity="info"
outlined
styleClass="action-button">
</p-button>
</a>
</div>
<div class="footer-section">
<div class="support-info">
<p>
Starring the project on <span class="highlight github">GitHub</span> increases visibility, helps Booklore reach more book lovers, and motivates ongoing development.
</p>
<p>
Financial contributions through <span class="highlight open-collective">Open Collective</span> directly support hosting infrastructure, feature development, and long-term sustainability.
</p>
<p class="final-message">
Every form of support, stars, feedback, or contributions, helps keep Booklore thriving and accessible for all book enthusiasts.
</p>
</div>
<p class="commitment">
Booklore is and will always remain free for everyone.
</p>
</div>
<div class="message-section">
<p class="message">
Your support and engagement fuel Booklore's continuous evolution and inspire meaningful improvements.
</p>
<p class="author">- Aditya, Creator & Maintainer</p>
</div>
</div>
</div>
@@ -1,12 +1,22 @@
@use '../../styles/panel-shared' as panel;
.support-dialog-container {
max-width: 850px;
margin: 0 auto;
padding: 2rem 1.5rem;
display: flex;
flex-direction: column;
}
.panel-header {
@include panel.panel-header;
}
.dialog-content {
padding: 1.5rem 1.5rem 2.5rem;
background: var(--card-background);
border: 1px solid var(--border-color);
border-radius: 0.75rem;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
padding-top: 20px;
border-top: none;
border-radius: 0 0 10px 10px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.header-section {
@@ -96,7 +106,6 @@
font-size: 0.875rem;
line-height: 1.6;
color: var(--text-color-secondary);
max-width: 850px;
margin: 0 auto 1.25rem;
p {
@@ -1,5 +1,6 @@
import {Component} from '@angular/core';
import {Component, inject} from '@angular/core';
import {Button} from 'primeng/button';
import {DynamicDialogRef} from 'primeng/dynamicdialog';
@Component({
selector: 'app-github-support-dialog',
@@ -10,4 +11,9 @@ import {Button} from 'primeng/button';
styleUrls: ['./github-support-dialog.scss']
})
export class GithubSupportDialog {
private dialogRef = inject(DynamicDialogRef);
close(): void {
this.dialogRef.close();
}
}
@@ -1,166 +1,188 @@
<p-tabs [(value)]="activeTabIndex">
<p-tablist>
<p-tab value="0">Prime Icons</p-tab>
<p-tab value="1">SVG Icons</p-tab>
@if (canManageIcons) {
<p-tab value="2">Add SVG Icon(s)</p-tab>
}
</p-tablist>
<p-tabpanels>
<p-tabpanel value="0">
<input type="text" placeholder="Search Prime icons..." [(ngModel)]="searchText" class="icon-search"/>
<div class="icon-picker-container">
<div class="panel-header">
<div class="header-icon-wrapper">
<i class="pi pi-palette header-icon"></i>
</div>
<div class="header-text">
<h2 class="panel-title">Choose an Icon</h2>
<p class="panel-description">Select or upload custom icons</p>
</div>
<p-button
icon="pi pi-times"
[rounded]="true"
[text]="true"
severity="secondary"
(click)="ref.close()"
styleClass="close-button">
</p-button>
</div>
<div class="icon-grid">
@for (icon of filteredIcons(); track icon) {
<div
class="icon-item"
(click)="selectIcon(icon)"
[class.selected]="icon === selectedIcon"
[title]="icon">
<i [class]="icon"></i>
</div>
<div class="dialog-content">
<p-tabs [(value)]="activeTabIndex">
<p-tablist>
<p-tab value="0">Prime Icons</p-tab>
<p-tab value="1">SVG Icons</p-tab>
@if (canManageIcons) {
<p-tab value="2">Add SVG Icon(s)</p-tab>
}
</div>
</p-tabpanel>
<p-tabpanel value="1">
<div class="svg-browse-container">
@if (isLoadingSvgIcons) {
<div class="loading-message">Loading icons...</div>
} @else if (svgIconsError) {
<div class="error-message">{{ svgIconsError }}</div>
} @else {
<input type="text" placeholder="Search SVG icons..." [(ngModel)]="svgSearchText" class="icon-search"/>
</p-tablist>
<p-tabpanels>
<p-tabpanel value="0">
<input type="text" placeholder="Search Prime icons..." [(ngModel)]="searchText" class="icon-search"/>
<div class="icon-grid">
@for (iconName of filteredSvgIcons(); track iconName) {
@for (icon of filteredIcons(); track icon) {
<div
class="icon-item svg-icon-item"
(click)="selectSvgIcon(iconName)"
[class.selected]="iconName === selectedSvgIcon"
[title]="iconName"
draggable="true"
(dragstart)="onSvgIconDragStart(iconName)"
(dragend)="onSvgIconDragEnd()"
>
<div
class="svg-icon-inline"
[innerHTML]="getSvgContent(iconName)"
></div>
class="icon-item"
(click)="selectIcon(icon)"
[class.selected]="icon === selectedIcon"
[title]="icon">
<i [class]="icon"></i>
</div>
}
</div>
</p-tabpanel>
<p-tabpanel value="1">
<div class="svg-browse-container">
@if (isLoadingSvgIcons) {
<div class="loading-message">Loading icons...</div>
} @else if (svgIconsError) {
<div class="error-message">{{ svgIconsError }}</div>
} @else {
<input type="text" placeholder="Search SVG icons..." [(ngModel)]="svgSearchText" class="icon-search"/>
@if (canManageIcons) {
<div style="display: flex; align-items: center; position: fixed; right: 32px; bottom: 32px; z-index: 101;">
<div
class="svg-trash-area"
[class.trash-hover]="isTrashHover"
(dragover)="onTrashDragOver($event)"
(dragleave)="onTrashDragLeave($event)"
(drop)="onTrashDrop($event)">
<i class="pi pi-trash"></i>
<span>Drag here to delete icon</span>
</div>
</div>
}
}
</div>
</p-tabpanel>
@if (canManageIcons) {
<p-tabpanel value="2">
<div class="svg-paste-container">
<div class="svg-input-section">
<input
type="text"
[(ngModel)]="svgName"
placeholder="Enter icon name for saving"
class="svg-name-input"
/>
<textarea
[(ngModel)]="svgContent"
(ngModelChange)="onSvgContentChange()"
placeholder="Paste your SVG code here..."
class="svg-textarea"
rows="8"></textarea>
@if (svgContent && svgPreview) {
<div class="svg-preview-section">
<h4 class="preview-title">Preview</h4>
<div class="svg-preview" [innerHTML]="svgPreview"></div>
</div>
}
@if (errorMessage) {
<div class="error-message">{{ errorMessage }}</div>
}
<div class="button-container">
<p-button
(onClick)="addSvgEntry()"
[disabled]="!svgContent || !svgName"
label="Add to Queue"
severity="primary"
outlined
icon="pi pi-plus">
</p-button>
</div>
</div>
@if (svgEntries.length > 0) {
<div class="svg-entries-section">
<div class="entries-header">
<h4 class="entries-title">
Queued Icons ({{ svgEntries.length }})
</h4>
<p-button
(onClick)="clearAllEntries()"
label="Clear All"
severity="danger"
[text]="true"
icon="pi pi-times">
</p-button>
</div>
<div class="entries-grid">
@for (entry of svgEntries; track entry.name; let i = $index) {
<div class="entry-card" [class.has-error]="entry.error">
<div class="entry-header">
<span class="entry-name">{{ entry.name }}</span>
<button
class="entry-remove"
(click)="removeSvgEntry(i)"
title="Remove">
<i class="pi pi-times"></i>
</button>
</div>
<div class="entry-preview" [innerHTML]="entry.preview"></div>
@if (entry.error) {
<div class="entry-error">{{ entry.error }}</div>
}
<div class="icon-grid">
@for (iconName of filteredSvgIcons(); track iconName) {
<div
class="icon-item svg-icon-item"
(click)="selectSvgIcon(iconName)"
[class.selected]="iconName === selectedSvgIcon"
[title]="iconName"
draggable="true"
(dragstart)="onSvgIconDragStart(iconName)"
(dragend)="onSvgIconDragEnd()"
>
<div
class="svg-icon-inline"
[innerHTML]="getSvgContent(iconName)"
></div>
</div>
}
</div>
@if (batchErrorMessage) {
<div class="error-message">{{ batchErrorMessage }}</div>
}
<div class="batch-actions">
<p-button
(onClick)="saveAllSvgs()"
[loading]="isSavingBatch"
[disabled]="svgEntries.length === 0"
label="Save All Icons"
severity="success"
icon="pi pi-save">
</p-button>
@if (canManageIcons) {
<div style="display: flex; align-items: center; position: fixed; right: 32px; bottom: 32px; z-index: 101;">
<div
class="svg-trash-area"
[class.trash-hover]="isTrashHover"
(dragover)="onTrashDragOver($event)"
(dragleave)="onTrashDragLeave($event)"
(drop)="onTrashDrop($event)">
<i class="pi pi-trash"></i>
<span>Drag here to delete icon</span>
</div>
</div>
}
}
</div>
</p-tabpanel>
@if (canManageIcons) {
<p-tabpanel value="2">
<div class="svg-paste-container">
<div class="svg-input-section">
<input
type="text"
[(ngModel)]="svgName"
placeholder="Enter icon name for saving"
class="svg-name-input"
/>
<textarea
[(ngModel)]="svgContent"
(ngModelChange)="onSvgContentChange()"
placeholder="Paste your SVG code here..."
class="svg-textarea"
rows="8"></textarea>
@if (svgContent && svgPreview) {
<div class="svg-preview-section">
<h4 class="preview-title">Preview</h4>
<div class="svg-preview" [innerHTML]="svgPreview"></div>
</div>
}
@if (errorMessage) {
<div class="error-message">{{ errorMessage }}</div>
}
<div class="button-container">
<p-button
(onClick)="addSvgEntry()"
[disabled]="!svgContent || !svgName"
label="Add to Queue"
severity="primary"
outlined
icon="pi pi-plus">
</p-button>
</div>
</div>
@if (svgEntries.length > 0) {
<div class="svg-entries-section">
<div class="entries-header">
<h4 class="entries-title">
Queued Icons ({{ svgEntries.length }})
</h4>
<p-button
(onClick)="clearAllEntries()"
label="Clear All"
severity="danger"
[text]="true"
icon="pi pi-times">
</p-button>
</div>
<div class="entries-grid">
@for (entry of svgEntries; track entry.name; let i = $index) {
<div class="entry-card" [class.has-error]="entry.error">
<div class="entry-header">
<span class="entry-name">{{ entry.name }}</span>
<button
class="entry-remove"
(click)="removeSvgEntry(i)"
title="Remove">
<i class="pi pi-times"></i>
</button>
</div>
<div class="entry-preview" [innerHTML]="entry.preview"></div>
@if (entry.error) {
<div class="entry-error">{{ entry.error }}</div>
}
</div>
}
</div>
@if (batchErrorMessage) {
<div class="error-message">{{ batchErrorMessage }}</div>
}
<div class="batch-actions">
<p-button
(onClick)="saveAllSvgs()"
[loading]="isSavingBatch"
[disabled]="svgEntries.length === 0"
label="Save All Icons"
severity="success"
icon="pi pi-save">
</p-button>
</div>
</div>
}
</div>
}
</div>
</p-tabpanel>
}
</p-tabpanels>
</p-tabs>
</p-tabpanel>
}
</p-tabpanels>
</p-tabs>
</div>
</div>
@@ -1,3 +1,28 @@
@use '../../styles/panel-shared' as panel;
.icon-picker-container {
display: flex;
flex-direction: column;
max-height: 85dvh;
}
.panel-header {
@include panel.panel-header;
flex-shrink: 0;
}
.dialog-content {
padding: 1rem;
background: var(--card-background);
border: 1px solid var(--border-color);
border-top: none;
border-radius: 0 0 10px 10px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
overflow-y: auto;
flex: 1;
min-height: 0;
}
.icon-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(25px, 1fr));
@@ -1,26 +1,48 @@
@if (loading) {
<div class="p-4 text-center text-gray-400">
Loading changelog...
<div class="changelog-container">
<div class="panel-header">
<div class="header-icon-wrapper">
<i class="pi pi-sparkles header-icon"></i>
</div>
<div class="header-text">
<h2 class="panel-title">What's New</h2>
<p class="panel-description">Latest updates and improvements</p>
</div>
<p-button
icon="pi pi-times"
[rounded]="true"
[text]="true"
severity="secondary"
(click)="dialogRef.close()"
styleClass="close-button">
</p-button>
</div>
}
@if (!loading && changelog.length === 0) {
<div class="p-4 text-center text-gray-400">
No updates available.
</div>
}
<div class="dialog-content">
@if (loading) {
<div class="loading-state">
Loading changelog...
</div>
}
@if (!loading && changelog.length > 0) {
<div class="space-y-6 p-4 overflow-auto">
@for (release of changelog; track release) {
<div class="border-b pb-4">
<p class="font-bold text-2xl pb-2">
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
{{ release.name }} ({{ release.publishedAt | date: 'mediumDate' }})
</a>
</p>
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
@if (!loading && changelog.length === 0) {
<div class="empty-state">
No updates available.
</div>
}
@if (!loading && changelog.length > 0) {
<div class="changelog-list">
@for (release of changelog; track release) {
<div class="release-item">
<p class="release-title">
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="release-link">
{{ release.name }} ({{ release.publishedAt | date: 'mediumDate' }})
</a>
</p>
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
</div>
}
</div>
}
</div>
}
</div>
@@ -1,3 +1,64 @@
@use '../../../../../shared/styles/panel-shared' as panel;
.changelog-container {
display: flex;
flex-direction: column;
max-height: 90dvh;
}
.panel-header {
@include panel.panel-header;
}
.dialog-content {
padding: 1.5rem;
background: var(--card-background);
border: 1px solid var(--border-color);
border-top: none;
border-radius: 0 0 10px 10px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
overflow-y: auto;
flex: 1;
}
.loading-state,
.empty-state {
padding: 1rem;
text-align: center;
color: var(--text-secondary-color);
}
.changelog-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.release-item {
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-color);
&:last-child {
border-bottom: none;
}
}
.release-title {
font-weight: 700;
font-size: 1.25rem;
padding-bottom: 0.5rem;
margin: 0;
}
.release-link {
color: var(--primary-color);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
:host ::ng-deep .prose h3 {
margin-top: 0px;
margin-top: 0;
}
@@ -4,12 +4,15 @@ import { ReleaseNote, VersionService } from '../../../../service/version.service
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import showdown from 'showdown';
import {DatePipe} from '@angular/common';
import {DynamicDialogRef} from 'primeng/dynamicdialog';
import {Button} from 'primeng/button';
@Component({
selector: 'app-version-changelog-dialog',
standalone: true,
imports: [
DatePipe
DatePipe,
Button
],
templateUrl: './version-changelog-dialog.component.html',
styleUrl: './version-changelog-dialog.component.scss'
@@ -18,6 +21,7 @@ export class VersionChangelogDialogComponent implements OnInit {
private versionService = inject(VersionService);
private sanitizer = inject(DomSanitizer);
dialogRef = inject(DynamicDialogRef);
changelog: ReleaseNote[] = [];
loading = true;
@@ -19,6 +19,25 @@ import {MetadataFetchOptionsComponent} from '../../features/metadata/component/m
import {ShelfEditDialogComponent} from '../../features/book/components/shelf-edit-dialog/shelf-edit-dialog.component';
import {IconPickerComponent} from '../components/icon-picker/icon-picker-component';
/**
* Dialog size classes - use these to control dialog dimensions
*/
export const DialogSize = {
XS: 'dialog-xs', // ~400px - confirmations, simple alerts
SM: 'dialog-sm', // ~550px - simple forms, pickers
MD: 'dialog-md', // ~700px - standard dialogs
LG: 'dialog-lg', // ~900px - complex forms, lists
XL: 'dialog-xl', // ~1200px - data-heavy views
FULL: 'dialog-full', // viewport - fullscreen editors
} as const;
/**
* Dialog style modifiers - composable with size classes
*/
export const DialogStyle = {
MINIMAL: 'dialog-minimal', // removes padding for custom headers
} as const;
@Injectable({
providedIn: 'root',
})
@@ -41,41 +60,41 @@ export class DialogLauncherService {
return this.dialogService.open(component as Type<any>, {
...this.defaultDialogOptions,
...options,
});
}
openDashboardSettingsDialog(): DynamicDialogRef | null {
return this.openDialog(DashboardSettingsComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.XL} ${DialogStyle.MINIMAL}`,
});
}
openGithubSupportDialog(): DynamicDialogRef | null {
return this.openDialog(GithubSupportDialog, {
header: 'Support Booklore',
showHeader: false,
styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`,
});
}
openLibraryCreateDialog(): DynamicDialogRef | null {
return this.openDialog(LibraryCreatorComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
});
}
openDirectoryPickerDialog(): DynamicDialogRef | null {
return this.openDialog(DirectoryPickerComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
});
}
openLibraryEditDialog(libraryId: number): DynamicDialogRef | null {
return this.openDialog(LibraryCreatorComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
data: {
mode: 'edit',
libraryId: libraryId
@@ -85,7 +104,8 @@ export class DialogLauncherService {
openLibraryMetadataFetchDialog(libraryId: number): DynamicDialogRef | null {
return this.openDialog(MetadataFetchOptionsComponent, {
header: 'Metadata Refresh Options',
showHeader: false,
styleClass: `${DialogSize.SM} ${DialogStyle.MINIMAL}`,
data: {
libraryId: libraryId,
metadataRefreshType: MetadataRefreshType.LIBRARY,
@@ -96,7 +116,7 @@ export class DialogLauncherService {
openShelfEditDialog(shelfId: number): DynamicDialogRef | null {
return this.openDialog(ShelfEditDialogComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.SM} ${DialogStyle.MINIMAL}`,
data: {
shelfId: shelfId
},
@@ -106,35 +126,35 @@ export class DialogLauncherService {
openFileUploadDialog(): DynamicDialogRef | null {
return this.openDialog(BookUploaderComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
});
}
openCreateUserDialog(): DynamicDialogRef | null {
return this.openDialog(CreateUserDialogComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`,
});
}
openUserProfileDialog(): DynamicDialogRef | null {
return this.openDialog(UserProfileDialogComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.SM} ${DialogStyle.MINIMAL}`,
});
}
openMagicShelfCreateDialog(): DynamicDialogRef | null {
return this.openDialog(MagicShelfComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.XL} ${DialogStyle.MINIMAL}`,
});
}
openMagicShelfEditDialog(shelfId: number): DynamicDialogRef | null {
return this.openDialog(MagicShelfComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.XL} ${DialogStyle.MINIMAL}`,
data: {
id: shelfId,
editMode: true,
@@ -144,28 +164,29 @@ export class DialogLauncherService {
openVersionChangelogDialog(): DynamicDialogRef | null {
return this.openDialog(VersionChangelogDialogComponent, {
header: "What's New",
styleClass: 'dialog-medium',
showHeader: false,
styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`,
});
}
openEmailRecipientDialog(): DynamicDialogRef | null {
return this.openDialog(CreateEmailRecipientDialogComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
});
}
openEmailProviderDialog(): DynamicDialogRef | null {
return this.openDialog(CreateEmailProviderDialogComponent, {
showHeader: false,
styleClass: 'dynamic-dialog-minimal',
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
});
}
openBookdropFinalizeResultDialog(result: BookdropFinalizeResult): DynamicDialogRef | null {
return this.openDialog(BookdropFinalizeResultDialogComponent, {
header: 'Import Summary',
showHeader: false,
styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`,
data: {
result: result,
},
@@ -174,19 +195,18 @@ export class DialogLauncherService {
openMetadataReviewDialog(taskId: string): DynamicDialogRef | null {
return this.openDialog(MetadataReviewDialogComponent, {
header: 'Review Metadata Proposal',
showHeader: false,
styleClass: `${DialogSize.FULL} ${DialogStyle.MINIMAL}`,
data: {
taskId,
},
styleClass: 'dialog-maximal',
});
}
openIconPickerDialog(): DynamicDialogRef | null {
return this.openDialog(IconPickerComponent, {
header: 'Choose an Icon',
styleClass: 'dialog-medium',
showHeader: false,
styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`,
});
}
}