chore(ui): clear eslint no-unused-vars bucket
- Frontend lint cleanup: - remove unused imports, constants, locals, and callback parameters across the UI codebase - keep template and callback signatures intact where bindings still pass event arguments by explicitly consuming the values instead of changing behavior - Metadata and reader surfaces: - trim dead symbols in the metadata editor, viewer, search, and reader flows without mixing in broader refactors - preserve existing runtime behavior while tightening the code paths that the ESLint bucket touches - Validation: - ran `just ui lint` and cleared the `@typescript-eslint/no-unused-vars` bucket; the command still fails on the remaining ESLint backlog - ran `just ui check`; deps and typecheck pass, and the remaining failure is the outstanding ESLint backlog
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import {HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest} from '@angular/common/http';
|
||||
import {inject} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {catchError, filter, switchMap, take} from 'rxjs/operators';
|
||||
import {BehaviorSubject, Observable, throwError} from 'rxjs';
|
||||
import {AuthService} from '../../shared/service/auth.service';
|
||||
@@ -8,7 +7,6 @@ import {API_CONFIG} from '../config/api-config';
|
||||
|
||||
export const AuthInterceptorService: HttpInterceptorFn = (req, next: HttpHandlerFn) => {
|
||||
const authService = inject(AuthService);
|
||||
const router = inject(Router);
|
||||
|
||||
const token = authService.getInternalAccessToken();
|
||||
const isApiRequest = req.url.startsWith(`${API_CONFIG.BASE_URL}/api/`);
|
||||
@@ -18,7 +16,7 @@ export const AuthInterceptorService: HttpInterceptorFn = (req, next: HttpHandler
|
||||
return next(authReq).pipe(
|
||||
catchError((error: HttpErrorResponse) => {
|
||||
if (error.status === 401) {
|
||||
return handle401Error(authService, authReq, next, router);
|
||||
return handle401Error(authService, authReq, next);
|
||||
}
|
||||
return throwError(() => error);
|
||||
})
|
||||
@@ -28,7 +26,7 @@ export const AuthInterceptorService: HttpInterceptorFn = (req, next: HttpHandler
|
||||
let isRefreshing = false;
|
||||
const refreshTokenSubject = new BehaviorSubject<string | null>(null);
|
||||
|
||||
function handle401Error(authService: AuthService, request: HttpRequest<unknown>, next: HttpHandlerFn, router: Router): Observable<HttpEvent<unknown>> {
|
||||
function handle401Error(authService: AuthService, request: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>> {
|
||||
if (!isRefreshing) {
|
||||
isRefreshing = true;
|
||||
refreshTokenSubject.next(null);
|
||||
@@ -47,7 +45,7 @@ function handle401Error(authService: AuthService, request: HttpRequest<unknown>,
|
||||
}),
|
||||
catchError(err => {
|
||||
isRefreshing = false;
|
||||
forceLogout(authService, router);
|
||||
forceLogout(authService);
|
||||
return throwError(() => err);
|
||||
})
|
||||
);
|
||||
@@ -64,6 +62,6 @@ function handle401Error(authService: AuthService, request: HttpRequest<unknown>,
|
||||
);
|
||||
}
|
||||
|
||||
function forceLogout(authService: AuthService, router: Router): void {
|
||||
function forceLogout(authService: AuthService): void {
|
||||
authService.logout();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import {inject} from '@angular/core';
|
||||
import {CanActivateFn, Router} from '@angular/router';
|
||||
import {AuthService} from '../../shared/service/auth.service';
|
||||
|
||||
export const AuthGuard: CanActivateFn = (route, state) => {
|
||||
export const AuthGuard: CanActivateFn = () => {
|
||||
const router = inject(Router);
|
||||
const authService = inject(AuthService);
|
||||
|
||||
@@ -20,7 +20,7 @@ export const AuthGuard: CanActivateFn = (route, state) => {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
localStorage.removeItem('accessToken_Internal');
|
||||
router.navigate(['/login']);
|
||||
return false;
|
||||
|
||||
@@ -2,8 +2,7 @@ import {inject, Injectable} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {firstValueFrom, Observable} from 'rxjs';
|
||||
import {API_CONFIG} from '../config/api-config';
|
||||
import {AppSettingsService, PublicAppSettings} from '../../shared/service/app-settings.service';
|
||||
import {filter, take} from 'rxjs/operators';
|
||||
import {AppSettingsService} from '../../shared/service/app-settings.service';
|
||||
|
||||
interface OidcPkceState {
|
||||
codeVerifier: string;
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
import {ChangeDetectorRef, Component, effect, inject, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||
import {ChangeDetectorRef, Component, inject, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
@@ -153,6 +153,7 @@ export class AdditionalFileUploaderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
uploadFiles(event: FileUploadHandlerEvent): void {
|
||||
void event;
|
||||
const filesToUpload = this.files.filter(f => f.status === 'Pending');
|
||||
|
||||
if (filesToUpload.length === 0) return;
|
||||
|
||||
@@ -10,7 +10,6 @@ import {MultiBookMetadataFetchComponent} from '../../../metadata/component/multi
|
||||
import {FileMoverComponent} from '../../../../shared/components/file-mover/file-mover-component';
|
||||
import {ShelfCreatorComponent} from '../shelf-creator/shelf-creator.component';
|
||||
import {BookSenderComponent} from '../book-sender/book-sender.component';
|
||||
import {MetadataFetchOptionsComponent} from '../../../metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
|
||||
import {BookMetadataCenterComponent} from '../../../metadata/component/book-metadata-center/book-metadata-center.component';
|
||||
import {CoverSearchComponent} from '../../../metadata/component/cover-search/cover-search.component';
|
||||
import {Book} from '../../model/book.model';
|
||||
|
||||
+2
-1
@@ -46,6 +46,7 @@ export class CoverScalePreferenceService {
|
||||
}
|
||||
|
||||
getCardHeight(_book: Book): number {
|
||||
void _book;
|
||||
// Use uniform height for all book types to ensure smooth virtual scrolling.
|
||||
// Mixed heights cause choppy/jumpy scrolling because the virtual scroller
|
||||
// cannot accurately estimate positions when item heights vary.
|
||||
@@ -72,7 +73,7 @@ export class CoverScalePreferenceService {
|
||||
detail: this.t.translate('book.coverPref.toast.savedDetail', {scale: scale.toFixed(2)}),
|
||||
life: 1500
|
||||
});
|
||||
} catch (e) {
|
||||
} catch {
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: this.t.translate('book.coverPref.toast.saveFailedSummary'),
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ export class SidebarFilterTogglePrefService {
|
||||
private savePreference(value: boolean): void {
|
||||
try {
|
||||
this.localStorageService.set(this.STORAGE_KEY, value);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: this.t.translate('book.filterPref.toast.saveFailedSummary'),
|
||||
|
||||
@@ -9,7 +9,7 @@ import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {EmailV2ProviderService} from '../../../settings/email-v2/email-v2-provider/email-v2-provider.service';
|
||||
import {EmailV2RecipientService} from '../../../settings/email-v2/email-v2-recipient/email-v2-recipient.service';
|
||||
import {Book, BookFile} from '../../model/book.model';
|
||||
import {Book} from '../../model/book.model';
|
||||
import {RadioButton} from 'primeng/radiobutton';
|
||||
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ export class ReadStatusHelper {
|
||||
}
|
||||
|
||||
shouldShowStatusIcon(_readStatus: ReadStatus | undefined): boolean {
|
||||
void _readStatus;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export class SortService {
|
||||
fileSizeKb: (book) => book.fileSizeKb || null,
|
||||
fileName: (book) => book.fileName,
|
||||
filePath: (book) => book.filePath,
|
||||
random: (book) => Math.random(),
|
||||
random: () => Math.random(),
|
||||
seriesName: (book) => book.metadata?.seriesName?.toLowerCase() || null,
|
||||
seriesNumber: (book) => book.metadata?.seriesNumber ?? null,
|
||||
readStatus: (book) => book.readStatus ? (SortService.READ_STATUS_RANK[book.readStatus] ?? null) : null,
|
||||
|
||||
-16
@@ -25,22 +25,6 @@ interface PreviewResult {
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
const PLACEHOLDER_KEY_MAP: Record<string, string> = {
|
||||
'*': 'wildcard',
|
||||
'SeriesName': 'seriesName',
|
||||
'Title': 'title',
|
||||
'Subtitle': 'subtitle',
|
||||
'Authors': 'authors',
|
||||
'SeriesNumber': 'seriesNumber',
|
||||
'Published': 'published',
|
||||
'Publisher': 'publisher',
|
||||
'Language': 'language',
|
||||
'SeriesTotal': 'seriesTotal',
|
||||
'ISBN10': 'isbn10',
|
||||
'ISBN13': 'isbn13',
|
||||
'ASIN': 'asin',
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-bookdrop-pattern-extract-dialog',
|
||||
standalone: true,
|
||||
|
||||
+7
-6
@@ -7,14 +7,14 @@ import {Observable, sample} from "rxjs";
|
||||
import {MessageService} from "primeng/api";
|
||||
import {Book, BookMetadata, ComicMetadata, MetadataClearFlags, MetadataUpdateWrapper,} from "../../../../book/model/book.model";
|
||||
import {UrlHelperService} from "../../../../../shared/service/url-helper.service";
|
||||
import {ALL_COMIC_METADATA_FIELDS, AUDIOBOOK_METADATA_FIELDS, COMIC_FORM_TO_MODEL_LOCK, COMIC_TEXT_METADATA_FIELDS, COMIC_ARRAY_METADATA_FIELDS, COMIC_TEXTAREA_METADATA_FIELDS, MetadataFieldConfig, isFieldEmbeddable, hasMetadataWriter} from '../../../../../shared/metadata';
|
||||
import {ALL_COMIC_METADATA_FIELDS, AUDIOBOOK_METADATA_FIELDS, COMIC_FORM_TO_MODEL_LOCK, COMIC_TEXT_METADATA_FIELDS, COMIC_ARRAY_METADATA_FIELDS, COMIC_TEXTAREA_METADATA_FIELDS, isFieldEmbeddable, hasMetadataWriter} from '../../../../../shared/metadata';
|
||||
import {FileUpload, FileUploadErrorEvent, FileUploadEvent,} from "primeng/fileupload";
|
||||
import {HttpResponse} from "@angular/common/http";
|
||||
import {BookService} from "../../../../book/service/book.service";
|
||||
import {BookMetadataManageService} from "../../../../book/service/book-metadata-manage.service";
|
||||
import {ProgressSpinner} from "primeng/progressspinner";
|
||||
import {Tooltip} from "primeng/tooltip";
|
||||
import {filter, finalize, switchMap, take, tap} from "rxjs/operators";
|
||||
import {filter, finalize, take, tap} from "rxjs/operators";
|
||||
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
|
||||
import {MetadataRefreshType} from "../../../model/request/metadata-refresh-type.enum";
|
||||
import {AutoComplete, AutoCompleteSelectEvent} from "primeng/autocomplete";
|
||||
@@ -607,7 +607,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
this.saveMetadata().pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
|
||||
}
|
||||
|
||||
saveMetadata(): Observable<void> {
|
||||
saveMetadata(): Observable<unknown> {
|
||||
this.isSaving = true;
|
||||
return this.bookMetadataManageService
|
||||
.updateBookMetadata(
|
||||
@@ -617,7 +617,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
)
|
||||
.pipe(
|
||||
tap({
|
||||
next: (response: any) => {
|
||||
next: () => {
|
||||
this.isSaving = false;
|
||||
this.messageService.add({
|
||||
severity: "info",
|
||||
@@ -870,7 +870,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
.updateBookMetadata(this.currentBookId, metadataUpdateWrapper, false)
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: (response) => {
|
||||
next: () => {
|
||||
if (shouldLockAllFields !== undefined) {
|
||||
this.messageService.add({
|
||||
severity: "success",
|
||||
@@ -919,6 +919,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
}
|
||||
|
||||
onUploadError($event: FileUploadErrorEvent) {
|
||||
void $event;
|
||||
this.isUploading = false;
|
||||
this.messageService.add({
|
||||
severity: "error",
|
||||
@@ -1006,7 +1007,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
detail: this.t.translate('metadata.editor.toast.customAudiobookCoverGenerated'),
|
||||
});
|
||||
},
|
||||
error: (err) => {
|
||||
error: () => {
|
||||
this.messageService.add({
|
||||
severity: "error",
|
||||
summary: this.t.translate('metadata.editor.toast.errorSummary'),
|
||||
|
||||
+1
@@ -165,6 +165,7 @@ export class MetadataPickerComponent implements OnInit {
|
||||
}
|
||||
|
||||
private patchMetadataToForm(metadata: BookMetadata, book: Book): void {
|
||||
void book;
|
||||
const patchData: Record<string, unknown> = {};
|
||||
|
||||
for (const field of ALL_METADATA_FIELDS) {
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy, OnChanges {
|
||||
this.currentSettings = settings;
|
||||
const providerSettings = settings.metadataProviderSettings ?? {};
|
||||
this.providers = Object.entries(providerSettings)
|
||||
.filter(([_, value]) => !!value && typeof value === 'object' && 'enabled' in value && (value as any).enabled)
|
||||
.filter(([, value]) => !!value && typeof value === 'object' && 'enabled' in value && (value as any).enabled)
|
||||
.map(([key]) => key.charAt(0).toUpperCase() + key.slice(1));
|
||||
|
||||
const currentProviders = this.form.get('provider')?.value || [];
|
||||
@@ -309,7 +309,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy, OnChanges {
|
||||
this.providerFilterOptions = [
|
||||
{label: `All (${this.allFetchedMetadata.length})`, value: 'all'},
|
||||
...Array.from(this.providerCounts.entries())
|
||||
.filter(([_, count]) => count > 0)
|
||||
.filter(([, count]) => count > 0)
|
||||
.map(([provider, count]) => ({
|
||||
label: `${provider.charAt(0).toUpperCase() + provider.slice(1)} (${count})`,
|
||||
value: provider
|
||||
|
||||
+4
-4
@@ -17,7 +17,7 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {ProgressBar} from 'primeng/progressbar';
|
||||
import {MetadataRefreshType} from '../../../model/request/metadata-refresh-type.enum';
|
||||
import {Router} from '@angular/router';
|
||||
import {filter, take, tap} from 'rxjs/operators';
|
||||
import {tap} from 'rxjs/operators';
|
||||
import {Menu} from 'primeng/menu';
|
||||
import {ResetProgressType, ResetProgressTypes} from '../../../../../shared/constants/reset-progress-type';
|
||||
import {DatePicker} from 'primeng/datepicker';
|
||||
@@ -444,7 +444,7 @@ export class MetadataViewerComponent implements OnInit, OnChanges, AfterViewChec
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes['recommendedBooks']) {
|
||||
this.originalRecommendedBooks = [...this.recommendedBooks];
|
||||
this.filterRecommendations(this.book);
|
||||
this.filterRecommendations();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,10 +456,10 @@ export class MetadataViewerComponent implements OnInit, OnChanges, AfterViewChec
|
||||
this.originalRecommendedBooks = [...this.recommendedBooks];
|
||||
}),
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
).subscribe(() => this.filterRecommendations(this.book));
|
||||
).subscribe(() => this.filterRecommendations());
|
||||
}
|
||||
|
||||
private filterRecommendations(book: Book | null): void {
|
||||
private filterRecommendations(): void {
|
||||
if (!this.originalRecommendedBooks) return;
|
||||
const bookInSeriesIds = new Set(this.bookInSeries.map(book => book.id));
|
||||
this.recommendedBooks = this.originalRecommendedBooks.filter(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {Component, effect, ElementRef, HostListener, inject, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {forkJoin, from, Observable, Subject} from 'rxjs';
|
||||
import {debounceTime, map, switchMap, takeUntil, timeout} from 'rxjs/operators';
|
||||
import {forkJoin, from, Subject} from 'rxjs';
|
||||
import {debounceTime, map, switchMap, takeUntil} from 'rxjs/operators';
|
||||
import {PageTitleService} from "../../../shared/service/page-title.service";
|
||||
import {CbxReaderService} from '../../book/service/cbx-reader.service';
|
||||
import {BookService} from '../../book/service/book.service';
|
||||
@@ -1058,7 +1058,7 @@ export class CbxReaderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
@HostListener('document:mouseleave', ['$event'])
|
||||
onMouseLeave(event: MouseEvent): void {
|
||||
onMouseLeave(): void {
|
||||
this.visibilityManager.handleMouseLeave();
|
||||
if (this.isMagnifierActive) {
|
||||
this.hideMagnifier();
|
||||
|
||||
@@ -273,6 +273,7 @@ export class ReaderEventService {
|
||||
}
|
||||
|
||||
private handleTouchStart(event: TouchEvent, _doc: Document): void {
|
||||
void _doc;
|
||||
if (event.touches.length !== 1) return;
|
||||
|
||||
const touch = event.touches[0];
|
||||
|
||||
@@ -424,12 +424,12 @@ export class EbookReaderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
@HostListener('document:mouseleave', ['$event'])
|
||||
onMouseLeave(event: MouseEvent): void {
|
||||
onMouseLeave(): void {
|
||||
this.visibilityManager.handleMouseLeave();
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
onWindowResize(event: Event): void {
|
||||
onWindowResize(): void {
|
||||
this.visibilityManager.updateWindowHeight(window.innerHeight);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ export class ReaderLeftSidebarService {
|
||||
isSearching: false,
|
||||
progress: 1
|
||||
});
|
||||
} catch (error) {
|
||||
} catch {
|
||||
this._searchState.update(current => ({...current, isSearching: false}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,11 @@ export class PdfReaderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
const serialized = this.pdfViewerService.getSerializedAnnotations();
|
||||
if (serialized && serialized.length > 0) {
|
||||
const cleaned = serialized.map(({id, ...rest}: any) => rest);
|
||||
const cleaned = serialized.map((annotation: any) => {
|
||||
const {id, ...rest} = annotation;
|
||||
void id;
|
||||
return rest;
|
||||
});
|
||||
const data = JSON.stringify(cleaned);
|
||||
this.pdfAnnotationService.saveAnnotations(this.bookId, data).subscribe();
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import {inject, Injectable} from '@angular/core';
|
||||
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
import {API_CONFIG} from '../../../../../core/config/api-config';
|
||||
|
||||
|
||||
+1
@@ -95,6 +95,7 @@ export class FileNamingPatternComponent implements OnInit {
|
||||
}
|
||||
|
||||
onLibraryPatternChange(_library: Library): void {
|
||||
void _library;
|
||||
// Optionally add per-library validation here
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {MetadataMatchWeightsService} from '../../../../shared/service/metadata-match-weights.service';
|
||||
import {Button} from 'primeng/button';
|
||||
import {AppSettingKey, AppSettings} from '../../../../shared/model/app-settings.model';
|
||||
import {AppSettingKey} from '../../../../shared/model/app-settings.model';
|
||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
||||
import {InputNumber} from 'primeng/inputnumber';
|
||||
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ export class MetadataPersistenceSettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
onFilesizeChange(format: keyof SaveToOriginalFileSettings): void {
|
||||
void format;
|
||||
this.settingsHelper.saveSetting(AppSettingKey.METADATA_PERSISTENCE_SETTINGS, this.metadataPersistence);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import {UserSettings} from '../../user-management/user.service';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {CustomFontService} from '../../../../shared/service/custom-font.service';
|
||||
import {CustomFont} from '../../../../shared/model/custom-font.model';
|
||||
import {skip, Subject, takeUntil} from 'rxjs';
|
||||
import {Subject} from 'rxjs';
|
||||
import {addCustomFontsToDropdown} from '../../../../shared/util/custom-font.util';
|
||||
import {Skeleton} from 'primeng/skeleton';
|
||||
import {themes} from '../../../readers/ebook-reader/state/themes.constant';
|
||||
|
||||
@@ -4,7 +4,6 @@ import {FormsModule} from '@angular/forms';
|
||||
import {TooltipModule} from 'primeng/tooltip';
|
||||
import {TranslocoDirective} from '@jsverse/transloco';
|
||||
import {UserService, UserSettings} from '../user-management/user.service';
|
||||
import {ReaderPreferencesService} from './reader-preferences.service';
|
||||
import {EpubReaderPreferencesComponent} from './epub-reader-preferences/epub-reader-preferences-component';
|
||||
import {PdfReaderPreferencesComponent} from './pdf-reader-preferences/pdf-reader-preferences-component';
|
||||
import {CbxReaderPreferencesComponent} from './cbx-reader-preferences/cbx-reader-preferences-component';
|
||||
|
||||
@@ -13,7 +13,6 @@ import {LibraryService} from '../../book/service/library.service';
|
||||
import {Dialog} from 'primeng/dialog';
|
||||
import {Password} from 'primeng/password';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
import {takeUntil} from 'rxjs/operators';
|
||||
import {Subject} from 'rxjs';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {DialogLauncherService} from '../../../shared/services/dialog-launcher.service';
|
||||
|
||||
-1
@@ -6,7 +6,6 @@ import {Password} from 'primeng/password';
|
||||
import {User, UserService, UserUpdateRequest} from '../user-management/user.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {Subject} from 'rxjs';
|
||||
import {takeUntil} from 'rxjs/operators';
|
||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/transloco';
|
||||
|
||||
|
||||
+2
-10
@@ -7,13 +7,6 @@ import {BookService} from '../../../../../book/service/book.service';
|
||||
import {Book} from '../../../../../book/model/book.model';
|
||||
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||
|
||||
interface ScoreRange {
|
||||
label: string;
|
||||
min: number;
|
||||
max: number;
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface ScoreStats {
|
||||
range: string;
|
||||
count: number;
|
||||
@@ -22,10 +15,9 @@ interface ScoreStats {
|
||||
}
|
||||
|
||||
type ScoreChartData = ChartData<'doughnut', number[], string>;
|
||||
type ScoreRangeKey = 'excellent' | 'good' | 'fair' | 'poor' | 'veryPoor';
|
||||
|
||||
const SCORE_RANGE_KEYS = ['excellent', 'good', 'fair', 'poor', 'veryPoor'] as const;
|
||||
|
||||
const SCORE_RANGE_DEFS: { key: typeof SCORE_RANGE_KEYS[number]; min: number; max: number; color: string }[] = [
|
||||
const SCORE_RANGE_DEFS: { key: ScoreRangeKey; min: number; max: number; color: string }[] = [
|
||||
{key: 'excellent', min: 90, max: 100, color: '#16A34A'},
|
||||
{key: 'good', min: 70, max: 89, color: '#22C55E'},
|
||||
{key: 'fair', min: 50, max: 69, color: '#F59E0B'},
|
||||
|
||||
+1
-1
@@ -334,7 +334,7 @@ export class PublicationTimelineChartComponent {
|
||||
|
||||
// Rarity Score: % of books in decades with fewer than 3 books
|
||||
let rareBooks = 0;
|
||||
for (const [_, count] of decadeCounts) {
|
||||
for (const count of decadeCounts.values()) {
|
||||
if (count < 3) rareBooks += count;
|
||||
}
|
||||
const rarityScore = years.length > 0 ? Math.round((rareBooks / years.length) * 100) : 0;
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ export class RatingTasteChartComponent {
|
||||
};
|
||||
|
||||
const datasets = Array.from(dataPoints.entries())
|
||||
.filter(([_, points]) => points.length > 0)
|
||||
.filter(([, points]) => points.length > 0)
|
||||
.map(([label, points]) => ({
|
||||
label: `${label} (${points.length})`,
|
||||
data: points,
|
||||
|
||||
@@ -157,6 +157,7 @@ export class BookUploaderComponent implements OnInit {
|
||||
}
|
||||
|
||||
onRemoveTemplatingFile(event: Event, file: File, removeFileCallback: FileRemoveCallback, _index?: number): void {
|
||||
void _index;
|
||||
// Remove from our tracking array
|
||||
this.files = this.files.filter(f => f.file !== file);
|
||||
|
||||
@@ -172,6 +173,7 @@ export class BookUploaderComponent implements OnInit {
|
||||
}
|
||||
|
||||
uploadFiles(_event: FileUploadHandlerEvent): void {
|
||||
void _event;
|
||||
if (this.value === 'library' && (!this.selectedLibrary || !this.selectedPath)) {
|
||||
this.messageService.add({
|
||||
severity: 'warn',
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
import {Component, inject, OnDestroy} from '@angular/core';
|
||||
import {NotificationEventService} from '../../websocket/notification-event.service';
|
||||
import {LogNotification} from '../../websocket/model/log-notification.model';
|
||||
import {Tag} from 'primeng/tag';
|
||||
import {TranslocoService} from '@jsverse/transloco';
|
||||
import {Subject} from 'rxjs';
|
||||
import {takeUntil} from 'rxjs/operators';
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ export class MetadataProgressWidgetComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
for (const [taskId, task] of Object.entries(tasks)) {
|
||||
for (const taskId of Object.keys(tasks)) {
|
||||
this.lastUpdateMap.set(taskId, now);
|
||||
|
||||
if (this.timeoutHandles.has(taskId)) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import {DialogLauncherService} from '../../../services/dialog-launcher.service';
|
||||
import {BookDialogHelperService} from '../../../../features/book/components/book-browser/book-dialog-helper.service';
|
||||
import {IconDisplayComponent} from '../../../components/icon-display/icon-display.component';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {MenuItem} from 'primeng/api';
|
||||
import {IconSelection} from '../../../service/icon-picker.service';
|
||||
import {TranslocoPipe} from '@jsverse/transloco';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component, computed, effect, ElementRef, inject, OnDestroy, ViewChild} from '@angular/core';
|
||||
import {Component, effect, ElementRef, inject, OnDestroy, ViewChild} from '@angular/core';
|
||||
import {MenuItem} from 'primeng/api';
|
||||
import {LayoutService} from '../layout-main/service/app.layout.service';
|
||||
import {Router, RouterLink} from '@angular/router';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
||||
import { effect, inject, Injectable, PLATFORM_ID, signal } from '@angular/core';
|
||||
import { $t, updatePreset, updateSurfacePalette } from '@primeuix/themes';
|
||||
import { $t } from '@primeuix/themes';
|
||||
import Aura from '@primeuix/themes/aura';
|
||||
import { AppState } from '../model/app-state.model';
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ export function createRxStompConfig(authService: AuthService): RxStompConfig {
|
||||
}
|
||||
},
|
||||
debug: (msg: string): void => {
|
||||
void msg;
|
||||
// console.log(new Date(), msg);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user