Dialog refactor 2 (#2321)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+23
-2
@@ -1,5 +1,25 @@
|
||||
<div class="rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]">
|
||||
<p-tabs [(value)]="tab" lazy="true" scrollable>
|
||||
<div class="book-metadata-center-container">
|
||||
@if (config) {
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-book header-icon"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">Book Details</h2>
|
||||
<p class="panel-description">View and edit book metadata</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="rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]" [class.dialog-mode]="config">
|
||||
<p-tabs [(value)]="tab" lazy="true" scrollable>
|
||||
<p-tablist>
|
||||
<p-tab value="view">
|
||||
<i [class]="'pi pi-book'"></i>
|
||||
@@ -39,4 +59,5 @@
|
||||
}
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+18
-5
@@ -1,3 +1,21 @@
|
||||
@use '../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
.book-metadata-center-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
@include panel.panel-header;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.dialog-mode {
|
||||
border-radius: 0 0 0.75rem 0.75rem !important;
|
||||
border-width: 1px 0 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .layout-main .tabpanels-responsive {
|
||||
height: calc(100dvh - 9.7rem);
|
||||
}
|
||||
@@ -23,8 +41,3 @@
|
||||
::ng-deep .book-details-dialog .p-dialog-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::ng-deep .book-details-dialog app-book-metadata-center > div {
|
||||
border-radius: 0 0 0.75rem 0.75rem !important;
|
||||
border-width: 1px 0 0 !important;
|
||||
}
|
||||
+5
-3
@@ -8,6 +8,7 @@ import {BookService} from '../../../book/service/book.service';
|
||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
||||
import {Tab, TabList, TabPanel, TabPanels, Tabs,} from 'primeng/tabs';
|
||||
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {Button} from 'primeng/button';
|
||||
import {BookMetadataHostService} from '../../../../shared/service/book-metadata-host.service';
|
||||
import {MetadataViewerComponent} from './metadata-viewer/metadata-viewer.component';
|
||||
import {MetadataEditorComponent} from './metadata-editor/metadata-editor.component';
|
||||
@@ -25,7 +26,8 @@ import {MetadataSearcherComponent} from './metadata-searcher/metadata-searcher.c
|
||||
TabPanel,
|
||||
MetadataViewerComponent,
|
||||
MetadataEditorComponent,
|
||||
MetadataSearcherComponent
|
||||
MetadataSearcherComponent,
|
||||
Button
|
||||
],
|
||||
styleUrls: ['./book-metadata-center.component.scss'],
|
||||
})
|
||||
@@ -65,8 +67,8 @@ export class BookMetadataCenterComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
constructor(
|
||||
@Optional() private config?: DynamicDialogConfig,
|
||||
@Optional() private ref?: DynamicDialogRef
|
||||
@Optional() public config?: DynamicDialogConfig,
|
||||
@Optional() public ref?: DynamicDialogRef
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -101,6 +101,7 @@ label {
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
overflow: auto;
|
||||
height: 72.5dvh;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 0.5rem;
|
||||
@@ -315,8 +316,7 @@ label {
|
||||
z-index: 10;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 0.5rem;
|
||||
padding-bottom: 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+340
-320
@@ -1,362 +1,382 @@
|
||||
<div class="relative">
|
||||
@if (loading) {
|
||||
<div class="absolute inset-0 z-50 flex items-center justify-center bg-black/60">
|
||||
<p-progressSpinner></p-progressSpinner>
|
||||
<div class="bulk-update-container">
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-pencil header-icon"></i>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="p-4 border border-gray-700 rounded-md mb-4 bg-gray-900 text-gray-200">
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<p class="text-base font-semibold">
|
||||
Editing {{ books.length }} Book{{ books.length !== 1 ? 's' : '' }}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
(click)="showBookList = !showBookList"
|
||||
class="text-sm text-sky-400 hover:underline">
|
||||
{{ showBookList ? 'Hide' : 'Show' }} Titles
|
||||
</button>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">Bulk Edit Metadata</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>
|
||||
|
||||
@if (showBookList) {
|
||||
<div class="max-h-48 overflow-y-auto border-t border-gray-700 pt-2 pl-1 text-sm text-gray-300">
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
@for (book of books; track book) {
|
||||
<li>{{ book.metadata?.title || 'Untitled Book' }}</li>
|
||||
}
|
||||
</ul>
|
||||
<div class="dialog-content relative">
|
||||
@if (loading) {
|
||||
<div class="absolute inset-0 z-50 flex items-center justify-center bg-black/60">
|
||||
<p-progressSpinner></p-progressSpinner>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="px-4 text-sm text-yellow-500 mb-2">
|
||||
<i class="pi pi-exclamation-triangle mr-1"></i>
|
||||
Checking <strong>Clear</strong> will remove that field’s metadata from <strong>all selected books</strong>.
|
||||
</div>
|
||||
<div class="p-4 border border-gray-700 rounded-md mb-4 bg-gray-900 text-gray-200">
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<p class="text-base font-semibold">
|
||||
Editing {{ books.length }} Book{{ books.length !== 1 ? 's' : '' }}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
(click)="showBookList = !showBookList"
|
||||
class="text-sm text-sky-400 hover:underline">
|
||||
{{ showBookList ? 'Hide' : 'Show' }} Titles
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<form [formGroup]="metadataForm" (ngSubmit)="onSubmit()" (keydown)="onFormKeydown($event)" class="flex flex-col gap-4 w-full p-4">
|
||||
@if (showBookList) {
|
||||
<div class="max-h-48 overflow-y-auto border-t border-gray-700 pt-2 pl-1 text-sm text-gray-300">
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
@for (book of books; track book) {
|
||||
<li>{{ book.metadata?.title || 'Untitled Book' }}</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between gap-7">
|
||||
<!-- Authors -->
|
||||
<div class="flex flex-col gap-2 w-full md:basis-[80%]">
|
||||
<label for="authors" class="flex items-center justify-between gap-2">
|
||||
<div class="px-4 text-sm text-yellow-500 mb-2">
|
||||
<i class="pi pi-exclamation-triangle mr-1"></i>
|
||||
Checking <strong>Clear</strong> will remove that field's metadata from <strong>all selected books</strong>.
|
||||
</div>
|
||||
|
||||
<form [formGroup]="metadataForm" (ngSubmit)="onSubmit()" (keydown)="onFormKeydown($event)" class="flex flex-col gap-4 w-full p-4">
|
||||
|
||||
<div class="flex justify-between gap-7">
|
||||
<!-- Authors -->
|
||||
<div class="flex flex-col gap-2 w-full md:basis-[80%]">
|
||||
<label for="authors" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Author(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enter multiple authors. Press Enter after typing each name."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.authors" [ngModelOptions]="{standalone: true}" (onChange)="onFieldClearToggle('authors')" binary="true" inputId="clearAuthors"/>
|
||||
<label for="clearAuthors" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="authors"
|
||||
formControlName="authors"
|
||||
[disabled]="clearFields.authors"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredAuthors"
|
||||
(completeMethod)="filterAuthors($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('authors', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('authors', $event)">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
|
||||
<!-- Language -->
|
||||
<div class="flex flex-col gap-2 md:basis-[20%]">
|
||||
<label for="language" class="flex items-center justify-between gap-2">
|
||||
<span>Language</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.language" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('language')" binary="true" inputId="clearLanguage"/>
|
||||
<label for="clearLanguage" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<input pInputText id="language" formControlName="language" [disabled]="clearFields.language" class="w-full"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between gap-7">
|
||||
<!-- Publisher -->
|
||||
<div class="flex flex-col gap-2 w-full md:basis-[80%]">
|
||||
<label for="publisher" class="flex items-center justify-between gap-2">
|
||||
<span>Publisher</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.publisher" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('publisher')" binary="true" inputId="clearPublisher"/>
|
||||
<label for="clearPublisher" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
inputStyleClass="w-full"
|
||||
formControlName="publisher"
|
||||
inputId="publisher"
|
||||
[disabled]="clearFields.publisher"
|
||||
[multiple]="false"
|
||||
[dropdown]="false"
|
||||
[showClear]="true"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredPublishers"
|
||||
(completeMethod)="filterPublishers($event)">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
|
||||
<!-- Published Date -->
|
||||
<div class="flex flex-col gap-2 md:basis-[20%]">
|
||||
<label for="publishedDate" class="flex items-center justify-between gap-2">
|
||||
<span>Published Date</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.publishedDate" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('publishedDate')" binary="true" inputId="clearPublishedDate"/>
|
||||
<label for="clearPublishedDate" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-datepicker
|
||||
class="w-full md:min-w-[9rem]"
|
||||
formControlName="publishedDate"
|
||||
inputId="publishedDate"
|
||||
dataType="string"
|
||||
dateFormat="yy-mm-dd"
|
||||
[disabled]="clearFields.publishedDate"
|
||||
[keepInvalid]="true"
|
||||
[showIcon]="true"
|
||||
[iconDisplay]="'input'"
|
||||
fluid="true"
|
||||
appendTo="body">
|
||||
</p-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between gap-7">
|
||||
<!-- Series Name -->
|
||||
<div class="flex flex-col gap-2 w-full md:basis-[80%]">
|
||||
<label for="seriesName" class="flex items-center justify-between gap-2">
|
||||
<span>Series Name</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.seriesName" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('seriesName')" binary="true" inputId="clearSeriesName"/>
|
||||
<label for="clearSeriesName" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
inputStyleClass="w-full"
|
||||
formControlName="seriesName"
|
||||
inputId="seriesName"
|
||||
[disabled]="clearFields.seriesName"
|
||||
[multiple]="false"
|
||||
[dropdown]="false"
|
||||
[showClear]="true"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredSeries"
|
||||
(completeMethod)="filterSeries($event)">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
|
||||
<!-- Series Total -->
|
||||
<div class="flex flex-col gap-2 md:basis-[20%]">
|
||||
<label for="seriesTotal" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Total Books
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Total number of books in the series."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.seriesTotal" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('seriesTotal')" binary="true" inputId="clearSeriesTotal"/>
|
||||
<label for="clearSeriesTotal" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<input pInputText id="seriesTotal" type="number" min="1" formControlName="seriesTotal"
|
||||
[disabled]="clearFields.seriesTotal" class="w-full"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Genres -->
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="genres" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Author(s)
|
||||
Genre(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enter multiple authors. Press Enter after typing each name."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
pTooltip="Enter multiple genres. Press Enter after typing each genre."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.authors" [ngModelOptions]="{standalone: true}" (onChange)="onFieldClearToggle('authors')" binary="true" inputId="clearAuthors"/>
|
||||
<label for="clearAuthors" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
<p-checkbox [(ngModel)]="clearFields.genres" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('genres')" binary="true" inputId="clearGenres"/>
|
||||
<label for="clearGenres" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="authors"
|
||||
formControlName="authors"
|
||||
[disabled]="clearFields.authors"
|
||||
id="genres"
|
||||
formControlName="genres"
|
||||
[disabled]="clearFields.genres"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredAuthors"
|
||||
(completeMethod)="filterAuthors($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('authors', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('authors', $event)">
|
||||
[suggestions]="filteredGenres"
|
||||
(completeMethod)="filterGenres($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('genres', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('genres', $event)">
|
||||
</p-autoComplete>
|
||||
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<p-checkbox
|
||||
inputId="mergeCategories"
|
||||
name="mergeCategories"
|
||||
[(ngModel)]="mergeCategories"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
binary="true"
|
||||
/>
|
||||
<label for="mergeCategories" class="text-sm text-gray-300 cursor-pointer">
|
||||
Keep existing genres and add new ones (uncheck to remove all existing genres)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Language -->
|
||||
<div class="flex flex-col gap-2 md:basis-[20%]">
|
||||
<label for="language" class="flex items-center justify-between gap-2">
|
||||
<span>Language</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.language" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('language')" binary="true" inputId="clearLanguage"/>
|
||||
<label for="clearLanguage" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<input pInputText id="language" formControlName="language" [disabled]="clearFields.language" class="w-full"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between gap-7">
|
||||
<!-- Publisher -->
|
||||
<div class="flex flex-col gap-2 w-full md:basis-[80%]">
|
||||
<label for="publisher" class="flex items-center justify-between gap-2">
|
||||
<span>Publisher</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.publisher" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('publisher')" binary="true" inputId="clearPublisher"/>
|
||||
<label for="clearPublisher" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
inputStyleClass="w-full"
|
||||
formControlName="publisher"
|
||||
inputId="publisher"
|
||||
[disabled]="clearFields.publisher"
|
||||
[multiple]="false"
|
||||
[dropdown]="false"
|
||||
[showClear]="true"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredPublishers"
|
||||
(completeMethod)="filterPublishers($event)">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
|
||||
<!-- Published Date -->
|
||||
<div class="flex flex-col gap-2 md:basis-[20%]">
|
||||
<label for="publishedDate" class="flex items-center justify-between gap-2">
|
||||
<span>Published Date</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.publishedDate" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('publishedDate')" binary="true" inputId="clearPublishedDate"/>
|
||||
<label for="clearPublishedDate" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-datepicker
|
||||
class="w-full md:min-w-[9rem]"
|
||||
formControlName="publishedDate"
|
||||
inputId="publishedDate"
|
||||
dataType="string"
|
||||
dateFormat="yy-mm-dd"
|
||||
[disabled]="clearFields.publishedDate"
|
||||
[keepInvalid]="true"
|
||||
[showIcon]="true"
|
||||
[iconDisplay]="'input'"
|
||||
fluid="true"
|
||||
appendTo="body">
|
||||
</p-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between gap-7">
|
||||
<!-- Series Name -->
|
||||
<div class="flex flex-col gap-2 w-full md:basis-[80%]">
|
||||
<label for="seriesName" class="flex items-center justify-between gap-2">
|
||||
<span>Series Name</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.seriesName" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('seriesName')" binary="true" inputId="clearSeriesName"/>
|
||||
<label for="clearSeriesName" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
inputStyleClass="w-full"
|
||||
formControlName="seriesName"
|
||||
inputId="seriesName"
|
||||
[disabled]="clearFields.seriesName"
|
||||
[multiple]="false"
|
||||
[dropdown]="false"
|
||||
[showClear]="true"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredSeries"
|
||||
(completeMethod)="filterSeries($event)">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
|
||||
<!-- Series Total -->
|
||||
<div class="flex flex-col gap-2 md:basis-[20%]">
|
||||
<label for="seriesTotal" class="flex items-center justify-between gap-2">
|
||||
<!-- Moods -->
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="moods" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Total Books
|
||||
Mood(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Total number of books in the series."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
pTooltip="Enter multiple moods. Press Enter after typing each mood."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.seriesTotal" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('seriesTotal')" binary="true" inputId="clearSeriesTotal"/>
|
||||
<label for="clearSeriesTotal" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
<p-checkbox [(ngModel)]="clearFields.moods" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('moods')" binary="true" inputId="clearMoods"/>
|
||||
<label for="clearMoods" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<input pInputText id="seriesTotal" type="number" min="1" formControlName="seriesTotal"
|
||||
[disabled]="clearFields.seriesTotal" class="w-full"/>
|
||||
</div>
|
||||
</div>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="moods"
|
||||
formControlName="moods"
|
||||
[disabled]="clearFields.moods"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredMoods"
|
||||
(completeMethod)="filterMoods($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('moods', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('moods', $event)">
|
||||
</p-autoComplete>
|
||||
|
||||
<!-- Genres -->
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="genres" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Genre(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enter multiple genres. Press Enter after typing each genre."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.genres" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('genres')" binary="true" inputId="clearGenres"/>
|
||||
<label for="clearGenres" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<p-checkbox
|
||||
inputId="mergeMoods"
|
||||
name="mergeMoods"
|
||||
[(ngModel)]="mergeMoods"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
binary="true"
|
||||
/>
|
||||
<label for="mergeMoods" class="text-sm text-gray-300 cursor-pointer">
|
||||
Keep existing moods and add new ones (uncheck to remove all existing moods)
|
||||
</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="genres"
|
||||
formControlName="genres"
|
||||
[disabled]="clearFields.genres"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredGenres"
|
||||
(completeMethod)="filterGenres($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('genres', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('genres', $event)">
|
||||
</p-autoComplete>
|
||||
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<p-checkbox
|
||||
inputId="mergeCategories"
|
||||
name="mergeCategories"
|
||||
[(ngModel)]="mergeCategories"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
binary="true"
|
||||
/>
|
||||
<label for="mergeCategories" class="text-sm text-gray-300 cursor-pointer">
|
||||
Keep existing genres and add new ones (uncheck to remove all existing genres)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Moods -->
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="moods" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Mood(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enter multiple moods. Press Enter after typing each mood."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.moods" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('moods')" binary="true" inputId="clearMoods"/>
|
||||
<label for="clearMoods" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
<!-- Tags -->
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="tags" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Tag(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enter multiple tags. Press Enter after typing each tag."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.tags" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('tags')" binary="true" inputId="clearTags"/>
|
||||
<label for="clearTags" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="tags"
|
||||
formControlName="tags"
|
||||
[disabled]="clearFields.tags"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredTags"
|
||||
(completeMethod)="filterTags($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('tags', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('tags', $event)">
|
||||
</p-autoComplete>
|
||||
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<p-checkbox
|
||||
inputId="mergeTags"
|
||||
name="mergeTags"
|
||||
[(ngModel)]="mergeTags"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
binary="true"
|
||||
/>
|
||||
<label for="mergeTags" class="text-sm text-gray-300 cursor-pointer">
|
||||
Keep existing tags and add new ones (uncheck to remove all existing tags)
|
||||
</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="moods"
|
||||
formControlName="moods"
|
||||
[disabled]="clearFields.moods"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredMoods"
|
||||
(completeMethod)="filterMoods($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('moods', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('moods', $event)">
|
||||
</p-autoComplete>
|
||||
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<p-checkbox
|
||||
inputId="mergeMoods"
|
||||
name="mergeMoods"
|
||||
[(ngModel)]="mergeMoods"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
binary="true"
|
||||
/>
|
||||
<label for="mergeMoods" class="text-sm text-gray-300 cursor-pointer">
|
||||
Keep existing moods and add new ones (uncheck to remove all existing moods)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tags -->
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="tags" class="flex items-center justify-between gap-2">
|
||||
<span class="flex items-center gap-2">
|
||||
Tag(s)
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enter multiple tags. Press Enter after typing each tag."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer"></i>
|
||||
</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<p-checkbox [(ngModel)]="clearFields.tags" [ngModelOptions]="{standalone: true}"
|
||||
(onChange)="onFieldClearToggle('tags')" binary="true" inputId="clearTags"/>
|
||||
<label for="clearTags" class="text-sm text-gray-300 cursor-pointer">Clear</label>
|
||||
</div>
|
||||
</label>
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
id="tags"
|
||||
formControlName="tags"
|
||||
[disabled]="clearFields.tags"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[suggestions]="filteredTags"
|
||||
(completeMethod)="filterTags($event)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp('tags', $event)"
|
||||
(onSelect)="onAutoCompleteSelect('tags', $event)">
|
||||
</p-autoComplete>
|
||||
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<p-checkbox
|
||||
inputId="mergeTags"
|
||||
name="mergeTags"
|
||||
[(ngModel)]="mergeTags"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
binary="true"
|
||||
/>
|
||||
<label for="mergeTags" class="text-sm text-gray-300 cursor-pointer">
|
||||
Keep existing tags and add new ones (uncheck to remove all existing tags)
|
||||
<!-- Cover Image Upload Section -->
|
||||
<div class="flex flex-col gap-2 border border-gray-700 rounded-md p-4 bg-gray-900">
|
||||
<label class="flex items-center gap-2 text-base font-semibold">
|
||||
<i class="pi pi-image"></i>
|
||||
Cover Image
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Cover Image Upload Section -->
|
||||
<div class="flex flex-col gap-2 border border-gray-700 rounded-md p-4 bg-gray-900">
|
||||
<label class="flex items-center gap-2 text-base font-semibold">
|
||||
<i class="pi pi-image"></i>
|
||||
Cover Image
|
||||
</label>
|
||||
<p class="text-sm text-gray-400">
|
||||
Upload an image to set as the cover for all selected books.
|
||||
</p>
|
||||
<div class="flex items-center gap-4 mt-2">
|
||||
@if (selectedCoverFile) {
|
||||
<div class="flex items-center gap-2 text-sm text-gray-300">
|
||||
<i class="pi pi-file-image"></i>
|
||||
<span>{{ selectedCoverFile.name }}</span>
|
||||
<p class="text-sm text-gray-400">
|
||||
Upload an image to set as the cover for all selected books.
|
||||
</p>
|
||||
<div class="flex items-center gap-4 mt-2">
|
||||
@if (selectedCoverFile) {
|
||||
<div class="flex items-center gap-2 text-sm text-gray-300">
|
||||
<i class="pi pi-file-image"></i>
|
||||
<span>{{ selectedCoverFile.name }}</span>
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[text]="true"
|
||||
size="small"
|
||||
severity="danger"
|
||||
(onClick)="clearCoverFile()"
|
||||
pTooltip="Remove file"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
</div>
|
||||
} @else {
|
||||
<input
|
||||
type="file"
|
||||
#coverFileInput
|
||||
accept="image/jpeg,image/png,image/webp"
|
||||
(change)="onCoverFileSelect($event)"
|
||||
class="hidden">
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[text]="true"
|
||||
icon="pi pi-upload"
|
||||
label="Select Image"
|
||||
[outlined]="true"
|
||||
size="small"
|
||||
severity="danger"
|
||||
(onClick)="clearCoverFile()"
|
||||
pTooltip="Remove file"
|
||||
tooltipPosition="top">
|
||||
severity="info"
|
||||
(onClick)="coverFileInput.click()">
|
||||
</p-button>
|
||||
</div>
|
||||
} @else {
|
||||
<input
|
||||
type="file"
|
||||
#coverFileInput
|
||||
accept="image/jpeg,image/png,image/webp"
|
||||
(change)="onCoverFileSelect($event)"
|
||||
class="hidden">
|
||||
<p-button
|
||||
icon="pi pi-upload"
|
||||
label="Select Image"
|
||||
[outlined]="true"
|
||||
size="small"
|
||||
severity="info"
|
||||
(onClick)="coverFileInput.click()">
|
||||
</p-button>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end mt-4">
|
||||
<p-button type="submit" label="Apply to Selected" [disabled]="loading"/>
|
||||
</div>
|
||||
</form>
|
||||
<div class="flex justify-end mt-4">
|
||||
<p-button type="submit" label="Apply to Selected" [disabled]="loading"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+24
@@ -1,3 +1,27 @@
|
||||
@use '../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
.bulk-update-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
@include panel.panel-header;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
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);
|
||||
}
|
||||
|
||||
::ng-deep .p-inputchips {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ export class BulkMetadataUpdateComponent implements OnInit {
|
||||
};
|
||||
|
||||
private readonly config = inject(DynamicDialogConfig);
|
||||
private readonly ref = inject(DynamicDialogRef);
|
||||
readonly ref = inject(DynamicDialogRef);
|
||||
private readonly fb = inject(FormBuilder);
|
||||
private readonly bookService = inject(BookService);
|
||||
private readonly messageService = inject(MessageService);
|
||||
|
||||
+121
-70
@@ -1,99 +1,150 @@
|
||||
<div class="cover-search-container">
|
||||
<div class="search-section">
|
||||
<form [formGroup]="searchForm" (ngSubmit)="onSearch()">
|
||||
<div class="form-grid">
|
||||
<div class="form-field">
|
||||
<label for="title">Title *</label>
|
||||
<input
|
||||
pInputText
|
||||
id="title"
|
||||
formControlName="title"
|
||||
placeholder="Enter book title"
|
||||
/>
|
||||
@if (searchForm.get('title')?.invalid && searchForm.get('title')?.touched) {
|
||||
<small class="error-message">
|
||||
Title is required
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-image header-icon"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">Search Cover Images</h2>
|
||||
<p class="panel-description">Find and select a cover for your book</p>
|
||||
</div>
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[rounded]="true"
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="dynamicDialogRef.close()"
|
||||
styleClass="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="author">Author</label>
|
||||
<input
|
||||
pInputText
|
||||
id="author"
|
||||
formControlName="author"
|
||||
placeholder="Enter author name"
|
||||
/>
|
||||
</div>
|
||||
<div class="dialog-content">
|
||||
<!-- Search Form -->
|
||||
<div class="search-section">
|
||||
<form [formGroup]="searchForm" (ngSubmit)="onSearch()">
|
||||
<div class="form-row">
|
||||
<div class="form-field title-field">
|
||||
<label for="title">
|
||||
<i class="pi pi-book"></i>
|
||||
Title
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
<input
|
||||
pInputText
|
||||
id="title"
|
||||
formControlName="title"
|
||||
placeholder="Enter book title"
|
||||
/>
|
||||
@if (searchForm.get('title')?.invalid && searchForm.get('title')?.touched) {
|
||||
<small class="error-message">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
Title is required
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label> </label>
|
||||
<div class="button-group">
|
||||
<div class="form-field author-field">
|
||||
<label for="author">
|
||||
<i class="pi pi-user"></i>
|
||||
Author
|
||||
</label>
|
||||
<input
|
||||
pInputText
|
||||
id="author"
|
||||
formControlName="author"
|
||||
placeholder="Enter author name (optional)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<p-button
|
||||
type="submit"
|
||||
outlined
|
||||
label="Search Covers"
|
||||
label="Search"
|
||||
icon="pi pi-search"
|
||||
[loading]="loading"
|
||||
[disabled]="searchForm.invalid">
|
||||
</p-button>
|
||||
|
||||
<p-button
|
||||
type="button"
|
||||
label="Clear"
|
||||
icon="pi pi-times"
|
||||
icon="pi pi-refresh"
|
||||
[text]="true"
|
||||
[rounded]="true"
|
||||
severity="secondary"
|
||||
(click)="onClear()"
|
||||
styleClass="p-button-secondary p-button-outlined">
|
||||
pTooltip="Reset search"
|
||||
tooltipPosition="top">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@if (hasSearched) {
|
||||
<!-- Results Area -->
|
||||
<div class="results-section">
|
||||
@if (loading) {
|
||||
<div class="loading-container">
|
||||
<p-progressSpinner></p-progressSpinner>
|
||||
<p>Searching for book covers...</p>
|
||||
@if (!hasSearched) {
|
||||
<!-- Initial State -->
|
||||
<div class="empty-state">
|
||||
<div class="empty-state-icon">
|
||||
<i class="pi pi-images"></i>
|
||||
</div>
|
||||
<h3>Search for Book Covers</h3>
|
||||
<p>Enter a book title above to find cover images from various sources.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading && coverImages.length === 0) {
|
||||
<div class="no-results">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<p>No cover images found. Try adjusting your search terms.</p>
|
||||
} @else if (loading) {
|
||||
<!-- Loading State -->
|
||||
<div class="loading-state">
|
||||
<p-progressSpinner strokeWidth="3" animationDuration="1s"></p-progressSpinner>
|
||||
<p>Searching for covers...</p>
|
||||
</div>
|
||||
} @else if (coverImages.length === 0) {
|
||||
<!-- No Results State -->
|
||||
<div class="empty-state no-results">
|
||||
<div class="empty-state-icon warning">
|
||||
<i class="pi pi-search"></i>
|
||||
</div>
|
||||
<h3>No Covers Found</h3>
|
||||
<p>Try adjusting your search terms or check the spelling.</p>
|
||||
</div>
|
||||
} @else {
|
||||
<!-- Results Grid -->
|
||||
<div class="results-header">
|
||||
<span class="results-count">
|
||||
<i class="pi pi-images"></i>
|
||||
{{ coverImages.length }} cover{{ coverImages.length !== 1 ? 's' : '' }} found
|
||||
</span>
|
||||
<span class="results-hint">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Click on an image to preview, or select to apply
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!loading && coverImages.length > 0) {
|
||||
<div class="covers-grid">
|
||||
@for (cover of coverImages; track cover.url; let i = $index) {
|
||||
<div class="cover-item">
|
||||
<p-image
|
||||
[src]="cover.url"
|
||||
[alt]="'Book cover ' + (i + 1)"
|
||||
appendTo="body"
|
||||
[preview]="true">
|
||||
</p-image>
|
||||
@if (cover.width && cover.height) {
|
||||
<div class="resolution-overlay">
|
||||
{{cover.width}} x {{cover.height}}
|
||||
<div class="cover-card">
|
||||
<div class="cover-image-wrapper">
|
||||
<p-image
|
||||
[src]="cover.url"
|
||||
[alt]="'Book cover ' + (i + 1)"
|
||||
appendTo="body"
|
||||
[preview]="true">
|
||||
</p-image>
|
||||
@if (cover.width && cover.height) {
|
||||
<div class="resolution-badge">
|
||||
{{ cover.width }} x {{ cover.height }}
|
||||
</div>
|
||||
}
|
||||
<div class="cover-overlay">
|
||||
<p-button
|
||||
(click)="selectAndSave(cover)"
|
||||
label="Select Cover"
|
||||
icon="pi pi-check"
|
||||
size="small">
|
||||
</p-button>
|
||||
</div>
|
||||
}
|
||||
<p-button
|
||||
class="select-button"
|
||||
(click)="selectAndSave(cover)"
|
||||
label="Pick & Save"
|
||||
severity="info"
|
||||
title="Select & Save this cover">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+295
-113
@@ -1,148 +1,330 @@
|
||||
@use '../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
:host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.cover-search-container {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
.search-section {
|
||||
background: var(--surface-card);
|
||||
border: 1px solid var(--surface-border);
|
||||
border-radius: 8px;
|
||||
padding: 0 1.5rem 0 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
.panel-header {
|
||||
@include panel.panel-header;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0 0 1.5rem 0;
|
||||
color: var(--text-color);
|
||||
.dialog-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
min-height: 0;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// Search Section
|
||||
.search-section {
|
||||
flex-shrink: 0;
|
||||
background: var(--surface-ground);
|
||||
border: 1px solid var(--surface-border);
|
||||
border-radius: 12px;
|
||||
padding: 1.25rem 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.form-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.title-field {
|
||||
flex: 1.2;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr auto;
|
||||
gap: 1rem;
|
||||
align-items: end;
|
||||
&.author-field {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.form-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-color-secondary);
|
||||
|
||||
label {
|
||||
font-weight: 500;
|
||||
color: var(--text-color);
|
||||
}
|
||||
i {
|
||||
font-size: 0.875rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: var(--red-500);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.required {
|
||||
color: var(--red-400);
|
||||
}
|
||||
}
|
||||
|
||||
.button-group {
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
color: var(--red-400);
|
||||
font-size: 0.8rem;
|
||||
|
||||
i {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.results-section {
|
||||
padding: 0 1.5rem 0 1.5rem;
|
||||
.form-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 3rem;
|
||||
background: var(--surface-card);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--surface-border);
|
||||
// Results Section
|
||||
.results-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 1rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
}
|
||||
// Empty & Loading States
|
||||
.empty-state,
|
||||
.loading-state {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
background: var(--surface-ground);
|
||||
border: 1px dashed var(--surface-border);
|
||||
border-radius: 12px;
|
||||
|
||||
.no-results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 3rem;
|
||||
color: var(--text-secondary-color);
|
||||
background: var(--surface-card);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--surface-border);
|
||||
h3 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-color-secondary);
|
||||
max-width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.covers-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 1.5rem;
|
||||
padding: 1rem 0;
|
||||
.empty-state-icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
|
||||
border-radius: 50%;
|
||||
margin-bottom: 1.5rem;
|
||||
|
||||
.cover-item {
|
||||
position: relative;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
padding: 4px;
|
||||
transition: all 0.3s ease;
|
||||
i {
|
||||
font-size: 2rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: var(--primary-color);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
&.warning {
|
||||
background: linear-gradient(135deg, var(--yellow-100), var(--yellow-50));
|
||||
|
||||
.resolution-overlay {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
color: white;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
backdrop-filter: blur(4px);
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.select-button {
|
||||
position: absolute !important;
|
||||
bottom: 8px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 120px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 2;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&:hover .select-button {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
i {
|
||||
color: var(--yellow-600);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-state {
|
||||
p {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Results Header
|
||||
.results-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid var(--surface-border);
|
||||
|
||||
.results-count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
|
||||
i {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.results-hint {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-color-secondary);
|
||||
|
||||
i {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Covers Grid
|
||||
.covers-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
||||
gap: 1.25rem;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.cover-card {
|
||||
.cover-image-wrapper {
|
||||
position: relative;
|
||||
width: 150px;
|
||||
height: 220px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: var(--surface-ground);
|
||||
border: 2px solid transparent;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--primary-color);
|
||||
|
||||
.cover-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
::ng-deep {
|
||||
.p-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.p-image-preview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.p-image-preview-mask {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.p-image-preview-indicator {
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.resolution-badge {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
color: white;
|
||||
padding: 3px 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.cover-overlay {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.5rem;
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
|
||||
opacity: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive
|
||||
@media (max-width: 768px) {
|
||||
.cover-search-container .search-section .form-grid {
|
||||
grid-template-columns: 1fr;
|
||||
.search-section .form-row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
.form-field .button-group {
|
||||
justify-content: stretch;
|
||||
.form-field {
|
||||
&.title-field,
|
||||
&.author-field {
|
||||
flex: none;
|
||||
}
|
||||
}
|
||||
|
||||
::ng-deep .p-button {
|
||||
.form-actions {
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
margin-top: 0.5rem;
|
||||
|
||||
::ng-deep .p-button:not(.p-button-icon-only) {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.results-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.covers-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -10,6 +10,7 @@ import {ProgressSpinner} from 'primeng/progressspinner';
|
||||
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {BookService} from '../../../book/service/book.service';
|
||||
import {Image} from 'primeng/image';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cover-search',
|
||||
@@ -20,7 +21,8 @@ import {Image} from 'primeng/image';
|
||||
FormsModule,
|
||||
InputText,
|
||||
ProgressSpinner,
|
||||
Image
|
||||
Image,
|
||||
Tooltip
|
||||
],
|
||||
styleUrls: ['./cover-search.component.scss']
|
||||
})
|
||||
|
||||
+8
-6
@@ -1,7 +1,9 @@
|
||||
<div class="flex flex-col space-y-6">
|
||||
<app-metadata-advanced-fetch-options
|
||||
(metadataOptionsSubmitted)="onMetadataSubmit($event)"
|
||||
[currentMetadataOptions]="currentMetadataOptions"
|
||||
[submitButtonLabel]="'Start Refresh'">
|
||||
</app-metadata-advanced-fetch-options>
|
||||
<div class="metadata-fetch-options-container">
|
||||
<div class="dialog-content">
|
||||
<app-metadata-advanced-fetch-options
|
||||
(metadataOptionsSubmitted)="onMetadataSubmit($event)"
|
||||
[currentMetadataOptions]="currentMetadataOptions"
|
||||
[submitButtonLabel]="'Start Refresh'">
|
||||
</app-metadata-advanced-fetch-options>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@use '../../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
.metadata-fetch-options-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
@include panel.panel-header;
|
||||
}
|
||||
|
||||
+1
-2
@@ -6,7 +6,6 @@ import {MetadataRefreshOptions} from '../../../model/request/metadata-refresh-op
|
||||
import {AppSettingsService} from '../../../../../shared/service/app-settings.service';
|
||||
import {filter, take} from 'rxjs/operators';
|
||||
import {MetadataAdvancedFetchOptionsComponent} from '../metadata-advanced-fetch-options/metadata-advanced-fetch-options.component';
|
||||
import {TaskCreateRequest, TaskType} from '../../../../settings/task-management/task.service';
|
||||
import {TaskHelperService} from '../../../../settings/task-management/task-helper.service';
|
||||
|
||||
@Component({
|
||||
@@ -25,7 +24,7 @@ export class MetadataFetchOptionsComponent {
|
||||
currentMetadataOptions!: MetadataRefreshOptions;
|
||||
|
||||
private dynamicDialogConfig = inject(DynamicDialogConfig);
|
||||
private dynamicDialogRef = inject(DynamicDialogRef);
|
||||
dynamicDialogRef = inject(DynamicDialogRef);
|
||||
private taskHelperService = inject(TaskHelperService);
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
|
||||
|
||||
+40
-27
@@ -1,6 +1,24 @@
|
||||
@if (!loading) {
|
||||
<div class="px-4 pt-4 pb-2 h-full flex flex-col">
|
||||
<div class="flex-grow overflow-auto">
|
||||
<div class="metadata-review-container">
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-pencil header-icon"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">Review Metadata Proposal</h2>
|
||||
<p class="panel-description">Review and accept fetched metadata</p>
|
||||
</div>
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[rounded]="true"
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="close()"
|
||||
styleClass="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
@if (!loading) {
|
||||
<div class="dialog-content">
|
||||
@if (currentProposal?.metadataJson; as proposed) {
|
||||
<app-metadata-picker
|
||||
[fetchedMetadata]="proposed"
|
||||
@@ -11,25 +29,21 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<p-divider/>
|
||||
|
||||
<div class="flex justify-between items-center flex-wrap gap-2 pt-4">
|
||||
|
||||
<div class="flex items-center gap-2 pl-1 group"
|
||||
pTooltip="{{ currentIndex + 1 }} of {{ proposals.length }} processed ({{ ((currentIndex + 1) / proposals.length * 100) | number: '1.0-0' }}%)"
|
||||
tooltipPosition="top">
|
||||
<p-progressBar
|
||||
[value]="((currentIndex + 1) / proposals.length) * 100"
|
||||
class="w-40 h-3 transition-all duration-300 ease-in-out group-hover:shadow-md"
|
||||
showValue="false">
|
||||
</p-progressBar>
|
||||
<span class="text-sm text-gray-300 font-medium tabular-nums whitespace-nowrap">
|
||||
Book {{ currentIndex + 1 }} / {{ proposals.length }}
|
||||
</span>
|
||||
<div class="dialog-footer">
|
||||
<div class="footer-info">
|
||||
<div class="progress-group" pTooltip="{{ currentIndex + 1 }} of {{ proposals.length }} processed ({{ ((currentIndex + 1) / proposals.length * 100) | number: '1.0-0' }}%)" tooltipPosition="top">
|
||||
<p-progressBar
|
||||
[value]="((currentIndex + 1) / proposals.length) * 100"
|
||||
class="progress-bar"
|
||||
showValue="false">
|
||||
</p-progressBar>
|
||||
<span class="progress-text">
|
||||
Book {{ currentIndex + 1 }} / {{ proposals.length }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2 justify-end">
|
||||
|
||||
<div class="footer-actions">
|
||||
<p-button
|
||||
label="Close"
|
||||
icon="pi pi-times-circle"
|
||||
@@ -77,12 +91,11 @@
|
||||
[outlined]="true"
|
||||
(click)="onNext()">
|
||||
</p-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="p-4 h-full flex items-center justify-center">
|
||||
<p-progressSpinner class="w-8 h-8" strokeWidth="4"></p-progressSpinner>
|
||||
</div>
|
||||
}
|
||||
} @else {
|
||||
<div class="dialog-content loading-state">
|
||||
<p-progressSpinner class="spinner" strokeWidth="4"></p-progressSpinner>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
@use '../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
.metadata-review-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
@include panel.panel-header;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-top: none;
|
||||
|
||||
&.loading-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 0 0 10px 10px;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
@include panel.dialog-footer;
|
||||
|
||||
.footer-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.progress-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
cursor: help;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 10rem;
|
||||
height: 0.75rem;
|
||||
|
||||
@media (max-width: 640px) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary-color);
|
||||
white-space: nowrap;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.footer-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
.footer-info {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress-group {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.footer-actions {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+51
-31
@@ -1,32 +1,52 @@
|
||||
<div class="rounded-xl">
|
||||
<p-tabs [value]="'edit'" lazy="true">
|
||||
<p-tablist>
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tab value="edit">Edit Metadata</p-tab>
|
||||
}
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tab value="match">Search Metadata</p-tab>
|
||||
}
|
||||
</p-tablist>
|
||||
<p-tabpanels class="h-[78dvh]">
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tabpanel value="edit">
|
||||
<app-metadata-editor
|
||||
[book$]="book$"
|
||||
[disableNext]="disableNext"
|
||||
[disablePrevious]="disablePrevious"
|
||||
(nextBookClicked)="handleNextBook()"
|
||||
(previousBookClicked)="handlePreviousBook()"
|
||||
(closeDialogButtonClicked)="handleCloseDialogButton()"
|
||||
[showNavigationButtons]="true"
|
||||
></app-metadata-editor>
|
||||
</p-tabpanel>
|
||||
}
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tabpanel value="match">
|
||||
<app-metadata-searcher [book$]="book$"></app-metadata-searcher>
|
||||
</p-tabpanel>
|
||||
}
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
<div class="multi-book-editor-container">
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-pencil header-icon"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">Edit Metadata</h2>
|
||||
<p class="panel-description">{{ filteredBooks.length }} book{{ filteredBooks.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="dialog-content">
|
||||
<p-tabs [value]="'edit'" lazy="true">
|
||||
<p-tablist>
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tab value="edit">Edit Metadata</p-tab>
|
||||
}
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tab value="match">Search Metadata</p-tab>
|
||||
}
|
||||
</p-tablist>
|
||||
<p-tabpanels>
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tabpanel value="edit">
|
||||
<app-metadata-editor
|
||||
[book$]="book$"
|
||||
[disableNext]="disableNext"
|
||||
[disablePrevious]="disablePrevious"
|
||||
(nextBookClicked)="handleNextBook()"
|
||||
(previousBookClicked)="handlePreviousBook()"
|
||||
(closeDialogButtonClicked)="handleCloseDialogButton()"
|
||||
[showNavigationButtons]="true"
|
||||
></app-metadata-editor>
|
||||
</p-tabpanel>
|
||||
}
|
||||
@if (admin || canEditMetadata) {
|
||||
<p-tabpanel value="match">
|
||||
<app-metadata-searcher [book$]="book$"></app-metadata-searcher>
|
||||
</p-tabpanel>
|
||||
}
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
@use '../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
:host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.multi-book-editor-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;
|
||||
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);
|
||||
|
||||
::ng-deep {
|
||||
p-tabs {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.p-tabpanels {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -8,6 +8,7 @@ import {UserService} from '../../../settings/user-management/user.service';
|
||||
import {distinctUntilChanged, filter, map, shareReplay, switchMap, takeUntil} from 'rxjs/operators';
|
||||
import {MetadataEditorComponent} from '../book-metadata-center/metadata-editor/metadata-editor.component';
|
||||
import {MetadataSearcherComponent} from '../book-metadata-center/metadata-searcher/metadata-searcher.component';
|
||||
import {Button} from 'primeng/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-multi-book-metadata-editor-component',
|
||||
@@ -18,7 +19,8 @@ import {MetadataSearcherComponent} from '../book-metadata-center/metadata-search
|
||||
TabList,
|
||||
TabPanel,
|
||||
TabPanels,
|
||||
Tabs
|
||||
Tabs,
|
||||
Button
|
||||
],
|
||||
templateUrl: './multi-book-metadata-editor-component.html',
|
||||
standalone: true,
|
||||
@@ -37,7 +39,7 @@ export class MultiBookMetadataEditorComponent implements OnInit, OnDestroy {
|
||||
admin = false;
|
||||
|
||||
private readonly config = inject(DynamicDialogConfig);
|
||||
private readonly ref = inject(DynamicDialogRef);
|
||||
readonly ref = inject(DynamicDialogRef);
|
||||
private readonly bookService = inject(BookService);
|
||||
private readonly userService = inject(UserService);
|
||||
|
||||
|
||||
+33
-14
@@ -1,16 +1,35 @@
|
||||
<div class="mx-4 mb-4">
|
||||
<p class="text-sm font-semibold mb-2 text-[var(--primary-color)]">
|
||||
{{ booksToShow.length }} Books Selected
|
||||
</p>
|
||||
<div class="max-h-24 overflow-auto border border-gray-500 rounded p-2 text-sm">
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
@for (book of booksToShow; track book.id) {
|
||||
<li>
|
||||
<span class="text-gray-400">#{{ book.id }}</span>: {{ book.metadata?.title || 'Untitled' }}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<div class="multi-book-fetch-container">
|
||||
<div class="panel-header">
|
||||
<div class="header-icon-wrapper">
|
||||
<i class="pi pi-sync header-icon"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h2 class="panel-title">Metadata Refresh Options</h2>
|
||||
<p class="panel-description">{{ booksToShow.length }} books selected</p>
|
||||
</div>
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[rounded]="true"
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="dialogRef.close()"
|
||||
styleClass="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
<div class="dialog-content">
|
||||
<div class="book-list-section">
|
||||
<div class="max-h-24 overflow-auto border border-gray-500 rounded p-2 text-sm">
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
@for (book of booksToShow; track book.id) {
|
||||
<li>
|
||||
<span class="text-gray-400">#{{ book.id }}</span>: {{ book.metadata?.title || 'Untitled' }}
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<app-metadata-fetch-options></app-metadata-fetch-options>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<app-metadata-fetch-options></app-metadata-fetch-options>
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
@use '../../../../shared/styles/panel-shared' as panel;
|
||||
|
||||
:host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.multi-book-fetch-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: 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);
|
||||
}
|
||||
|
||||
.book-list-section {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
::ng-deep app-metadata-fetch-options {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
+4
-2
@@ -4,19 +4,20 @@ import {Subject, takeUntil} from 'rxjs';
|
||||
import {MetadataRefreshType} from '../../model/request/metadata-refresh-type.enum';
|
||||
import {MetadataRefreshOptions} from '../../model/request/metadata-refresh-options.model';
|
||||
|
||||
import {DynamicDialogConfig} from 'primeng/dynamicdialog';
|
||||
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {BookService} from '../../../book/service/book.service';
|
||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
||||
import {Book} from '../../../book/model/book.model';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {MetadataFetchOptionsComponent} from '../metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
|
||||
import {Button} from 'primeng/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-multi-book-metadata-fetch-component',
|
||||
standalone: true,
|
||||
templateUrl: './multi-book-metadata-fetch-component.html',
|
||||
styleUrl: './multi-book-metadata-fetch-component.scss',
|
||||
imports: [MetadataFetchOptionsComponent, FormsModule],
|
||||
imports: [MetadataFetchOptionsComponent, FormsModule, Button],
|
||||
})
|
||||
export class MultiBookMetadataFetchComponent implements OnInit, OnDestroy {
|
||||
bookIds!: number[];
|
||||
@@ -27,6 +28,7 @@ export class MultiBookMetadataFetchComponent implements OnInit, OnDestroy {
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
private dynamicDialogConfig = inject(DynamicDialogConfig);
|
||||
dialogRef = inject(DynamicDialogRef);
|
||||
private bookService = inject(BookService);
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
expanded = false;
|
||||
|
||||
Reference in New Issue
Block a user