From bb0e6cc1a72a1d1cec21a520b1e8619f427b6a10 Mon Sep 17 00:00:00 2001 From: Alex <25013571+alexhb1@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:26:34 +0100 Subject: [PATCH] chore: mechanical lint fixes (#2933) --- frontend/eslint-suppressions.json | 2250 +---------------- frontend/oxlint-suppressions.json | 934 +------ frontend/src/app/app.component.html | 6 +- frontend/src/app/app.component.ts | 45 +- .../app/core/config/transloco-loader.spec.ts | 8 +- .../src/app/core/config/transloco-loader.ts | 4 +- .../src/app/core/custom-reuse-strategy.ts | 6 +- .../security/auth-initialization-service.ts | 4 +- .../core/security/auth-initializer.spec.ts | 14 +- .../src/app/core/security/auth-initializer.ts | 2 +- .../authentication-settings.component.html | 66 +- .../authentication-settings.component.ts | 11 +- .../oidc-callback/oidc-callback.component.ts | 6 +- .../src/app/core/security/oidc.service.ts | 8 +- frontend/src/app/core/security/secure-pipe.ts | 4 +- .../src/app/core/services/loading.service.ts | 10 +- .../post-login-initializer.service.ts | 6 +- .../app/core/services/pwa-update.service.ts | 10 +- .../src/app/core/testing/query-testing.ts | 6 +- .../author-browser.component.html | 52 +- .../author-browser.component.ts | 50 +- .../author-card/author-card.component.html | 8 +- .../author-card/author-card.component.ts | 25 +- .../author-detail.component.html | 24 +- .../author-detail/author-detail.component.ts | 22 +- .../author-editor.component.html | 46 +- .../author-editor/author-editor.component.ts | 17 +- .../author-match/author-match.component.html | 12 +- .../author-match/author-match.component.ts | 27 +- .../author-photo-search.component.html | 14 +- .../author-photo-search.component.ts | 13 +- .../service/author-selection.service.ts | 4 +- .../author-browser/service/author.service.ts | 22 +- .../browse/book-browse-bulk-bar.component.ts | 7 +- ...-browse-column-width-preference.service.ts | 4 +- .../browse/book-browse-detail-line.service.ts | 4 +- .../browse/book-browse-table.component.ts | 17 +- .../add-physical-book-dialog.component.html | 9 +- .../add-physical-book-dialog.component.ts | 16 +- .../additional-file-uploader.component.html | 8 +- .../additional-file-uploader.component.ts | 16 +- .../book-card-lite-component.html | 5 +- .../book-card-lite-component.ts | 13 +- .../book-file-attacher.component.html | 12 +- .../book-file-attacher.component.ts | 17 +- .../book-menu/book-menu.component.ts | 9 +- .../book-notes/book-notes-component.html | 26 +- .../book-notes/book-notes-component.ts | 15 +- .../book-reviews/book-review-service.ts | 8 +- .../book-reviews/book-reviews.component.html | 3 +- .../book-reviews/book-reviews.component.ts | 25 +- .../book-sender/book-sender.component.html | 12 +- .../book-sender/book-sender.component.ts | 10 +- .../bulk-isbn-import-dialog.component.html | 1 + .../bulk-isbn-import-dialog.component.ts | 32 +- .../components/cards/book-card.component.ts | 11 +- .../duplicate-merger.component.html | 51 +- .../duplicate-merger.component.ts | 60 +- .../book-card-overlay-preference.service.ts | 12 +- .../legacy-book-card.component.html | 19 +- .../legacy-book-card.component.spec.ts | 4 +- .../legacy-book-card.component.ts | 44 +- .../library-shelf-menu-items.component.ts | 3 +- .../library-shelf-menu.component.ts | 3 +- ...lock-unlock-metadata-dialog.component.html | 15 +- .../lock-unlock-metadata-dialog.component.ts | 11 +- .../series-page/series-page.component.html | 61 +- .../series-page/series-page.component.ts | 82 +- .../shelf-assigner.component.html | 3 +- .../shelf-assigner.component.ts | 18 +- .../shelf-creator.component.html | 2 +- .../shelf-creator/shelf-creator.component.ts | 10 +- .../shelf-edit-dialog.component.html | 11 +- .../shelf-edit-dialog.component.ts | 12 +- .../book-background-submission.service.ts | 4 +- .../book/data/book-command.service.ts | 4 +- .../features/book/data/book-query.service.ts | 4 +- .../book/data/book-shelf-command.service.ts | 4 +- .../data/shelf-definition-query.service.ts | 4 +- .../book/helpers/read-status.helper.ts | 6 +- .../service/book-dialog-helper.service.ts | 6 +- .../book/service/book-file.service.ts | 31 +- .../book/service/book-menu.service.ts | 6 +- .../service/book-metadata-manage.service.ts | 17 +- .../book/service/book-navigation.service.ts | 6 +- .../book/service/book-patch.service.ts | 15 +- .../book/service/book-socket.service.ts | 8 +- .../app/features/book/service/book.service.ts | 43 +- .../book/service/cbx-reader.service.ts | 8 +- .../service/library-health.service.spec.ts | 4 +- .../book/service/library-health.service.ts | 18 +- .../service/library-shelf-menu.service.ts | 4 +- .../book/service/library.service.spec.ts | 2 +- .../features/book/service/library.service.ts | 20 +- .../features/book/service/metadata-task.ts | 8 +- .../features/book/service/shelf.service.ts | 20 +- .../bookdrop-bulk-edit-dialog.component.html | 29 +- ...okdrop-file-metadata-picker.component.html | 96 +- ...bookdrop-file-metadata-picker.component.ts | 6 +- .../bookdrop-file-review.component.html | 75 +- .../bookdrop-file-review.component.ts | 4 +- ...drop-finalize-result-dialog.component.html | 7 +- ...okdrop-finalize-result-dialog.component.ts | 3 +- ...drop-pattern-extract-dialog.component.html | 27 +- ...okdrop-pattern-extract-dialog.component.ts | 4 +- .../service/bookdrop-file-api.service.ts | 8 +- .../bookdrop/service/bookdrop-file.service.ts | 13 +- .../bookdrop/service/bookdrop.service.ts | 6 +- .../command-palette.component.html | 2 +- .../command-palette.service.ts | 4 +- .../dashboard-scroller.component.ts | 5 +- .../main-dashboard.component.html | 3 +- .../services/dashboard-config.service.ts | 6 +- .../design-system.component.html | 2 +- .../design-system/design-system.component.ts | 6 +- .../forms/device-form.component.ts | 14 +- .../component/magic-shelf-component.html | 86 +- .../component/magic-shelf-component.ts | 29 +- .../service/magic-shelf.service.ts | 9 +- .../book-metadata-center.component.html | 13 +- .../book-metadata-center.component.ts | 24 +- .../book-reading-sessions.component.html | 6 +- .../book-reading-sessions.component.ts | 12 +- .../metadata-editor.component.html | 270 +- .../metadata-editor.component.ts | 55 +- .../metadata-picker.component.ts | 31 +- .../metadata-searcher.component.html | 11 +- .../metadata-searcher.component.spec.ts | 2 +- .../metadata-searcher.component.ts | 5 +- .../metadata-tabs.component.html | 64 +- .../metadata-tabs/metadata-tabs.component.ts | 11 +- .../metadata-viewer.component.html | 87 +- .../metadata-viewer.component.ts | 53 +- .../sidecar-viewer.component.ts | 7 +- .../bulk-metadata-update-component.html | 32 +- .../bulk-metadata-update-component.ts | 13 +- .../cover-search/cover-search.component.html | 17 +- .../metadata-manager.component.html | 34 +- .../metadata-manager.component.ts | 22 +- ...data-advanced-fetch-options.component.html | 41 +- ...tadata-advanced-fetch-options.component.ts | 6 +- .../metadata-fetch-options.component.html | 3 +- .../metadata-fetch-options.component.ts | 9 +- ...ata-provider-field-selector.component.html | 3 +- ...adata-provider-field-selector.component.ts | 9 +- .../metadata-review-dialog-component.html | 26 +- .../metadata-review-dialog-component.ts | 11 +- .../multi-book-metadata-editor-component.html | 7 +- .../multi-book-metadata-editor-component.ts | 6 +- .../multi-book-metadata-fetch-component.html | 5 +- .../multi-book-metadata-fetch-component.ts | 7 +- .../metadata-refresh-submission.service.ts | 4 +- .../metadata/service/sidecar.service.ts | 10 +- .../sources/metadata-source-query.service.ts | 4 +- .../notebook/notebook.component.html | 6 +- .../components/notebook/notebook.component.ts | 10 +- .../notebook/service/notebook.service.ts | 8 +- .../audiobook-player.component.ts | 25 +- .../audiobook-player/audiobook.service.ts | 13 +- .../readers/audiobook-player/index.ts | 2 +- .../cbx-reader/cbx-reader.component.html | 23 +- .../cbx-reader/cbx-reader.component.ts | 195 +- .../core/cbx-page-dimension.service.ts | 10 +- .../cbx-reader/core/cbx-reader-storage.ts | 4 +- .../dialogs/cbx-note-dialog.component.html | 10 +- .../dialogs/cbx-note-dialog.component.ts | 6 +- .../dialogs/cbx-shortcuts-help.component.html | 6 +- .../dialogs/cbx-shortcuts-help.component.ts | 4 +- .../layout/footer/cbx-footer.component.html | 14 +- .../layout/footer/cbx-footer.component.ts | 4 +- .../layout/footer/cbx-footer.service.ts | 16 +- .../layout/header/cbx-header.component.html | 26 +- .../layout/header/cbx-header.component.ts | 4 +- .../layout/header/cbx-header.service.ts | 19 +- .../cbx-quick-settings.component.html | 24 +- .../cbx-quick-settings.service.ts | 28 +- .../layout/sidebar/cbx-sidebar.component.html | 40 +- .../layout/sidebar/cbx-sidebar.service.ts | 14 +- .../renderers/canvas-renderer.component.ts | 2 +- .../core/epub-streaming.service.ts | 10 +- .../ebook-reader/core/event.service.ts | 11 +- .../ebook-reader/core/loader.service.ts | 6 +- .../ebook-reader/core/style.service.ts | 8 +- .../ebook-reader/core/view-manager.service.ts | 22 +- .../dialogs/metadata-dialog.component.html | 2 +- .../dialogs/metadata-dialog.component.ts | 9 +- .../dialogs/note-dialog.component.html | 10 +- .../dialogs/note-dialog.component.ts | 6 +- .../dialogs/settings-dialog.component.html | 38 +- .../dialogs/settings-dialog.component.ts | 13 +- .../dialogs/shortcuts-help.component.html | 6 +- .../dialogs/shortcuts-help.component.ts | 5 +- .../ebook-reader/ebook-reader.component.html | 23 +- .../ebook-reader/ebook-reader.component.ts | 54 +- .../annotation-renderer.service.ts | 16 +- .../annotations/annotation.service.ts | 6 +- .../features/bookmarks/bookmark.service.ts | 7 +- .../features/fonts/custom-font.service.ts | 10 +- .../features/notes/note.service.ts | 12 +- .../features/selection/selection.service.ts | 10 +- .../layout/footer/footer.component.html | 32 +- .../layout/footer/footer.component.ts | 11 +- .../layout/header/header.component.html | 48 +- .../layout/header/header.component.ts | 4 +- .../layout/header/header.service.ts | 18 +- .../header/quick-settings.component.html | 14 +- .../layout/header/quick-settings.component.ts | 9 +- .../layout/panel/panel.component.html | 40 +- .../layout/panel/panel.service.ts | 6 +- .../layout/sidebar/sidebar.component.html | 29 +- .../layout/sidebar/sidebar.service.ts | 30 +- .../shared/selection-popup.component.html | 30 +- .../shared/selection-popup.component.ts | 4 +- .../ebook-reader/state/progress.service.ts | 14 +- .../state/reader-state.service.ts | 14 +- .../components/pdf-sidebar.component.html | 32 +- .../components/pdf-sidebar.component.ts | 8 +- .../pdf-reader/pdf-reader.component.html | 132 +- .../pdf-reader/pdf-reader.component.ts | 51 +- .../services/embedpdf-book.service.ts | 8 +- .../services/pdf-bookmark.service.ts | 6 +- .../pdf-reader/utils/annotation-converter.ts | 4 +- .../series-browser.component.html | 14 +- .../series-browser.component.ts | 20 +- .../series-card/series-card.component.html | 10 +- .../series-card/series-card.component.ts | 12 +- .../series-scroller.component.html | 3 +- .../service/series-data.service.ts | 12 +- .../settings/audit-logs/audit-log.service.ts | 6 +- .../audit-logs/audit-logs.component.html | 13 +- .../audit-logs/audit-logs.component.ts | 8 +- .../custom-fonts/custom-fonts.component.html | 18 +- .../custom-fonts/custom-fonts.component.ts | 13 +- .../font-upload-dialog.component.html | 4 +- .../font-upload-dialog.component.ts | 8 +- .../hardcover-settings-component.html | 13 +- .../hardcover-settings-component.ts | 8 +- .../hardcover-sync-settings.service.ts | 6 +- .../kobo-sync-settings-component.html | 55 +- .../kobo-sync-settings-component.ts | 10 +- .../kobo-sync-settings/kobo.service.ts | 12 +- .../koreader-settings-component.html | 22 +- .../koreader-settings-component.ts | 17 +- .../koreader-settings/koreader.service.ts | 9 +- .../device-settings-component.html | 6 +- ...reate-email-provider-dialog.component.html | 4 +- .../create-email-provider-dialog.component.ts | 11 +- ...eate-email-recipient-dialog.component.html | 2 +- ...create-email-recipient-dialog.component.ts | 10 +- .../email-v2-provider.component.html | 27 +- .../email-v2-provider.component.ts | 14 +- .../email-v2-provider.service.ts | 9 +- .../email-v2-recipient.component.html | 18 +- .../email-v2-recipient.component.ts | 12 +- .../email-v2-recipient.service.ts | 9 +- .../settings/email-v2/email-v2.component.html | 6 +- .../settings/email-v2/email-v2.component.ts | 2 +- .../settings/email-v2/email.service.ts | 9 +- .../file-naming-pattern.component.html | 11 +- .../file-naming-pattern.component.ts | 11 +- .../global-preferences.component.html | 23 +- .../global-preferences.component.ts | 11 +- .../metadata-match-weights-component.html | 6 +- .../metadata-match-weights-component.ts | 14 +- .../metadata-provider-settings.component.html | 24 +- .../metadata-provider-settings.component.ts | 9 +- .../library-metadata-settings.component.html | 8 +- .../library-metadata-settings.component.ts | 16 +- ...tadata-persistence-settings-component.html | 27 +- ...metadata-persistence-settings-component.ts | 5 +- .../metadata-settings-component.html | 13 +- .../metadata-settings-component.ts | 5 +- .../public-reviews-settings-component.html | 9 +- .../settings/opds-settings/opds-settings.html | 40 +- .../settings/opds-settings/opds-settings.ts | 22 +- .../settings/opds-settings/opds.service.ts | 8 +- .../cbx-reader-preferences-component.ts | 3 +- .../epub-reader-preferences-component.html | 26 +- .../epub-reader-preferences-component.ts | 7 +- .../local-settings.component.html | 9 +- .../local-settings.component.ts | 14 +- .../reader-preferences.component.html | 13 +- .../reader-preferences.service.ts | 4 +- .../settings-application-mode.component.ts | 3 +- .../features/settings/settings.component.html | 26 +- .../features/settings/settings.component.ts | 14 +- .../task-management/task-helper.service.ts | 10 +- .../task-management.component.html | 28 +- .../task-management.component.ts | 8 +- .../settings/task-management/task.service.ts | 12 +- .../content-restriction.service.ts | 8 +- ...content-restrictions-editor.component.html | 10 +- .../content-restrictions-editor.component.ts | 21 +- .../create-user-dialog.component.html | 57 +- .../create-user-dialog.component.ts | 15 +- .../user-management.component.html | 90 +- .../user-management.component.ts | 18 +- .../user-management/user-stats.service.ts | 8 +- .../settings/user-management/user.service.ts | 19 +- .../user-profile-dialog.component.html | 22 +- .../user-profile-dialog.component.ts | 11 +- .../dashboard-preferences.component.html | 35 +- .../display-preferences.component.html | 15 +- .../meta-center-view-mode-component.ts | 7 +- ...sidebar-sorting-preferences.component.html | 9 +- .../sidebar-sorting-preferences.component.ts | 7 +- .../view-preferences-parent.component.html | 13 +- .../view-preferences-parent.component.ts | 7 +- .../view-preferences.component.html | 21 +- .../view-preferences.component.ts | 22 +- .../author-universe-chart.component.ts | 2 +- .../top-items-chart.component.html | 8 +- .../top-items-chart.component.ts | 19 +- .../library-stats.component.html | 24 +- .../service/libraries-summary.service.ts | 10 +- .../service/library-filter.service.ts | 13 +- .../shared/stats-chart-theme.service.ts | 6 +- .../book-flow-chart.component.ts | 3 +- .../completion-race-chart.component.ts | 5 +- .../completion-timeline-chart.component.ts | 7 +- .../favorite-days-chart.component.html | 6 +- .../favorite-days-chart.component.ts | 5 +- .../genre-stats-chart.component.ts | 7 +- .../page-turner-chart.component.ts | 7 +- .../peak-hours-chart.component.html | 6 +- .../peak-hours-chart.component.ts | 7 +- .../read-status-chart.component.ts | 4 +- .../reading-clock-chart.component.ts | 2 +- .../reading-progress-chart.component.ts | 2 +- .../reading-session-heatmap.component.ts | 5 +- .../reading-session-timeline.component.html | 6 +- .../reading-session-timeline.component.ts | 9 +- .../series-progress-chart.component.html | 4 +- .../session-archetypes-chart.component.html | 4 +- .../session-archetypes-chart.component.ts | 7 +- .../service/user-chart-config.service.ts | 6 +- .../user-stats/user-stats.component.html | 50 +- .../user-stats/user-stats.component.ts | 4 +- .../bulk-actions-bar.component.ts | 6 +- .../facet-range-inputs.component.ts | 3 +- .../filter-rail/filter-section.component.ts | 6 +- .../book-uploader.component.html | 12 +- .../book-uploader/book-uploader.component.ts | 17 +- .../change-password.component.html | 6 +- .../change-password.component.ts | 9 +- .../components/cover/cover.component.ts | 3 +- .../directory-picker.component.ts | 8 +- .../directory-picker/utility.service.ts | 11 +- .../file-mover/file-mover-component.html | 17 +- .../file-mover/file-mover-component.ts | 20 +- .../icon-display/icon-display.component.ts | 17 +- .../icon-picker/icon-picker-component.ts | 29 +- .../components/icon/app-icon.directive.ts | 7 +- .../components/icon/svg-content.directive.ts | 3 +- ...rary-import-progress-widget-component.html | 6 +- .../live-notification-box.component.ts | 3 +- .../components/login/login.component.html | 5 +- .../components/login/login.component.ts | 12 +- .../metadata-progress-widget-component.html | 22 +- .../metadata-progress-widget-component.ts | 23 +- .../shared/components/setup/login.guard.ts | 10 +- .../components/setup/setup-redirect.guard.ts | 11 +- .../components/setup/setup.component.ts | 10 +- .../shared/components/setup/setup.guard.ts | 11 +- .../shared/components/setup/setup.service.ts | 7 +- .../shared/components/tag/tag.component.ts | 18 +- .../layout-main/app.layout.component.html | 8 +- .../layout-main/app.layout.component.ts | 8 +- .../app.sidebar-item-row.component.html | 4 +- .../app.sidebar-item-row.component.ts | 7 +- .../app.sidebar-section.component.ts | 3 +- .../layout-sidebar/app.sidebar.component.html | 2 +- .../version-changelog-dialog.component.html | 3 +- .../version-changelog-dialog.component.ts | 6 +- .../src/app/shared/layout/layout.service.ts | 6 +- .../app.page-header-breadcrumbs.component.ts | 8 +- .../layout/page-header/page-header.service.ts | 4 +- .../shared/layout/theme/favicon-service.ts | 6 +- .../metadata/metadata-catalog.service.ts | 4 +- .../shared/metadata/metadata-form.builder.ts | 6 +- .../metadata-provider-fields.service.ts | 4 +- .../metadata/metadata-utils.service.spec.ts | 4 +- .../shared/metadata/metadata-utils.service.ts | 6 +- .../app/shared/service/annotation.service.ts | 8 +- .../app/shared/service/app-locale.service.ts | 6 +- .../shared/service/app-settings.service.ts | 18 +- .../app/shared/service/app-theme.service.ts | 12 +- .../app/shared/service/app-ui-font.service.ts | 4 +- .../service/audiobook-session.service.ts | 10 +- .../src/app/shared/service/auth.service.ts | 21 +- .../app/shared/service/book-mark.service.ts | 8 +- .../service/book-metadata-host.service.ts | 6 +- .../shared/service/book-note-v2.service.ts | 8 +- .../app/shared/service/book-note.service.ts | 8 +- .../shared/service/cache-storage.service.ts | 8 +- .../service/cover-scale-preference.service.ts | 9 +- .../app/shared/service/custom-font.service.ts | 26 +- .../shared/service/file-download.service.ts | 8 +- .../shared/service/file-operations.service.ts | 9 +- .../app/shared/service/icon-picker.service.ts | 6 +- .../service/language-resolver.service.ts | 4 +- .../library-import-progress.service.ts | 4 +- .../shared/service/local-settings.service.ts | 8 +- .../shared/service/local-storage.service.ts | 4 +- .../service/metadata-match-weights.service.ts | 9 +- .../service/metadata-progress.service.ts | 17 +- .../service/oidc-group-mapping.service.ts | 8 +- .../app/shared/service/page-title.service.ts | 6 +- .../shared/service/pdf-annotation.service.ts | 8 +- .../service/reading-session-api.service.ts | 6 +- .../shared/service/reading-session.service.ts | 6 +- .../service/route-scroll-position.service.ts | 10 +- .../shared/service/settings-helper.service.ts | 6 +- .../shared/service/startup.service.spec.ts | 24 +- .../src/app/shared/service/startup.service.ts | 18 +- .../app/shared/service/url-helper.service.ts | 10 +- .../src/app/shared/service/version.service.ts | 10 +- .../app/shared/service/wake-lock.service.ts | 6 +- .../services/custom-svg-cache.service.ts | 6 +- .../app/shared/services/custom-svg.service.ts | 11 +- .../services/dialog-launcher.service.spec.ts | 2 +- .../services/dialog-launcher.service.ts | 10 +- .../app-autocomplete-base.directive.ts | 3 +- .../app-autocomplete-popup.component.ts | 2 +- .../app-autocomplete.component.ts | 2 +- .../ui/checkbox/app-checkbox.component.ts | 3 +- .../app-date-picker-base.directive.ts | 7 +- .../shared/ui/field/app-field.component.ts | 3 +- .../shared/ui/input/app-input.component.ts | 3 +- .../ui/menu/app-menu-checkbox.component.ts | 5 +- .../shared/ui/menu/app-menu-item.component.ts | 5 +- .../ui/menu/app-menu-radio.component.ts | 7 +- .../ui/menu/app-menu-trigger.directive.ts | 6 +- .../app/shared/ui/menu/app-menu.component.ts | 13 +- .../src/app/shared/ui/menu/app-menu.spec.ts | 6 +- .../ui/message/app-message.component.ts | 5 +- .../app-number-input.component.ts | 3 +- .../radio-group/app-radio-group.component.ts | 3 +- .../shared/ui/rating/app-rating.component.ts | 3 +- .../ui/select/app-select-base.directive.ts | 5 +- .../shared/ui/slider/app-slider.component.ts | 3 +- .../shared/ui/switch/app-switch.component.ts | 3 +- .../app/shared/ui/tabs/app-tabs.component.ts | 7 +- .../ui/textarea/app-textarea.component.ts | 3 +- .../websocket/notification-event.service.ts | 10 +- .../app/shared/websocket/rx-stomp.service.ts | 8 +- frontend/src/main.ts | 2 +- 447 files changed, 2935 insertions(+), 6862 deletions(-) diff --git a/frontend/eslint-suppressions.json b/frontend/eslint-suppressions.json index 7eda89a96..eb9eb88a0 100644 --- a/frontend/eslint-suppressions.json +++ b/frontend/eslint-suppressions.json @@ -1,298 +1,52 @@ { - "src/app/app.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/app.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 16 - }, - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/core/config/transloco-loader.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/core/custom-reuse-strategy.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/core/security/auth-initialization-service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/core/security/oauth2-management/authentication-settings.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 23 - }, - "@angular-eslint/template/require-switch-default": { - "count": 1 - } - }, - "src/app/core/security/oauth2-management/authentication-settings.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/core/security/oidc.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/core/services/loading.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/core/services/post-login-initializer.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/core/services/pwa-update.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/author-browser/components/author-browser/author-browser.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - }, - "@angular-eslint/template/prefer-at-else": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 16 - } - }, - "src/app/features/author-browser/components/author-browser/author-browser.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 12 - } - }, - "src/app/features/author-browser/components/author-card/author-card.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, "src/app/features/author-browser/components/author-card/author-card.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 7 - }, "@angular-eslint/prefer-signals": { "count": 7 } }, - "src/app/features/author-browser/components/author-detail/author-detail.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/features/author-browser/components/author-detail/author-detail.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/author-browser/components/author-editor/author-editor.component.html": { - "@angular-eslint/template/prefer-at-else": { - "count": 4 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 16 - } - }, "src/app/features/author-browser/components/author-editor/author-editor.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { - "count": 4 - } - }, - "src/app/features/author-browser/components/author-match/author-match.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 4 + "count": 2 } }, "src/app/features/author-browser/components/author-match/author-match.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 10 - } - }, - "src/app/features/author-browser/components/author-photo-search/author-photo-search.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 5 - } - }, - "src/app/features/author-browser/components/author-photo-search/author-photo-search.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - } - }, - "src/app/features/author-browser/service/author-selection.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/author-browser/service/author.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, - "src/app/features/book/browse/book-browse-bulk-bar.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/book/browse/book-browse-column-width-preference.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/browse/book-browse-detail-line.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/browse/book-browse-table.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 8 - } - }, - "src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - }, - "@angular-eslint/template/require-switch-default": { - "count": 1 - } - }, "src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.ts": { "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/book/components/book-card-lite/book-card-lite-component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/book/components/book-card-lite/book-card-lite-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, "@angular-eslint/prefer-signals": { - "count": 4 - } - }, - "src/app/features/book/components/book-file-attacher/book-file-attacher.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 4 + "count": 3 } }, "src/app/features/book/components/book-file-attacher/book-file-attacher.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 7 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, - "src/app/features/book/components/book-menu/book-menu.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 13 - } - }, - "src/app/features/book/components/book-notes/book-notes-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - } - }, "src/app/features/book/components/book-notes/book-notes-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - }, "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/features/book/components/book-reviews/book-review-service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { "count": 1 } }, "src/app/features/book/components/book-reviews/book-reviews.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 5 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 } }, "src/app/features/book/components/book-reviews/book-reviews.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 9 - }, "@angular-eslint/prefer-signals": { - "count": 5 - } - }, - "src/app/features/book/components/book-sender/book-sender.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { "count": 4 } }, "src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.html": { "@angular-eslint/template/require-switch-default": { - "count": 2 - } - }, - "src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 10 + "count": 1 } }, "src/app/features/book/components/cards/book-card.component.html": { @@ -300,276 +54,27 @@ "count": 1 } }, - "src/app/features/book/components/cards/book-card.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/book/components/duplicate-merger/duplicate-merger.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 19 - } - }, - "src/app/features/book/components/duplicate-merger/duplicate-merger.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 10 - }, - "@angular-eslint/prefer-signals": { - "count": 5 - } - }, - "src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/book/components/legacy-book-card/legacy-book-card.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 5 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 6 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/book/components/legacy-book-card/legacy-book-card.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 17 } }, "src/app/features/book/components/library-shelf-menu/library-shelf-menu-items.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/features/book/components/library-shelf-menu/library-shelf-menu.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 7 - } - }, - "src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, "src/app/features/book/components/series-page/series-page.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 3 - }, "@angular-eslint/template/no-non-null-assertion": { "count": 4 - }, - "@angular-eslint/template/prefer-at-empty": { - "count": 1 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 3 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 13 - }, - "@angular-eslint/template/prefer-style-binding": { - "count": 5 - } - }, - "src/app/features/book/components/series-page/series-page.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 18 - }, - "@angular-eslint/prefer-signals": { - "count": 18 - } - }, - "src/app/features/book/components/shelf-assigner/shelf-assigner.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/book/components/shelf-creator/shelf-creator.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.html": { - "@angular-eslint/template/prefer-at-else": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 4 - } - }, - "src/app/features/book/data/book-background-submission.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/data/book-command.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/data/book-query.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/data/book-shelf-command.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/data/shelf-definition-query.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/helpers/read-status.helper.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-dialog-helper.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-file.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 7 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-menu.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-metadata-manage.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-navigation.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-patch.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book-socket.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/book.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 8 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/book/service/cbx-reader.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/library-health.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/book/service/library-shelf-menu.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/library.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/book/service/metadata-task.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/book/service/shelf.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/bookdrop/component/bookdrop-bulk-edit-dialog/bookdrop-bulk-edit-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 11 } }, "src/app/features/bookdrop/component/bookdrop-file-metadata-picker/bookdrop-file-metadata-picker.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 3 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 23 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 5 } }, "src/app/features/bookdrop/component/bookdrop-file-metadata-picker/bookdrop-file-metadata-picker.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 6 } @@ -577,167 +82,39 @@ "src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 1 - }, - "@angular-eslint/template/prefer-at-empty": { - "count": 1 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 20 } }, "src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.ts": { "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { "count": 1 } }, - "src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - } - }, "src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.ts": { "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/bookdrop/service/bookdrop-file-api.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/bookdrop/service/bookdrop-file.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/bookdrop/service/bookdrop.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/command-palette/command-palette.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/command-palette/command-palette.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.html": { "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/dashboard/components/main-dashboard/main-dashboard.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/dashboard/services/dashboard-config.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/design-system/design-system.component.html": { "@angular-eslint/template/no-any": { "count": 4 } }, - "src/app/features/magic-shelf/component/magic-shelf-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 42 - } - }, - "src/app/features/magic-shelf/component/magic-shelf-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 9 - }, - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/magic-shelf/service/magic-shelf.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 5 - } - }, - "src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { - "count": 2 + "count": 1 } }, "src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.html": { "@angular-eslint/template/no-non-null-assertion": { - "count": 53 - }, - "@angular-eslint/template/prefer-at-else": { - "count": 26 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 95 + "count": 31 } }, "src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 16 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 4 } @@ -748,317 +125,69 @@ } }, "src/app/features/metadata/component/book-metadata-center/metadata-picker/metadata-picker.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 10 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 3 } }, - "src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.html": { - "@angular-eslint/template/prefer-at-else": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - } - }, "src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 4 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 23 - } - }, - "src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 } }, "src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 1 - }, "@angular-eslint/template/no-non-null-assertion": { "count": 62 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 9 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 25 } }, "src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 19 - }, - "@angular-eslint/prefer-signals": { - "count": 4 - } - }, - "src/app/features/metadata/component/book-metadata-center/sidecar-viewer/sidecar-viewer.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 11 - } - }, - "src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - } - }, - "src/app/features/metadata/component/cover-search/cover-search.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 6 - } - }, - "src/app/features/metadata/component/metadata-manager/metadata-manager.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 17 - } - }, - "src/app/features/metadata/component/metadata-manager/metadata-manager.component.ts": { "@angular-eslint/prefer-signals": { "count": 3 } }, - "src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 16 - } - }, "src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, - "src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - } - }, "src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.ts": { - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, "src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/metadata/data/metadata-refresh-submission.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/metadata/service/sidecar.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/metadata/sources/metadata-source-query.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/notebook/components/notebook/notebook.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 3 - } - }, - "src/app/features/notebook/components/notebook/notebook.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/notebook/service/notebook.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/readers/audiobook-player/audiobook-player.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 12 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/readers/audiobook-player/audiobook.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/cbx-reader/cbx-reader.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 3 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/features/readers/cbx-reader/cbx-reader.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 18 - }, - "@angular-eslint/prefer-signals": { - "count": 67 - } - }, - "src/app/features/readers/cbx-reader/core/cbx-page-dimension.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 4 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - } - }, - "src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 7 - } - }, - "src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - } - }, - "src/app/features/readers/cbx-reader/layout/header/cbx-header.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 13 - } - }, "src/app/features/readers/cbx-reader/layout/header/cbx-header.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, - "src/app/features/readers/cbx-reader/layout/header/cbx-header.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 12 - } - }, "src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 8 - }, "@angular-eslint/template/no-non-null-assertion": { "count": 2 }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 12 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } @@ -1068,201 +197,50 @@ "count": 4 } }, - "src/app/features/readers/ebook-reader/core/epub-streaming.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/core/event.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/core/loader.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/core/style.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/core/view-manager.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 1 - }, "@angular-eslint/template/no-non-null-assertion": { "count": 2 } }, "src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/readers/ebook-reader/dialogs/note-dialog.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 4 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/readers/ebook-reader/dialogs/note-dialog.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 19 - } - }, "src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 3 } }, - "src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/ebook-reader.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 10 - } - }, "src/app/features/readers/ebook-reader/ebook-reader.component.ts": { "@angular-eslint/prefer-signals": { - "count": 13 - } - }, - "src/app/features/readers/ebook-reader/features/annotations/annotation-renderer.service.ts": { - "@angular-eslint/prefer-service-decorator": { "count": 1 } }, - "src/app/features/readers/ebook-reader/features/bookmarks/bookmark.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/readers/ebook-reader/features/fonts/custom-font.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/layout/footer/footer.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 9 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 7 - } - }, "src/app/features/readers/ebook-reader/layout/footer/footer.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 3 } }, - "src/app/features/readers/ebook-reader/layout/header/header.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 12 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 12 - } - }, - "src/app/features/readers/ebook-reader/layout/header/header.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/layout/header/quick-settings.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 6 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/readers/ebook-reader/layout/header/quick-settings.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, "src/app/features/readers/ebook-reader/layout/panel/panel.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 7 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 13 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, "src/app/features/readers/ebook-reader/layout/sidebar/sidebar.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 6 - }, "@angular-eslint/template/no-non-null-assertion": { "count": 2 }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } @@ -1272,94 +250,29 @@ "count": 4 } }, - "src/app/features/readers/ebook-reader/shared/selection-popup.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 8 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 7 - } - }, "src/app/features/readers/ebook-reader/shared/selection-popup.component.ts": { - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 6 } }, - "src/app/features/readers/ebook-reader/state/reader-state.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/readers/pdf-reader/components/pdf-sidebar.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 7 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/features/readers/pdf-reader/components/pdf-sidebar.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 4 - } - }, "src/app/features/readers/pdf-reader/pdf-reader.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 20 - }, "@angular-eslint/template/no-non-null-assertion": { "count": 2 }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 46 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/features/readers/pdf-reader/pdf-reader.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 19 - } - }, - "src/app/features/series-browser/components/series-browser/series-browser.component.html": { - "@angular-eslint/template/prefer-at-else": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 4 - } - }, - "src/app/features/series-browser/components/series-card/series-card.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 3 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, "src/app/features/series-browser/components/series-card/series-card.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/series-browser/components/series-scroller/series-scroller.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, "src/app/features/series-browser/components/series-scroller/series-scroller.component.ts": { "@angular-eslint/prefer-output-emitter-ref": { "count": 1 @@ -1368,308 +281,29 @@ "count": 2 } }, - "src/app/features/series-browser/service/series-data.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/settings/audit-logs/audit-log.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/audit-logs/audit-logs.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/settings/audit-logs/audit-logs.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 4 - } - }, - "src/app/features/settings/custom-fonts/custom-fonts.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - } - }, - "src/app/features/settings/custom-fonts/custom-fonts.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - } - }, - "src/app/features/settings/custom-fonts/font-upload-dialog/font-upload-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, "src/app/features/settings/custom-fonts/font-upload-dialog/font-upload-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/settings/device-settings/component/hardcover-settings/hardcover-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 5 - } - }, - "src/app/features/settings/device-settings/component/hardcover-settings/hardcover-settings-component.ts": { - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/settings/device-settings/component/hardcover-settings/hardcover-sync-settings.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/device-settings/component/kobo-sync-settings/kobo-sync-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 20 - } - }, - "src/app/features/settings/device-settings/component/kobo-sync-settings/kobo.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/device-settings/component/koreader-settings/koreader-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/features/settings/device-settings/component/koreader-settings/koreader-settings-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - }, - "@angular-eslint/prefer-signals": { - "count": 6 - } - }, - "src/app/features/settings/device-settings/component/koreader-settings/koreader.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/device-settings/device-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/settings/email-v2/create-email-provider-dialog/create-email-provider-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/features/settings/email-v2/create-email-provider-dialog/create-email-provider-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/settings/email-v2/create-email-recipient-dialog/create-email-recipient-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/create-email-recipient-dialog/create-email-recipient-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/settings/email-v2/email-v2-provider/email-v2-provider.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - } - }, - "src/app/features/settings/email-v2/email-v2-provider/email-v2-provider.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email-v2-provider/email-v2-provider.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email-v2-recipient/email-v2-recipient.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 6 - } - }, - "src/app/features/settings/email-v2/email-v2-recipient/email-v2-recipient.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email-v2-recipient/email-v2-recipient.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email-v2.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/settings/email-v2/email.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/file-naming-pattern/file-naming-pattern.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 4 - } - }, - "src/app/features/settings/file-naming-pattern/file-naming-pattern.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/settings/global-preferences/global-preferences.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/features/settings/global-preferences/global-preferences.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/settings/global-preferences/metadata-match-weights/metadata-match-weights-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, "src/app/features/settings/global-preferences/metadata-provider-settings/metadata-provider-settings.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 10 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/features/settings/global-preferences/metadata-provider-settings/metadata-provider-settings.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - } - }, "src/app/features/settings/library-metadata-settings/library-metadata-settings.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 7 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/settings/metadata-settings/metadata-persistence-settings/metadata-persistence-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 9 - } - }, - "src/app/features/settings/metadata-settings/metadata-persistence-settings/metadata-persistence-settings-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/settings/metadata-settings/metadata-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 6 - } - }, - "src/app/features/settings/metadata-settings/metadata-settings-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/settings/metadata-settings/public-reviews-settings/public-reviews-settings-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/settings/opds-settings/opds-settings.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 14 - } - }, - "src/app/features/settings/opds-settings/opds-settings.ts": { - "@angular-eslint/inject-at-top": { - "count": 7 - }, - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/features/settings/opds-settings/opds.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 } }, "src/app/features/settings/reader-preferences/cbx-reader-preferences/cbx-reader-preferences-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 13 - } - }, - "src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/settings/reader-preferences/local-settings/local-settings.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, "src/app/features/settings/reader-preferences/local-settings/local-settings.component.ts": { "@angular-eslint/no-async-lifecycle-method": { "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 3 } }, "src/app/features/settings/reader-preferences/pdf-reader-preferences/pdf-reader-preferences-component.ts": { @@ -1677,400 +311,78 @@ "count": 1 } }, - "src/app/features/settings/reader-preferences/reader-preferences.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 5 - } - }, - "src/app/features/settings/reader-preferences/reader-preferences.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/settings/reader-preferences/settings-application-mode/settings-application-mode.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/settings/settings.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 13 - } - }, - "src/app/features/settings/settings.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/features/settings/task-management/task-helper.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/settings/task-management/task-management.component.html": { "@angular-eslint/template/no-non-null-assertion": { "count": 3 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 3 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/features/settings/task-management/task.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/user-management/content-restriction.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/user-management/content-restrictions-editor/content-restrictions-editor.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 } }, "src/app/features/settings/user-management/content-restrictions-editor/content-restrictions-editor.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - }, - "@angular-eslint/prefer-output-emitter-ref": { - "count": 1 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, - "src/app/features/settings/user-management/create-user-dialog/create-user-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 28 - } - }, - "src/app/features/settings/user-management/create-user-dialog/create-user-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 7 - } - }, - "src/app/features/settings/user-management/user-management.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 39 - } - }, - "src/app/features/settings/user-management/user-management.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/features/settings/user-management/user-stats.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/settings/user-management/user.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/features/settings/user-profile-dialog/user-profile-dialog.component.html": { - "@angular-eslint/template/prefer-at-else": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/features/settings/user-profile-dialog/user-profile-dialog.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 5 - } - }, - "src/app/features/settings/view-preferences-parent/dashboard-preferences/dashboard-preferences.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 12 - } - }, - "src/app/features/settings/view-preferences-parent/display-preferences/display-preferences.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 5 - } - }, - "src/app/features/settings/view-preferences-parent/meta-center-view-mode/meta-center-view-mode-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/settings/view-preferences-parent/sidebar-sorting-preferences/sidebar-sorting-preferences.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/features/settings/view-preferences-parent/sidebar-sorting-preferences/sidebar-sorting-preferences.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/settings/view-preferences-parent/view-preferences-parent.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 6 - } - }, - "src/app/features/settings/view-preferences-parent/view-preferences-parent.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 10 - } - }, - "src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 9 - } - }, - "src/app/features/stats/component/library-stats/charts/top-items-chart/top-items-chart.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 4 - } - }, "src/app/features/stats/component/library-stats/charts/top-items-chart/top-items-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, "src/app/features/stats/component/library-stats/library-stats.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 11 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/features/stats/component/library-stats/service/libraries-summary.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/stats/component/library-stats/service/library-filter.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/features/stats/component/shared/stats-chart-theme.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/stats/component/user-stats/charts/book-flow-chart/book-flow-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, "src/app/features/stats/component/user-stats/charts/completion-race-chart/completion-race-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, "src/app/features/stats/component/user-stats/charts/completion-timeline-chart/completion-timeline-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/stats/component/user-stats/charts/favorite-days-chart/favorite-days-chart.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/features/stats/component/user-stats/charts/favorite-days-chart/favorite-days-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, "src/app/features/stats/component/user-stats/charts/genre-stats-chart/genre-stats-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/stats/component/user-stats/charts/page-turner-chart/page-turner-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/features/stats/component/user-stats/charts/peak-hours-chart/peak-hours-chart.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/features/stats/component/user-stats/charts/peak-hours-chart/peak-hours-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, "src/app/features/stats/component/user-stats/charts/reading-session-heatmap/reading-session-heatmap.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/stats/component/user-stats/charts/reading-session-timeline/reading-session-timeline.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, "src/app/features/stats/component/user-stats/charts/reading-session-timeline/reading-session-timeline.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, "@angular-eslint/prefer-signals": { "count": 2 } }, - "src/app/features/stats/component/user-stats/charts/series-progress-chart/series-progress-chart.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - } - }, - "src/app/features/stats/component/user-stats/charts/session-archetypes-chart/session-archetypes-chart.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - } - }, "src/app/features/stats/component/user-stats/charts/session-archetypes-chart/session-archetypes-chart.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, "@angular-eslint/prefer-signals": { "count": 1 } }, - "src/app/features/stats/component/user-stats/service/user-chart-config.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, "src/app/features/stats/component/user-stats/user-stats.component.html": { - "@angular-eslint/template/button-has-type": { - "count": 2 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 23 - }, "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/shared/browse/bulk-actions/bulk-actions-bar.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/shared/browse/filter-rail/facet-range-inputs.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/browse/filter-rail/filter-section.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, "src/app/shared/browse/grid/grid-item.component.ts": { "@angular-eslint/template/require-switch-default": { "count": 1 } }, - "src/app/shared/components/book-uploader/book-uploader.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 4 - }, - "@angular-eslint/template/require-switch-default": { - "count": 1 - } - }, "src/app/shared/components/book-uploader/book-uploader.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 7 - }, "@angular-eslint/prefer-signals": { - "count": 3 - } - }, - "src/app/shared/components/change-password/change-password.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/shared/components/change-password/change-password.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - } - }, - "src/app/shared/components/cover/cover.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/components/directory-picker/directory-picker.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/no-duplicates-in-metadata-arrays": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/shared/components/directory-picker/utility.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { "count": 1 } }, @@ -2079,564 +391,12 @@ "count": 4 } }, - "src/app/shared/components/file-mover/file-mover-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/shared/components/file-mover/file-mover-component.ts": { - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, "src/app/shared/components/icon-display/icon-display.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, "@angular-eslint/prefer-signals": { "count": 6 }, - "@angular-eslint/template/prefer-class-binding": { - "count": 2 - }, "@angular-eslint/template/prefer-style-binding": { "count": 3 } - }, - "src/app/shared/components/icon-picker/icon-picker-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - }, - "@angular-eslint/prefer-signals": { - "count": 8 - } - }, - "src/app/shared/components/icon/app-icon.directive.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/components/icon/svg-content.directive.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/shared/components/library-import-progress-widget/library-import-progress-widget-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/shared/components/live-notification-box/live-notification-box.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/components/login/login.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/shared/components/login/login.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - } - }, - "src/app/shared/components/metadata-progress-widget/metadata-progress-widget-component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 8 - } - }, - "src/app/shared/components/metadata-progress-widget/metadata-progress-widget-component.ts": { - "@angular-eslint/inject-at-top": { - "count": 7 - } - }, - "src/app/shared/components/setup/login.guard.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/components/setup/setup-redirect.guard.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/components/setup/setup.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/shared/components/setup/setup.guard.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/components/setup/setup.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/components/tag/tag.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 8 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/shared/layout/layout-main/app.layout.component.html": { - "@angular-eslint/template/prefer-class-binding": { - "count": 1 - }, - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 3 - } - }, - "src/app/shared/layout/layout-main/app.layout.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/shared/layout/layout-sidebar/app.sidebar-item-row.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 2 - } - }, - "src/app/shared/layout/layout-sidebar/app.sidebar-item-row.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/shared/layout/layout-sidebar/app.sidebar-section.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/layout/layout-sidebar/app.sidebar.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/shared/layout/layout-sidebar/version-changelog-dialog/version-changelog-dialog.component.html": { - "@angular-eslint/template/prefer-self-closing-tags": { - "count": 1 - } - }, - "src/app/shared/layout/layout-sidebar/version-changelog-dialog/version-changelog-dialog.component.ts": { - "@angular-eslint/prefer-signals": { - "count": 1 - } - }, - "src/app/shared/layout/layout.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/layout/page-header/app.page-header-breadcrumbs.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/template/prefer-class-binding": { - "count": 1 - } - }, - "src/app/shared/layout/page-header/page-header.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/layout/theme/favicon-service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/metadata/metadata-catalog.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/metadata/metadata-form.builder.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/metadata/metadata-provider-fields.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/metadata/metadata-utils.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/annotation.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/app-locale.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/app-settings.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/shared/service/app-theme.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/app-ui-font.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/audiobook-session.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/auth.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 4 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/book-mark.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/book-metadata-host.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/book-note-v2.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/book-note.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/cache-storage.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/cover-scale-preference.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/custom-font.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - }, - "@angular-eslint/prefer-signals": { - "count": 2 - } - }, - "src/app/shared/service/file-download.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/file-operations.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/icon-picker.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/language-resolver.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/library-import-progress.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/local-settings.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/local-storage.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/metadata-match-weights.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/metadata-progress.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/oidc-group-mapping.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/page-title.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/pdf-annotation.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/reading-session-api.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/reading-session.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/route-scroll-position.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/settings-helper.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/startup.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/url-helper.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/version.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/service/wake-lock.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/services/custom-svg-cache.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/services/custom-svg.service.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - }, - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/services/dialog-launcher.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/ui/autocomplete/app-autocomplete-base.directive.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/autocomplete/app-autocomplete-popup.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/checkbox/app-checkbox.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/date-picker/app-date-picker-base.directive.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/shared/ui/field/app-field.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/input/app-input.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/menu/app-menu-checkbox.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/shared/ui/menu/app-menu-item.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/shared/ui/menu/app-menu-radio.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/shared/ui/menu/app-menu-trigger.directive.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/shared/ui/menu/app-menu.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 6 - } - }, - "src/app/shared/ui/menu/app-menu.spec.ts": { - "@angular-eslint/template/button-has-type": { - "count": 3 - } - }, - "src/app/shared/ui/message/app-message.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/shared/ui/number-input/app-number-input.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/radio-group/app-radio-group.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/rating/app-rating.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/select/app-select-base.directive.ts": { - "@angular-eslint/inject-at-top": { - "count": 2 - } - }, - "src/app/shared/ui/slider/app-slider.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/switch/app-switch.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/ui/tabs/app-tabs.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 3 - } - }, - "src/app/shared/ui/textarea/app-textarea.component.ts": { - "@angular-eslint/inject-at-top": { - "count": 1 - } - }, - "src/app/shared/websocket/notification-event.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } - }, - "src/app/shared/websocket/rx-stomp.service.ts": { - "@angular-eslint/prefer-service-decorator": { - "count": 1 - } } } \ No newline at end of file diff --git a/frontend/oxlint-suppressions.json b/frontend/oxlint-suppressions.json index 3367b0174..5494a1076 100644 --- a/frontend/oxlint-suppressions.json +++ b/frontend/oxlint-suppressions.json @@ -14,14 +14,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 18 - } - }, - "src/app/core/config/transloco-loader.spec.ts": { - "typescript/dot-notation": { - "count": 13 } }, "src/app/core/config/transloco-loader.ts": { @@ -39,11 +31,6 @@ "count": 1 } }, - "src/app/core/security/auth-initializer.ts": { - "typescript/no-deprecated": { - "count": 1 - } - }, "src/app/core/security/auth-interceptor.service.ts": { "typescript/no-unsafe-return": { "count": 1 @@ -61,9 +48,6 @@ }, "typescript/no-unsafe-member-access": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/core/security/oidc-callback/oidc-callback.component.ts": { @@ -72,9 +56,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/core/security/oidc.service.ts": { @@ -89,14 +70,6 @@ }, "typescript/no-unsafe-return": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/core/security/secure-pipe.ts": { - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/core/services/loading.service.ts": { @@ -105,9 +78,6 @@ }, "typescript/no-unnecessary-condition": { "count": 3 - }, - "typescript/prefer-optional-chain": { - "count": 2 } }, "src/app/core/services/pwa-update.service.ts": { @@ -116,20 +86,11 @@ }, "typescript/no-unsafe-member-access": { "count": 2 - }, - "typescript/prefer-optional-chain": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/core/testing/query-testing.ts": { "anti-slop/no-unknown-parameters": { "count": 1 - }, - "typescript/no-deprecated": { - "count": 3 } }, "src/app/features/author-browser/components/author-browser/author-browser.component.ts": { @@ -138,12 +99,6 @@ }, "typescript/no-unnecessary-condition": { "count": 5 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 14 } }, "src/app/features/author-browser/components/author-card/author-card.component.ts": { @@ -155,17 +110,11 @@ }, "typescript/no-unsafe-assignment": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/author-browser/components/author-detail/author-detail.component.ts": { "typescript/no-unnecessary-condition": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 8 } }, "src/app/features/author-browser/components/author-editor/author-editor.component.ts": { @@ -180,14 +129,6 @@ }, "typescript/no-unsafe-member-access": { "count": 7 - }, - "typescript/prefer-readonly": { - "count": 4 - } - }, - "src/app/features/author-browser/components/author-match/author-match.component.ts": { - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/author-browser/components/author-photo-search/author-photo-search.component.ts": { @@ -199,9 +140,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/author-browser/service/author-selection.service.ts": { @@ -215,9 +153,6 @@ }, "typescript/no-unsafe-argument": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/book/browse/book-browse-column-width-preference.service.ts": { @@ -272,9 +207,6 @@ }, "typescript/no-unsafe-member-access": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.ts": { @@ -289,14 +221,6 @@ }, "typescript/no-unsafe-member-access": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 8 - } - }, - "src/app/features/book/components/book-card-lite/book-card-lite-component.ts": { - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/book/components/book-file-attacher/book-file-attacher.component.ts": { @@ -311,9 +235,6 @@ }, "typescript/no-unsafe-member-access": { "count": 5 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/book/components/book-menu/book-menu.component.ts": { @@ -323,18 +244,7 @@ }, "src/app/features/book/components/book-notes/book-notes-component.ts": { "typescript/no-unnecessary-condition": { - "count": 3 - }, - "typescript/prefer-optional-chain": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 - } - }, - "src/app/features/book/components/book-reviews/book-review-service.ts": { - "typescript/prefer-readonly": { - "count": 1 + "count": 2 } }, "src/app/features/book/components/book-reviews/book-reviews.component.ts": { @@ -342,16 +252,7 @@ "count": 1 }, "typescript/no-unnecessary-condition": { - "count": 7 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-optional-chain": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 7 + "count": 6 } }, "src/app/features/book/components/book-sender/book-sender.component.ts": { @@ -366,9 +267,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.ts": { @@ -386,9 +284,6 @@ }, "typescript/prefer-promise-reject-errors": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/book/components/cards/book-card.component.ts": { @@ -397,9 +292,6 @@ } }, "src/app/features/book/components/duplicate-merger/duplicate-merger.component.ts": { - "typescript/no-deprecated": { - "count": 2 - }, "typescript/no-unnecessary-condition": { "count": 2 }, @@ -409,9 +301,6 @@ "typescript/no-unsafe-member-access": { "count": 2 }, - "typescript/prefer-readonly": { - "count": 1 - }, "typescript/switch-exhaustiveness-check": { "count": 1 } @@ -422,12 +311,6 @@ }, "typescript/no-unnecessary-condition": { "count": 8 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/book/components/legacy-book-card/legacy-book-card.component.spec.ts": { @@ -437,10 +320,7 @@ }, "src/app/features/book/components/legacy-book-card/legacy-book-card.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { - "count": 4 - }, - "typescript/no-deprecated": { - "count": 1 + "count": 3 }, "typescript/no-floating-promises": { "count": 2 @@ -448,17 +328,8 @@ "typescript/no-unnecessary-condition": { "count": 5 }, - "typescript/no-unnecessary-template-expression": { - "count": 1 - }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, "typescript/no-unsafe-argument": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 14 } }, "src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts": { @@ -467,9 +338,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/book/components/series-page/series-page.component.ts": { @@ -490,12 +358,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 15 } }, "src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts": { @@ -516,9 +378,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 9 } }, "src/app/features/book/components/shelf-creator/shelf-creator.component.spec.ts": { @@ -532,9 +391,6 @@ }, "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.ts": { @@ -546,9 +402,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/book/data/book-command-pending-state.ts": { @@ -602,9 +455,6 @@ }, "anti-slop/no-unknown-parameters": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/book/service/book-file.service.ts": { @@ -622,12 +472,6 @@ }, "typescript/no-unsafe-return": { "count": 5 - }, - "typescript/prefer-nullish-coalescing": { - "count": 5 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/book/service/book-menu.service.ts": { @@ -641,37 +485,17 @@ "src/app/features/book/service/book-metadata-manage.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 3 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/book/service/book-patch.service.ts": { "anti-slop/no-known-value-widening": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 4 - } - }, - "src/app/features/book/service/book-socket.service.ts": { - "typescript/no-unsafe-enum-comparison": { - "count": 1 } }, "src/app/features/book/service/book.service.ts": { "anti-slop/no-known-value-widening": { "count": 1 }, - "typescript/dot-notation": { - "count": 2 - }, - "typescript/no-deprecated": { - "count": 4 - }, "typescript/no-unnecessary-condition": { "count": 1 }, @@ -684,30 +508,16 @@ "typescript/no-unsafe-return": { "count": 2 }, - "typescript/prefer-readonly": { - "count": 8 - }, "typescript/switch-exhaustiveness-check": { "count": 1 } }, - "src/app/features/book/service/cbx-reader.service.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/features/book/service/library-health.service.ts": { - "typescript/no-deprecated": { - "count": 1 - }, "typescript/no-unsafe-assignment": { "count": 1 }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/book/service/library-shelf-menu.service.ts": { @@ -715,24 +525,6 @@ "count": 1 } }, - "src/app/features/book/service/library.service.ts": { - "typescript/no-deprecated": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 - } - }, - "src/app/features/book/service/metadata-task.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/features/book/service/shelf.service.ts": { - "typescript/prefer-readonly": { - "count": 5 - } - }, "src/app/features/bookdrop/component/bookdrop-bulk-edit-dialog/bookdrop-bulk-edit-dialog.component.ts": { "anti-slop/no-unsafe-dictionary-type": { "count": 1 @@ -797,9 +589,6 @@ "typescript/no-unsafe-member-access": { "count": 2 }, - "typescript/prefer-optional-chain": { - "count": 1 - }, "typescript/prefer-promise-reject-errors": { "count": 1 } @@ -824,19 +613,6 @@ }, "typescript/no-unsafe-member-access": { "count": 4 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - } - }, - "src/app/features/bookdrop/service/bookdrop-file-api.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/features/bookdrop/service/bookdrop.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/command-palette/command-palette.component.ts": { @@ -855,16 +631,6 @@ "count": 3 } }, - "src/app/features/design-system/design-system.component.ts": { - "typescript/no-deprecated": { - "count": 2 - } - }, - "src/app/features/design-system/forms/device-form.component.ts": { - "typescript/no-deprecated": { - "count": 7 - } - }, "src/app/features/library-creator/library-creator.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 5 @@ -881,7 +647,7 @@ "count": 1 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 23 + "count": 21 }, "typescript/consistent-type-assertions": { "count": 1 @@ -889,9 +655,6 @@ "typescript/no-unnecessary-condition": { "count": 9 }, - "typescript/no-unnecessary-type-assertion": { - "count": 2 - }, "typescript/no-unsafe-argument": { "count": 5 }, @@ -900,9 +663,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/magic-shelf/service/magic-shelf-utils.ts": { @@ -938,9 +698,6 @@ "typescript/no-unsafe-member-access": { "count": 2 }, - "typescript/prefer-readonly": { - "count": 12 - }, "typescript/require-await": { "count": 2 } @@ -948,9 +705,6 @@ "src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/no-unnecessary-template-expression": { - "count": 1 } }, "src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts": { @@ -961,14 +715,11 @@ "count": 3 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 19 + "count": 16 }, "typescript/no-unnecessary-condition": { "count": 9 }, - "typescript/no-unnecessary-type-assertion": { - "count": 3 - }, "typescript/no-unsafe-assignment": { "count": 58 }, @@ -977,15 +728,6 @@ }, "typescript/no-unsafe-member-access": { "count": 4 - }, - "typescript/prefer-nullish-coalescing": { - "count": 2 - }, - "typescript/prefer-optional-chain": { - "count": 2 - }, - "typescript/prefer-readonly": { - "count": 11 } }, "src/app/features/metadata/component/book-metadata-center/metadata-picker/metadata-picker.component.ts": { @@ -996,14 +738,11 @@ "count": 3 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 49 + "count": 48 }, "typescript/no-unnecessary-condition": { "count": 27 }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, "typescript/no-unsafe-argument": { "count": 1 }, @@ -1018,25 +757,11 @@ }, "typescript/no-unsafe-return": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 2 - }, - "typescript/prefer-readonly": { - "count": 7 - } - }, - "src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.spec.ts": { - "typescript/prefer-optional-chain": { - "count": 1 } }, "src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts": { @@ -1054,14 +779,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 18 - } - }, - "src/app/features/metadata/component/book-metadata-center/sidecar-viewer/sidecar-viewer.component.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.ts": { @@ -1107,12 +824,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 7 } }, "src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.ts": { @@ -1127,25 +838,16 @@ }, "typescript/no-unsafe-member-access": { "count": 4 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.ts": { "typescript/no-unsafe-argument": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.ts": { @@ -1160,9 +862,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.ts": { @@ -1174,35 +873,21 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.ts": { "typescript/no-unsafe-argument": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/features/metadata/service/sidecar.service.ts": { - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/features/notebook/components/notebook/notebook.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/readers/audiobook-player/audiobook-player.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { - "count": 3 + "count": 1 }, "typescript/no-floating-promises": { "count": 9 @@ -1210,14 +895,8 @@ "typescript/no-unnecessary-condition": { "count": 75 }, - "typescript/no-unnecessary-type-assertion": { - "count": 2 - }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 9 } }, "src/app/features/readers/audiobook-player/audiobook.service.ts": { @@ -1226,19 +905,11 @@ }, "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 - } - }, - "src/app/features/readers/audiobook-player/index.ts": { - "typescript/consistent-type-exports": { - "count": 1 } }, "src/app/features/readers/cbx-reader/cbx-reader.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { - "count": 54 + "count": 47 }, "typescript/no-floating-promises": { "count": 1 @@ -1249,27 +920,11 @@ "typescript/no-unnecessary-condition": { "count": 15 }, - "typescript/no-unnecessary-type-assertion": { - "count": 7 - }, "typescript/no-unsafe-assignment": { "count": 2 }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 34 - } - }, - "src/app/features/readers/cbx-reader/core/cbx-page-dimension.service.ts": { - "typescript/prefer-readonly": { - "count": 3 - } - }, - "src/app/features/readers/cbx-reader/core/cbx-reader-storage.ts": { - "typescript/prefer-nullish-coalescing": { - "count": 1 } }, "src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.ts": { @@ -1290,48 +945,19 @@ "count": 1 } }, - "src/app/features/readers/cbx-reader/layout/footer/cbx-footer.service.ts": { - "typescript/prefer-readonly": { - "count": 8 - } - }, - "src/app/features/readers/cbx-reader/layout/header/cbx-header.service.ts": { - "typescript/prefer-readonly": { - "count": 9 - } - }, "src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 2 } }, - "src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.service.ts": { - "typescript/prefer-readonly": { - "count": 14 - } - }, - "src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.service.ts": { - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 - } - }, "src/app/features/readers/cbx-reader/renderers/canvas-renderer.component.ts": { "typescript/no-unnecessary-condition": { "count": 8 - }, - "typescript/prefer-includes": { - "count": 2 } }, "src/app/features/readers/ebook-reader/core/epub-streaming.service.ts": { "anti-slop/no-unsafe-dictionary-type": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/features/readers/ebook-reader/core/event.service.ts": { @@ -1343,17 +969,11 @@ }, "typescript/no-unnecessary-condition": { "count": 9 - }, - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/features/readers/ebook-reader/core/style.service.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/readers/ebook-reader/core/view-manager.service.ts": { @@ -1364,24 +984,13 @@ "count": 1 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 6 + "count": 2 }, "typescript/no-unnecessary-condition": { "count": 2 }, - "typescript/no-unnecessary-type-assertion": { - "count": 4 - }, "typescript/no-unsafe-return": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 4 - } - }, - "src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/readers/ebook-reader/dialogs/note-dialog.component.ts": { @@ -1395,9 +1004,6 @@ "src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.ts": { @@ -1418,44 +1024,29 @@ "typescript/no-unnecessary-condition": { "count": 6 }, - "typescript/prefer-readonly": { - "count": 15 - }, "typescript/switch-exhaustiveness-check": { "count": 1 } }, "src/app/features/readers/ebook-reader/features/annotations/annotation-renderer.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { - "count": 5 + "count": 1 }, "typescript/no-floating-promises": { "count": 1 }, - "typescript/no-unnecessary-type-assertion": { - "count": 4 - }, "typescript/no-useless-default-assignment": { "count": 4 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/readers/ebook-reader/features/annotations/annotation.service.ts": { "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/readers/ebook-reader/features/bookmarks/bookmark.service.ts": { "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/features/readers/ebook-reader/features/fonts/custom-font.service.ts": { @@ -1464,46 +1055,16 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/features/readers/ebook-reader/features/notes/note.service.ts": { - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/readers/ebook-reader/features/selection/selection.service.ts": { "typescript/no-floating-promises": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/readers/ebook-reader/layout/footer/footer.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 2 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/features/readers/ebook-reader/layout/header/header.service.ts": { - "typescript/prefer-readonly": { - "count": 9 - } - }, - "src/app/features/readers/ebook-reader/layout/header/quick-settings.component.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/readers/ebook-reader/layout/panel/panel.component.ts": { @@ -1520,23 +1081,6 @@ }, "typescript/no-unnecessary-condition": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 3 - } - }, - "src/app/features/readers/ebook-reader/layout/sidebar/sidebar.service.ts": { - "anti-slop/require-safety-comment-for-type-assertion": { - "count": 1 - }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 3 - }, - "typescript/prefer-readonly": { - "count": 9 } }, "src/app/features/readers/ebook-reader/shared/header-footer.util.ts": { @@ -1552,9 +1096,6 @@ "src/app/features/readers/ebook-reader/state/progress.service.ts": { "typescript/no-unnecessary-condition": { "count": 7 - }, - "typescript/prefer-readonly": { - "count": 7 } }, "src/app/features/readers/ebook-reader/state/reader-state.service.ts": { @@ -1563,12 +1104,6 @@ }, "typescript/no-unnecessary-condition": { "count": 11 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/readers/pdf-reader/pdf-reader.component.ts": { @@ -1579,7 +1114,7 @@ "count": 2 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 19 + "count": 18 }, "typescript/no-base-to-string": { "count": 1 @@ -1593,20 +1128,11 @@ "typescript/no-unnecessary-condition": { "count": 14 }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, "typescript/no-unsafe-argument": { "count": 1 }, - "typescript/prefer-readonly": { - "count": 16 - }, "typescript/require-await": { "count": 1 - }, - "typescript/use-unknown-in-catch-callback-variable": { - "count": 2 } }, "src/app/features/readers/pdf-reader/services/embedpdf-book.service.ts": { @@ -1617,7 +1143,7 @@ "count": 3 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 26 + "count": 24 }, "typescript/no-redundant-type-constituents": { "count": 2 @@ -1625,31 +1151,19 @@ "typescript/no-unnecessary-condition": { "count": 18 }, - "typescript/no-unnecessary-type-assertion": { - "count": 2 - }, "typescript/no-unsafe-enum-comparison": { "count": 1 }, "typescript/no-unsafe-member-access": { "count": 2 }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, "typescript/prefer-promise-reject-errors": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/readers/pdf-reader/services/pdf-bookmark.service.ts": { "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/readers/pdf-reader/utils/annotation-converter.ts": { @@ -1660,7 +1174,7 @@ "count": 8 }, "anti-slop/require-safety-comment-for-type-assertion": { - "count": 24 + "count": 23 }, "typescript/consistent-type-assertions": { "count": 3 @@ -1668,9 +1182,6 @@ "typescript/no-unnecessary-condition": { "count": 8 }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, "typescript/no-unsafe-argument": { "count": 1 }, @@ -1682,33 +1193,16 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-optional-chain": { - "count": 1 - } - }, - "src/app/features/series-browser/components/series-browser/series-browser.component.ts": { - "typescript/prefer-readonly": { - "count": 10 } }, "src/app/features/series-browser/components/series-card/series-card.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/series-browser/service/series-data.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/settings/audit-logs/audit-logs.component.ts": { @@ -1731,9 +1225,6 @@ "src/app/features/settings/custom-fonts/custom-fonts.component.ts": { "typescript/no-floating-promises": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/settings/custom-fonts/font-upload-dialog/font-upload-dialog.component.ts": { @@ -1745,14 +1236,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 - } - }, - "src/app/features/settings/device-settings/component/hardcover-settings/hardcover-settings-component.ts": { - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 } }, "src/app/features/settings/device-settings/component/kobo-sync-settings/kobo-sync-settings-component.ts": { @@ -1761,33 +1244,16 @@ }, "typescript/no-unnecessary-condition": { "count": 19 - }, - "typescript/prefer-readonly": { - "count": 4 - }, - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 - } - }, - "src/app/features/settings/device-settings/component/kobo-sync-settings/kobo.service.ts": { - "typescript/no-unnecessary-template-expression": { - "count": 2 } }, "src/app/features/settings/device-settings/component/koreader-settings/koreader-settings-component.ts": { "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 } }, "src/app/features/settings/device-settings/component/koreader-settings/koreader.service.ts": { "anti-slop/no-known-value-widening": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/settings/email-v2/create-email-provider-dialog/create-email-provider-dialog.component.ts": { @@ -1799,9 +1265,6 @@ }, "typescript/no-unsafe-member-access": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/settings/email-v2/create-email-recipient-dialog/create-email-recipient-dialog.component.ts": { @@ -1813,47 +1276,11 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 4 - } - }, - "src/app/features/settings/email-v2/email-v2-provider/email-v2-provider.component.ts": { - "typescript/prefer-readonly": { - "count": 6 - } - }, - "src/app/features/settings/email-v2/email-v2-provider/email-v2-provider.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email-v2-recipient/email-v2-recipient.component.ts": { - "typescript/prefer-readonly": { - "count": 5 - } - }, - "src/app/features/settings/email-v2/email-v2-recipient/email-v2-recipient.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email-v2.component.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/features/settings/email-v2/email.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/settings/file-naming-pattern/file-naming-pattern.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/settings/global-preferences/global-preferences.component.ts": { @@ -1862,25 +1289,16 @@ }, "typescript/no-unnecessary-condition": { "count": 4 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/settings/global-preferences/metadata-match-weights/metadata-match-weights-component.ts": { "typescript/no-unsafe-assignment": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 7 } }, "src/app/features/settings/global-preferences/metadata-provider-settings/metadata-provider-settings.component.ts": { "typescript/no-unnecessary-condition": { "count": 29 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/settings/library-metadata-settings/library-metadata-settings.component.ts": { @@ -1889,12 +1307,6 @@ }, "typescript/no-unnecessary-condition": { "count": 8 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 7 } }, "src/app/features/settings/metadata-settings/metadata-persistence-settings/metadata-persistence-settings-component.ts": { @@ -1921,21 +1333,10 @@ "count": 1 }, "typescript/no-unsafe-assignment": { - "count": 2 + "count": 1 }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 - }, - "unicorn/no-new-array": { - "count": 1 - } - }, - "src/app/features/settings/opds-settings/opds.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/settings/reader-preferences/cbx-reader-preferences/cbx-reader-preferences-component.ts": { @@ -1952,17 +1353,11 @@ }, "typescript/prefer-optional-chain": { "count": 1 - }, - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 } }, "src/app/features/settings/reader-preferences/local-settings/local-settings.component.ts": { "typescript/no-misused-promises": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 4 } }, "src/app/features/settings/reader-preferences/reader-preferences.service.ts": { @@ -1988,17 +1383,11 @@ }, "typescript/no-unsafe-assignment": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/settings/task-management/task-helper.service.ts": { "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/features/settings/task-management/task-management.component.ts": { @@ -2010,39 +1399,16 @@ }, "typescript/no-unsafe-enum-comparison": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/settings/task-management/task.service.ts": { "anti-slop/no-unsafe-dictionary-type": { "count": 1 - }, - "typescript/no-unnecessary-template-expression": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/features/settings/user-management/content-restriction.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/settings/user-management/content-restrictions-editor/content-restrictions-editor.component.ts": { - "anti-slop/require-safety-comment-for-type-assertion": { - "count": 3 - }, "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/no-unnecessary-type-assertion": { - "count": 3 - }, - "typescript/prefer-readonly": { - "count": 5 } }, "src/app/features/settings/user-management/create-user-dialog/create-user-dialog.component.ts": { @@ -2054,9 +1420,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 7 } }, "src/app/features/settings/user-management/entity-view-preferences.ts": { @@ -2066,33 +1429,21 @@ }, "src/app/features/settings/user-management/user-management.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { - "count": 2 + "count": 1 }, "typescript/no-unnecessary-condition": { "count": 7 }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, "typescript/no-unsafe-assignment": { "count": 2 }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/settings/user-management/user-stats.service.ts": { "typescript/no-unnecessary-condition": { "count": 4 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/features/settings/user-management/user.service.ts": { @@ -2119,9 +1470,6 @@ }, "typescript/no-unsafe-member-access": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/settings/user-profile-dialog/user-profile-dialog.component.ts": { @@ -2143,14 +1491,6 @@ "src/app/features/settings/view-preferences-parent/meta-center-view-mode/meta-center-view-mode-component.ts": { "typescript/no-unnecessary-condition": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 3 - } - }, - "src/app/features/settings/view-preferences-parent/view-preferences-parent.component.ts": { - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/settings/view-preferences-parent/view-preferences/view-preferences.component.ts": { @@ -2159,9 +1499,6 @@ }, "typescript/no-unnecessary-condition": { "count": 11 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/features/stats/component/library-stats/charts/author-universe-chart/author-universe-chart.component.ts": { @@ -2170,9 +1507,6 @@ }, "typescript/no-unnecessary-condition": { "count": 3 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 } }, "src/app/features/stats/component/library-stats/charts/metadata-score-chart/metadata-score-chart.component.ts": { @@ -2191,9 +1525,6 @@ } }, "src/app/features/stats/component/library-stats/charts/top-items-chart/top-items-chart.component.ts": { - "typescript/prefer-nullish-coalescing": { - "count": 4 - }, "typescript/prefer-optional-chain": { "count": 1 } @@ -2201,9 +1532,6 @@ "src/app/features/stats/component/library-stats/service/libraries-summary.service.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/features/stats/component/library-stats/service/library-filter.service.spec.ts": { @@ -2220,9 +1548,6 @@ }, "typescript/no-unnecessary-type-assertion": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/stats/component/shared/stats-chart-theme.service.ts": { @@ -2288,26 +1613,11 @@ }, "typescript/no-unnecessary-condition": { "count": 5 - }, - "unicorn/no-useless-spread": { - "count": 2 } }, "src/app/features/stats/component/user-stats/charts/reading-clock-chart/reading-clock-chart.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/no-unsafe-argument": { - "count": 1 - }, - "typescript/no-unsafe-assignment": { - "count": 1 - }, - "typescript/no-unsafe-return": { - "count": 2 - }, - "unicorn/no-new-array": { - "count": 1 } }, "src/app/features/stats/component/user-stats/charts/reading-debt-chart/reading-debt-chart.component.ts": { @@ -2344,14 +1654,11 @@ }, "src/app/features/stats/component/user-stats/charts/reading-progress-chart/reading-progress-chart.component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { - "count": 3 + "count": 2 }, "typescript/no-unnecessary-condition": { "count": 1 }, - "typescript/no-unnecessary-type-assertion": { - "count": 1 - }, "typescript/restrict-template-expressions": { "count": 1 } @@ -2370,12 +1677,6 @@ }, "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/features/stats/component/user-stats/charts/series-progress-chart/series-progress-chart.component.ts": { @@ -2389,9 +1690,6 @@ "src/app/features/stats/component/user-stats/charts/session-archetypes-chart/session-archetypes-chart.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 2 } }, "src/app/features/stats/component/user-stats/service/user-chart-config.service.ts": { @@ -2399,20 +1697,12 @@ "count": 2 } }, - "src/app/features/stats/component/user-stats/user-stats.component.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/shared/browse/results.ts": { "anti-slop/no-unknown-returns": { "count": 2 } }, "src/app/shared/components/book-uploader/book-uploader.component.ts": { - "typescript/no-deprecated": { - "count": 1 - }, "typescript/no-unnecessary-condition": { "count": 4 }, @@ -2431,16 +1721,6 @@ "count": 1 } }, - "src/app/shared/components/directory-picker/directory-picker.component.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/shared/components/directory-picker/utility.service.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/shared/components/file-mover/file-mover-component.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 4 @@ -2453,12 +1733,6 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 7 } }, "src/app/shared/components/icon-display/icon-display.component.ts": { @@ -2491,11 +1765,6 @@ "count": 1 } }, - "src/app/shared/components/live-notification-box/live-notification-box.component.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, "src/app/shared/components/login/login.component.ts": { "typescript/no-floating-promises": { "count": 1 @@ -2511,9 +1780,6 @@ }, "typescript/no-unsafe-member-access": { "count": 3 - }, - "typescript/prefer-readonly": { - "count": 6 } }, "src/app/shared/components/metadata-progress-widget/metadata-progress-widget-component.spec.ts": { @@ -2524,22 +1790,6 @@ "src/app/shared/components/metadata-progress-widget/metadata-progress-widget-component.ts": { "typescript/no-unnecessary-condition": { "count": 3 - }, - "typescript/no-unsafe-enum-comparison": { - "count": 2 - }, - "typescript/prefer-readonly": { - "count": 7 - } - }, - "src/app/shared/components/setup/login.guard.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/shared/components/setup/setup-redirect.guard.ts": { - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/shared/components/setup/setup.component.ts": { @@ -2554,22 +1804,11 @@ }, "typescript/no-unsafe-member-access": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 3 } }, "src/app/shared/components/setup/setup.guard.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 2 - } - }, - "src/app/shared/components/setup/setup.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/layout/layout-sidebar/app.sidebar-section.component.spec.ts": { @@ -2577,11 +1816,6 @@ "count": 1 } }, - "src/app/shared/layout/layout-sidebar/version-changelog-dialog/version-changelog-dialog.component.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/shared/layout/layout.service.ts": { "typescript/no-unnecessary-condition": { "count": 1 @@ -2611,9 +1845,6 @@ }, "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/layout/theme/theme-palette-extend.ts": { @@ -2643,11 +1874,6 @@ "count": 1 } }, - "src/app/shared/metadata/metadata-utils.service.spec.ts": { - "typescript/dot-notation": { - "count": 2 - } - }, "src/app/shared/metadata/metadata-utils.service.ts": { "anti-slop/no-unknown-parameters": { "count": 5 @@ -2676,16 +1902,6 @@ "count": 2 } }, - "src/app/shared/service/app-locale.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/shared/service/app-settings.service.ts": { - "typescript/prefer-readonly": { - "count": 5 - } - }, "src/app/shared/service/app-theme.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 @@ -2697,9 +1913,6 @@ "src/app/shared/service/audiobook-session.service.ts": { "anti-slop/no-unknown-parameters": { "count": 1 - }, - "typescript/prefer-optional-chain": { - "count": 2 } }, "src/app/shared/service/auth.service.ts": { @@ -2711,17 +1924,6 @@ }, "typescript/no-unsafe-return": { "count": 1 - }, - "typescript/prefer-nullish-coalescing": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 5 - } - }, - "src/app/shared/service/book-metadata-host.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/service/cache-storage.service.ts": { @@ -2733,41 +1935,16 @@ }, "typescript/no-floating-promises": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/service/custom-font.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 - }, - "typescript/no-deprecated": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 - }, - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 - } - }, - "src/app/shared/service/file-download.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/app/shared/service/file-operations.service.ts": { - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/service/icon-picker.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/service/language-resolver.service.ts": { @@ -2775,11 +1952,6 @@ "count": 4 } }, - "src/app/shared/service/local-settings.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, "src/app/shared/service/local-storage.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 @@ -2788,33 +1960,17 @@ "count": 2 } }, - "src/app/shared/service/metadata-match-weights.service.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/shared/service/metadata-progress.service.ts": { "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 }, "typescript/no-unnecessary-condition": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 6 - } - }, - "src/app/shared/service/oidc-group-mapping.service.ts": { - "typescript/prefer-readonly": { - "count": 2 } }, "src/app/shared/service/page-title.service.ts": { "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/service/reading-session.service.ts": { @@ -2822,46 +1978,22 @@ "count": 1 } }, - "src/app/shared/service/route-scroll-position.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, "src/app/shared/service/settings-helper.service.ts": { "anti-slop/no-unknown-parameters": { "count": 1 } }, - "src/app/shared/service/startup.service.ts": { - "typescript/no-deprecated": { - "count": 1 - }, - "typescript/prefer-readonly": { - "count": 6 - } - }, "src/app/shared/service/url-helper.service.ts": { - "typescript/prefer-readonly": { - "count": 2 - }, "typescript/switch-exhaustiveness-check": { "count": 1 } }, - "src/app/shared/service/version.service.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/shared/service/wake-lock.service.ts": { "typescript/no-floating-promises": { "count": 1 }, "typescript/no-misused-promises": { "count": 2 - }, - "typescript/prefer-readonly": { - "count": 1 } }, "src/app/shared/services/custom-svg.service.ts": { @@ -2869,11 +2001,6 @@ "count": 1 } }, - "src/app/shared/services/dialog-launcher.service.spec.ts": { - "typescript/await-thenable": { - "count": 1 - } - }, "src/app/shared/services/dialog-launcher.service.ts": { "anti-slop/no-object-parameters": { "count": 1 @@ -2883,12 +2010,6 @@ }, "anti-slop/require-safety-comment-for-type-assertion": { "count": 1 - }, - "typescript/prefer-readonly": { - "count": 1 - }, - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 } }, "src/app/shared/ui/autocomplete/app-autocomplete-popup.component.ts": { @@ -2896,11 +2017,6 @@ "count": 1 } }, - "src/app/shared/ui/autocomplete/app-autocomplete.component.ts": { - "typescript/prefer-optional-chain": { - "count": 1 - } - }, "src/app/shared/ui/checkbox/app-checkbox.component.ts": { "typescript/no-unnecessary-condition": { "count": 1 @@ -2951,9 +2067,6 @@ }, "typescript/no-unnecessary-condition": { "count": 1 - }, - "typescript/prefer-optional-chain": { - "count": 1 } }, "src/app/shared/ui/menu/menu-item-setup.ts": { @@ -3016,26 +2129,11 @@ "count": 5 } }, - "src/app/shared/websocket/notification-event.service.ts": { - "typescript/prefer-readonly": { - "count": 2 - } - }, "src/app/shared/websocket/rx-stomp.config.spec.ts": { "typescript/no-floating-promises": { "count": 2 } }, - "src/app/shared/websocket/rx-stomp.service.ts": { - "typescript/prefer-readonly": { - "count": 1 - } - }, - "src/main.ts": { - "typescript/use-unknown-in-catch-callback-variable": { - "count": 1 - } - }, "src/types/epubjs.d.ts": { "anti-slop/no-unknown-parameters": { "count": 2 diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html index b5c0c44e5..eb3e61ddc 100644 --- a/frontend/src/app/app.component.html +++ b/frontend/src/app/app.component.html @@ -48,13 +48,13 @@

{{ t('offline') }}

{{ t('connectionLost') }}

- + } @else { - + - + } diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index d922a7924..7e74bdb2c 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -31,28 +31,27 @@ import {RxStompState} from '@stomp/rx-stomp'; imports: [ConfirmDialog, Toast, RouterOutlet, TranslocoDirective, TranslocoPipe, CommandPaletteComponent] }) export class AppComponent implements OnInit, OnDestroy { - - loading = signal(true); - offline = signal(false); - private subscriptions: Subscription[] = []; - private subscriptionsInitialized = false; - - private appThemeService = inject(AppThemeService); // DO NOT REMOVE: Used to initialize app theme on startup - private authInit = inject(AuthInitializationService); - private bookService = inject(BookService); - private authorService = inject(AuthorService); - private rxStompService = inject(RxStompService); - private notificationEventService = inject(NotificationEventService); - private metadataProgressService = inject(MetadataProgressService); - private bookdropFileService = inject(BookdropFileService); - private taskService = inject(TaskService); - private metadataRefreshSubmissionService = inject(MetadataRefreshSubmissionService); - private libraryHealthService = inject(LibraryHealthService); - private authService = inject(AuthService); - private commandPaletteService = inject(CommandPaletteService); + private readonly appThemeService = inject(AppThemeService); // DO NOT REMOVE: Used to initialize app theme on startup + private readonly authInit = inject(AuthInitializationService); + private readonly bookService = inject(BookService); + private readonly authorService = inject(AuthorService); + private readonly rxStompService = inject(RxStompService); + private readonly notificationEventService = inject(NotificationEventService); + private readonly metadataProgressService = inject(MetadataProgressService); + private readonly bookdropFileService = inject(BookdropFileService); + private readonly taskService = inject(TaskService); + private readonly metadataRefreshSubmissionService = inject(MetadataRefreshSubmissionService); + private readonly libraryHealthService = inject(LibraryHealthService); + private readonly authService = inject(AuthService); + private readonly commandPaletteService = inject(CommandPaletteService); private readonly libraryImportProgressService = inject(LibraryImportProgressService); private readonly translocoService = inject(TranslocoService); - private destroyRef = inject(DestroyRef); + private readonly destroyRef = inject(DestroyRef); + + readonly loading = signal(true); + readonly offline = signal(false); + private readonly subscriptions: Subscription[] = []; + private subscriptionsInitialized = false; private readonly syncAuthInitializationEffect = effect(() => { const ready = this.authInit.initialized(); this.loading.set(!ready); @@ -79,7 +78,7 @@ export class AppComponent implements OnInit, OnDestroy { this.destroyRef.onDestroy(() => document.removeEventListener('keydown', this.onGlobalKeydown)); } - private onGlobalKeydown = (event: KeyboardEvent): void => { + private readonly onGlobalKeydown = (event: KeyboardEvent): void => { if (event.repeat) return; const combo = (event.metaKey || event.ctrlKey) && !event.shiftKey && !event.altKey; if (!combo) return; @@ -88,11 +87,11 @@ export class AppComponent implements OnInit, OnDestroy { this.commandPaletteService.toggle(); }; - private onOnline = () => { + private readonly onOnline = () => { this.offline.set(false); }; - private onOffline = () => { + private readonly onOffline = () => { this.checkServerReachable().then(reachable => { this.offline.set(!reachable); }); diff --git a/frontend/src/app/core/config/transloco-loader.spec.ts b/frontend/src/app/core/config/transloco-loader.spec.ts index 728294e6e..499b07c60 100644 --- a/frontend/src/app/core/config/transloco-loader.spec.ts +++ b/frontend/src/app/core/config/transloco-loader.spec.ts @@ -11,7 +11,7 @@ describe('TranslocoInlineLoader', () => { const translation = await firstValueFrom(loader.getTranslation('en')); expect(translation).toBe(EN_TRANSLATIONS); - expect(translation['auth']['login']['sessionRevoked']).toBe(en['auth']['login']['sessionRevoked']); + expect(translation['auth']['login']['sessionRevoked']).toBe(en.auth.login.sessionRevoked); }); it('falls back to english for unsupported languages', async () => { @@ -25,9 +25,9 @@ describe('TranslocoInlineLoader', () => { const loader = new TranslocoInlineLoader(); const translation = await firstValueFrom(loader.getTranslation('de')); - expect(translation['auth']['login']['oidcInitError']).toBe(de['auth']['login']['oidcInitError']); - expect(translation['auth']['login']['sessionRevoked']).toBe(de['auth']['login']['sessionRevoked']); - expect(translation['auth']['login']['oidcErrors']['providerUnreachable']).toBe(de['auth']['login']['oidcErrors']['providerUnreachable']); + expect(translation['auth']['login']['oidcInitError']).toBe(de.auth.login.oidcInitError); + expect(translation['auth']['login']['sessionRevoked']).toBe(de.auth.login.sessionRevoked); + expect(translation['auth']['login']['oidcErrors']['providerUnreachable']).toBe(de.auth.login.oidcErrors.providerUnreachable); }); it('exposes the available language metadata', () => { diff --git a/frontend/src/app/core/config/transloco-loader.ts b/frontend/src/app/core/config/transloco-loader.ts index 15698933c..540dad37f 100644 --- a/frontend/src/app/core/config/transloco-loader.ts +++ b/frontend/src/app/core/config/transloco-loader.ts @@ -1,4 +1,4 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {Translation, TranslocoLoader} from '@jsverse/transloco'; import {from, of, Observable} from 'rxjs'; import en from '../../../i18n/en.json'; @@ -68,7 +68,7 @@ function deepMerge(base: Record, override: Record { if (lang === 'en') { diff --git a/frontend/src/app/core/custom-reuse-strategy.ts b/frontend/src/app/core/custom-reuse-strategy.ts index cec0308c7..30eb1855d 100644 --- a/frontend/src/app/core/custom-reuse-strategy.ts +++ b/frontend/src/app/core/custom-reuse-strategy.ts @@ -1,4 +1,4 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {ActivatedRouteSnapshot, BaseRouteReuseStrategy, Params} from '@angular/router'; function paramsMatch(a: Params, b: Params): boolean { @@ -7,9 +7,7 @@ function paramsMatch(a: Params, b: Params): boolean { return aKeys.length === bKeys.length && aKeys.every(key => a[key] === b[key]); } -@Injectable({ - providedIn: 'root', -}) +@Service() export class CustomReuseStrategy extends BaseRouteReuseStrategy { override shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { return future.routeConfig === curr.routeConfig && paramsMatch(future.params, curr.params); diff --git a/frontend/src/app/core/security/auth-initialization-service.ts b/frontend/src/app/core/security/auth-initialization-service.ts index 398728deb..be862032f 100644 --- a/frontend/src/app/core/security/auth-initialization-service.ts +++ b/frontend/src/app/core/security/auth-initialization-service.ts @@ -1,6 +1,6 @@ -import {Injectable, signal} from '@angular/core'; +import {Service, signal} from '@angular/core'; -@Injectable({providedIn: 'root'}) +@Service() export class AuthInitializationService { private readonly _initialized = signal(false); readonly initialized = this._initialized.asReadonly(); diff --git a/frontend/src/app/core/security/auth-initializer.spec.ts b/frontend/src/app/core/security/auth-initializer.spec.ts index d8e2e38bf..70c803994 100644 --- a/frontend/src/app/core/security/auth-initializer.spec.ts +++ b/frontend/src/app/core/security/auth-initializer.spec.ts @@ -20,7 +20,7 @@ describe('initializeAuthFactory', () => { }; const queryClient = { - fetchQuery: vi.fn(), + query: vi.fn(), }; const appSettingsService = { @@ -40,13 +40,13 @@ describe('initializeAuthFactory', () => { authService.getInternalAccessToken.mockReset(); authService.remoteLogin.mockReset(); authService.initializeWebSocketConnection.mockReset(); - queryClient.fetchQuery.mockReset(); + queryClient.query.mockReset(); appSettingsService.getPublicSettingsQueryOptions.mockClear(); }); it('marks auth initialized when public settings are unavailable', async () => { const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => undefined); - queryClient.fetchQuery.mockResolvedValue(null); + queryClient.query.mockResolvedValue(null); const injector = Injector.create({ providers: [ @@ -65,7 +65,7 @@ describe('initializeAuthFactory', () => { }); it('initializes websocket auth when local auth is active and a token exists', async () => { - queryClient.fetchQuery.mockResolvedValue({...settingsBase, remoteAuthEnabled: false}); + queryClient.query.mockResolvedValue({...settingsBase, remoteAuthEnabled: false}); authService.getInternalAccessToken.mockReturnValue('access-token'); const injector = Injector.create({ @@ -84,7 +84,7 @@ describe('initializeAuthFactory', () => { }); it('skips websocket initialization when local auth is active and no token exists', async () => { - queryClient.fetchQuery.mockResolvedValue({...settingsBase, remoteAuthEnabled: false}); + queryClient.query.mockResolvedValue({...settingsBase, remoteAuthEnabled: false}); authService.getInternalAccessToken.mockReturnValue(null); const injector = Injector.create({ @@ -103,7 +103,7 @@ describe('initializeAuthFactory', () => { }); it('performs remote login when remote auth is enabled', async () => { - queryClient.fetchQuery.mockResolvedValue({...settingsBase, remoteAuthEnabled: true}); + queryClient.query.mockResolvedValue({...settingsBase, remoteAuthEnabled: true}); authService.remoteLogin.mockReturnValue(of({ accessToken: 'access', refreshToken: 'refresh', @@ -127,7 +127,7 @@ describe('initializeAuthFactory', () => { it('marks auth initialized even when remote login fails', async () => { const error = new Error('remote login failed'); - queryClient.fetchQuery.mockResolvedValue({...settingsBase, remoteAuthEnabled: true}); + queryClient.query.mockResolvedValue({...settingsBase, remoteAuthEnabled: true}); authService.remoteLogin.mockReturnValue(throwError(() => error)); const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined); diff --git a/frontend/src/app/core/security/auth-initializer.ts b/frontend/src/app/core/security/auth-initializer.ts index bba48fbba..fecede602 100644 --- a/frontend/src/app/core/security/auth-initializer.ts +++ b/frontend/src/app/core/security/auth-initializer.ts @@ -13,7 +13,7 @@ export function initializeAuthFactory() { const authInitService = inject(AuthInitializationService); const queryClient = inject(QueryClient); - const settingsPromise = queryClient.fetchQuery(appSettingsService.getPublicSettingsQueryOptions()); + const settingsPromise = queryClient.query(appSettingsService.getPublicSettingsQueryOptions()); const timeoutPromise = new Promise(resolve => setTimeout(() => resolve(null), SETTINGS_TIMEOUT_MS) ); diff --git a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html index ebd9b73ac..87e84515b 100644 --- a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html +++ b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.html @@ -41,8 +41,7 @@ - + [disabled]="true" />
@@ -62,7 +61,7 @@

{{ t('oidc.description') }} - + @if (!isOidcFormComplete() && !oidcEnabled) { {{ t('oidc.configHint') }} } @@ -71,8 +70,7 @@ - + (onChange)="toggleOidcEnabled()" /> @@ -158,8 +156,7 @@ [showButtons]="true" [placeholder]="t('providerConfig.sessionDurationPlaceholder')" mode="decimal" - [useGrouping]="false"> - + [useGrouping]="false" /> {{ t('providerConfig.sessionDurationHint') }} @@ -225,8 +222,7 @@ [label]="redirectUri" [removable]="true" [attr.aria-label]="t('mobileRedirectUris.removeLabel', {uri: redirectUri})" - (onRemove)="removeMobileRedirectUri(index)"> - + (onRemove)="removeMobileRedirectUri(index)" /> } - + [disabled]="!oidcProvider.issuerUri || isTestingConnection()" /> - + [disabled]="!isOidcFormComplete()" /> @if (testConnectionResult() && showTestDetails()) { @@ -309,6 +303,7 @@ @case ('SKIP') { } + @default never; } {{ check.name }} {{ check.message }} @@ -342,8 +337,7 @@ severity="secondary" size="small" [style]="{'min-width': '2rem'}" - (click)="copyToClipboard(item.value)"> - + (click)="copyToClipboard(item.value)" /> } @@ -384,8 +378,7 @@ - + (onChange)="toggleOidcForceOnlyMode()" /> @@ -421,8 +414,7 @@ - + (onChange)="saveOidcAutoProvisionSettings()" />

@@ -446,8 +438,7 @@ - + (onChange)="saveOidcAutoProvisionSettings()" />
@if (autoUserProvisioningEnabled) { @@ -460,8 +451,7 @@ [binary]="true" [disabled]="true" [ngModel]="true" - inputId="permissionRead"> - + inputId="permissionRead" /> @@ -470,8 +460,7 @@ - + [inputId]="perm.value" /> } @@ -490,16 +479,14 @@ [placeholder]="t('provisioning.selectLibraries')" appendTo="body" class="libraries-select" - style="flex: 1;"> - + style="flex: 1;" /> - + (click)="saveOidcAutoProvisionSettings()" /> @@ -526,8 +513,7 @@ [outlined]="true" severity="success" size="small" - (click)="openNewGroupMapping()"> - + (click)="openNewGroupMapping()" /> @@ -542,8 +528,7 @@ [options]="groupSyncModeOptions" optionLabel="label" optionValue="value" - appendTo="body"> - + appendTo="body" /> {{ t('groupMapping.syncModeHint') }}
@@ -553,8 +538,7 @@ icon="pi pi-save" severity="success" size="small" - (click)="saveGroupSyncMode()"> - + (click)="saveGroupSyncMode()" />
@@ -591,8 +575,8 @@ {{ mapping.description }}
- - + +
@@ -634,7 +618,7 @@

{{ t('groupMapping.permissionsLabel') }}

- +
@@ -663,8 +647,7 @@ (ngModelChange)="updateGroupMappingDraft({libraryIds: $event})" [placeholder]="t('provisioning.selectLibraries')" appendTo="body" - class="libraries-select"> - + class="libraries-select" />
} @@ -673,8 +656,7 @@ [label]="'common.save' | transloco" icon="pi pi-check" (click)="saveGroupMapping()" - [disabled]="!groupMappingDraft()?.oidcGroupClaim"> - + [disabled]="!groupMappingDraft()?.oidcGroupClaim" /> } diff --git a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts index eedcf8021..d3ae9760d 100644 --- a/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts +++ b/frontend/src/app/core/security/oauth2-management/authentication-settings.component.ts @@ -45,6 +45,11 @@ import {Chip} from '@openng/optimus-ui/chip'; styleUrls: ['./authentication-settings.component.scss'] }) export class AuthenticationSettingsComponent { + private readonly appSettingsService = inject(AppSettingsService); + private readonly messageService = inject(MessageService); + private readonly libraryService = inject(LibraryService); + private readonly groupMappingService = inject(OidcGroupMappingService); + private readonly t = inject(TranslocoService); readonly defaultMobileRedirectUri = 'grimmory://oauth2-callback'; readonly wildcardMobileRedirectUri = '*'; availablePermissions = [ @@ -127,12 +132,6 @@ export class AuthenticationSettingsComponent { groups: '' } }; - - private appSettingsService = inject(AppSettingsService); - private messageService = inject(MessageService); - private libraryService = inject(LibraryService); - private groupMappingService = inject(OidcGroupMappingService); - private t = inject(TranslocoService); get allLibraries() { return this.libraryService.libraries(); } private readonly loadSettingsEffect = effect(() => { diff --git a/frontend/src/app/core/security/oidc-callback/oidc-callback.component.ts b/frontend/src/app/core/security/oidc-callback/oidc-callback.component.ts index 429e7aaae..f5fed5914 100644 --- a/frontend/src/app/core/security/oidc-callback/oidc-callback.component.ts +++ b/frontend/src/app/core/security/oidc-callback/oidc-callback.component.ts @@ -11,9 +11,9 @@ import {AuthService} from '../../../shared/service/auth.service'; imports: [TranslocoPipe] }) export class OidcCallbackComponent implements OnInit { - private router = inject(Router); - private oidcService = inject(OidcService); - private authService = inject(AuthService); + private readonly router = inject(Router); + private readonly oidcService = inject(OidcService); + private readonly authService = inject(AuthService); ngOnInit(): void { const params = new URLSearchParams(window.location.search); diff --git a/frontend/src/app/core/security/oidc.service.ts b/frontend/src/app/core/security/oidc.service.ts index 85504f1c2..5f9178d5c 100644 --- a/frontend/src/app/core/security/oidc.service.ts +++ b/frontend/src/app/core/security/oidc.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {firstValueFrom, Observable} from 'rxjs'; import {API_CONFIG} from '../config/api-config'; @@ -17,11 +17,11 @@ interface OidcTokenResponse { expires?: number } -@Injectable({providedIn: 'root'}) +@Service() export class OidcService { - private http = inject(HttpClient); - private appSettingsService = inject(AppSettingsService); + private readonly http = inject(HttpClient); + private readonly appSettingsService = inject(AppSettingsService); async generatePkce(): Promise<{codeVerifier: string; codeChallenge: string}> { const array = new Uint8Array(32); diff --git a/frontend/src/app/core/security/secure-pipe.ts b/frontend/src/app/core/security/secure-pipe.ts index c8d3d51df..64162091c 100644 --- a/frontend/src/app/core/security/secure-pipe.ts +++ b/frontend/src/app/core/security/secure-pipe.ts @@ -9,8 +9,8 @@ import { map } from 'rxjs/operators'; pure: true }) export class SecurePipe implements PipeTransform { - private http = inject(HttpClient); - private sanitizer = inject(DomSanitizer); + private readonly http = inject(HttpClient); + private readonly sanitizer = inject(DomSanitizer); transform(url: string): Observable { return this.http.get(url, { responseType: 'blob' }).pipe( diff --git a/frontend/src/app/core/services/loading.service.ts b/frontend/src/app/core/services/loading.service.ts index d1de6adc7..96d4807d5 100644 --- a/frontend/src/app/core/services/loading.service.ts +++ b/frontend/src/app/core/services/loading.service.ts @@ -1,8 +1,6 @@ -import { Injectable } from '@angular/core'; +import { Service } from '@angular/core'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class LoadingService { private activeLoaders: HTMLElement[] = []; @@ -48,7 +46,7 @@ export class LoadingService { } hide(loader: HTMLElement): void { - if (loader && loader.parentNode) { + if (loader?.parentNode) { loader.parentNode.removeChild(loader); const index = this.activeLoaders.indexOf(loader); @@ -64,7 +62,7 @@ export class LoadingService { hideAll(): void { this.activeLoaders.forEach(loader => { - if (loader && loader.parentNode) { + if (loader?.parentNode) { loader.parentNode.removeChild(loader); } }); diff --git a/frontend/src/app/core/services/post-login-initializer.service.ts b/frontend/src/app/core/services/post-login-initializer.service.ts index 4a58df5e9..913dead16 100644 --- a/frontend/src/app/core/services/post-login-initializer.service.ts +++ b/frontend/src/app/core/services/post-login-initializer.service.ts @@ -1,10 +1,8 @@ -import {Injectable, inject, Injector} from '@angular/core'; +import {Service, inject, Injector} from '@angular/core'; import {defer, from, Observable} from 'rxjs'; import {StartupService} from '../../shared/service/startup.service'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class PostLoginInitializerService { private readonly injector = inject(Injector); diff --git a/frontend/src/app/core/services/pwa-update.service.ts b/frontend/src/app/core/services/pwa-update.service.ts index 6e1b79497..6bb588d3a 100644 --- a/frontend/src/app/core/services/pwa-update.service.ts +++ b/frontend/src/app/core/services/pwa-update.service.ts @@ -1,12 +1,10 @@ -import { inject, Injectable } from '@angular/core'; +import { inject, Service } from '@angular/core'; import { SwUpdate, VersionReadyEvent } from '@angular/service-worker'; import { filter } from 'rxjs/operators'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class PwaUpdateService { - private swUpdate = inject(SwUpdate); + private readonly swUpdate = inject(SwUpdate); constructor() { if (this.swUpdate.isEnabled) { @@ -36,7 +34,7 @@ export class PwaUpdateService { const guardStr = sessionStorage.getItem(key); const guard = guardStr ? JSON.parse(guardStr) : null; - if (guard && guard.reason === reason && now - guard.timestamp < 10000) { + if (guard?.reason === reason && now - guard.timestamp < 10000) { console.error(`PWA reload guard triggered for reason: ${reason}. Stopped reloading to avoid loop.`); return false; } diff --git a/frontend/src/app/core/testing/query-testing.ts b/frontend/src/app/core/testing/query-testing.ts index e2dff0086..644132ac0 100644 --- a/frontend/src/app/core/testing/query-testing.ts +++ b/frontend/src/app/core/testing/query-testing.ts @@ -40,7 +40,7 @@ export function createQueryClientHarness(): QueryClientHarness { } export function flushSignalAndQueryEffects(): void { - TestBed.flushEffects(); + TestBed.tick(); } export function observeActiveQuery(queryClient: QueryClient, queryKey: readonly unknown[], data: unknown) { @@ -82,12 +82,12 @@ export function observeActiveQuery(queryClient: QueryClient, queryKey: readonly export async function flushQueryAsync(rounds = 5): Promise { const appRef = TestBed.inject(ApplicationRef); for (let i = 0; i < rounds; i++) { - TestBed.flushEffects(); + TestBed.tick(); appRef.tick(); await Promise.resolve(); await new Promise(resolve => setTimeout(resolve, 0)); } - TestBed.flushEffects(); + TestBed.tick(); appRef.tick(); } diff --git a/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.html b/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.html index 103650162..52af39523 100644 --- a/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.html +++ b/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.html @@ -6,12 +6,11 @@ [style]="{'width': '60px', 'height': '60px'}" strokeWidth="3" fill="transparent" - animationDuration="1.5s"> - + animationDuration="1.5s" /> } - @if (!loading()) { + @else {

{{ t('browseAllAuthors') }}

@@ -35,14 +34,13 @@ (ngModelChange)="onSortChange($event)" optionLabel="label" optionValue="value" - class="sort-dropdown"> - + class="sort-dropdown" /> - -
@@ -100,8 +97,7 @@ (ngModelChange)="onFilterChange('photoStatus', $event)" optionLabel="label" optionValue="value" - class="filter-dropdown"> - + class="filter-dropdown" />
@@ -118,8 +114,7 @@ (ngModelChange)="onFilterChange('readStatus', $event)" optionLabel="label" optionValue="value" - class="filter-dropdown"> - + class="filter-dropdown" />
@@ -142,8 +137,7 @@ (ngModelChange)="onFilterChange('bookCount', $event)" optionLabel="label" optionValue="value" - class="filter-dropdown"> - + class="filter-dropdown" />
@@ -154,8 +148,7 @@ (ngModelChange)="onFilterChange('library', $event)" optionLabel="label" optionValue="value" - class="filter-dropdown"> - + class="filter-dropdown" />
@@ -166,8 +159,7 @@ (ngModelChange)="onFilterChange('genre', $event)" optionLabel="label" optionValue="value" - class="filter-dropdown"> - + class="filter-dropdown" />
@if (activeFilterCount() > 0) { @@ -178,8 +170,7 @@ [outlined]="true" size="small" (onClick)="resetFilters()" - class="filter-reset-btn"> - + class="filter-reset-btn" /> } @@ -214,8 +205,7 @@ (editAuthor)="navigateToAuthorEdit($event)" (deleteAuthor)="deleteAuthor($event)" (quickMatched)="onAuthorQuickMatched($event)" - (checkboxClick)="onCheckboxClicked($event)"> - + (checkboxClick)="onCheckboxClicked($event)" /> } } @@ -233,7 +223,7 @@ {{ t('footer.selected') }} @if (canEditMetadata || canDeleteBook) { - +
@if (canEditMetadata) { - + tooltipPosition="top" /> } @if (canDeleteBook) { - + tooltipPosition="top" /> }
} - +
- + tooltipPosition="top" /> - + tooltipPosition="top" />
diff --git a/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.ts b/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.ts index 3bd68c6b1..b8b4b6b26 100644 --- a/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.ts +++ b/frontend/src/app/features/author-browser/components/author-browser/author-browser.component.ts @@ -84,17 +84,17 @@ export class AuthorBrowserComponent implements OnInit { private static readonly MIN_SCALE = 0.7; private static readonly MAX_SCALE = 1.3; - private authorService = inject(AuthorService); - private bookService = inject(BookService); - private messageService = inject(MessageService); - private pageTitle = inject(PageTitleService); - private scrollService = inject(RouteScrollPositionService); - private t = inject(TranslocoService); - private router = inject(Router); - private activatedRoute = inject(ActivatedRoute); - private destroyRef = inject(DestroyRef); - private localStorageService = inject(LocalStorageService); - private layoutService = inject(LayoutService); + private readonly authorService = inject(AuthorService); + private readonly bookService = inject(BookService); + private readonly messageService = inject(MessageService); + private readonly pageTitle = inject(PageTitleService); + private readonly scrollService = inject(RouteScrollPositionService); + private readonly t = inject(TranslocoService); + private readonly router = inject(Router); + private readonly activatedRoute = inject(ActivatedRoute); + private readonly destroyRef = inject(DestroyRef); + private readonly localStorageService = inject(LocalStorageService); + private readonly layoutService = inject(LayoutService); protected userService = inject(UserService); protected selectionService = inject(AuthorSelectionService); @@ -123,17 +123,17 @@ export class AuthorBrowserComponent implements OnInit { readonly screenWidth = signal(typeof window !== 'undefined' ? window.innerWidth : 1024); thumbnailCacheBusters = new Map(); - private selectedAuthors = this.selectionService.selectedAuthors; - private allAuthorsState = signal(null); + private readonly selectedAuthors = this.selectionService.selectedAuthors; + private readonly allAuthorsState = signal(null); - loading = computed(() => this.allAuthorsState() === null || this.bookService.isBooksLoading()); + readonly loading = computed(() => this.allAuthorsState() === null || this.bookService.isBooksLoading()); protected currentUser = this.userService.currentUser; - selectedCount = computed(() => this.selectedAuthors().size); - searchTerm = signal(''); - sortBy = signal('name'); - sortDirection = signal('asc'); - filters = signal({...DEFAULT_AUTHOR_FILTERS}); - private enrichedAuthors = computed(() => { + readonly selectedCount = computed(() => this.selectedAuthors().size); + readonly searchTerm = signal(''); + readonly sortBy = signal('name'); + readonly sortDirection = signal('asc'); + readonly filters = signal({...DEFAULT_AUTHOR_FILTERS}); + private readonly enrichedAuthors = computed(() => { const authors = this.allAuthorsState(); if (!authors) { return []; @@ -141,7 +141,7 @@ export class AuthorBrowserComponent implements OnInit { return this.enrichAuthors(authors, this.bookService.books()); }); - libraryOptions = computed(() => { + readonly libraryOptions = computed(() => { const allLabel = this.t.translate('authorBrowser.filters.all'); const librarySet = new Set(); @@ -156,7 +156,7 @@ export class AuthorBrowserComponent implements OnInit { ...[...librarySet].sort().map(library => ({label: library, value: library})) ]; }); - genreOptions = computed(() => { + readonly genreOptions = computed(() => { const allLabel = this.t.translate('authorBrowser.filters.all'); const genreSet = new Set(); @@ -171,7 +171,7 @@ export class AuthorBrowserComponent implements OnInit { ...[...genreSet].sort().map(category => ({label: category, value: category})) ]; }); - activeFilterCount = computed(() => { + readonly activeFilterCount = computed(() => { const filters = this.filters(); let count = 0; if (filters.matchStatus !== 'all') count++; @@ -182,7 +182,7 @@ export class AuthorBrowserComponent implements OnInit { if (filters.genre !== 'all') count++; return count; }); - filteredAuthors = computed(() => { + readonly filteredAuthors = computed(() => { let result = this.enrichedAuthors(); const search = this.searchTerm().trim().toLowerCase(); @@ -443,7 +443,7 @@ export class AuthorBrowserComponent implements OnInit { } return authors.map(author => { - const authorBooks = booksByAuthor.get(author.name.toLowerCase()) || []; + const authorBooks = booksByAuthor.get(author.name.toLowerCase()) ?? []; const libraryIds = new Set(); const libraryNameSet = new Set(); diff --git a/frontend/src/app/features/author-browser/components/author-card/author-card.component.html b/frontend/src/app/features/author-browser/components/author-card/author-card.component.html index 42ab0a3df..bf3260e56 100644 --- a/frontend/src/app/features/author-browser/components/author-card/author-card.component.html +++ b/frontend/src/app/features/author-browser/components/author-card/author-card.component.html @@ -28,8 +28,7 @@ class="select-checkbox" (click)="captureMouseEvent($event)" [ngModel]="isSelected" - (onChange)="toggleSelection($event)"> - + (onChange)="toggleSelection($event)" /> }
@@ -38,14 +37,13 @@ }

{{ author.name }}

diff --git a/frontend/src/app/features/author-browser/components/author-card/author-card.component.ts b/frontend/src/app/features/author-browser/components/author-card/author-card.component.ts index 1526652a3..855e145cb 100644 --- a/frontend/src/app/features/author-browser/components/author-card/author-card.component.ts +++ b/frontend/src/app/features/author-browser/components/author-card/author-card.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges} from '@angular/core'; +import {ChangeDetectorRef, Component, inject, Input, OnChanges, output, SimpleChanges} from '@angular/core'; import {TranslocoPipe, TranslocoService} from '@jsverse/transloco'; import {Tooltip} from '@openng/optimus-ui/tooltip'; import {CheckboxChangeEvent, Checkbox} from '@openng/optimus-ui/checkbox'; @@ -17,26 +17,25 @@ import {AuthorService} from '../../service/author.service'; imports: [TranslocoPipe, Tooltip, Checkbox, FormsModule, TieredMenu, Button] }) export class AuthorCardComponent implements OnChanges { + private readonly authorService = inject(AuthorService); + private readonly messageService = inject(MessageService); + private readonly t = inject(TranslocoService); + private readonly cdr = inject(ChangeDetectorRef); @Input({required: true}) author!: AuthorSummary; @Input() canQuickMatch = false; @Input() canDelete = false; @Input() isCheckboxEnabled = false; @Input() isSelected = false; - @Output() cardClick = new EventEmitter(); - @Output() quickMatched = new EventEmitter(); - @Output() checkboxClick = new EventEmitter<{ index: number; author: AuthorSummary; selected: boolean; shiftKey: boolean }>(); - @Output() viewAuthor = new EventEmitter(); - @Output() editAuthor = new EventEmitter(); - @Output() deleteAuthor = new EventEmitter(); - @Output() menuToggled = new EventEmitter(); + readonly cardClick = output(); + readonly quickMatched = output(); + readonly checkboxClick = output<{ index: number; author: AuthorSummary; selected: boolean; shiftKey: boolean }>(); + readonly viewAuthor = output(); + readonly editAuthor = output(); + readonly deleteAuthor = output(); + readonly menuToggled = output(); @Input() index = 0; @Input() cacheBuster = 0; - - private authorService = inject(AuthorService); - private messageService = inject(MessageService); - private t = inject(TranslocoService); - private cdr = inject(ChangeDetectorRef); private lastShiftKey = false; hasPhoto = false; diff --git a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html index 662bd697b..dc140e38a 100644 --- a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html +++ b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html @@ -1,8 +1,7 @@ @if (loading()) {
- - +

{{ t('loading') }}

} @@ -50,13 +49,13 @@ target="_blank" rel="noopener noreferrer" class="asin-link"> - + - + } @if (canEditMetadata) { @@ -68,15 +67,14 @@ [disabled]="quickMatching" (onClick)="quickMatch()" [pTooltip]="t('quickMatchTooltip')" - tooltipPosition="top"> - + tooltipPosition="top" /> } @if (author.description) {
{{ author.description }}
@@ -87,8 +85,7 @@ iconPos="right" size="small" text - (click)="toggleExpand()"> - + (click)="toggleExpand()" /> }
} @@ -120,8 +117,7 @@ [index]="virtualItem.index" [book]="book" [isSeriesCollapsed]="false" - [overlayPreferenceService]="bookCardOverlayPreferenceService"> - + [overlayPreferenceService]="bookCardOverlayPreferenceService" /> } @@ -138,15 +134,13 @@ - + (authorUpdated)="onAuthorUpdated($event)" /> - + (authorMatched)="onAuthorUpdated($event)" /> } diff --git a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts index 134194da6..3661fe4cc 100644 --- a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts +++ b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts @@ -1,6 +1,5 @@ import { AfterViewChecked, Component, computed, ElementRef, inject, OnInit, signal, viewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { NgClass } from '@angular/common'; import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@openng/optimus-ui/tabs'; import { ProgressSpinner } from '@openng/optimus-ui/progressspinner'; import { Button } from '@openng/optimus-ui/button'; @@ -26,7 +25,6 @@ import { createVirtualGrid } from '../../../../shared/util/virtual-grid.util'; templateUrl: './author-detail.component.html', styleUrls: ['./author-detail.component.scss'], imports: [ - NgClass, Tabs, TabList, Tab, @@ -46,30 +44,30 @@ export class AuthorDetailComponent implements OnInit, AfterViewChecked { private static readonly GRID_GAP = 21; - private route = inject(ActivatedRoute); - private router = inject(Router); - private authorService = inject(AuthorService); - private bookService = inject(BookService); - private messageService = inject(MessageService); + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly authorService = inject(AuthorService); + private readonly bookService = inject(BookService); + private readonly messageService = inject(MessageService); protected coverScalePreferenceService = inject(CoverScalePreferenceService); protected bookCardOverlayPreferenceService = inject(BookCardOverlayPreferenceService); protected userService = inject(UserService); - private pageTitle = inject(PageTitleService); - private t = inject(TranslocoService); + private readonly pageTitle = inject(PageTitleService); + private readonly t = inject(TranslocoService); readonly descriptionContentRef = viewChild>('descriptionContent'); private readonly scrollElement = viewChild>('scrollElement'); - loading = signal(true); + readonly loading = signal(true); tab = 'books'; isExpanded = false; isOverflowing = false; hasPhoto = true; photoTimestamp = Date.now(); quickMatching = false; - private authorState = signal(null); + private readonly authorState = signal(null); author = this.authorState.asReadonly(); - authorBooks = computed(() => { + readonly authorBooks = computed(() => { const authorName = this.author()?.name?.toLowerCase(); if (!authorName) { return []; diff --git a/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.html b/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.html index 18d66fc93..ab53fec2f 100644 --- a/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.html +++ b/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.html @@ -8,8 +8,7 @@ width="200" appendTo="body" [preview]="true" - (onImageError)="onPhotoError()"> - + (onImageError)="onPhotoError()" /> } @else {
@@ -17,7 +16,7 @@ } @if (isUploading()) { - + }
@@ -34,8 +33,7 @@ (onUpload)="onUpload()" (onError)="onUploadError()" [auto]="true" - (onBeforeUpload)="onBeforeUpload()"> - + (onBeforeUpload)="onBeforeUpload()" /> - + severity="info" /> @if (!form.get('photoLocked')?.value) { - + severity="success" /> } - @if (form.get('photoLocked')?.value) { + @else { - + severity="warn" /> }
@@ -79,10 +74,10 @@
@if (!form.get('nameLocked')?.value) { - + } - @if (form.get('nameLocked')?.value) { - + @else { + }
@@ -92,10 +87,10 @@
@if (!form.get('asinLocked')?.value) { - + } - @if (form.get('asinLocked')?.value) { - + @else { + }
@@ -106,26 +101,25 @@ @if (!form.get('descriptionLocked')?.value) { - + } - @if (form.get('descriptionLocked')?.value) { - + @else { + } diff --git a/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.ts b/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.ts index 291f1c688..c496aabc2 100644 --- a/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.ts +++ b/frontend/src/app/features/author-browser/components/author-editor/author-editor.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Input, OnChanges, OnInit, Output, signal, SimpleChanges} from '@angular/core'; +import {Component, inject, Input, OnChanges, OnInit, output, signal, SimpleChanges} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms'; import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; import {Button} from '@openng/optimus-ui/button'; @@ -35,19 +35,18 @@ import {AuthorPhotoSearchComponent} from '../author-photo-search/author-photo-se providers: [DialogService] }) export class AuthorEditorComponent implements OnInit, OnChanges { + private readonly authorService = inject(AuthorService); + private readonly messageService = inject(MessageService); + private readonly dialogService = inject(DialogService); + private readonly t = inject(TranslocoService); @Input({required: true}) authorId!: number; @Input({required: true}) author!: AuthorDetails; - @Output() authorUpdated = new EventEmitter(); - - private authorService = inject(AuthorService); - private messageService = inject(MessageService); - private dialogService = inject(DialogService); - private t = inject(TranslocoService); + readonly authorUpdated = output(); form!: FormGroup; - isSaving = signal(false); - isUploading = signal(false); + readonly isSaving = signal(false); + readonly isUploading = signal(false); hasPhoto = true; photoTimestamp = Date.now(); diff --git a/frontend/src/app/features/author-browser/components/author-match/author-match.component.html b/frontend/src/app/features/author-browser/components/author-match/author-match.component.html index a5cefa9f6..ff6144fa5 100644 --- a/frontend/src/app/features/author-browser/components/author-match/author-match.component.html +++ b/frontend/src/app/features/author-browser/components/author-match/author-match.component.html @@ -19,8 +19,7 @@ (ngModelChange)="selectedRegion.set($event)" optionLabel="label" optionValue="value" - class="region-dropdown"> - + class="region-dropdown" />
- + [disabled]="!canSearch()" />
@@ -40,8 +38,7 @@ [style]="{'width': '40px', 'height': '40px'}" strokeWidth="3" fill="transparent" - animationDuration="1.5s"> - + animationDuration="1.5s" /> {{ t('searching') }} } @@ -91,8 +88,7 @@ icon="pi pi-link" severity="success" [loading]="matching()" - (onClick)="matchAuthor(result)"> -
+ (onClick)="matchAuthor(result)" /> } diff --git a/frontend/src/app/features/author-browser/components/author-match/author-match.component.ts b/frontend/src/app/features/author-browser/components/author-match/author-match.component.ts index c3d1ca818..a4c629033 100644 --- a/frontend/src/app/features/author-browser/components/author-match/author-match.component.ts +++ b/frontend/src/app/features/author-browser/components/author-match/author-match.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectionStrategy, Component, computed, EventEmitter, inject, Input, OnInit, Output, signal} from '@angular/core'; +import {ChangeDetectionStrategy, Component, computed, inject, Input, OnInit, output, signal} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {Button} from '@openng/optimus-ui/button'; import {InputText} from '@openng/optimus-ui/inputtext'; @@ -30,24 +30,23 @@ interface RegionOption { ] }) export class AuthorMatchComponent implements OnInit { + private readonly authorService = inject(AuthorService); + private readonly messageService = inject(MessageService); + private readonly t = inject(TranslocoService); @Input({required: true}) authorId!: number; @Input({required: true}) authorName!: string; - @Output() authorMatched = new EventEmitter(); + readonly authorMatched = output(); - private authorService = inject(AuthorService); - private messageService = inject(MessageService); - private t = inject(TranslocoService); + readonly searchQuery = signal(''); + readonly asinQuery = signal(''); + readonly selectedRegion = signal('us'); + readonly searching = signal(false); + readonly matching = signal(false); + readonly results = signal([]); + readonly hasSearched = signal(false); - searchQuery = signal(''); - asinQuery = signal(''); - selectedRegion = signal('us'); - searching = signal(false); - matching = signal(false); - results = signal([]); - hasSearched = signal(false); - - canSearch = computed(() => !!this.searchQuery().trim() || !!this.asinQuery().trim()); + readonly canSearch = computed(() => !!this.searchQuery().trim() || !!this.asinQuery().trim()); regionOptions: RegionOption[] = [ {label: 'US', value: 'us'}, diff --git a/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.html b/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.html index e418bfd1a..16f621e9c 100644 --- a/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.html +++ b/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.html @@ -21,8 +21,7 @@ [label]="t('searchBtn')" icon="pi pi-search" [loading]="searching" - [disabled]="searchForm.invalid"> -
+ [disabled]="searchForm.invalid" /> - + tooltipPosition="top" /> @@ -49,7 +47,7 @@ } @else if (searching) {
- +

{{ t('searching') }}

} @else if (photos.length === 0) { @@ -76,8 +74,7 @@ [src]="photo.url" [alt]="t('photoAlt', { index: i + 1 })" appendTo="body" - [preview]="true"> - + [preview]="true" /> @if (photo.width && photo.height) {
{{ photo.width }} x {{ photo.height }} @@ -88,8 +85,7 @@ (click)="selectAndUploadPhoto(photo)" [label]="t('selectBtn')" icon="pi pi-check" - size="small"> - + size="small" />
diff --git a/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.ts b/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.ts index cecfb2997..55ea36792 100644 --- a/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.ts +++ b/frontend/src/app/features/author-browser/components/author-photo-search/author-photo-search.component.ts @@ -27,18 +27,17 @@ import {AuthorPhotoResult} from '../../model/author.model'; ] }) export class AuthorPhotoSearchComponent implements OnInit { + private readonly fb = inject(FormBuilder); + private readonly authorService = inject(AuthorService); + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); + protected dynamicDialogRef = inject(DynamicDialogRef); + private readonly messageService = inject(MessageService); + private readonly t = inject(TranslocoService); searchForm: FormGroup; photos: AuthorPhotoResult[] = []; searching = false; hasSearched = false; - private fb = inject(FormBuilder); - private authorService = inject(AuthorService); - private dynamicDialogConfig = inject(DynamicDialogConfig); - protected dynamicDialogRef = inject(DynamicDialogRef); - private messageService = inject(MessageService); - private t = inject(TranslocoService); - private authorId!: number; constructor() { diff --git a/frontend/src/app/features/author-browser/service/author-selection.service.ts b/frontend/src/app/features/author-browser/service/author-selection.service.ts index 0a08b2b32..e06201adc 100644 --- a/frontend/src/app/features/author-browser/service/author-selection.service.ts +++ b/frontend/src/app/features/author-browser/service/author-selection.service.ts @@ -1,4 +1,4 @@ -import {computed, Injectable, signal} from '@angular/core'; +import {computed, Service, signal} from '@angular/core'; import {AuthorSummary} from '../model/author.model'; export interface AuthorCheckboxClickEvent { @@ -8,7 +8,7 @@ export interface AuthorCheckboxClickEvent { shiftKey: boolean; } -@Injectable({providedIn: 'root'}) +@Service() export class AuthorSelectionService { private readonly _selectedAuthors = signal>(new Set()); readonly selectedAuthors = this._selectedAuthors.asReadonly(); diff --git a/frontend/src/app/features/author-browser/service/author.service.ts b/frontend/src/app/features/author-browser/service/author.service.ts index 4815aecb4..1bb726b2b 100644 --- a/frontend/src/app/features/author-browser/service/author.service.ts +++ b/frontend/src/app/features/author-browser/service/author.service.ts @@ -1,4 +1,4 @@ -import {computed, DestroyRef, effect, inject, Injectable} from '@angular/core'; +import {computed, DestroyRef, effect, inject, Service} from '@angular/core'; import {HttpClient, HttpHeaders} from '@angular/common/http'; import {lastValueFrom, Observable} from 'rxjs'; import {map, tap} from 'rxjs/operators'; @@ -12,29 +12,27 @@ import {AUTHORS_QUERY_KEY} from './author-query-keys'; import {invalidateAuthorsQuery, patchAuthorInCache} from './author-query-cache'; import {invalidateAllBookCaches} from '../../book/service/legacy-book-cache'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class AuthorService { - private http = inject(HttpClient); - private authService = inject(AuthService); - private sseClient = inject(SseClient); - private queryClient = inject(QueryClient); - private destroyRef = inject(DestroyRef); + private readonly http = inject(HttpClient); + private readonly authService = inject(AuthService); + private readonly sseClient = inject(SseClient); + private readonly queryClient = inject(QueryClient); + private readonly destroyRef = inject(DestroyRef); private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/authors`; private readonly mediaBaseUrl = `${API_CONFIG.BASE_URL}/api/v1/media`; private readonly token = this.authService.token; private readonly authorInvalidationDebounceMs = 200; private authorInvalidationTimer: ReturnType | null = null; - private authorsQuery = injectQuery(() => ({ + private readonly authorsQuery = injectQuery(() => ({ ...this.getAuthorsQueryOptions(), enabled: !!this.token(), })); - allAuthors = computed(() => this.authorsQuery.data() ?? null); - isAuthorsLoading = computed(() => !!this.token() && this.authorsQuery.isPending()); + readonly allAuthors = computed(() => this.authorsQuery.data() ?? null); + readonly isAuthorsLoading = computed(() => !!this.token() && this.authorsQuery.isPending()); constructor() { this.destroyRef.onDestroy(() => this.clearAuthorInvalidationTimer()); diff --git a/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.ts b/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.ts index 977aaf73b..c1aa21b5a 100644 --- a/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.ts +++ b/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.ts @@ -60,14 +60,13 @@ const NO_OVERFLOW: ReadonlySet = new Set(); templateUrl: './book-browse-bulk-bar.component.html', }) export class BookBrowseBulkBarComponent { + private readonly userService = inject(UserService); + private readonly appSettingsService = inject(AppSettingsService); + private readonly shelfDefinitionQuery = inject(ShelfDefinitionQueryService); readonly selection = input.required(); readonly books = input.required(); readonly total = input.required(); readonly fetchIds = input.required<() => Promise>(); - - private readonly userService = inject(UserService); - private readonly appSettingsService = inject(AppSettingsService); - private readonly shelfDefinitionQuery = inject(ShelfDefinitionQueryService); protected readonly commands = createBookBrowseBulkCommands({ selection: this.selection, books: this.books, diff --git a/frontend/src/app/features/book/browse/book-browse-column-width-preference.service.ts b/frontend/src/app/features/book/browse/book-browse-column-width-preference.service.ts index 607ece96f..3111341f7 100644 --- a/frontend/src/app/features/book/browse/book-browse-column-width-preference.service.ts +++ b/frontend/src/app/features/book/browse/book-browse-column-width-preference.service.ts @@ -1,10 +1,10 @@ -import {Injectable, inject} from '@angular/core'; +import {Service, inject} from '@angular/core'; import {LocalStorageService} from '../../../shared/service/local-storage.service'; const STORAGE_KEY = 'browseTableColumnWidths'; -@Injectable({providedIn: 'root'}) +@Service() export class BookBrowseColumnWidthPreferenceService { private readonly localStorage = inject(LocalStorageService); diff --git a/frontend/src/app/features/book/browse/book-browse-detail-line.service.ts b/frontend/src/app/features/book/browse/book-browse-detail-line.service.ts index 17eae2b77..a45469e8e 100644 --- a/frontend/src/app/features/book/browse/book-browse-detail-line.service.ts +++ b/frontend/src/app/features/book/browse/book-browse-detail-line.service.ts @@ -1,4 +1,4 @@ -import {Injectable, inject} from '@angular/core'; +import {Service, inject} from '@angular/core'; import {toSignal} from '@angular/core/rxjs-interop'; import {TranslocoService} from '@jsverse/transloco'; @@ -7,7 +7,7 @@ import {type BookSummary} from '../data/book-response.models'; import {formatBookValue} from './book-browse-columns'; import {type BookColumnKind, type BookColumnValue, type BookDetailLineSortKey} from './book-browse-fields'; -@Injectable({providedIn: 'root'}) +@Service() export class BookBrowseDetailLineService { private readonly transloco = inject(TranslocoService); private readonly activeLang = toSignal(this.transloco.langChanges$, { diff --git a/frontend/src/app/features/book/browse/book-browse-table.component.ts b/frontend/src/app/features/book/browse/book-browse-table.component.ts index 674411e54..194cae3a9 100644 --- a/frontend/src/app/features/book/browse/book-browse-table.component.ts +++ b/frontend/src/app/features/book/browse/book-browse-table.component.ts @@ -120,6 +120,14 @@ const BODY_CELL_CLASS = }, }) export class BookBrowseTableComponent { + private readonly transloco = inject(TranslocoService); + private readonly urlHelper = inject(UrlHelperService); + private readonly router = inject(Router); + private readonly locationStrategy = inject(LocationStrategy); + private readonly route = inject(ActivatedRoute); + private readonly scrollPosition = inject(RouteScrollPositionService); + private readonly destroyRef = inject(DestroyRef); + private readonly columnWidthPreference = inject(BookBrowseColumnWidthPreferenceService); readonly books = input.required(); readonly status = input.required(); readonly hasNextPage = input.required(); @@ -146,15 +154,6 @@ export class BookBrowseTableComponent { readonly emptyDef = contentChild.required(BrowseEmptyDef); - private readonly transloco = inject(TranslocoService); - private readonly urlHelper = inject(UrlHelperService); - private readonly router = inject(Router); - private readonly locationStrategy = inject(LocationStrategy); - private readonly route = inject(ActivatedRoute); - private readonly scrollPosition = inject(RouteScrollPositionService); - private readonly destroyRef = inject(DestroyRef); - private readonly columnWidthPreference = inject(BookBrowseColumnWidthPreferenceService); - private readonly initialColumnSizing: ColumnSizingState = this.columnWidthPreference.load(); private readonly selectColumnVisible = computed(() => this.selection() !== null); private readonly sortOptionsById = computed(() => diff --git a/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.html b/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.html index 288f228b3..c744d7894 100644 --- a/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.html +++ b/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.html @@ -112,8 +112,7 @@ [placeholder]="t('authorsPlaceholder')" (completeMethod)="filterAuthors($event)" (onKeyUp)="onAutoCompleteKeyUp('authors', $event)" - (onSelect)="onAutoCompleteSelect('authors', $event)"> - + (onSelect)="onAutoCompleteSelect('authors', $event)" /> @@ -192,8 +191,7 @@ [(ngModel)]="pageCount" [useGrouping]="false" [placeholder]="t('pageCountPlaceholder')" - class="input-full"> - + class="input-full" /> @@ -217,8 +215,7 @@ [placeholder]="t('categoriesPlaceholder')" (completeMethod)="filterCategories($event)" (onKeyUp)="onAutoCompleteKeyUp('categories', $event)" - (onSelect)="onAutoCompleteSelect('categories', $event)"> - + (onSelect)="onAutoCompleteSelect('categories', $event)" /> diff --git a/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.ts b/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.ts index 00293cb6b..c859ff605 100644 --- a/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.ts +++ b/frontend/src/app/features/book/components/add-physical-book-dialog/add-physical-book-dialog.component.ts @@ -34,12 +34,12 @@ import {TranslocoDirective} from '@jsverse/transloco'; styleUrl: './add-physical-book-dialog.component.scss', }) export class AddPhysicalBookDialogComponent { - private dynamicDialogRef = inject(DynamicDialogRef); - private dialogConfig = inject(DynamicDialogConfig); - private bookService = inject(BookService); - private queryClient = inject(QueryClient); - private sources = inject(MetadataSourceQueryService); - private libraryService = inject(LibraryService); + private readonly dynamicDialogRef = inject(DynamicDialogRef); + private readonly dialogConfig = inject(DynamicDialogConfig); + private readonly bookService = inject(BookService); + private readonly queryClient = inject(QueryClient); + private readonly sources = inject(MetadataSourceQueryService); + private readonly libraryService = inject(LibraryService); selectedLibraryId: number | null = null; title: string = ''; @@ -59,8 +59,8 @@ export class AddPhysicalBookDialogComponent { filteredCategories: string[] = []; coverUrl: string | null = null; - isLoading = signal(false); - isFetchingMetadata = signal(false); + readonly isLoading = signal(false); + readonly isFetchingMetadata = signal(false); readonly metadataLookupMessage = signal<'metadataNotFound' | 'metadataLookupFailed' | null>(null); private readonly initializeSelectedLibraryEffect = effect(() => { const libraries = this.libraries; diff --git a/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.html b/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.html index 00d14279d..9252bbf06 100644 --- a/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.html +++ b/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.html @@ -14,8 +14,7 @@ [text]="true" severity="secondary" (click)="closeDialog()" - class="close-button"> - + class="close-button" />
@@ -29,7 +28,7 @@ [placeholder]="t('selectFileType')" class="full-width" [disabled]="isUploading" - > + /> } + @default never; }
} @@ -118,7 +118,7 @@ } - +
diff --git a/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.ts b/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.ts index c83a4f4b3..15ca8d6f0 100644 --- a/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.ts +++ b/frontend/src/app/features/book/components/additional-file-uploader/additional-file-uploader.component.ts @@ -42,12 +42,12 @@ interface UploadingFile { }) export class AdditionalFileUploaderComponent implements OnInit, OnDestroy { private readonly t = inject(TranslocoService); - private dialogRef = inject(DynamicDialogRef); - private config = inject(DynamicDialogConfig); - private bookFileService = inject(BookFileService); - private appSettingsService = inject(AppSettingsService); - private messageService = inject(MessageService); - private cdr = inject(ChangeDetectorRef); + private readonly dialogRef = inject(DynamicDialogRef); + private readonly config = inject(DynamicDialogConfig); + private readonly bookFileService = inject(BookFileService); + private readonly appSettingsService = inject(AppSettingsService); + private readonly messageService = inject(MessageService); + private readonly cdr = inject(ChangeDetectorRef); book!: Book; files: UploadingFile[] = []; @@ -60,8 +60,8 @@ export class AdditionalFileUploaderComponent implements OnInit, OnDestroy { fileTypeOptions: FileTypeOption[] = []; - @ViewChild(FileUpload) private fileUpload!: FileUpload; - private destroy$ = new Subject(); + @ViewChild(FileUpload) private readonly fileUpload!: FileUpload; + private readonly destroy$ = new Subject(); ngOnInit(): void { this.book = this.config.data.book; diff --git a/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.html b/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.html index 62742c945..0d646a56b 100644 --- a/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.html +++ b/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.html @@ -20,8 +20,7 @@ [rounded]="true" [pTooltip]="book.metadata?.title" tooltipPosition="top" - [ngClass]="{ 'is-visible': isHovered }" - (onClick)="openBookInfo(book)"> - + [class.is-visible]="isHovered" + (onClick)="openBookInfo(book)" /> }
diff --git a/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.ts b/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.ts index 60a759592..ccb070989 100644 --- a/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.ts +++ b/frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.ts @@ -5,7 +5,6 @@ import {CoverComponent} from '../../../../shared/components/cover/cover.componen import {Button} from '@openng/optimus-ui/button'; import {UserService} from '../../../settings/user-management/user.service'; import {Router} from '@angular/router'; -import {NgClass} from '@angular/common'; import {BookMetadataHostService} from '../../../../shared/service/book-metadata-host.service'; import {Tooltip} from '@openng/optimus-ui/tooltip'; @@ -14,7 +13,6 @@ import {Tooltip} from '@openng/optimus-ui/tooltip'; changeDetection: ChangeDetectionStrategy.OnPush, imports: [ Button, - NgClass, Tooltip, CoverComponent ], @@ -22,16 +20,15 @@ import {Tooltip} from '@openng/optimus-ui/tooltip'; styleUrl: './book-card-lite-component.scss' }) export class BookCardLiteComponent { + private readonly router = inject(Router); + protected urlHelper = inject(UrlHelperService); + private readonly userService = inject(UserService); + private readonly bookMetadataHostService = inject(BookMetadataHostService); @Input() book!: Book; @Input() isActive: boolean = false; @Input() showSeriesNumber: boolean = false; - private router = inject(Router); - protected urlHelper = inject(UrlHelperService); - private userService = inject(UserService); - private bookMetadataHostService = inject(BookMetadataHostService); - - private metadataCenterViewMode = computed(() => + private readonly metadataCenterViewMode = computed(() => this.userService.currentUser()?.userSettings.metadataCenterViewMode ?? 'route' ); isHovered: boolean = false; diff --git a/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.html b/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.html index 52a598f63..711c9d347 100644 --- a/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.html +++ b/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.html @@ -9,8 +9,7 @@

{{ isBulkMode ? t('descriptionBulk') : t('description') }}

- + class="close-button" />
@@ -61,8 +60,7 @@
- - + @@ -84,11 +82,9 @@
- + [disabled]="isAttaching" /> - + [disabled]="!canAttach()" [loading]="isAttaching" />
diff --git a/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.ts b/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.ts index 9e566bb01..7025c5f8d 100644 --- a/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.ts +++ b/frontend/src/app/features/book/components/book-file-attacher/book-file-attacher.component.ts @@ -34,6 +34,13 @@ export interface BookFileAttacherSourceBook { styleUrls: ['./book-file-attacher.component.scss'] }) export class BookFileAttacherComponent implements OnInit, AfterViewInit, OnDestroy { + private readonly t = inject(TranslocoService); + private readonly appSettingsService = inject(AppSettingsService); + private readonly dialogRef = inject(DynamicDialogRef); + private readonly config = inject(DynamicDialogConfig); + private readonly bookService = inject(BookService); + private readonly bookFileService = inject(BookFileService); + private readonly messageService = inject(MessageService); @ViewChild('autocompleteWrapper') autocompleteWrapper!: ElementRef; sourceBooks: readonly BookFileAttacherSourceBook[] = []; @@ -44,17 +51,9 @@ export class BookFileAttacherComponent implements OnInit, AfterViewInit, OnDestr filteredBooks: Book[] = []; autocomplePanelStyle: Record = {}; - private destroy$ = new Subject(); + private readonly destroy$ = new Subject(); private allBooks: Signal = signal([]); - private readonly t = inject(TranslocoService); - private readonly appSettingsService = inject(AppSettingsService); - private dialogRef = inject(DynamicDialogRef); - private config = inject(DynamicDialogConfig); - private bookService = inject(BookService); - private bookFileService = inject(BookFileService); - private messageService = inject(MessageService); - ngAfterViewInit(): void { setTimeout(() => { const width = this.autocompleteWrapper?.nativeElement?.offsetWidth; diff --git a/frontend/src/app/features/book/components/book-menu/book-menu.component.ts b/frontend/src/app/features/book/components/book-menu/book-menu.component.ts index 1030ec6f6..38e4fc755 100644 --- a/frontend/src/app/features/book/components/book-menu/book-menu.component.ts +++ b/frontend/src/app/features/book/components/book-menu/book-menu.component.ts @@ -101,11 +101,6 @@ const BOOK_MENU_READ_ACTION_LABEL_KEYS: Readonly> templateUrl: './book-menu.component.html', }) export class BookMenuComponent { - readonly books = input([]); - readonly openInNewTab = input(false, {transform: booleanAttribute}); - - readonly deleted = output(); - private readonly userService = inject(UserService); private readonly appSettingsService = inject(AppSettingsService); private readonly fileDownload = inject(FileDownloadService); @@ -119,6 +114,10 @@ export class BookMenuComponent { private readonly confirmationService = inject(ConfirmationService); private readonly transloco = inject(TranslocoService); private readonly router = inject(Router); + readonly books = input([]); + readonly openInNewTab = input(false, {transform: booleanAttribute}); + + readonly deleted = output(); private readonly rootMenu = viewChild.required(AppMenuComponent); private readonly bookSnapshot = signal(null); diff --git a/frontend/src/app/features/book/components/book-notes/book-notes-component.html b/frontend/src/app/features/book/components/book-notes/book-notes-component.html index e6f3f8a61..df9fc1707 100644 --- a/frontend/src/app/features/book/components/book-notes/book-notes-component.html +++ b/frontend/src/app/features/book/components/book-notes/book-notes-component.html @@ -16,8 +16,7 @@ (click)="openCreateDialog()" pTooltip="Add New Note" tooltipPosition="top" - class="action-btn floating-btn"> - + class="action-btn floating-btn" />

No notes yet for this book

@@ -55,8 +54,7 @@ (onClick)="openEditDialog(note)" pTooltip="Edit note" tooltipPosition="top" - class="action-btn-hover"> - + class="action-btn-hover" /> - + class="action-btn-hover" /> @@ -91,8 +88,7 @@ severity="success" (click)="openCreateDialog()" pTooltip="Add New Note" - tooltipPosition="left"> - + tooltipPosition="left" /> } @@ -136,15 +132,13 @@ label="Cancel" severity="secondary" outlined - (onClick)="cancelCreate()"> - + (onClick)="cancelCreate()" /> - + (onClick)="createNote()" /> @@ -189,18 +183,16 @@ label="Cancel" severity="secondary" outlined - (onClick)="cancelEdit()"> - + (onClick)="cancelEdit()" /> - + (onClick)="updateNote()" /> - + diff --git a/frontend/src/app/features/book/components/book-notes/book-notes-component.ts b/frontend/src/app/features/book/components/book-notes/book-notes-component.ts index b0df860ff..7a5f3e506 100644 --- a/frontend/src/app/features/book/components/book-notes/book-notes-component.ts +++ b/frontend/src/app/features/book/components/book-notes/book-notes-component.ts @@ -29,16 +29,15 @@ import {BookNote, BookNoteService, CreateBookNoteRequest} from '../../../../shar styleUrl: './book-notes-component.scss' }) export class BookNotesComponent implements OnInit, OnChanges { + private readonly bookNoteService = inject(BookNoteService); + private readonly confirmationService = inject(ConfirmationService); + private readonly messageService = inject(MessageService); + private readonly destroyRef = inject(DestroyRef); + private readonly t = inject(TranslocoService); @Input() bookId!: number; - private bookNoteService = inject(BookNoteService); - private confirmationService = inject(ConfirmationService); - private messageService = inject(MessageService); - private destroyRef = inject(DestroyRef); - private readonly t = inject(TranslocoService); - notes: BookNote[] = []; - loading = signal(false); + readonly loading = signal(false); showCreateDialog = false; showEditDialog = false; selectedNote: BookNote | null = null; @@ -62,7 +61,7 @@ export class BookNotesComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes['bookId'] && changes['bookId'].currentValue) { + if (changes['bookId']?.currentValue) { this.loadNotes(); } } diff --git a/frontend/src/app/features/book/components/book-reviews/book-review-service.ts b/frontend/src/app/features/book/components/book-reviews/book-review-service.ts index 333049dd6..478d2f27d 100644 --- a/frontend/src/app/features/book/components/book-reviews/book-review-service.ts +++ b/frontend/src/app/features/book/components/book-reviews/book-review-service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {API_CONFIG} from '../../../../core/config/api-config'; @@ -17,13 +17,11 @@ export interface BookReview { textReviewsCount?: number; } -@Injectable({ - providedIn: 'root', -}) +@Service() export class BookReviewService { + private readonly http = inject(HttpClient); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/reviews`; - private http = inject(HttpClient); getByBookId(bookId: number): Observable { return this.http.get(`${this.url}/book/${bookId}`); diff --git a/frontend/src/app/features/book/components/book-reviews/book-reviews.component.html b/frontend/src/app/features/book/components/book-reviews/book-reviews.component.html index babae8502..afafc18ac 100644 --- a/frontend/src/app/features/book/components/book-reviews/book-reviews.component.html +++ b/frontend/src/app/features/book/components/book-reviews/book-reviews.component.html @@ -18,8 +18,7 @@ (click)="fetchNewReviews()" [pTooltip]="t('tooltip.fetchReviews')" tooltipPosition="top" - class="action-btn floating-btn"> - + class="action-btn floating-btn" /> }

{{ t('empty.noReviews') }}

diff --git a/frontend/src/app/features/book/components/book-reviews/book-reviews.component.ts b/frontend/src/app/features/book/components/book-reviews/book-reviews.component.ts index 585cd669d..6168a2ee0 100644 --- a/frontend/src/app/features/book/components/book-reviews/book-reviews.component.ts +++ b/frontend/src/app/features/book/components/book-reviews/book-reviews.component.ts @@ -25,27 +25,26 @@ import {MetadataCatalogService} from '../../../../shared/metadata/metadata-catal styleUrl: './book-reviews.component.scss' }) export class BookReviewsComponent implements OnInit, OnChanges { + private readonly reviewService = inject(BookReviewService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly confirmationService = inject(ConfirmationService); + private readonly messageService = inject(MessageService); + private readonly userService = inject(UserService); + private readonly appSettingsService = inject(AppSettingsService); + private readonly destroyRef = inject(DestroyRef); + private readonly t = inject(TranslocoService); + protected readonly catalog = inject(MetadataCatalogService); @Input() bookId!: number; @Input() reviews: BookReview[] | undefined = []; @Input() active: boolean = false; @Input() reviewsLocked = false; - - private reviewService = inject(BookReviewService); - private bookMetadataManageService = inject(BookMetadataManageService); - private confirmationService = inject(ConfirmationService); - private messageService = inject(MessageService); - private userService = inject(UserService); - private appSettingsService = inject(AppSettingsService); - private destroyRef = inject(DestroyRef); - private readonly t = inject(TranslocoService); - protected readonly catalog = inject(MetadataCatalogService); private loadingBookId: number | null = null; private loadingRequestSeq = 0; private activeLoadingRequestSeq: number | null = null; - loading = signal(false); + readonly loading = signal(false); hasPermission = false; revealedSpoilers = new Set(); sortAscending = false; @@ -58,7 +57,7 @@ export class BookReviewsComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes['bookId'] && changes['bookId'].currentValue) { + if (changes['bookId']?.currentValue) { this.loadReviews(); } } @@ -320,7 +319,7 @@ export class BookReviewsComponent implements OnInit, OnChanges { } private updateSpoilerState(): void { - const spoilerReviews = this.reviews?.filter(r => r.spoiler) || []; + const spoilerReviews = this.reviews?.filter(r => r.spoiler) ?? []; const revealedSpoilerReviews = spoilerReviews.filter(r => r.id && this.revealedSpoilers.has(r.id)); this.allSpoilersRevealed = spoilerReviews.length > 0 && spoilerReviews.length === revealedSpoilerReviews.length; } diff --git a/frontend/src/app/features/book/components/book-sender/book-sender.component.html b/frontend/src/app/features/book/components/book-sender/book-sender.component.html index 6f0cde14a..7bf290952 100644 --- a/frontend/src/app/features/book/components/book-sender/book-sender.component.html +++ b/frontend/src/app/features/book/components/book-sender/book-sender.component.html @@ -14,8 +14,7 @@ [text]="true" severity="secondary" (click)="dynamicDialogRef.close()" - class="close-button"> - + class="close-button" />
@@ -29,8 +28,7 @@ [placeholder]="t('selectProvider')" [(ngModel)]="selectedProvider" appendTo="body" - class="full-width"> - + class="full-width" />
@@ -43,8 +41,7 @@ [(ngModel)]="selectedRecipient" [disabled]="!selectedProvider" appendTo="body" - class="full-width"> - + class="full-width" />
@if (emailableFiles.length > 0) { @@ -79,8 +76,7 @@ icon="pi pi-envelope" [label]="t('sendBook')" [disabled]="!selectedProvider || !selectedRecipient" - (onClick)="sendBook()"> - + (onClick)="sendBook()" />
diff --git a/frontend/src/app/features/book/components/book-sender/book-sender.component.ts b/frontend/src/app/features/book/components/book-sender/book-sender.component.ts index ba7554ccb..17fe818b9 100644 --- a/frontend/src/app/features/book/components/book-sender/book-sender.component.ts +++ b/frontend/src/app/features/book/components/book-sender/book-sender.component.ts @@ -41,13 +41,13 @@ const LARGE_FILE_THRESHOLD_KB = 25 * 1024; // 25MB }) export class BookSenderComponent implements OnInit { - private emailProviderService = inject(EmailV2ProviderService); - private emailRecipientService = inject(EmailV2RecipientService); - private emailService = inject(EmailService); - private messageService = inject(MessageService); + private readonly emailProviderService = inject(EmailV2ProviderService); + private readonly emailRecipientService = inject(EmailV2RecipientService); + private readonly emailService = inject(EmailService); + private readonly messageService = inject(MessageService); private readonly t = inject(TranslocoService); dynamicDialogRef = inject(DynamicDialogRef); - private dynamicDialogConfig = inject(DynamicDialogConfig); + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); book: BookSenderSource = this.dynamicDialogConfig.data.book; diff --git a/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.html b/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.html index d60759b81..34d9d87bb 100644 --- a/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.html +++ b/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.html @@ -217,6 +217,7 @@ @case ('created') { } @case ('created-no-metadata') { } @case ('failed') { } + @default never; } {{ entry.isbn }} diff --git a/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.ts b/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.ts index f2ed27add..07525b2dd 100644 --- a/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.ts +++ b/frontend/src/app/features/book/components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component.ts @@ -60,29 +60,29 @@ type ImportPhase = 'upload' | 'processing' | 'summary'; styleUrl: './bulk-isbn-import-dialog.component.scss', }) export class BulkIsbnImportDialogComponent { - private dynamicDialogRef = inject(DynamicDialogRef); - private dialogConfig = inject(DynamicDialogConfig); - private bookService = inject(BookService); - private queryClient = inject(QueryClient); - private sources = inject(MetadataSourceQueryService); - private libraryService = inject(LibraryService); + private readonly dynamicDialogRef = inject(DynamicDialogRef); + private readonly dialogConfig = inject(DynamicDialogConfig); + private readonly bookService = inject(BookService); + private readonly queryClient = inject(QueryClient); + private readonly sources = inject(MetadataSourceQueryService); + private readonly libraryService = inject(LibraryService); selectedLibraryId: number | null = null; - phase: WritableSignal = signal('upload'); + readonly phase: WritableSignal = signal('upload'); pasteText = ''; - entries: WritableSignal = signal([]); - skipped: WritableSignal = signal([]); - duplicatesRemoved = signal(0); + readonly entries: WritableSignal = signal([]); + readonly skipped: WritableSignal = signal([]); + readonly duplicatesRemoved = signal(0); showSkipped = false; - processedCount = signal(0); - createdCount = signal(0); - noMetadataCount = signal(0); - failedCount = signal(0); + readonly processedCount = signal(0); + readonly createdCount = signal(0); + readonly noMetadataCount = signal(0); + readonly failedCount = signal(0); cancelled = false; - parseError = signal(''); + readonly parseError = signal(''); readonly maxIsbnCount = MAX_ISBN_COUNT; private readonly initializeSelectedLibraryEffect = effect(() => { const libraries = this.libraries; @@ -218,7 +218,7 @@ export class BulkIsbnImportDialogComponent { this.dynamicDialogRef.close(); } - progressPercent = computed( + readonly progressPercent = computed( () => this.entries().length > 0 ? Math.round((this.processedCount() / this.entries().length) * 100) : 0 ); diff --git a/frontend/src/app/features/book/components/cards/book-card.component.ts b/frontend/src/app/features/book/components/cards/book-card.component.ts index 874b84154..6bb8938ff 100644 --- a/frontend/src/app/features/book/components/cards/book-card.component.ts +++ b/frontend/src/app/features/book/components/cards/book-card.component.ts @@ -70,6 +70,11 @@ export function bookCardCoverSrc( templateUrl: './book-card.component.html', }) export class BookCardComponent { + private readonly urlHelper = inject(UrlHelperService); + private readonly transloco = inject(TranslocoService); + private readonly router = inject(Router); + private readonly locationStrategy = inject(LocationStrategy); + private readonly destroyRef = inject(DestroyRef); readonly book = input.required(); readonly squareCovers = input(false, {transform: booleanAttribute}); readonly showBadge = input(true, {transform: booleanAttribute}); @@ -89,12 +94,6 @@ export class BookCardComponent { readonly action = output(); readonly menuRequested = output(); readonly detailRequested = output(); - - private readonly urlHelper = inject(UrlHelperService); - private readonly transloco = inject(TranslocoService); - private readonly router = inject(Router); - private readonly locationStrategy = inject(LocationStrategy); - private readonly destroyRef = inject(DestroyRef); private readonly activeLang = toSignal(this.transloco.langChanges$, { initialValue: this.transloco.getActiveLang(), }); diff --git a/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.html b/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.html index 4dc42c8a3..573329e67 100644 --- a/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.html +++ b/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.html @@ -14,8 +14,7 @@ [text]="true" severity="secondary" (click)="closeDialog()" - class="close-button"> - + class="close-button" />
@@ -27,13 +26,12 @@ (onChange)="onPresetChange()" optionLabel="label" optionValue="value" - [disabled]="isScanning() || isMerging()"> - + [disabled]="isScanning() || isMerging()" />
- @@ -41,23 +39,23 @@ @if (showAdvanced) {
- +
- +
- +
- +
- +
@@ -72,8 +70,7 @@ icon="pi pi-search" (click)="scan()" [disabled]="!canScan" - [loading]="isScanning()"> - + [loading]="isScanning()" />
@@ -81,8 +78,7 @@ [(ngModel)]="moveFiles" [binary]="true" inputId="moveFiles" - [disabled]="isMerging()"> - + [disabled]="isMerging()" />
@if (activeGroups.length > 0) { @@ -92,15 +88,14 @@ severity="success" (click)="mergeAll()" [disabled]="isMerging()" - [loading]="isMerging()"> - + [loading]="isMerging()" /> }
@if (isMerging()) { - + } @@ -139,9 +134,9 @@
{{ t('groupLabel', { index: pageFirst + $index + 1 }) }} - + @if (hasSameFormatConflict(group)) { - + }
- + [disabled]="isMerging()" /> @if (getDeleteSelectedCount(group) > 0) { - + [disabled]="isMerging()" /> } - + [disabled]="isMerging()" />
@@ -183,8 +175,7 @@ [ngModel]="group.selectedForDeletion.has(book.id)" (onChange)="toggleDeleteSelection(group, book.id)" [disabled]="isMerging()" - class="delete-checkbox"> - + class="delete-checkbox" /> }
diff --git a/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.ts b/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.ts index 82faea695..d7f7b2d79 100644 --- a/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.ts +++ b/frontend/src/app/features/book/components/duplicate-merger/duplicate-merger.component.ts @@ -8,7 +8,7 @@ import {SelectButton} from '@openng/optimus-ui/selectbutton'; import {ProgressBar} from '@openng/optimus-ui/progressbar'; import {Tag} from '@openng/optimus-ui/tag'; import {Paginator, PaginatorState} from '@openng/optimus-ui/paginator'; -import {Subject, takeUntil} from 'rxjs'; +import {lastValueFrom, Subject, takeUntil} from 'rxjs'; import {BookFileService} from '../../service/book-file.service'; import {BookService} from '../../service/book.service'; import {Book, DuplicateDetectionRequest, DuplicateGroup} from '../../model/book.model'; @@ -46,30 +46,6 @@ interface DisplayGroup extends DuplicateGroup { styleUrls: ['./duplicate-merger.component.scss'] }) export class DuplicateMergerComponent implements OnInit, OnDestroy { - libraryId!: number; - presetMode: PresetMode = 'balanced'; - showAdvanced = false; - - matchByIsbn = true; - matchByExternalId = true; - matchByTitleAuthor = true; - matchByDirectory = false; - matchByFilename = false; - - isScanning = signal(false); - isMerging = signal(false); - hasScanned = signal(false); - moveFiles = false; - mergeProgress = signal(0); - mergeTotal = signal(0); - - groups: DisplayGroup[] = []; - presetOptions: { label: string; value: PresetMode }[] = []; - - pageFirst = 0; - pageSize = 20; - - private destroy$ = new Subject(); private readonly bookFileService = inject(BookFileService); private readonly bookService = inject(BookService); private readonly messageService = inject(MessageService); @@ -80,6 +56,30 @@ export class DuplicateMergerComponent implements OnInit, OnDestroy { readonly urlHelper = inject(UrlHelperService); private readonly appSettingsService = inject(AppSettingsService); private readonly changeDetectorRef = inject(ChangeDetectorRef); + libraryId!: number; + presetMode: PresetMode = 'balanced'; + showAdvanced = false; + + matchByIsbn = true; + matchByExternalId = true; + matchByTitleAuthor = true; + matchByDirectory = false; + matchByFilename = false; + + readonly isScanning = signal(false); + readonly isMerging = signal(false); + readonly hasScanned = signal(false); + moveFiles = false; + readonly mergeProgress = signal(0); + readonly mergeTotal = signal(0); + + groups: DisplayGroup[] = []; + presetOptions: { label: string; value: PresetMode }[] = []; + + pageFirst = 0; + pageSize = 20; + + private readonly destroy$ = new Subject(); ngOnInit(): void { this.libraryId = this.config.data.libraryId; @@ -298,9 +298,8 @@ export class DuplicateMergerComponent implements OnInit, OnDestroy { group.dismissed = true; try { - await this.bookFileService.attachBookFiles(targetId, sourceIds, this.moveFiles) - .pipe(takeUntil(this.destroy$)) - .toPromise(); + await lastValueFrom(this.bookFileService.attachBookFiles(targetId, sourceIds, this.moveFiles) + .pipe(takeUntil(this.destroy$)), {defaultValue: undefined}); } catch { group.dismissed = false; this.messageService.add({ @@ -335,9 +334,8 @@ export class DuplicateMergerComponent implements OnInit, OnDestroy { } try { - await this.bookFileService.attachBookFiles(targetId, sourceIds, this.moveFiles) - .pipe(takeUntil(this.destroy$)) - .toPromise(); + await lastValueFrom(this.bookFileService.attachBookFiles(targetId, sourceIds, this.moveFiles) + .pipe(takeUntil(this.destroy$)), {defaultValue: undefined}); group.dismissed = true; successCount++; } catch { diff --git a/frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts b/frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts index dba7d9958..5ad98ff4d 100644 --- a/frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts +++ b/frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts @@ -1,13 +1,11 @@ -import {effect, inject, Injectable, signal} from '@angular/core'; +import {effect, inject, Service, signal} from '@angular/core'; import {EntityViewPreference, UserService} from '../../../settings/user-management/user.service'; interface LegacyOverlayPreference extends Partial { showBookTypePill?: boolean; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class BookCardOverlayPreferenceService { private static readonly PERSIST_DELAY_MS = 500; @@ -16,7 +14,7 @@ export class BookCardOverlayPreferenceService { private readonly _showBookTypePill = signal(true); readonly showBookTypePill = this._showBookTypePill.asReadonly(); - private currentContext: { type: 'LIBRARY' | 'SHELF' | 'MAGIC_SHELF', id: number } | null = null; + private readonly currentContext: { type: 'LIBRARY' | 'SHELF' | 'MAGIC_SHELF', id: number } | null = null; private persistTimeout: ReturnType | null = null; constructor() { @@ -90,9 +88,7 @@ export class BookCardOverlayPreferenceService { overrides: [] }); - if (!prefs.overrides) { - prefs.overrides = []; - } + prefs.overrides ??= []; if (this.currentContext) { let override = prefs.overrides.find(o => diff --git a/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.html b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.html index d61e383b1..afb482728 100644 --- a/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.html +++ b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.html @@ -5,7 +5,7 @@ (click)="onCardClick($event)" (keydown.enter)="onCardClick($event)"> -
+
@if (showBookTypePill() && displayFormat(); as fmt) { -
+
{{ fmt }}
} @@ -59,24 +59,23 @@ class="select-checkbox" (click)="captureMouseEvent($event)" [ngModel]="isSelected()" - (onChange)="toggleSelection($event)"> - + (onChange)="toggleSelection($event)" /> } @if (hasProgress()) {
@if (progressPercentage() !== null) { -
+
} @if (koProgressPercentage() !== null) { -
+
} @if (koboProgressPercentage() !== null) { -
+
} @@ -87,7 +86,7 @@ @if (!bottomBarHidden()) {
- +

{{ displayTitle() }}

- +
@@ -29,7 +28,7 @@ [icon]="getLockIcon(field)" [severity]="fieldLocks[field] === true ? 'danger' : fieldLocks[field] === false ? 'success' : 'secondary'" (click)="cycleLockState(field)" - > + />
}
@@ -37,13 +36,13 @@
diff --git a/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts index 63bbb771c..c37c24bc1 100644 --- a/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts +++ b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts @@ -24,18 +24,17 @@ import {MetadataProviderFieldsService} from '../../../../shared/metadata'; styleUrl: './lock-unlock-metadata-dialog.component.scss' }) export class LockUnlockMetadataDialogComponent implements OnInit { - private bookMetadataManageService = inject(BookMetadataManageService); - private dynamicDialogConfig = inject(DynamicDialogConfig); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); dialogRef = inject(DynamicDialogRef); - private messageService = inject(MessageService); - private loadingService = inject(LoadingService); + private readonly messageService = inject(MessageService); + private readonly loadingService = inject(LoadingService); private readonly t = inject(TranslocoService); + private readonly providerFields = inject(MetadataProviderFieldsService); fieldLocks: Record = {}; bookIds: Set = this.dynamicDialogConfig.data.bookIds; - private readonly providerFields = inject(MetadataProviderFieldsService); - lockableFields: string[] = [ 'titleLocked', 'subtitleLocked', 'publisherLocked', 'publishedDateLocked', 'descriptionLocked', 'isbn13Locked', 'isbn10Locked', 'pageCountLocked', 'thumbnailLocked', 'languageLocked', 'coverLocked', diff --git a/frontend/src/app/features/book/components/series-page/series-page.component.html b/frontend/src/app/features/book/components/series-page/series-page.component.html index 974f5f13a..1c369d5ea 100644 --- a/frontend/src/app/features/book/components/series-page/series-page.component.html +++ b/frontend/src/app/features/book/components/series-page/series-page.component.html @@ -1,8 +1,7 @@ @if (isBooksLoading()) {
- - +

{{ t('loadingSeriesDetails') }}

@@ -207,8 +206,7 @@ - + class="next-up-progress" /> {{ nextUp.progressPercent }}%
} @@ -223,7 +221,7 @@
@for (seg of segments; track seg.status) {
} @@ -231,9 +229,9 @@
@for (seg of segments; track seg.status) { + [style.border-color]="getStatusColor(seg.status)"> + [style.background-color]="getStatusColor(seg.status)"> {{ getStatusLabel(seg.status) }} ({{ seg.count }}) } @@ -259,15 +257,15 @@ {{ t('synopsis') }}
-
@if (isExpanded() || isOverflowing()) { - }
@@ -295,8 +293,7 @@ (checkboxClick)="onCheckboxClicked($event)" [isSelected]="isBookSelected(book)" [useSquareCovers]="seriesCardsUseSquareCovers" - [overlayPreferenceService]="bookCardOverlayPreferenceService"> - + [overlayPreferenceService]="bookCardOverlayPreferenceService" /> }
@@ -345,7 +342,7 @@ @if (getBookProgress(book); as progress) {
-
+
{{ progress }}%
@@ -354,7 +351,7 @@
@for (star of [1,2,3,4,5]; track star) { + [class]="book.personalRating! >= star * 2 ? 'pi-star-fill' : (book.personalRating! >= star * 2 - 1 ? 'pi-star-half-fill' : 'pi-star')"> } {{ book.personalRating }}/10 @@ -364,7 +361,7 @@
+ [style.background-color]="getStatusColor(book.readStatus)"> {{ getStatusLabel(book.readStatus) }} @if (book.primaryFile?.bookType; as bookType) { @@ -377,11 +374,11 @@ }
- - @@ -389,7 +386,7 @@
} - @if (books.length === 0) { + @empty {
{{ t('noBooksFound') }}
}
@@ -418,8 +415,7 @@ tooltipPosition="top" outlined="true" severity="info" - icon="pi pi-database"> - + icon="pi pi-database" /> } - + tooltipPosition="top" /> @if (user.permissions.canBulkLockUnlockMetadata) { - + tooltipPosition="top" /> } @if (user.permissions.canMoveOrganizeFiles && appSettings()?.diskType === 'LOCAL') { - + tooltipPosition="top" /> } @if (hasMoreActionsItems) {
@@ -457,13 +450,12 @@ tooltipPosition="top" outlined="true" severity="info" - icon="pi pi-ellipsis-v"> - + icon="pi pi-ellipsis-v" />
}
- + @if (user.permissions.admin || user.permissions.canDeleteBook) { - + - + tooltipPosition="top" /> }
diff --git a/frontend/src/app/features/book/components/series-page/series-page.component.ts b/frontend/src/app/features/book/components/series-page/series-page.component.ts index 15e825d45..7e691a8a9 100644 --- a/frontend/src/app/features/book/components/series-page/series-page.component.ts +++ b/frontend/src/app/features/book/components/series-page/series-page.component.ts @@ -2,7 +2,7 @@ import {FormsModule} from "@angular/forms"; import {Button} from "@openng/optimus-ui/button"; import {ActivatedRoute, Router} from "@angular/router"; import {toSignal} from '@angular/core/rxjs-interop'; -import {DecimalPipe, KeyValuePipe, NgClass, NgStyle} from "@angular/common"; +import {DecimalPipe, KeyValuePipe} from "@angular/common"; import {finalize, map, take} from "rxjs/operators"; import {Book, BookType, computeSeriesReadStatus, ReadStatus} from "../../model/book.model"; import {BookService} from "../../service/book.service"; @@ -75,8 +75,6 @@ interface SeriesStats { KeyValuePipe, Button, FormsModule, - NgStyle, - NgClass, LegacyBookCardComponent, ProgressSpinner, ProgressBar, @@ -94,32 +92,32 @@ interface SeriesStats { ], }) export class SeriesPageComponent implements AfterViewChecked { + private readonly route = inject(ActivatedRoute); + private readonly bookService = inject(BookService); + private readonly languageResolver = inject(LanguageResolverService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly router = inject(Router); + protected userService = inject(UserService); + private readonly bookMenuService = inject(BookMenuService); + protected confirmationService = inject(ConfirmationService); + private readonly loadingService = inject(LoadingService); + private readonly dialogHelperService = inject(BookDialogHelperService); + protected taskHelperService = inject(TaskHelperService); + private readonly messageService = inject(MessageService); + protected bookCardOverlayPreferenceService = inject(BookCardOverlayPreferenceService); + protected appSettingsService = inject(AppSettingsService); + private readonly t = inject(TranslocoService); + protected urlHelper = inject(UrlHelperService); + private readonly authorService = inject(AuthorService); + private readonly layoutService = inject(LayoutService); private readonly DEFAULT_SERIES_CARD_WIDTH = 135; private readonly DEFAULT_SERIES_CARD_HEIGHT = 220; private readonly DESKTOP_SERIES_GRID_GAP = 21; private readonly MOBILE_SERIES_GRID_GAP = 8; private readonly MOBILE_GRID_COLUMNS = 2; - private route = inject(ActivatedRoute); - private bookService = inject(BookService); - private languageResolver = inject(LanguageResolverService); - private bookMetadataManageService = inject(BookMetadataManageService); - private metadataCenterViewMode: "route" | "dialog" = "route"; + private readonly metadataCenterViewMode: "route" | "dialog" = "route"; private dialogRef?: DynamicDialogRef | null; - private router = inject(Router); - protected userService = inject(UserService); - private bookMenuService = inject(BookMenuService); - protected confirmationService = inject(ConfirmationService); - private loadingService = inject(LoadingService); - private dialogHelperService = inject(BookDialogHelperService); - protected taskHelperService = inject(TaskHelperService); - private messageService = inject(MessageService); - protected bookCardOverlayPreferenceService = inject(BookCardOverlayPreferenceService); - protected appSettingsService = inject(AppSettingsService); - private readonly t = inject(TranslocoService); - protected urlHelper = inject(UrlHelperService); - private authorService = inject(AuthorService); - private layoutService = inject(LayoutService); private readonly descriptionContentRef = viewChild>('descriptionContent'); private readonly seriesGridElement = viewChild>('seriesGrid'); @@ -143,11 +141,11 @@ export class SeriesPageComponent implements AfterViewChecked { protected readonly seriesCardsUseSquareCovers = false; protected readonly onSeriesBookCardSelect = this.handleBookSelect.bind(this); - private seriesParam = toSignal(this.route.paramMap.pipe( + private readonly seriesParam = toSignal(this.route.paramMap.pipe( map((params) => params.get("seriesName") || ""), ), {initialValue: ""}); - filteredBooks = computed(() => { + readonly filteredBooks = computed(() => { const seriesName = this.seriesParam().trim().toLowerCase(); const inSeries = this.bookService.books().filter( (book) => book.metadata?.seriesName?.trim().toLowerCase() === seriesName @@ -177,16 +175,16 @@ export class SeriesPageComponent implements AfterViewChecked { this.seriesCardSizeForWidth(this.seriesGridCardWidth()).height ); - coverBook = computed(() => this.filteredBooks()[0] ?? null); - private firstBookId = computed(() => this.coverBook()?.id ?? null); - private firstBookDetailQuery = injectQuery(() => ({ + readonly coverBook = computed(() => this.filteredBooks()[0] ?? null); + private readonly firstBookId = computed(() => this.coverBook()?.id ?? null); + private readonly firstBookDetailQuery = injectQuery(() => ({ ...this.bookService.bookDetailQueryOptions(this.firstBookId() ?? -1, true), enabled: this.firstBookId() != null, })); - seriesTitle = computed(() => this.filteredBooks()[0]?.metadata?.seriesName || this.seriesParam()); + readonly seriesTitle = computed(() => this.filteredBooks()[0]?.metadata?.seriesName || this.seriesParam()); - yearsRange = computed(() => { + readonly yearsRange = computed(() => { const years = this.filteredBooks() .map((book) => book.metadata?.publishedDate) .filter((date): date is string => !!date) @@ -202,18 +200,18 @@ export class SeriesPageComponent implements AfterViewChecked { return min === max ? String(min) : `${min}-${max}`; }); - firstBookWithDesc = computed(() => this.firstBookDetailQuery.data() ?? null); - firstDescription = computed(() => this.firstBookWithDesc()?.metadata?.description || ""); + readonly firstBookWithDesc = computed(() => this.firstBookDetailQuery.data() ?? null); + readonly firstDescription = computed(() => this.firstBookWithDesc()?.metadata?.description || ""); - seriesReadStatus = computed(() => computeSeriesReadStatus(this.filteredBooks())); + readonly seriesReadStatus = computed(() => computeSeriesReadStatus(this.filteredBooks())); - seriesReadProgress = computed(() => { + readonly seriesReadProgress = computed(() => { const books = this.filteredBooks(); const readCount = books.filter((book) => book.readStatus === ReadStatus.READ).length; return `${readCount}/${books.length}`; }); - allAuthors = computed(() => { + readonly allAuthors = computed(() => { const authors = new Set(); for (const book of this.filteredBooks()) { book.metadata?.authors?.forEach((author) => authors.add(author)); @@ -221,7 +219,7 @@ export class SeriesPageComponent implements AfterViewChecked { return Array.from(authors); }); - allCategories = computed(() => { + readonly allCategories = computed(() => { const categories = new Set(); for (const book of this.filteredBooks()) { book.metadata?.categories?.forEach((category) => categories.add(category)); @@ -229,7 +227,7 @@ export class SeriesPageComponent implements AfterViewChecked { return Array.from(categories); }); - allPublishers = computed(() => { + readonly allPublishers = computed(() => { const publishers = new Set(); for (const book of this.filteredBooks()) { if (book.metadata?.publisher) { @@ -239,7 +237,7 @@ export class SeriesPageComponent implements AfterViewChecked { return Array.from(publishers); }); - allLanguages = computed(() => { + readonly allLanguages = computed(() => { const languages = new Set(); for (const book of this.filteredBooks()) { if (book.metadata?.language) { @@ -249,7 +247,7 @@ export class SeriesPageComponent implements AfterViewChecked { return Array.from(languages); }); - seriesCompletion = computed(() => { + readonly seriesCompletion = computed(() => { const totals = this.filteredBooks() .map((book) => book.metadata?.seriesTotal) .filter((total): total is number => total != null && total > 0); @@ -276,7 +274,7 @@ export class SeriesPageComponent implements AfterViewChecked { }; }); - readStatusBreakdown = computed(() => { + readonly readStatusBreakdown = computed(() => { const books = this.filteredBooks(); if (books.length === 0) return []; @@ -294,14 +292,14 @@ export class SeriesPageComponent implements AfterViewChecked { return segments; }); - nextUp = computed(() => { + readonly nextUp = computed(() => { const books = this.filteredBooks(); const reading = books.find(book => book.readStatus === ReadStatus.READING || book.readStatus === ReadStatus.RE_READING || book.readStatus === ReadStatus.PAUSED ); - const target = reading || books.find(book => book.readStatus === ReadStatus.UNREAD || !book.readStatus); + const target = reading ?? books.find(book => book.readStatus === ReadStatus.UNREAD || !book.readStatus); if (!target) return null; const isAudiobook = target.primaryFile?.bookType === 'AUDIOBOOK'; @@ -330,7 +328,7 @@ export class SeriesPageComponent implements AfterViewChecked { return {book: target, thumbnailUrl, isReading, progressPercent}; }); - seriesStats = computed(() => { + readonly seriesStats = computed(() => { let totalPages = 0; const personalRatings: number[] = []; const goodreadsRatings: number[] = []; diff --git a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.html b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.html index 7f739a99b..9e3acda70 100644 --- a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.html +++ b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.html @@ -20,8 +20,7 @@ [rounded]="true" severity="secondary" (onClick)="closeDialog()" - class="close-button"> - + class="close-button" />
diff --git a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts index 5c0a2b1ce..f91f08526 100644 --- a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts +++ b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts @@ -37,18 +37,18 @@ import {IconSelection, toIconSelection} from '../../../../shared/icons/icon-sele }) export class ShelfAssignerComponent { - private shelfService = inject(ShelfService); - private dynamicDialogConfig = inject(DynamicDialogConfig); - private dynamicDialogRef = inject(DynamicDialogRef); - private messageService = inject(MessageService); - private bookService = inject(BookService); - private bookDialogHelper = inject(BookDialogHelperService); - private loadingService = inject(LoadingService); - private userService = inject(UserService); + private readonly shelfService = inject(ShelfService); + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); + private readonly dynamicDialogRef = inject(DynamicDialogRef); + private readonly messageService = inject(MessageService); + private readonly bookService = inject(BookService); + private readonly bookDialogHelper = inject(BookDialogHelperService); + private readonly loadingService = inject(LoadingService); + private readonly userService = inject(UserService); private readonly t = inject(TranslocoService); searchQuery = ''; - private currentUser = this.userService.currentUser; + private readonly currentUser = this.userService.currentUser; book: Book = this.dynamicDialogConfig.data.book; selectedShelves: Shelf[] = []; diff --git a/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.html b/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.html index 87c31e619..b4ee9adab 100644 --- a/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.html +++ b/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.html @@ -99,7 +99,7 @@ {{ t('visibilityLabel') }}
- +
diff --git a/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.ts b/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.ts index 98f3654b2..6de0719ab 100644 --- a/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.ts +++ b/frontend/src/app/features/book/components/shelf-creator/shelf-creator.component.ts @@ -30,11 +30,11 @@ import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; styleUrl: './shelf-creator.component.scss', }) export class ShelfCreatorComponent { - private shelfService = inject(ShelfService); - private dynamicDialogRef = inject(DynamicDialogRef); - private messageService = inject(MessageService); - private iconPickerService = inject(IconPickerService); - private userService = inject(UserService); + private readonly shelfService = inject(ShelfService); + private readonly dynamicDialogRef = inject(DynamicDialogRef); + private readonly messageService = inject(MessageService); + private readonly iconPickerService = inject(IconPickerService); + private readonly userService = inject(UserService); private readonly t = inject(TranslocoService); shelfName: string = ''; diff --git a/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.html b/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.html index 6f880be4c..0c1d6f658 100644 --- a/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.html +++ b/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.html @@ -16,8 +16,7 @@ [rounded]="true" severity="secondary" (onClick)="closeDialog()" - class="close-button"> - + class="close-button" />
@@ -31,10 +30,10 @@ {{ t('shelfIconLabel') }}
@if (!selectedIcon) { - + } - @if (selectedIcon) { + @else {
- +
}
@@ -53,7 +52,7 @@
{{ t('visibilityLabel') }}
- +
diff --git a/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.ts b/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.ts index bdfcf7368..27560f5bb 100644 --- a/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.ts +++ b/frontend/src/app/features/book/components/shelf-edit-dialog/shelf-edit-dialog.component.ts @@ -31,12 +31,12 @@ import {IconSelection, toIconSelection} from '../../../../shared/icons/icon-sele }) export class ShelfEditDialogComponent implements OnInit { - private shelfService = inject(ShelfService); - private dynamicDialogConfig = inject(DynamicDialogConfig); - private dynamicDialogRef = inject(DynamicDialogRef); - private messageService = inject(MessageService); - private iconPickerService = inject(IconPickerService); - private userService = inject(UserService); + private readonly shelfService = inject(ShelfService); + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); + private readonly dynamicDialogRef = inject(DynamicDialogRef); + private readonly messageService = inject(MessageService); + private readonly iconPickerService = inject(IconPickerService); + private readonly userService = inject(UserService); private readonly t = inject(TranslocoService); private readonly injector = inject(Injector); private shelfInitialized = false; diff --git a/frontend/src/app/features/book/data/book-background-submission.service.ts b/frontend/src/app/features/book/data/book-background-submission.service.ts index 8ec113db5..159d4a42d 100644 --- a/frontend/src/app/features/book/data/book-background-submission.service.ts +++ b/frontend/src/app/features/book/data/book-background-submission.service.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {mutationOptions} from '@tanstack/angular-query-experimental'; import {lastValueFrom} from 'rxjs'; @@ -7,7 +7,7 @@ import {API_CONFIG} from '../../../core/config/api-config'; import {bookBackgroundSubmissionKeys} from './book-background-submission-keys'; import {ChangeCoversVariables, QuickSendBookVariables} from './book-background-submission.models'; -@Injectable({providedIn: 'root'}) +@Service() export class BookBackgroundSubmissionService { private readonly http = inject(HttpClient); private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/books`; diff --git a/frontend/src/app/features/book/data/book-command.service.ts b/frontend/src/app/features/book/data/book-command.service.ts index c395ec13f..0a9d23f89 100644 --- a/frontend/src/app/features/book/data/book-command.service.ts +++ b/frontend/src/app/features/book/data/book-command.service.ts @@ -1,5 +1,5 @@ import {HttpClient, HttpParams} from '@angular/common/http'; -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {lastValueFrom} from 'rxjs'; import {API_CONFIG} from '../../../core/config/api-config'; @@ -34,7 +34,7 @@ const RESET_PROGRESS_BACKEND_TYPES = { KOBO: 'KOBO', } as const satisfies Record; -@Injectable({providedIn: 'root'}) +@Service() export class BookCommandService { private readonly http = inject(HttpClient); private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/books`; diff --git a/frontend/src/app/features/book/data/book-query.service.ts b/frontend/src/app/features/book/data/book-query.service.ts index f973652ff..3857c65c2 100644 --- a/frontend/src/app/features/book/data/book-query.service.ts +++ b/frontend/src/app/features/book/data/book-query.service.ts @@ -1,5 +1,5 @@ import {HttpClient, HttpParams} from '@angular/common/http'; -import {effect, inject, Injectable} from '@angular/core'; +import {effect, inject, Service} from '@angular/core'; import { type InfiniteData, infiniteQueryOptions, @@ -30,7 +30,7 @@ import {BookDetail, BookRecommendation, BookSummary} from './book-response.model import {abortSignal, QUERY_DEFAULTS} from '../../../core/data/query-transport'; import {AuthService} from '../../../shared/service/auth.service'; -@Injectable({providedIn: 'root'}) +@Service() export class BookQueryService { private readonly http = inject(HttpClient); private readonly authService = inject(AuthService); diff --git a/frontend/src/app/features/book/data/book-shelf-command.service.ts b/frontend/src/app/features/book/data/book-shelf-command.service.ts index 557546b46..581952e40 100644 --- a/frontend/src/app/features/book/data/book-shelf-command.service.ts +++ b/frontend/src/app/features/book/data/book-shelf-command.service.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {lastValueFrom} from 'rxjs'; import {API_CONFIG} from '../../../core/config/api-config'; @@ -14,7 +14,7 @@ import {BookShelf} from './book-response.models'; import {applyBookQueryChangeSet} from './book-query-cache'; import {invalidateShelfDefinitions} from './shelf-definition-query-cache'; -@Injectable({providedIn: 'root'}) +@Service() export class BookShelfCommandService { private readonly http = inject(HttpClient); private readonly membershipUrl = `${API_CONFIG.BASE_URL}/api/v1/books/shelves`; diff --git a/frontend/src/app/features/book/data/shelf-definition-query.service.ts b/frontend/src/app/features/book/data/shelf-definition-query.service.ts index bcc3155fd..c8f8bd758 100644 --- a/frontend/src/app/features/book/data/shelf-definition-query.service.ts +++ b/frontend/src/app/features/book/data/shelf-definition-query.service.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {effect, inject, Injectable} from '@angular/core'; +import {effect, inject, Service} from '@angular/core'; import {queryOptions, QueryClient} from '@tanstack/angular-query-experimental'; import {lastValueFrom, takeUntil} from 'rxjs'; @@ -9,7 +9,7 @@ import {ShelfDefinition} from './shelf-definition.models'; import {shelfDefinitionQueryKeys} from './shelf-definition-query-keys'; import {AuthService} from '../../../shared/service/auth.service'; -@Injectable({providedIn: 'root'}) +@Service() export class ShelfDefinitionQueryService { private readonly http = inject(HttpClient); private readonly authService = inject(AuthService); diff --git a/frontend/src/app/features/book/helpers/read-status.helper.ts b/frontend/src/app/features/book/helpers/read-status.helper.ts index ab217eed5..ccab6562e 100644 --- a/frontend/src/app/features/book/helpers/read-status.helper.ts +++ b/frontend/src/app/features/book/helpers/read-status.helper.ts @@ -1,9 +1,7 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {ReadStatus} from '../model/book.model'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class ReadStatusHelper { getReadStatusIcon(readStatus: ReadStatus | undefined): string { diff --git a/frontend/src/app/features/book/service/book-dialog-helper.service.ts b/frontend/src/app/features/book/service/book-dialog-helper.service.ts index 2125aef56..54870b02d 100644 --- a/frontend/src/app/features/book/service/book-dialog-helper.service.ts +++ b/frontend/src/app/features/book/service/book-dialog-helper.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {DynamicDialogRef} from '@openng/optimus-ui/dynamicdialog'; import {DialogLauncherService, DialogSize, DialogStyle} from '../../../shared/services/dialog-launcher.service'; import {MetadataRefreshType} from '../../metadata/model/request/metadata-refresh-type.enum'; @@ -12,10 +12,10 @@ interface MetadataRefreshDialogContext { libraryId?: number; } -@Injectable({providedIn: 'root'}) +@Service() export class BookDialogHelperService { - private dialogLauncherService = inject(DialogLauncherService); + private readonly dialogLauncherService = inject(DialogLauncherService); private openDialog(component: unknown, options: object): DynamicDialogRef | null { return this.dialogLauncherService.openDialog(component, options); diff --git a/frontend/src/app/features/book/service/book-file.service.ts b/frontend/src/app/features/book/service/book-file.service.ts index a2df81fec..735a4f4dd 100644 --- a/frontend/src/app/features/book/service/book-file.service.ts +++ b/frontend/src/app/features/book/service/book-file.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {Observable, throwError, from} from 'rxjs'; import {HttpClient, HttpEventType, HttpRequest} from '@angular/common/http'; import {catchError, filter, map, tap} from 'rxjs/operators'; @@ -13,21 +13,18 @@ import {QueryClient} from '@tanstack/angular-query-experimental'; import {patchAttachedBookFilesInCache, patchBookInCacheWith, upsertBooksInCache} from './legacy-book-cache'; import {mitigateWebkitUploadBug} from '../../../shared/util/mitigate-webkit-upload-bug'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class BookFileService { + private readonly http = inject(HttpClient); + private readonly messageService = inject(MessageService); + private readonly fileDownloadService = inject(FileDownloadService); + private readonly queryClient = inject(QueryClient); + private readonly cacheStorageService = inject(CacheStorageService); + private readonly localSettingsService = inject(LocalSettingsService); + private readonly t = inject(TranslocoService); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/books`; - private http = inject(HttpClient); - private messageService = inject(MessageService); - private fileDownloadService = inject(FileDownloadService); - private queryClient = inject(QueryClient); - private cacheStorageService = inject(CacheStorageService); - private localSettingsService = inject(LocalSettingsService); - private readonly t = inject(TranslocoService); - getFileContent(bookId: number, bookType?: string): Observable { let url = `${this.url}/${bookId}/content`; if (bookType) { @@ -81,7 +78,7 @@ export class BookFileService { tap(() => { patchBookInCacheWith(this.queryClient, bookId, book => { if (isPrimary) { - const remaining = book.alternativeFormats?.filter(f => f.id !== fileId) || []; + const remaining = book.alternativeFormats?.filter(f => f.id !== fileId) ?? []; const [newPrimary, ...rest] = remaining; return {...book, primaryFile: newPrimary, alternativeFormats: rest}; } @@ -143,9 +140,9 @@ export class BookFileService { .pipe(tap(newFile => { patchBookInCacheWith(this.queryClient, bookId, book => { if (fileType === AdditionalFileType.ALTERNATIVE_FORMAT) { - return {...book, alternativeFormats: [...(book.alternativeFormats || []), newFile]}; + return {...book, alternativeFormats: [...(book.alternativeFormats ?? []), newFile]}; } - return {...book, supplementaryFiles: [...(book.supplementaryFiles || []), newFile]}; + return {...book, supplementaryFiles: [...(book.supplementaryFiles ?? []), newFile]}; }); this.messageService.add({ severity: 'success', @@ -166,8 +163,8 @@ export class BookFileService { downloadAdditionalFile(book: Book, fileId: number): void { const additionalFile = [ - ...(book.alternativeFormats || []), - ...(book.supplementaryFiles || []) + ...(book.alternativeFormats ?? []), + ...(book.supplementaryFiles ?? []) ].find((f: AdditionalFile) => f.id === fileId); const downloadUrl = `${this.url}/${book.id}/files/${fileId}/download`; this.fileDownloadService.downloadFile(downloadUrl, additionalFile?.fileName ?? 'file'); diff --git a/frontend/src/app/features/book/service/book-menu.service.ts b/frontend/src/app/features/book/service/book-menu.service.ts index 15e94d781..6a7b87f97 100644 --- a/frontend/src/app/features/book/service/book-menu.service.ts +++ b/frontend/src/app/features/book/service/book-menu.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {ConfirmationService, MenuItem, MessageService} from '@openng/optimus-ui/api'; import {BookService} from './book.service'; import {BookMetadataManageService} from './book-metadata-manage.service'; @@ -12,9 +12,7 @@ import {APIException} from '../../../shared/models/api-exception.model'; import {HttpErrorResponse} from '@angular/common/http'; import {TranslocoService} from '@jsverse/transloco'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class BookMenuService { confirmationService = inject(ConfirmationService); diff --git a/frontend/src/app/features/book/service/book-metadata-manage.service.ts b/frontend/src/app/features/book/service/book-metadata-manage.service.ts index 9ad182b50..d0d5b6f5c 100644 --- a/frontend/src/app/features/book/service/book-metadata-manage.service.ts +++ b/frontend/src/app/features/book/service/book-metadata-manage.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {Observable, of} from 'rxjs'; import {HttpClient, HttpEventType, HttpParams, HttpRequest} from '@angular/common/http'; import {catchError, filter, map, tap, mergeMap} from 'rxjs/operators'; @@ -10,18 +10,15 @@ import {QueryClient} from '@tanstack/angular-query-experimental'; import {invalidateAllBookCaches, invalidateBooksById, patchBookMetadataInCache, patchBooksInCacheWith} from './legacy-book-cache'; import {mitigateWebkitUploadBug} from '../../../shared/util/mitigate-webkit-upload-bug'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class BookMetadataManageService { + private readonly http = inject(HttpClient); + private readonly messageService = inject(MessageService); + private readonly queryClient = inject(QueryClient); + private readonly t = inject(TranslocoService); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/books`; - private http = inject(HttpClient); - private messageService = inject(MessageService); - private queryClient = inject(QueryClient); - private readonly t = inject(TranslocoService); - updateBookMetadata(bookId: number | undefined, wrapper: MetadataUpdateWrapper, mergeCategories: boolean, replaceMode: 'REPLACE_ALL' | 'REPLACE_WHEN_PROVIDED' = 'REPLACE_ALL'): Observable { const params = new HttpParams().set('mergeCategories', mergeCategories.toString()).set('replaceMode', replaceMode); return this.http.put(`${this.url}/${bookId}/metadata`, wrapper, {params}).pipe( @@ -201,7 +198,7 @@ export class BookMetadataManageService { } supportsDualCovers(book: Book): boolean { - const allFiles = [book.primaryFile, ...(book.alternativeFormats || [])].filter(f => f?.bookType); + const allFiles = [book.primaryFile, ...(book.alternativeFormats ?? [])].filter(f => f?.bookType); const hasAudiobook = allFiles.some(f => f!.bookType === 'AUDIOBOOK'); const hasEbook = allFiles.some(f => f!.bookType !== 'AUDIOBOOK'); return hasAudiobook && hasEbook; diff --git a/frontend/src/app/features/book/service/book-navigation.service.ts b/frontend/src/app/features/book/service/book-navigation.service.ts index 37e69c99b..3e4bd10ce 100644 --- a/frontend/src/app/features/book/service/book-navigation.service.ts +++ b/frontend/src/app/features/book/service/book-navigation.service.ts @@ -1,4 +1,4 @@ -import {computed, inject, Injectable, signal} from '@angular/core'; +import {computed, inject, Service, signal} from '@angular/core'; import {Router} from '@angular/router'; import {UserService} from '../../settings/user-management/user.service'; @@ -10,9 +10,7 @@ export interface BookNavigationState { currentIndex: number; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class BookNavigationService { private readonly router = inject(Router); private readonly userService = inject(UserService); diff --git a/frontend/src/app/features/book/service/book-patch.service.ts b/frontend/src/app/features/book/service/book-patch.service.ts index 05ac4ee9f..ff4a3596c 100644 --- a/frontend/src/app/features/book/service/book-patch.service.ts +++ b/frontend/src/app/features/book/service/book-patch.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {HttpClient, HttpParams} from '@angular/common/http'; import {Observable, Subject} from 'rxjs'; import {distinctUntilChanged, exhaustMap, share, tap} from 'rxjs/operators'; @@ -32,18 +32,15 @@ function getResetProgressFields(type: ResetProgressType): Partial { }; } -@Injectable({ - providedIn: 'root', -}) +@Service() export class BookPatchService { + private readonly http = inject(HttpClient); + private readonly queryClient = inject(QueryClient); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/books`; - private http = inject(HttpClient); - private queryClient = inject(QueryClient); + private readonly epubProgressSubject = new Subject<{ bookId: number; cfi: string; href: string; percentage: number; bookFileId?: number }>(); - private epubProgressSubject = new Subject<{ bookId: number; cfi: string; href: string; percentage: number; bookFileId?: number }>(); - - private epubProgress$ = this.epubProgressSubject.pipe( + private readonly epubProgress$ = this.epubProgressSubject.pipe( distinctUntilChanged((prev, curr) => prev.bookId === curr.bookId && prev.cfi === curr.cfi && diff --git a/frontend/src/app/features/book/service/book-socket.service.ts b/frontend/src/app/features/book/service/book-socket.service.ts index d933355dd..c7a045278 100644 --- a/frontend/src/app/features/book/service/book-socket.service.ts +++ b/frontend/src/app/features/book/service/book-socket.service.ts @@ -1,8 +1,8 @@ -import {DestroyRef, inject, Injectable} from '@angular/core'; +import {DestroyRef, inject, Service} from '@angular/core'; import {QueryClient} from '@tanstack/angular-query-experimental'; import {invalidateBookRecommendations} from '../data/book-query-cache'; -import {TaskProgressPayload} from '../../settings/task-management/task.service'; +import {TaskProgressPayload, TaskStatus} from '../../settings/task-management/task.service'; import {Book} from '../model/book.model'; import { BookCoverPatch, @@ -17,7 +17,7 @@ import { function isBookIdArray(payload: Book | readonly number[]): payload is readonly number[] { return Array.isArray(payload); } -@Injectable({providedIn: 'root'}) +@Service() export class BookSocketService { private readonly queryClient = inject(QueryClient); private readonly destroyRef = inject(DestroyRef); @@ -55,7 +55,7 @@ export class BookSocketService { } handleTaskProgress(payload: TaskProgressPayload): void { - if (payload.taskType !== 'UPDATE_BOOK_RECOMMENDATIONS' || payload.taskStatus !== 'COMPLETED') { + if (payload.taskType !== 'UPDATE_BOOK_RECOMMENDATIONS' || payload.taskStatus !== TaskStatus.COMPLETED) { return; } void Promise.all([ diff --git a/frontend/src/app/features/book/service/book.service.ts b/frontend/src/app/features/book/service/book.service.ts index d12092ee5..f10594cec 100644 --- a/frontend/src/app/features/book/service/book.service.ts +++ b/frontend/src/app/features/book/service/book.service.ts @@ -1,4 +1,4 @@ -import {computed, effect, inject, Injectable} from '@angular/core'; +import {computed, effect, inject, Service} from '@angular/core'; import {first, from, lastValueFrom, Observable, throwError} from 'rxjs'; import {HttpClient, HttpParams} from '@angular/common/http'; import {catchError, map, tap} from 'rxjs/operators'; @@ -26,29 +26,26 @@ import { patchBooksInCache, } from './legacy-book-cache'; -@Injectable({ - providedIn: 'root', -}) +@Service() export class BookService { + private readonly http = inject(HttpClient); + private readonly messageService = inject(MessageService); + private readonly authService = inject(AuthService); + private readonly router = inject(Router); + private readonly bookSocketService = inject(BookSocketService); + private readonly bookPatchService = inject(BookPatchService); + private readonly queryClient = inject(QueryClient); + private readonly t = inject(TranslocoService); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/books`; - - private http = inject(HttpClient); - private messageService = inject(MessageService); - private authService = inject(AuthService); - private router = inject(Router); - private bookSocketService = inject(BookSocketService); - private bookPatchService = inject(BookPatchService); - private queryClient = inject(QueryClient); - private readonly t = inject(TranslocoService); private readonly token = this.authService.token; - private booksQuery = injectQuery(() => ({ + private readonly booksQuery = injectQuery(() => ({ ...this.getBooksQueryOptions(), enabled: !!this.token(), })); - books = computed(() => this.booksQuery.data() ?? []); + readonly books = computed(() => this.booksQuery.data() ?? []); /** Pre-computed unique metadata values for autocomplete across the app. */ readonly uniqueMetadata = computed(() => { @@ -81,7 +78,7 @@ export class BookService { }; }); - booksError = computed(() => { + readonly booksError = computed(() => { if (!this.token() || !this.booksQuery.isError()) { return null; } @@ -90,7 +87,7 @@ export class BookService { return error instanceof Error ? error.message : 'Failed to load books'; }); - isBooksLoading = computed(() => !!this.token() && this.booksQuery.isPending()); + readonly isBooksLoading = computed(() => !!this.token() && this.booksQuery.isPending()); constructor() { effect(() => { @@ -121,7 +118,7 @@ export class BookService { } ensureBookDetail(bookId: number, withDescription: boolean): Promise { - return this.queryClient.ensureQueryData(this.bookDetailQueryOptions(bookId, withDescription)); + return this.queryClient.query({...this.bookDetailQueryOptions(bookId, withDescription), staleTime: 'static'}); } /** @@ -132,7 +129,7 @@ export class BookService { * this network request is necessary to pick up progress saved on another device or browser. */ fetchFreshBookDetail(bookId: number, withDescription: boolean): Promise { - return this.queryClient.fetchQuery({ + return this.queryClient.query({ ...this.bookDetailQueryOptions(bookId, withDescription), staleTime: 0, }); @@ -170,7 +167,7 @@ export class BookService { } getBooksInSeries(bookId: number): Observable { - return from(this.queryClient.ensureQueryData(this.getBooksQueryOptions())).pipe( + return from(this.queryClient.query({...this.getBooksQueryOptions(), staleTime: 'static'})).pipe( map(books => { const currentBook = books.find(book => book.id === bookId); if (!currentBook?.metadata?.seriesName) { @@ -185,7 +182,7 @@ export class BookService { } getBookRecommendations(bookId: number, limit: number = 20): Observable { - return from(this.queryClient.ensureQueryData(this.bookRecommendationsQueryOptions(bookId, limit))); + return from(this.queryClient.query({...this.bookRecommendationsQueryOptions(bookId, limit), staleTime: 'static'})); } /*------------------ Book Operations ------------------*/ @@ -290,7 +287,7 @@ export class BookService { case 'EPUB': baseUrl = 'ebook-reader'; if (reader === 'epub-streaming') { - queryParams['streaming'] = true; + queryParams.streaming = true; } break; @@ -315,7 +312,7 @@ export class BookService { } if (isAlternativeFormat) { - queryParams['bookType'] = bookType; + queryParams.bookType = bookType; } const hasQueryParams = Object.keys(queryParams).length > 0; diff --git a/frontend/src/app/features/book/service/cbx-reader.service.ts b/frontend/src/app/features/book/service/cbx-reader.service.ts index 8d348e00a..ea0d098cc 100644 --- a/frontend/src/app/features/book/service/cbx-reader.service.ts +++ b/frontend/src/app/features/book/service/cbx-reader.service.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {Injectable, inject} from '@angular/core'; +import {Service, inject} from '@angular/core'; import {API_CONFIG} from '../../../core/config/api-config'; import {AuthService} from '../../../shared/service/auth.service'; @@ -8,13 +8,13 @@ export interface CbxPageInfo { displayName: string; } -@Injectable({providedIn: 'root'}) +@Service() export class CbxReaderService { + private readonly authService = inject(AuthService); + private readonly http = inject(HttpClient); private readonly pagesUrl = `${API_CONFIG.BASE_URL}/api/v1/cbx`; private readonly imageUrl = `${API_CONFIG.BASE_URL}/api/v1/media/book`; - private authService = inject(AuthService); - private http = inject(HttpClient); private getToken(): string | null { return this.authService.getInternalAccessToken(); diff --git a/frontend/src/app/features/book/service/library-health.service.spec.ts b/frontend/src/app/features/book/service/library-health.service.spec.ts index 6d7baa86e..0963d0e87 100644 --- a/frontend/src/app/features/book/service/library-health.service.spec.ts +++ b/frontend/src/app/features/book/service/library-health.service.spec.ts @@ -32,9 +32,9 @@ describe('LibraryHealthService', () => { }); async function fetchHealth(): Promise { - const fetchQuerySpy = vi.spyOn(queryClient, 'fetchQuery'); + const querySpy = vi.spyOn(queryClient, 'query'); service.fetchHealth(); - await fetchQuerySpy.mock.results[0]?.value; + await querySpy.mock.results[0]?.value; } it('fetches health', async () => { diff --git a/frontend/src/app/features/book/service/library-health.service.ts b/frontend/src/app/features/book/service/library-health.service.ts index 6d9313f8a..8852a7f7d 100644 --- a/frontend/src/app/features/book/service/library-health.service.ts +++ b/frontend/src/app/features/book/service/library-health.service.ts @@ -1,4 +1,4 @@ -import {computed, inject, Injectable, DestroyRef} from '@angular/core'; +import {computed, inject, Service, DestroyRef} from '@angular/core'; import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; import {HttpClient} from '@angular/common/http'; import {lastValueFrom} from 'rxjs'; @@ -8,22 +8,22 @@ import {injectQuery, queryOptions, QueryClient} from '@tanstack/angular-query-ex const LIBRARY_HEALTH_QUERY_KEY = ['libraryHealth'] as const; -@Injectable({providedIn: 'root'}) +@Service() export class LibraryHealthService { + private readonly http = inject(HttpClient); + private readonly rxStompService = inject(RxStompService); + private readonly queryClient = inject(QueryClient); + private readonly destroyRef = inject(DestroyRef); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/libraries/health`; - private http = inject(HttpClient); - private rxStompService = inject(RxStompService); - private queryClient = inject(QueryClient); - private destroyRef = inject(DestroyRef); private socketInitialized = false; - private healthQuery = injectQuery(() => ({ + private readonly healthQuery = injectQuery(() => ({ ...this.getHealthQueryOptions(), enabled: false, // manually triggered via initialize() })); - health = computed(() => this.healthQuery.data() ?? {}); + readonly health = computed(() => this.healthQuery.data() ?? {}); private getHealthQueryOptions() { return queryOptions({ @@ -33,7 +33,7 @@ export class LibraryHealthService { } fetchHealth(): void { - void this.queryClient.fetchQuery(this.getHealthQueryOptions()); + void this.queryClient.query(this.getHealthQueryOptions()); } initWebsocket(): void { diff --git a/frontend/src/app/features/book/service/library-shelf-menu.service.ts b/frontend/src/app/features/book/service/library-shelf-menu.service.ts index bafba2aa6..ab8772190 100644 --- a/frontend/src/app/features/book/service/library-shelf-menu.service.ts +++ b/frontend/src/app/features/book/service/library-shelf-menu.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {Router} from '@angular/router'; import {TranslocoService} from '@jsverse/transloco'; import {ConfirmationService, MessageService} from '@openng/optimus-ui/api'; @@ -15,7 +15,7 @@ import {ShelfService} from './shelf.service'; type LibraryShelfActionTarget = Readonly<{id: number; name: string}>; -@Injectable({providedIn: 'root'}) +@Service() export class LibraryShelfMenuService { private readonly confirmationService = inject(ConfirmationService); private readonly messageService = inject(MessageService); diff --git a/frontend/src/app/features/book/service/library.service.spec.ts b/frontend/src/app/features/book/service/library.service.spec.ts index 4d10bac57..7f190b8a8 100644 --- a/frontend/src/app/features/book/service/library.service.spec.ts +++ b/frontend/src/app/features/book/service/library.service.spec.ts @@ -102,7 +102,7 @@ describe('LibraryService', () => { expect(queryClientHarness.queryClient.removeQueries).toHaveBeenCalledWith({queryKey: libraryFormatCountsQueryKey(4), exact: true}); }); - it('hydrates format counts through ensureQueryData', async () => { + it('hydrates format counts through query', async () => { httpTestingController.expectOne(req => req.url.endsWith('/api/v1/libraries')).flush([]); const resultPromise = new Promise>((resolve, reject) => { diff --git a/frontend/src/app/features/book/service/library.service.ts b/frontend/src/app/features/book/service/library.service.ts index e56be65ad..286f9fdbb 100644 --- a/frontend/src/app/features/book/service/library.service.ts +++ b/frontend/src/app/features/book/service/library.service.ts @@ -1,4 +1,4 @@ -import {computed, effect, inject, Injectable} from '@angular/core'; +import {computed, effect, inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {from, lastValueFrom, Observable} from 'rxjs'; import {tap} from 'rxjs/operators'; @@ -13,22 +13,22 @@ import {invalidateShelfDefinitions} from '../data/shelf-definition-query-cache'; import {invalidateAllBookCaches} from './legacy-book-cache'; import {SHELVES_QUERY_KEY} from './shelf-query-keys'; -@Injectable({providedIn: 'root'}) +@Service() export class LibraryService { + private readonly http = inject(HttpClient); + private readonly authService = inject(AuthService); + private readonly queryClient = inject(QueryClient); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/libraries`; - private http = inject(HttpClient); - private authService = inject(AuthService); - private queryClient = inject(QueryClient); private readonly token = this.authService.token; - private librariesQuery = injectQuery(() => ({ + private readonly librariesQuery = injectQuery(() => ({ ...this.getLibrariesQueryOptions(), enabled: !!this.token(), })); - libraries = computed(() => this.librariesQuery.data() ?? []); + readonly libraries = computed(() => this.librariesQuery.data() ?? []); - librariesError = computed(() => { + readonly librariesError = computed(() => { if (!this.token() || !this.librariesQuery.isError()) { return null; } @@ -37,7 +37,7 @@ export class LibraryService { return error instanceof Error ? error.message : 'Failed to load libraries'; }); - isLibrariesLoading = computed(() => !!this.token() && this.librariesQuery.isPending()); + readonly isLibrariesLoading = computed(() => !!this.token() && this.librariesQuery.isPending()); constructor() { effect(() => { @@ -126,7 +126,7 @@ export class LibraryService { } getBookCountsByFormat(libraryId: number): Observable> { - return from(this.queryClient.ensureQueryData(this.getLibraryFormatCountsQueryOptions(libraryId))); + return from(this.queryClient.query({...this.getLibraryFormatCountsQueryOptions(libraryId), staleTime: 'static'})); } private sortLibraries(libraries: Library[]): Library[] { diff --git a/frontend/src/app/features/book/service/metadata-task.ts b/frontend/src/app/features/book/service/metadata-task.ts index 1887fd5f9..2602ee9b0 100644 --- a/frontend/src/app/features/book/service/metadata-task.ts +++ b/frontend/src/app/features/book/service/metadata-task.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable, map} from 'rxjs'; import {BookMetadata} from '../model/book.model'; @@ -35,13 +35,11 @@ export interface MetadataFetchTask { proposals: FetchedProposal[]; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class MetadataTaskService { + private readonly http = inject(HttpClient); private readonly url = `${API_CONFIG.BASE_URL}/api/metadata/tasks`; - private http = inject(HttpClient); getTaskWithProposals(taskId: string): Observable { return this.http.get<{ task: MetadataFetchTask }>(`${this.url}/${taskId}`) diff --git a/frontend/src/app/features/book/service/shelf.service.ts b/frontend/src/app/features/book/service/shelf.service.ts index 481740376..6d22f7591 100644 --- a/frontend/src/app/features/book/service/shelf.service.ts +++ b/frontend/src/app/features/book/service/shelf.service.ts @@ -1,4 +1,4 @@ -import {computed, effect, inject, Injectable} from '@angular/core'; +import {computed, effect, inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {lastValueFrom, Observable} from 'rxjs'; import {tap} from 'rxjs/operators'; @@ -16,23 +16,23 @@ import {AuthService} from '../../../shared/service/auth.service'; const KOBO_SHELF_NAME = 'Kobo'; const KOBO_SHELF_ICON = 'pi pi-tablet'; -@Injectable({providedIn: 'root'}) +@Service() export class ShelfService { + private readonly http = inject(HttpClient); + private readonly bookService = inject(BookService); + private readonly authService = inject(AuthService); + private readonly queryClient = inject(QueryClient); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/shelves`; - private http = inject(HttpClient); - private bookService = inject(BookService); - private authService = inject(AuthService); - private queryClient = inject(QueryClient); private readonly token = this.authService.token; - private shelvesQuery = injectQuery(() => ({ + private readonly shelvesQuery = injectQuery(() => ({ ...this.getShelvesQueryOptions(), enabled: !!this.token(), })); - shelves = computed(() => this.shelvesQuery.data() ?? []); + readonly shelves = computed(() => this.shelvesQuery.data() ?? []); - shelvesError = computed(() => { + readonly shelvesError = computed(() => { if (!this.token() || !this.shelvesQuery.isError()) { return null; } @@ -41,7 +41,7 @@ export class ShelfService { return error instanceof Error ? error.message : 'Failed to load shelves'; }); - isShelvesLoading = computed(() => !!this.token() && this.shelvesQuery.isPending()); + readonly isShelvesLoading = computed(() => !!this.token() && this.shelvesQuery.isPending()); constructor() { effect(() => { diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-bulk-edit-dialog/bookdrop-bulk-edit-dialog.component.html b/frontend/src/app/features/bookdrop/component/bookdrop-bulk-edit-dialog/bookdrop-bulk-edit-dialog.component.html index c3397d457..b5c1c022f 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-bulk-edit-dialog/bookdrop-bulk-edit-dialog.component.html +++ b/frontend/src/app/features/bookdrop/component/bookdrop-bulk-edit-dialog/bookdrop-bulk-edit-dialog.component.html @@ -5,7 +5,7 @@
- +

{{ t('textFieldsTitle') }}

@@ -16,8 +16,7 @@ [binary]="true" [ngModel]="isFieldEnabled(field.name)" (ngModelChange)="toggleField(field.name)" - [ariaLabel]="t('enableField', { label: field.label })"> - + [ariaLabel]="t('enableField', { label: field.label })" />
- +

{{ t('numberFieldsTitle') }}

@@ -41,8 +40,7 @@ [binary]="true" [ngModel]="isFieldEnabled(field.name)" (ngModelChange)="toggleField(field.name)" - [ariaLabel]="t('enableField', { label: field.label })"> - + [ariaLabel]="t('enableField', { label: field.label })" />
- +
@@ -68,8 +66,7 @@ [(ngModel)]="mergeArrays" optionLabel="label" optionValue="value" - ariaLabelledBy="merge-mode-label"> - + ariaLabelledBy="merge-mode-label" />

{{ t('helperText') }}

@@ -80,8 +77,7 @@ [binary]="true" [ngModel]="isFieldEnabled(field.name)" (ngModelChange)="toggleField(field.name)" - [ariaLabel]="t('enableField', { label: field.label })"> - + [ariaLabel]="t('enableField', { label: field.label })" /> - + class="field-input" />
}
- +
diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-file-metadata-picker/bookdrop-file-metadata-picker.component.html b/frontend/src/app/features/bookdrop/component/bookdrop-file-metadata-picker/bookdrop-file-metadata-picker.component.html index c3685ef1e..c15e53468 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-file-metadata-picker/bookdrop-file-metadata-picker.component.html +++ b/frontend/src/app/features/bookdrop/component/bookdrop-file-metadata-picker/bookdrop-file-metadata-picker.component.html @@ -52,10 +52,8 @@ appendTo="body" lazyLoad [preview]="true" - [ngClass]="{ - 'changed': isValueCopied('thumbnailUrl'), - }" - > + [class.changed]="isValueCopied('thumbnailUrl')" + /> } @else {
{{ t('noCoverImage') }}
@@ -80,7 +78,7 @@ appendTo="body" lazyLoad [preview]="true" - > + /> } @else {
{{ t('coverImageNotFound') }}
@@ -100,17 +98,13 @@ id="{{field.controlName}}" formControlName="{{field.controlName}}" class="dest" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" /> } @@ -147,17 +139,12 @@ [iconDisplay]="'input'" appendTo="body" class="dest" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }"> - + [class.changed]="isValueChanged(field.controlName)" /> } @@ -186,7 +171,7 @@
+ [class.changed]="isValueChanged('authors')"> @for (author of metadataForm.get('authors')!.value; track $index) { @if ($index === 0) { m } @@ -220,9 +205,7 @@ [dropdown]="false" [forceSelection]="false" class="dest full-width" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" (onBlur)="onAutoCompleteBlur(field.controlName, $event)" /> } @@ -230,9 +213,7 @@ size="small" [icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (isValueChanged(field.controlName) || !fetchedMetadata[field.fetchedKey] ? 'pi pi-refresh' : 'pi pi-angle-left')" [outlined]="true" - [ngClass]="{ - 'nosrc' : !fetchedMetadata[field.fetchedKey] - }" + [class.nosrc]="!fetchedMetadata[field.fetchedKey]" class="arrow-button" [severity]="isValueChanged(field.controlName) ? 'warn' : null" [disabled]="!isFetchedDifferent(field.controlName) && !isValueChanged(field.controlName)" @@ -249,9 +230,7 @@ [dropdown]="false" [forceSelection]="false" class="src full-width" - [ngClass]="{ - 'diff': isFetchedDifferent(field.controlName), - }" + [class.diff]="isFetchedDifferent(field.controlName)" /> }
@@ -268,17 +247,13 @@ id="{{field.controlName}}" formControlName="{{field.controlName}}" class="dest" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" > } @@ -310,17 +283,13 @@ id="{{field.controlName}}" formControlName="{{field.controlName}}" class="dest" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" /> } @@ -359,7 +326,7 @@ [pTooltip]="t('resetAllTooltip')" tooltipPosition="left" (onClick)="confirmReset()" - > + />
@@ -383,9 +350,7 @@ pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" /> - + [class.changed]="isValueChanged(field.controlName)" /> + [class.changed]="isValueChanged('authors')"> @for (author of metadataForm.get('authors')!.value; track $index) { @if ($index === 0) { m } @@ -475,9 +437,7 @@ [dropdown]="false" [forceSelection]="false" class="full-width" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" (onBlur)="onAutoCompleteBlur(field.controlName, $event)" /> } @@ -505,9 +465,7 @@ pSize="small" id="{{field.controlName}}" formControlName="{{field.controlName}}" - [ngClass]="{ - 'changed': isValueChanged(field.controlName), - }" + [class.changed]="isValueChanged(field.controlName)" > = {}; @Input() bookdropFileId!: number; - @Output() metadataCopied = new EventEmitter(); + readonly metadataCopied = output(); authorInputValue = ''; diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html b/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html index 155a3937d..fae7cb309 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html +++ b/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html @@ -23,8 +23,7 @@ outlined (click)="rescanBookdrop()" [pTooltip]="t('rescanTooltip')" - tooltipPosition="top"> - + tooltipPosition="top" />
@@ -54,7 +53,7 @@ @if (bookdropFileUis.length !== 0) {
-
@@ -116,8 +111,7 @@ optionValue="value" [placeholder]="t('libraryPlaceholder')" appendTo="body" - [(ngModel)]="defaultLibraryId"> - + [(ngModel)]="defaultLibraryId" /> - + [(ngModel)]="defaultPathId" /> - + tooltipPosition="top" />
}
- @if (bookdropFileUis.length === 0) { -
- {{ t('emptyState') }} -
- } @else { + @for (file of bookdropFileUis; track file.file.id) {
-
+
- + (ngModelChange)="toggleFileSelection(file.file.id, $event)" /> @if (file.metadataForm.get('thumbnailUrl')?.value) { - + (onChange)="onLibraryChange(file)" /> - + [(ngModel)]="file.selectedPathId" /> - + tooltipPosition="left" />
@@ -259,18 +243,21 @@ [copiedFields]="file.copiedFields" [savedFields]="file.savedFields" [bookdropFileId]="file.file.id" - (metadataCopied)="onMetadataCopied(file.file.id, $event)"> - + (metadataCopied)="onMetadataCopied(file.file.id, $event)" /> }
- } + } @empty { +
+ {{ t('emptyState') }} +
+ }
} @if (!loading()) { - + } @@ -330,8 +314,7 @@ outlined (click)="confirmReset()" [pTooltip]="t('resetTooltip')" - tooltipPosition="top"> -
+ tooltipPosition="top" /> - + tooltipPosition="top" /> - + tooltipPosition="top" /> diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.ts b/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.ts index 1cc2b5113..11e7d2b55 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.ts +++ b/frontend/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.ts @@ -88,7 +88,7 @@ export class BookdropFileReviewComponent implements OnInit { bookdropFileUis: BookdropFileUI[] = []; fileUiCache: Record = {}; copiedFlags: Record = {}; - loading = signal(true); + readonly loading = signal(true); saving = false; includeCoversOnCopy = true; @@ -124,7 +124,7 @@ export class BookdropFileReviewComponent implements OnInit { const selected = this.libraries.find((lib) => lib?.id && String(lib.id) === value) - if (selected && selected.paths.length === 1) { + if (selected?.paths.length === 1) { this.defaultPathId = String(selected.paths[0].id) } } diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.html b/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.html index 912163bd8..6443a63cd 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.html +++ b/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.html @@ -14,8 +14,7 @@ [text]="true" severity="secondary" (click)="ref.close()" - class="close-button"> -
+ class="close-button" />
@@ -44,13 +43,13 @@ @for (r of result.results; track r.fileName + ':' + $index) {
  • diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.ts b/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.ts index b4992a66a..ea2b1932b 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.ts +++ b/frontend/src/app/features/bookdrop/component/bookdrop-finalize-result-dialog/bookdrop-finalize-result-dialog.component.ts @@ -1,5 +1,5 @@ import {Component, inject, OnDestroy} from '@angular/core'; -import {DatePipe, NgClass} from '@angular/common'; +import {DatePipe} from '@angular/common'; import {BookdropFinalizeResult} from '../../service/bookdrop.service'; import {DynamicDialogConfig, DynamicDialogRef} from "@openng/optimus-ui/dynamicdialog"; import {Button} from '@openng/optimus-ui/button'; @@ -8,7 +8,6 @@ import {TranslocoDirective} from '@jsverse/transloco'; @Component({ selector: 'app-bookdrop-finalize-result-dialog', imports: [ - NgClass, DatePipe, Button, TranslocoDirective diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.html b/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.html index cef28f8ac..1516b9c52 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.html +++ b/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.html @@ -5,7 +5,7 @@
  • - +

    {{ t('patternTitle') }}

    @@ -25,8 +25,7 @@ severity="secondary" [disabled]="!hasValidPattern" [ariaLabel]="t('previewAriaLabel')" - (click)="previewPattern()"> - + (click)="previewPattern()" />
    @@ -39,8 +38,7 @@ [pTooltip]="getPlaceholderTooltip(placeholder)" tooltipPosition="top" class="placeholder-chip" - (click)="insertPlaceholder(placeholder.name)"> - + (click)="insertPlaceholder(placeholder.name)" /> } @@ -54,23 +52,22 @@ severity="secondary" size="small" outlined - (click)="applyCommonPattern(commonPattern.pattern)"> -
    + (click)="applyCommonPattern(commonPattern.pattern)" /> } - + @if (previewResults.length > 0) {

    {{ t('previewTitle') }}

    @for (preview of previewResults; track preview.fileName) { -
    +
    @@ -93,13 +90,13 @@
    - + }
    diff --git a/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.ts b/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.ts index 437cff8cb..0ac0e6865 100644 --- a/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.ts +++ b/frontend/src/app/features/bookdrop/component/bookdrop-pattern-extract-dialog/bookdrop-pattern-extract-dialog.component.ts @@ -8,7 +8,6 @@ import {Chip} from '@openng/optimus-ui/chip'; import {ProgressSpinner} from '@openng/optimus-ui/progressspinner'; import {BookdropService, PatternExtractResult} from '../../service/bookdrop.service'; import {MessageService} from '@openng/optimus-ui/api'; -import {NgClass} from '@angular/common'; import {Tooltip} from '@openng/optimus-ui/tooltip'; import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/transloco'; @@ -35,7 +34,6 @@ interface PreviewResult { Divider, Chip, ProgressSpinner, - NgClass, Tooltip, TranslocoDirective, TranslocoPipe, @@ -186,7 +184,7 @@ export class BookdropPatternExtractDialogComponent implements OnInit { this.previewResults = result.results.map(r => ({ fileName: r.fileName, success: r.success, - preview: r.extractedMetadata || {}, + preview: r.extractedMetadata ?? {}, errorMessage: r.errorMessage })); }, diff --git a/frontend/src/app/features/bookdrop/service/bookdrop-file-api.service.ts b/frontend/src/app/features/bookdrop/service/bookdrop-file-api.service.ts index bfdb3d306..d1b634509 100644 --- a/frontend/src/app/features/bookdrop/service/bookdrop-file-api.service.ts +++ b/frontend/src/app/features/bookdrop/service/bookdrop-file-api.service.ts @@ -1,16 +1,14 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {API_CONFIG} from '../../../core/config/api-config'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {BookdropFileNotification} from './bookdrop-file.service'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class BookdropFileApiService { + private readonly http = inject(HttpClient); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/bookdrop`; - private http = inject(HttpClient); getNotification(): Observable { return this.http.get(`${this.url}/notification`); diff --git a/frontend/src/app/features/bookdrop/service/bookdrop-file.service.ts b/frontend/src/app/features/bookdrop/service/bookdrop-file.service.ts index 4d2d87a20..6291cdea0 100644 --- a/frontend/src/app/features/bookdrop/service/bookdrop-file.service.ts +++ b/frontend/src/app/features/bookdrop/service/bookdrop-file.service.ts @@ -1,4 +1,4 @@ -import {computed, effect, inject, Injectable, signal} from '@angular/core'; +import {computed, effect, inject, Service, signal} from '@angular/core'; import {BookdropFileApiService} from './bookdrop-file-api.service'; import {AuthService} from '../../../shared/service/auth.service'; import {UserService} from '../../settings/user-management/user.service'; @@ -9,10 +9,11 @@ export interface BookdropFileNotification { lastUpdatedAt?: string; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class BookdropFileService { + private readonly apiService = inject(BookdropFileApiService); + private readonly authService = inject(AuthService); + private readonly userService = inject(UserService); private readonly summaryState = signal({ pendingCount: 0, totalCount: 0 @@ -21,10 +22,6 @@ export class BookdropFileService { readonly summary = this.summaryState.asReadonly(); readonly hasPendingFiles = computed(() => this.summary().pendingCount > 0); - private readonly apiService = inject(BookdropFileApiService); - private readonly authService = inject(AuthService); - private readonly userService = inject(UserService); - constructor() { effect(() => { const user = this.userService.currentUser(); diff --git a/frontend/src/app/features/bookdrop/service/bookdrop.service.ts b/frontend/src/app/features/bookdrop/service/bookdrop.service.ts index c4bb5a8df..7d9c8a0d0 100644 --- a/frontend/src/app/features/bookdrop/service/bookdrop.service.ts +++ b/frontend/src/app/features/bookdrop/service/bookdrop.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {BookMetadata} from '../../book/model/book.model'; @@ -97,10 +97,10 @@ export interface BulkEditResult { failed: number; } -@Injectable({providedIn: 'root'}) +@Service() export class BookdropService { + private readonly http = inject(HttpClient); private readonly url = `${API_CONFIG.BASE_URL}/api/v1/bookdrop`; - private http = inject(HttpClient); getPendingFiles(page: number = 0, size: number = 50): Observable> { return this.http.get>(`${this.url}/files?status=pending&page=${page}&size=${size}`); diff --git a/frontend/src/app/features/command-palette/command-palette.component.html b/frontend/src/app/features/command-palette/command-palette.component.html index d7cac514e..e48d496a2 100644 --- a/frontend/src/app/features/command-palette/command-palette.component.html +++ b/frontend/src/app/features/command-palette/command-palette.component.html @@ -90,7 +90,7 @@ [icon]="item.icon ?? null" size="18px" [displayEmpty]="true" - > + /> {{ item.title }} @if (item.subtitle) { {{ item.subtitle }} diff --git a/frontend/src/app/features/command-palette/command-palette.service.ts b/frontend/src/app/features/command-palette/command-palette.service.ts index 91657e825..6a6613c07 100644 --- a/frontend/src/app/features/command-palette/command-palette.service.ts +++ b/frontend/src/app/features/command-palette/command-palette.service.ts @@ -1,4 +1,4 @@ -import { computed, inject, Injectable, signal } from '@angular/core'; +import { computed, inject, Service, signal } from '@angular/core'; import { MessageService } from '@openng/optimus-ui/api'; import { toSignal } from '@angular/core/rxjs-interop'; import { Router } from '@angular/router'; @@ -39,7 +39,7 @@ interface CommandPaletteOverlayController { const BOOK_RESULT_LIMIT = 50; const MIN_BOOK_SEARCH_LENGTH = 2; -@Injectable({ providedIn: 'root' }) +@Service() export class CommandPaletteService { private readonly router = inject(Router); private readonly t = inject(TranslocoService); diff --git a/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts b/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts index 409de97c8..e4fd682c9 100644 --- a/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts +++ b/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts @@ -37,12 +37,11 @@ type ScrollerViewState = 'idle' | 'skeleton' | 'error' | 'empty' | 'books'; standalone: true }) export class DashboardScrollerComponent { - - readonly config = input.required(); - private readonly bookQuery = inject(BookQueryService); private readonly userService = inject(UserService); protected readonly bookNavigation = inject(BookNavigationService); + + readonly config = input.required(); protected readonly bookMenu = viewChild(BookMenuComponent); private readonly params = computed(() => dashboardRowQueryParams(this.config())); diff --git a/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.html b/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.html index 79811b494..04eb799c3 100644 --- a/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.html +++ b/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.html @@ -19,8 +19,7 @@ [label]="t('createLibrary')" icon="pi pi-plus" class="p-button-rounded p-button-outlined" - (click)="createNewLibrary()"> - + (click)="createNewLibrary()" />
    }
    diff --git a/frontend/src/app/features/dashboard/services/dashboard-config.service.ts b/frontend/src/app/features/dashboard/services/dashboard-config.service.ts index 18e0e4454..a89a16ade 100644 --- a/frontend/src/app/features/dashboard/services/dashboard-config.service.ts +++ b/frontend/src/app/features/dashboard/services/dashboard-config.service.ts @@ -1,11 +1,9 @@ -import {effect, inject, Injectable, signal} from '@angular/core'; +import {effect, inject, Service, signal} from '@angular/core'; import {DashboardConfig, DEFAULT_DASHBOARD_CONFIG, ScrollerType} from '../models/dashboard-config.model'; import {UserService} from '../../settings/user-management/user.service'; import {MagicShelfService} from '../../magic-shelf/service/magic-shelf.service'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class DashboardConfigService { private readonly userService = inject(UserService); private readonly magicShelfService = inject(MagicShelfService); diff --git a/frontend/src/app/features/design-system/design-system.component.html b/frontend/src/app/features/design-system/design-system.component.html index 39be96eaa..7f47ffc95 100644 --- a/frontend/src/app/features/design-system/design-system.component.html +++ b/frontend/src/app/features/design-system/design-system.component.html @@ -56,7 +56,7 @@ - + Delete this diff --git a/frontend/src/app/features/design-system/design-system.component.ts b/frontend/src/app/features/design-system/design-system.component.ts index adc648956..65bc018ec 100644 --- a/frontend/src/app/features/design-system/design-system.component.ts +++ b/frontend/src/app/features/design-system/design-system.component.ts @@ -19,7 +19,7 @@ import { LucideShare2, LucideSmartphone, LucideTag, - LucideTrash2, + LucideTrash, LucideTriangleAlert, LucideX, LucideZap, @@ -136,7 +136,7 @@ interface ButtonExample { LucideEllipsisVertical, LucideFolderOpen, LucideDownload, - LucideTrash2, + LucideTrash, LucideSearch, LucideX, LucideTriangleAlert, @@ -184,7 +184,7 @@ export class DesignSystemComponent { readonly iconCopy: LucideIconData = LucideCopy.icon; readonly iconPencil: LucideIconData = LucidePencil.icon; readonly iconDownload: LucideIconData = LucideDownload.icon; - readonly iconTrash: LucideIconData = LucideTrash2.icon; + readonly iconTrash: LucideIconData = LucideTrash.icon; readonly iconShare: LucideIconData = LucideShare2.icon; readonly iconFolderOpen: LucideIconData = LucideFolderOpen.icon; diff --git a/frontend/src/app/features/design-system/forms/device-form.component.ts b/frontend/src/app/features/design-system/forms/device-form.component.ts index b160d2aac..1dd457449 100644 --- a/frontend/src/app/features/design-system/forms/device-form.component.ts +++ b/frontend/src/app/features/design-system/forms/device-form.component.ts @@ -71,7 +71,7 @@ export class DeviceFormExampleComponent { readonly model = signal(createInitialModel()); readonly deviceForm = form(this.model, path => { - hidden(path.hardcover.apiKey, ({ valueOf }) => !valueOf(path.hardcover.enabled)); + hidden(path.hardcover.apiKey, {when: ({ valueOf }) => !valueOf(path.hardcover.enabled)}); required(path.hardcover.apiKey, { message: 'Enter your Hardcover API key' }); minLength(path.hardcover.apiKey, 20, { message: 'Hardcover keys are at least 20 characters' }); @@ -81,13 +81,13 @@ export class DeviceFormExampleComponent { max(path.kobo.markAsFinished, 100); min(path.kobo.conversionLimitMb, 1); max(path.kobo.conversionLimitMb, 250); - hidden(path.kobo.convertToKepub, ({ valueOf }) => !valueOf(path.kobo.enabled)); - hidden(path.kobo.markAsReading, ({ valueOf }) => !valueOf(path.kobo.enabled)); - hidden(path.kobo.markAsFinished, ({ valueOf }) => !valueOf(path.kobo.enabled)); - hidden(path.kobo.conversionLimitMb, ({ valueOf }) => !valueOf(path.kobo.enabled)); + hidden(path.kobo.convertToKepub, {when: ({ valueOf }) => !valueOf(path.kobo.enabled)}); + hidden(path.kobo.markAsReading, {when: ({ valueOf }) => !valueOf(path.kobo.enabled)}); + hidden(path.kobo.markAsFinished, {when: ({ valueOf }) => !valueOf(path.kobo.enabled)}); + hidden(path.kobo.conversionLimitMb, {when: ({ valueOf }) => !valueOf(path.kobo.enabled)}); - hidden(path.koreader.username, ({ valueOf }) => !valueOf(path.koreader.enabled)); - hidden(path.koreader.password, ({ valueOf }) => !valueOf(path.koreader.enabled)); + hidden(path.koreader.username, {when: ({ valueOf }) => !valueOf(path.koreader.enabled)}); + hidden(path.koreader.password, {when: ({ valueOf }) => !valueOf(path.koreader.enabled)}); required(path.koreader.username, { message: 'Choose a sync username' }); required(path.koreader.password, { message: 'Set a sync password' }); minLength(path.koreader.password, 6, { message: 'Use at least 6 characters' }); diff --git a/frontend/src/app/features/magic-shelf/component/magic-shelf-component.html b/frontend/src/app/features/magic-shelf/component/magic-shelf-component.html index cfd22aa78..11655f323 100644 --- a/frontend/src/app/features/magic-shelf/component/magic-shelf-component.html +++ b/frontend/src/app/features/magic-shelf/component/magic-shelf-component.html @@ -16,8 +16,7 @@ [rounded]="true" severity="secondary" (onClick)="cancel()" - class="close-button"> - + class="close-button" />
    @@ -37,8 +36,7 @@ [icon]="selectedIcon" [size]="'16px'" iconClass="selected-icon" - alt="Selected shelf icon"> - + alt="Selected shelf icon" /> {{ t('form.clickToChange') }}
    - +
    @@ -83,7 +81,7 @@ }
    - +
    @@ -121,10 +119,10 @@
    - - + + @if (group.parent) { - + }
    @@ -133,7 +131,7 @@
    @if (isGroup(ruleCtrl)) { - + } @else { @@ -141,82 +139,82 @@ @if (!['is_empty', 'is_not_empty'].includes(ruleCtrl.get('operator')?.value)) { @if (['within_last', 'older_than'].includes(ruleCtrl.get('operator')?.value)) { - - + + } @else if (ruleCtrl.get('operator')?.value === 'this_period') { - + } @else if (ruleCtrl.get('operator')?.value === 'in_between') { @if (ruleCtrl.get('field')?.value === 'publishedDate') { - - + + } @else if (['dateFinished', 'addedOn', 'lastReadTime'].includes(ruleCtrl.get('field')?.value)) { - - + + } @else if (numericFieldConfigMap().get(ruleCtrl.get('field')?.value)?.type === 'number') { - - + + } @else if (numericFieldConfigMap().get(ruleCtrl.get('field')?.value)?.type === 'decimal') { - - + + } @else { } } @else { @if (ruleCtrl.get('field')?.value === 'publishedDate') { - + } @else if (['dateFinished', 'addedOn', 'lastReadTime'].includes(ruleCtrl.get('field')?.value)) { - + } @else if (numericFieldConfigMap().get(ruleCtrl.get('field')?.value)?.type === 'boolean') { - + } @else if (numericFieldConfigMap().get(ruleCtrl.get('field')?.value)?.type === 'number') { - + } @else if (numericFieldConfigMap().get(ruleCtrl.get('field')?.value)?.type === 'decimal') { - + } @else if (ruleCtrl.get('field')?.value === 'seriesStatus') { - + } @else if (ruleCtrl.get('field')?.value === 'seriesGaps') { - + } @else if (ruleCtrl.get('field')?.value === 'seriesPosition') { - + } @else if (ruleCtrl.get('field')?.value === 'metadataPresence') { - + } @else if (['includes_any', 'includes_all', 'excludes_all'].includes(ruleCtrl.get('operator')?.value)) { @if (ruleCtrl.get('field')?.value === 'readStatus') { - + } @else if (ruleCtrl.get('field')?.value === 'fileType') { - + } @else if (ruleCtrl.get('field')?.value === 'library') { - + } @else if (ruleCtrl.get('field')?.value === 'shelf') { - + } @else if (ruleCtrl.get('field')?.value === 'categories') { - + } @else if (ruleCtrl.get('field')?.value === 'contentRating') { - + } @else {
    - +
    } } @else if (ruleCtrl.get('field')?.value === 'readStatus') { - + } @else if (ruleCtrl.get('field')?.value === 'fileType') { - + } @else if (ruleCtrl.get('field')?.value === 'library') { - + } @else if (ruleCtrl.get('field')?.value === 'shelf') { - + } @else if (ruleCtrl.get('field')?.value === 'categories') { - + } @else if (ruleCtrl.get('field')?.value === 'contentRating') { - + } @else { } } } - + }
    } diff --git a/frontend/src/app/features/magic-shelf/component/magic-shelf-component.ts b/frontend/src/app/features/magic-shelf/component/magic-shelf-component.ts index 5818a2458..b9d07b313 100644 --- a/frontend/src/app/features/magic-shelf/component/magic-shelf-component.ts +++ b/frontend/src/app/features/magic-shelf/component/magic-shelf-component.ts @@ -246,6 +246,15 @@ export class MagicShelfComponent implements OnInit { private readonly t = inject(TranslocoService); private readonly providerFields = inject(MetadataProviderFieldsService); private readonly injector = inject(Injector); + libraryService = inject(LibraryService); + shelfService = inject(ShelfService); + bookService = inject(BookService); + magicShelfService = inject(MagicShelfService); + ref = inject(DynamicDialogRef); + messageService = inject(MessageService); + config = inject(DynamicDialogConfig); + userService = inject(UserService); + private readonly iconPicker = inject(IconPickerService); private readonly controlIds = new WeakMap(); private controlIdCounter = 0; @@ -425,19 +434,19 @@ export class MagicShelfComponent implements OnInit { return DATE_PERIODS.map(period => ({label: this.t.translate(`magicShelf.datePeriods.${period}`), value: period})); } - libraryOptions = computed(() => + readonly libraryOptions = computed(() => this.libraryService.libraries().map(library => ({ label: library.name, value: library.id! })) ); - shelfOptions = computed(() => + readonly shelfOptions = computed(() => this.shelfService.shelves().map(shelf => ({ label: shelf.name, value: shelf.id! })) ); - categoryOptions = computed(() => { + readonly categoryOptions = computed(() => { const categoriesSet = new Set(); this.bookService.books().forEach(book => { book.metadata?.categories?.forEach(category => categoriesSet.add(category)); @@ -462,16 +471,6 @@ export class MagicShelfComponent implements OnInit { showImportPanel = false; importJson = ''; - libraryService = inject(LibraryService); - shelfService = inject(ShelfService); - bookService = inject(BookService); - magicShelfService = inject(MagicShelfService); - ref = inject(DynamicDialogRef); - messageService = inject(MessageService); - config = inject(DynamicDialogConfig); - userService = inject(UserService); - private iconPicker = inject(IconPickerService); - selectedIcon: IconSelection | null = null; private formInitializedFromShelf = false; @@ -666,13 +665,13 @@ export class MagicShelfComponent implements OnInit { value: new FormControl(null), valueStart: new FormControl(null), valueEnd: new FormControl(null), - }) as RuleFormGroup; + }); } createGroup(): GroupFormGroup { return new FormGroup({ type: new FormControl<'group'>('group' as const), - join: new FormControl<'and' | 'or'>('and' as 'and' | 'or'), + join: new FormControl<'and' | 'or'>('and'), rules: new FormArray([] as (GroupFormGroup | RuleFormGroup)[]), }) as GroupFormGroup; } diff --git a/frontend/src/app/features/magic-shelf/service/magic-shelf.service.ts b/frontend/src/app/features/magic-shelf/service/magic-shelf.service.ts index cd7efb143..b52d273d5 100644 --- a/frontend/src/app/features/magic-shelf/service/magic-shelf.service.ts +++ b/frontend/src/app/features/magic-shelf/service/magic-shelf.service.ts @@ -1,4 +1,4 @@ -import {computed, effect, inject, Injectable} from '@angular/core'; +import {computed, effect, inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {lastValueFrom, Observable} from 'rxjs'; import {tap} from 'rxjs/operators'; @@ -20,15 +20,12 @@ export interface MagicShelf { const MAGIC_SHELVES_QUERY_KEY = ['magicShelves'] as const; -@Injectable({ - providedIn: 'root', -}) +@Service() export class MagicShelfService { - private readonly url = `${API_CONFIG.BASE_URL}/api/magic-shelves`; - private readonly http = inject(HttpClient); private readonly authService = inject(AuthService); private readonly queryClient = inject(QueryClient); + private readonly url = `${API_CONFIG.BASE_URL}/api/magic-shelves`; private readonly token = this.authService.token; private readonly shelvesQuery = injectQuery(() => ({ diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.html b/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.html index 27b95aa15..4eaa7699e 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.html +++ b/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.html @@ -14,8 +14,7 @@ [text]="true" severity="secondary" (click)="ref?.close()" - class="close-button"> -
    + class="close-button" /> }
    @@ -48,24 +47,22 @@ - + [recommendedBooks]="recommendedBooks()" /> @if (canOpenTab(BookMetadataTab.Edit)) { - + [book]="book()" /> } @if (canOpenTab(BookMetadataTab.Match)) { - + } @if (canOpenTab(BookMetadataTab.Sidecar)) { - + } diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.ts index 00ab2aeec..841a2b8ff 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/book-metadata-center.component.ts @@ -46,21 +46,21 @@ enum BookMetadataTab { styleUrls: ['./book-metadata-center.component.scss'], }) export class BookMetadataCenterComponent implements OnInit { - private route = inject(ActivatedRoute); - private router = inject(Router); - private bookService = inject(BookService); - private userService = inject(UserService); - private appSettingsService = inject(AppSettingsService); - private metadataHostService = inject(BookMetadataHostService); - private destroyRef = inject(DestroyRef); - private pageTitle = inject(PageTitleService); - private t = inject(TranslocoService); + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly bookService = inject(BookService); + private readonly userService = inject(UserService); + private readonly appSettingsService = inject(AppSettingsService); + private readonly metadataHostService = inject(BookMetadataHostService); + private readonly destroyRef = inject(DestroyRef); + private readonly pageTitle = inject(PageTitleService); + private readonly t = inject(TranslocoService); readonly config = inject(DynamicDialogConfig, {optional: true}); readonly ref = inject(DynamicDialogRef, {optional: true}); BookMetadataTab = BookMetadataTab; - private currentBookId = signal(this.config?.data?.bookId ?? null); - private bookQuery = injectQuery(() => { + private readonly currentBookId = signal(this.config?.data?.bookId ?? null); + private readonly bookQuery = injectQuery(() => { const bookId = this.currentBookId(); if (bookId == null) { @@ -112,7 +112,7 @@ export class BookMetadataCenterComponent implements OnInit { return (this.admin() || this.canEditMetadata()) && !this.isPhysical && this.isLocalStorage() && sidecarEnabled; } - private validTabs = Object.values(BookMetadataTab); + private readonly validTabs = Object.values(BookMetadataTab); get tab(): BookMetadataTab { return this._tab; diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.html b/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.html index 25cb150d6..f01c1f5e2 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.html +++ b/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.html @@ -1,7 +1,7 @@
    @if (loading() && sessions.length === 0) {
    - +

    {{ t('loading') }}

    } @else if (sessions.length === 0) { @@ -37,7 +37,7 @@
    - + {{ formatBookType(session.bookType) }} @@ -52,7 +52,7 @@ @if (session.progressDelta !== null && session.progressDelta !== undefined) { - + {{ (session.progressDelta > 0 ? '+' : '') + session.progressDelta }}% diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.ts index 6e4b65ae4..0adbefe8b 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/book-reading-sessions/book-reading-sessions.component.ts @@ -6,27 +6,25 @@ import {finalize, Subject, takeUntil} from 'rxjs'; import {TableModule} from '@openng/optimus-ui/table'; import {ProgressSpinner} from '@openng/optimus-ui/progressspinner'; import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; -import {NgClass} from '@angular/common'; @Component({ selector: 'app-book-reading-sessions', standalone: true, imports: [ - NgClass,TableModule, ProgressSpinner, TranslocoDirective], + TableModule, ProgressSpinner, TranslocoDirective], templateUrl: './book-reading-sessions.component.html', styleUrls: ['./book-reading-sessions.component.scss'] }) export class BookReadingSessionsComponent implements OnInit, OnChanges { - @Input() bookId!: number; - private readonly readingSessionService = inject(ReadingSessionApiService); private readonly destroyRef = inject(DestroyRef); - private readonly cancelLoad$ = new Subject(); private readonly t = inject(TranslocoService); + @Input() bookId!: number; + private readonly cancelLoad$ = new Subject(); sessions: ReadingSessionResponse[] = []; rows = 5; - loading = signal(false); + readonly loading = signal(false); get pageReportTemplate(): string { return this.t.translate('metadata.readingSessions.pageReport'); @@ -87,7 +85,7 @@ export class BookReadingSessionsComponent implements OnInit, OnChanges { if (Math.abs(actualDuration - storedDuration) > 1) { // Discrepancy detected - show both values - return `${this.formatDuration(actualDuration)}`; + return this.formatDuration(actualDuration); } return this.formatDuration(actualDuration); diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.html b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.html index 38b4f8498..4b6464c09 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.html +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.html @@ -4,7 +4,7 @@
    } @if (isLoading) { - + }
    @@ -26,7 +26,7 @@ [preview]="true" [alt]="t('ebookCover')" /> @if (isUploading) { - + }
    @if (!book.isPhysical) { @@ -38,8 +38,7 @@ [outlined]="true" severity="warn" size="small" - [disabled]="book.metadata!['coverLocked']"> - + [disabled]="book.metadata!['coverLocked']" /> } - + [disabled]="book.metadata!['coverLocked'] || isGeneratingCover" /> - + severity="info" /> - + (onBeforeUpload)="onBeforeSend()" /> @if (!book.metadata!['coverLocked']) { - + } - @if (book.metadata!['coverLocked']) { - + @else { + }
    @@ -103,7 +99,7 @@ [preview]="true" [alt]="t('audiobookCover')" /> @if (isUploading) { - + }
    - + [disabled]="book.metadata!['audiobookCoverLocked']" /> - + [disabled]="book.metadata!['audiobookCoverLocked'] || isGeneratingAudiobookCover" /> - + severity="info" /> - + (onBeforeUpload)="onBeforeSend()" /> @if (!book.metadata!['audiobookCoverLocked']) { - + } - @if (book.metadata!['audiobookCoverLocked']) { - + @else { + }
    @@ -170,10 +162,10 @@
    @if (!book.metadata!['titleLocked']) { - + } - @if (book.metadata!['titleLocked']) { - + @else { + }
    @@ -183,10 +175,10 @@
    @if (!book.metadata!['subtitleLocked']) { - + } - @if (book.metadata!['subtitleLocked']) { - + @else { + }
    @@ -196,10 +188,10 @@
    @if (!book.metadata!['languageLocked']) { - + } - @if (book.metadata!['languageLocked']) { - + @else { + }
    @@ -243,10 +235,10 @@ } @if (!book.metadata!['authorsLocked']) { - + } - @if (book.metadata!['authorsLocked']) { - + @else { + } @@ -262,13 +254,12 @@ [suggestions]="filteredPublishers" [forceSelection]="false" [showClear]="false" - (completeMethod)="filterPublishers($event)"> - + (completeMethod)="filterPublishers($event)" /> @if (!book.metadata!['publisherLocked']) { - + } - @if (book.metadata!['publisherLocked']) { - + @else { + } @@ -284,13 +275,12 @@ [showIcon]="false" [iconDisplay]="'input'" fluid="true" - appendTo="body"> - + appendTo="body" /> @if (!book.metadata!['publishedDateLocked']) { - + } - @if (book.metadata!['publishedDateLocked']) { - + @else { + } @@ -310,14 +300,13 @@ [showClear]="true" (completeMethod)="filterCategories($event)" (onKeyUp)="onAutoCompleteKeyUp('categories', $event)" - (onSelect)="onAutoCompleteSelect('categories', $event)"> - + (onSelect)="onAutoCompleteSelect('categories', $event)" /> @if (!book.metadata!['categoriesLocked']) { - + } - @if (book.metadata!['categoriesLocked']) { - + @else { + } @@ -337,14 +326,13 @@ [showClear]="true" (completeMethod)="filterMoods($event)" (onKeyUp)="onAutoCompleteKeyUp('moods', $event)" - (onSelect)="onAutoCompleteSelect('moods', $event)"> - + (onSelect)="onAutoCompleteSelect('moods', $event)" /> @if (!book.metadata!['moodsLocked']) { - + } - @if (book.metadata!['moodsLocked']) { - + @else { + } @@ -361,14 +349,13 @@ [showClear]="true" (completeMethod)="filterTags($event)" (onKeyUp)="onAutoCompleteKeyUp('tags', $event)" - (onSelect)="onAutoCompleteSelect('tags', $event)"> - + (onSelect)="onAutoCompleteSelect('tags', $event)" /> @if (!book.metadata!['tagsLocked']) { - + } - @if (book.metadata!['tagsLocked']) { - + @else { + } @@ -387,13 +374,12 @@ [suggestions]="filteredSeries" [forceSelection]="false" [showClear]="false" - (completeMethod)="filterSeries($event)"> - + (completeMethod)="filterSeries($event)" /> @if (!book.metadata!['seriesNameLocked']) { - + } - @if (book.metadata!['seriesNameLocked']) { - + @else { + } @@ -403,10 +389,10 @@
    @if (!book.metadata!['seriesNumberLocked']) { - + } - @if (book.metadata!['seriesNumberLocked']) { - + @else { + }
    @@ -416,10 +402,10 @@
    @if (!book.metadata!['seriesTotalLocked']) { - + } - @if (book.metadata!['seriesTotalLocked']) { - + @else { + }
    @@ -428,10 +414,10 @@
    @if (!book.metadata!['reviewsLocked']) { - + } - @if (book.metadata!['reviewsLocked']) { - + @else { + }
    @@ -443,10 +429,10 @@
    @if (!book.metadata!['isbn10Locked']) { - + } - @if (book.metadata!['isbn10Locked']) { - + @else { + }
    @@ -455,10 +441,10 @@
    @if (!book.metadata!['isbn13Locked']) { - + } - @if (book.metadata!['isbn13Locked']) { - + @else { + }
    @@ -473,13 +459,12 @@ optionValue="value" [placeholder]="t('selectPlaceholder')" [showClear]="true" - appendTo="body"> - + appendTo="body" /> @if (!book.metadata!['ageRatingLocked']) { - + } - @if (book.metadata!['ageRatingLocked']) { - + @else { + } @@ -494,13 +479,12 @@ optionValue="value" [placeholder]="t('selectPlaceholder')" [showClear]="true" - appendTo="body"> - + appendTo="body" /> @if (!book.metadata!['contentRatingLocked']) { - + } - @if (book.metadata!['contentRatingLocked']) { - + @else { + } @@ -509,10 +493,10 @@
    @if (!book.metadata!['pageCountLocked']) { - + } - @if (book.metadata!['pageCountLocked']) { - + @else { + }
    @@ -542,15 +526,15 @@ {{ field.label }} @if (isEmbeddable(field.controlName, book)) { }
    @if (field.type === 'boolean') { - + } @else { } @if (!metadataForm.get(field.lockedKey)?.value) { - + } - @if (metadataForm.get(field.lockedKey)?.value) { - + @else { + }
    @@ -583,15 +567,15 @@ {{ field.label }} @if (isEmbeddable(field.controlName, book)) { }
    @if (field.type === 'boolean') { - + } @else { } @if (!metadataForm.get(field.lockedKey)?.value) { - + } - @if (metadataForm.get(field.lockedKey)?.value) { - + @else { + }
    @@ -613,14 +597,13 @@ [forceSelection]="false" [showClear]="true" (onKeyUp)="onAutoCompleteKeyUp(field.controlName, $event)" - (onSelect)="onAutoCompleteSelect(field.controlName, $event)"> - + (onSelect)="onAutoCompleteSelect(field.controlName, $event)" /> @if (!metadataForm.get(field.lockedKey)?.value) { - + } - @if (metadataForm.get(field.lockedKey)?.value) { - + @else { + } @@ -635,10 +618,10 @@
    @if (!metadataForm.get(field.lockedKey)?.value) { - + } - @if (metadataForm.get(field.lockedKey)?.value) { - + @else { + }
    @@ -671,10 +654,10 @@
    @if (!book.metadata![field.lockName]) { - + } - @if (book.metadata![field.lockName]) { - + @else { + }
    @@ -696,27 +679,27 @@ rows="10"> @if (!book.metadata!['descriptionLocked']) { - + } - @if (book.metadata!['descriptionLocked']) { - + @else { + } @@ -784,9 +763,9 @@
    @if (showNavigationButtons) {
    - - - + + +
    } @@ -801,8 +780,7 @@ outlined severity="info" [pTooltip]="t('previousBookTooltip')" - tooltipPosition="bottom"> - + tooltipPosition="bottom" /> {{ navigationPosition() }} @@ -815,8 +793,7 @@ rounded outlined [pTooltip]="t('nextBookTooltip')" - tooltipPosition="bottom"> - + tooltipPosition="bottom" />
    }
    @@ -828,8 +805,7 @@ (onClick)="fetchFromFile(book.id)" [disabled]="isFetchingFromFile" [pTooltip]="t('fetchFromFileBtn')" - tooltipPosition="top"> - + tooltipPosition="top" /> } - + tooltipPosition="top" /> - + tooltipPosition="top" /> - + tooltipPosition="top" />
    @@ -866,8 +839,7 @@ icon="pi pi-check" [loading]="isSaving" [disabled]="isSaving" - (onClick)="onSave()"> - + (onClick)="onSave()" />
    diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts index 662f7a9b6..4f0298165 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts @@ -1,5 +1,5 @@ import {HttpErrorResponse} from '@angular/common/http'; -import {Component, computed, DestroyRef, EventEmitter, inject, Input, OnInit, Output} from "@angular/core"; +import {Component, computed, DestroyRef, inject, Input, OnInit, output} from "@angular/core"; import {InputText} from "@openng/optimus-ui/inputtext"; import {Button} from "@openng/optimus-ui/button"; import {Divider} from "@openng/optimus-ui/divider"; @@ -62,6 +62,22 @@ import {MetadataSourceQueryService} from '../../../sources/metadata-source-query ], }) export class MetadataEditorComponent implements OnInit { + private readonly messageService = inject(MessageService); + private readonly bookService = inject(BookService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly taskHelperService = inject(TaskHelperService); + protected urlHelper = inject(UrlHelperService); + private readonly bookDialogHelperService = inject(BookDialogHelperService); + private readonly bookNavigationService = inject(BookNavigationService); + private readonly metadataHostService = inject(BookMetadataHostService); + private readonly router = inject(Router); + private readonly userService = inject(UserService); + private readonly destroyRef = inject(DestroyRef); + private readonly appSettingsService = inject(AppSettingsService); + private readonly t = inject(TranslocoService); + private readonly queryClient = inject(QueryClient); + private readonly sources = inject(MetadataSourceQueryService); + protected readonly providerFields = inject(MetadataProviderFieldsService); private currentBook: Book | null = null; @Input() @@ -85,30 +101,13 @@ export class MetadataEditorComponent implements OnInit { return this.currentBook; } - @Output() nextBookClicked = new EventEmitter(); - @Output() previousBookClicked = new EventEmitter(); - @Output() closeDialogButtonClicked = new EventEmitter(); + readonly nextBookClicked = output(); + readonly previousBookClicked = output(); + readonly closeDialogButtonClicked = output(); @Input() disableNext = false; @Input() disablePrevious = false; @Input() showNavigationButtons = false; - - private messageService = inject(MessageService); - private bookService = inject(BookService); - private bookMetadataManageService = inject(BookMetadataManageService); - private taskHelperService = inject(TaskHelperService); - protected urlHelper = inject(UrlHelperService); - private bookDialogHelperService = inject(BookDialogHelperService); - private bookNavigationService = inject(BookNavigationService); - private metadataHostService = inject(BookMetadataHostService); - private router = inject(Router); - private userService = inject(UserService); - private destroyRef = inject(DestroyRef); - private appSettingsService = inject(AppSettingsService); - private readonly t = inject(TranslocoService); - private readonly queryClient = inject(QueryClient); - private readonly sources = inject(MetadataSourceQueryService); - protected readonly providerFields = inject(MetadataProviderFieldsService); private readonly uniqueMetadata = computed(() => this.bookService.uniqueMetadata()); metadataForm: FormGroup; @@ -687,13 +686,13 @@ export class MetadataEditorComponent implements OnInit { for (const [modelKey, value] of Object.entries(lockGroups)) { comicMetadata[modelKey] = value; } - metadata.comicMetadata = comicMetadata as ComicMetadata; + metadata.comicMetadata = comicMetadata; const original = this.originalMetadata; const wasCleared = (key: keyof BookMetadata): boolean => { - const current = (metadata[key] as unknown) ?? null; - const prev = (original[key] as unknown) ?? null; + const current = (metadata[key]) ?? null; + const prev = (original[key]) ?? null; const isEmpty = (val: unknown): boolean => val === null || val === "" || (Array.isArray(val) && val.length === 0); @@ -773,7 +772,7 @@ export class MetadataEditorComponent implements OnInit { onUpload(event: FileUploadEvent): void { const response: HttpResponse = event.originalEvent as HttpResponse; - if (response && response.status === 200) { + if (response?.status === 200) { this.isUploading = false; this.bookService.handleBookMetadataUpdate(this.currentBookId); } else { @@ -1017,12 +1016,12 @@ export class MetadataEditorComponent implements OnInit { if (book.isPhysical) { return true; } - const allFiles = [book.primaryFile, ...(book.alternativeFormats || [])].filter(f => f?.bookType); + const allFiles = [book.primaryFile, ...(book.alternativeFormats ?? [])].filter(f => f?.bookType); return allFiles.some(f => f!.bookType !== 'AUDIOBOOK'); } hasAudiobookFormat(book: Book): boolean { - const allFiles = [book.primaryFile, ...(book.alternativeFormats || [])].filter(f => f?.bookType); + const allFiles = [book.primaryFile, ...(book.alternativeFormats ?? [])].filter(f => f?.bookType); return allFiles.some(f => f!.bookType === 'AUDIOBOOK'); } @@ -1062,7 +1061,7 @@ export class MetadataEditorComponent implements OnInit { onAudiobookCoverUpload(event: FileUploadEvent): void { const response: HttpResponse = event.originalEvent as HttpResponse; - if (response && response.status === 200) { + if (response?.status === 200) { this.isUploading = false; this.bookService.handleBookMetadataUpdate(this.currentBookId); } else { diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-picker/metadata-picker.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-picker/metadata-picker.component.ts index ed5642e7b..ccd71e103 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-picker/metadata-picker.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-picker/metadata-picker.component.ts @@ -1,4 +1,4 @@ -import {Component, computed, DestroyRef, effect, EventEmitter, inject, Input, Output, signal} from '@angular/core'; +import {Component, computed, DestroyRef, effect, inject, Input, output, signal} from '@angular/core'; import {Book, BookMetadata, ComicMetadata, MetadataClearFlags, MetadataUpdateWrapper} from '../../../../book/model/book.model'; import {MessageService} from '@openng/optimus-ui/api'; import {CdkDragDrop, CdkDropList, CdkDrag, moveItemInArray} from '@angular/cdk/drag-drop'; @@ -43,6 +43,16 @@ import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; ] }) export class MetadataPickerComponent { + private readonly messageService = inject(MessageService); + private readonly bookService = inject(BookService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + protected urlHelper = inject(UrlHelperService); + private readonly destroyRef = inject(DestroyRef); + private readonly appSettingsService = inject(AppSettingsService); + private readonly formBuilder = inject(MetadataFormBuilder); + private readonly metadataUtils = inject(MetadataUtilsService); + private readonly t = inject(TranslocoService); + protected readonly providerFields = inject(MetadataProviderFieldsService); // Cached arrays for template binding (avoid getter re-computation) metadataFieldsTop: MetadataFieldConfig[] = []; @@ -82,7 +92,7 @@ export class MetadataPickerComponent { return this.currentBook; } - @Output() goBack = new EventEmitter(); + readonly goBack = output(); currentBook: Book | null = null; @@ -97,17 +107,6 @@ export class MetadataPickerComponent { originalMetadata!: BookMetadata; isSaving = false; hoveredFields: Record = {}; - - private messageService = inject(MessageService); - private bookService = inject(BookService); - private bookMetadataManageService = inject(BookMetadataManageService); - protected urlHelper = inject(UrlHelperService); - private destroyRef = inject(DestroyRef); - private appSettingsService = inject(AppSettingsService); - private formBuilder = inject(MetadataFormBuilder); - private metadataUtils = inject(MetadataUtilsService); - private readonly t = inject(TranslocoService); - protected readonly providerFields = inject(MetadataProviderFieldsService); private readonly uniqueMetadata = computed(() => this.bookService.uniqueMetadata()); @@ -500,7 +499,7 @@ export class MetadataPickerComponent { } } - return flags as MetadataClearFlags; + return flags; } getThumbnail(): string | null { @@ -712,12 +711,12 @@ export class MetadataPickerComponent { if (book.isPhysical) { return true; } - const allFiles = [book.primaryFile, ...(book.alternativeFormats || [])].filter(f => f?.bookType); + const allFiles = [book.primaryFile, ...(book.alternativeFormats ?? [])].filter(f => f?.bookType); return allFiles.some(f => f!.bookType !== 'AUDIOBOOK'); } hasAudiobookFormat(book: Book): boolean { - const allFiles = [book.primaryFile, ...(book.alternativeFormats || [])].filter(f => f?.bookType); + const allFiles = [book.primaryFile, ...(book.alternativeFormats ?? [])].filter(f => f?.bookType); return allFiles.some(f => f!.bookType === 'AUDIOBOOK'); } diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.html b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.html index aad80cf23..d2e0bae94 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.html +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.html @@ -3,8 +3,7 @@ - + (goBack)="onGoBack()" /> } @else {
    @@ -24,8 +23,7 @@ optionValue="id" formControlName="providers" [placeholder]="t('selectProviders')" - class="'custom-multiselect'"> - + class="'custom-multiselect'" />
    @@ -79,8 +77,7 @@ type="submit" [disabled]="!isSearchEnabled || loading()" icon="pi pi-search" - class="'custom-search-button'"> - + class="'custom-search-button'" />
    @@ -131,7 +128,7 @@ } - @if (!hasSearched()) { + @else {
    diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.spec.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.spec.ts index 4aa49b0c1..95b546000 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.spec.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.spec.ts @@ -118,7 +118,7 @@ describe('MetadataSearcherComponent', () => { function latestQuery() { const query = prospective.mock.results.at(-1); - if (!query || query.type !== 'return') throw new Error('Expected a prospective query'); + if (query?.type !== 'return') throw new Error('Expected a prospective query'); return query.value; } diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.ts index 0179185ff..2cb2b9d70 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-searcher/metadata-searcher.component.ts @@ -40,15 +40,14 @@ const NO_SEARCH: MetadataSearchParams = {bookId: 0, providers: []}; standalone: true }) export class MetadataSearcherComponent { - readonly book = input(null); - readonly isActiveTab = input(false); - private readonly formBuilder = inject(FormBuilder); private readonly appSettingsService = inject(AppSettingsService); private readonly sources = inject(MetadataSourceQueryService); private readonly catalog = inject(MetadataCatalogService); private readonly queryClient = inject(QueryClient); private readonly t = inject(TranslocoService); + readonly book = input(null); + readonly isActiveTab = input(false); private readonly activeLang = toSignal(this.t.langChanges$, {initialValue: this.t.getActiveLang()}); private readonly search = signal(null); private resetForBookId: number | null = null; diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.html b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.html index 6dda85eef..a36e892e1 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.html +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.html @@ -21,7 +21,7 @@ @for (bookInSeriesItem of seriesBooks; track bookInSeriesItem.id) { @if (bookInSeriesItem.id !== currentBook.id) {
    - +
    } } @@ -37,7 +37,7 @@
    @for (recBook of recommendations; track recBook.book.id) {
    - +
    }
    @@ -82,17 +82,17 @@ - + - + - + @@ -199,8 +199,7 @@ outlined (onClick)="downloadAll(currentBook)" [pTooltip]="t('downloadAllTooltip')" - tooltipPosition="top"> - + tooltipPosition="top" />
    } @if (currentBook.primaryFile) { @@ -224,8 +223,7 @@ severity="primary" [pTooltip]="t('readTooltip')" tooltipPosition="top" - (onClick)="read(currentBook.id)"> - + (onClick)="read(currentBook.id)" /> - + (onClick)="read(currentBook.id, 'epub-streaming')" /> } @else if (currentBook.primaryFile.bookType && ['PDF', 'FB2', 'MOBI', 'AZW3', 'CBX'].includes(currentBook.primaryFile.bookType)) { - + (onClick)="read(currentBook.id)" /> } @else if (currentBook.primaryFile.bookType === 'AUDIOBOOK') { - + (onClick)="read(currentBook.id)" /> } - + (onClick)="download(currentBook)" /> @if (currentFileState.canDetach) { - + (onClick)="detachFile(currentBook, currentBook.primaryFile!.id, currentBook.primaryFile!.fileName || 'file')" /> } - + (onClick)="deleteFile(currentBook, currentBook.primaryFile!.id, currentBook.primaryFile!.fileName || 'file', true)" />
    @@ -312,8 +304,7 @@ severity="primary" [pTooltip]="t('readTooltip')" tooltipPosition="top" - (onClick)="read(currentBook.id, undefined, format.bookType)"> -
    + (onClick)="read(currentBook.id, undefined, format.bookType)" /> - + (onClick)="read(currentBook.id, 'epub-streaming', format.bookType)" /> } @else if (format.bookType && ['PDF', 'FB2', 'MOBI', 'AZW3', 'CBX'].includes(format.bookType)) { - + (onClick)="read(currentBook.id, undefined, format.bookType)" /> } @else if (format.bookType === 'AUDIOBOOK') { - + (onClick)="read(currentBook.id, undefined, format.bookType)" /> } - + (onClick)="downloadAdditionalFile(currentBook, format.id)" /> @if (currentFileState.canDetach) { - + (onClick)="detachFile(currentBook, format.id, format.fileName || 'file')" /> } - + (onClick)="deleteFile(currentBook, format.id, format.fileName || 'file', false)" /> } @@ -398,8 +383,7 @@ severity="success" [pTooltip]="t('downloadTooltip')" tooltipPosition="top" - (onClick)="downloadAdditionalFile(currentBook, file.id)"> -
    + (onClick)="downloadAdditionalFile(currentBook, file.id)" /> @if (currentFileState.canDetach) { - + (onClick)="detachFile(currentBook, file.id, file.fileName || 'file')" /> } - + (onClick)="deleteSupplementary(currentBook.id, file.id, file.fileName || 'file')" /> } diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.ts index 5d854433b..401cddfd8 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-tabs/metadata-tabs.component.ts @@ -91,17 +91,16 @@ const metadataTab = (value: MetadataTabValue, icon: string, labelKey: string): M styleUrl: './metadata-tabs.component.scss' }) export class MetadataTabsComponent { + protected urlHelper = inject(UrlHelperService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly audiobookService = inject(AudiobookService); + private readonly t = inject(TranslocoService); + private readonly destroyRef = inject(DestroyRef); readonly book = input.required(); readonly bookInSeries = input([]); readonly hasSeries = input(false); readonly recommendedBooks = input([]); - protected urlHelper = inject(UrlHelperService); - private bookMetadataManageService = inject(BookMetadataManageService); - private audiobookService = inject(AudiobookService); - private t = inject(TranslocoService); - private destroyRef = inject(DestroyRef); - readonly audiobookInfo = linkedSignal({ source: () => this.book().id, computation: () => null, diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.html b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.html index 8d0fbac53..073f8f07e 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.html +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.html @@ -29,11 +29,11 @@ [value]="progress" [showValue]="false" class="cover-progress-bar" - [ngClass]="{ + [class]="{ 'progress-complete': progress === 100, 'progress-incomplete': progress < 100 }" - > + /> } @if (getKoProgressPercent(book) !== null) { @@ -41,11 +41,10 @@ [value]="getKoProgressPercent(book)" [showValue]="false" class="cover-progress-bar" - [ngClass]="[ + [class]="[ getKoProgressPercent(book) === 100 ? 'progress-complete-ko' : 'progress-incomplete-ko' ]" - > - + /> } @if (getKoboProgressPercent(book) !== null) { @@ -53,11 +52,10 @@ [value]="getKoboProgressPercent(book)" [showValue]="false" class="cover-progress-bar" - [ngClass]="[ + [class]="[ getKoboProgressPercent(book) === 100 ? 'progress-complete-kobo' : 'progress-incomplete-kobo' ]" - > - + /> } @@ -72,8 +70,7 @@ outlined severity="info" [pTooltip]="t('goToPreviousBook')" - tooltipPosition="bottom"> -
    + tooltipPosition="bottom" /> {{ navigationPosition() }} @@ -86,8 +83,7 @@ rounded outlined [pTooltip]="t('goToNextBook')" - tooltipPosition="bottom"> -
    + tooltipPosition="bottom" /> } @@ -114,7 +110,7 @@ @@ -169,8 +165,7 @@ [ngModel]="book?.personalRating" (onRate)="onPersonalRatingChange(book, $event)" stars="10" - [style.--p-rating-icon-active-color]="getStarColorScaled(book?.personalRating, 10)"> - + [style.--p-rating-icon-active-color]="getStarColorScaled(book?.personalRating, 10)" /> - + class="reset-button" /> @if (providerBadges().length > 0) { @@ -325,8 +319,7 @@ severity="danger" text class="inline-action-button" - (onClick)="resetProgress(book, ResetProgressTypes.GRIMMORY)"> -
    + (onClick)="resetProgress(book, ResetProgressTypes.GRIMMORY)" /> } @@ -368,7 +361,7 @@ - + @@ -387,8 +380,7 @@ severity="danger" text class="inline-action-button" - (onClick)="resetProgress(book, ResetProgressTypes.KOREADER)"> -
    + (onClick)="resetProgress(book, ResetProgressTypes.KOREADER)" /> } @@ -408,8 +400,7 @@ severity="danger" text class="inline-action-button" - (onClick)="resetProgress(book, ResetProgressTypes.KOBO)"> -
    + (onClick)="resetProgress(book, ResetProgressTypes.KOBO)" /> } @@ -432,10 +423,9 @@ [showIcon]="true" [iconDisplay]="'input'" appendTo="body" - [style]="{ 'width': '125px', 'font-size': '12px' }"> - - - + [style]="{ 'width': '125px', 'font-size': '12px' }" /> + + } } @@ -522,7 +512,7 @@ @if (hasDigitalFile(book)) {
    - + @if (showFilePath) { {{ book?.primaryFile?.filePath }} } @@ -542,8 +532,7 @@ outlined severity="secondary" [pTooltip]="t('goToPreviousBook')" - tooltipPosition="bottom"> - + tooltipPosition="bottom" /> {{ navigationPosition() }} @@ -555,8 +544,7 @@ severity="secondary" outlined [pTooltip]="t('goToNextBook')" - tooltipPosition="bottom"> - + tooltipPosition="bottom" />
    } @if (hasDigitalFile(book)) { @@ -573,7 +561,7 @@ @if ((book!.alternativeFormats && book!.alternativeFormats.length > 0) || (book!.supplementaryFiles && book!.supplementaryFiles.length > 0)) { } @else { - + } } @if (currentUser.permissions.canEditMetadata || currentUser.permissions.admin) { @@ -586,12 +574,11 @@ [disabled]="isAutoFetching" [pTooltip]="t('fetchMetadataTooltip')" tooltipPosition="top" - class="mobile-icon-only"> - + class="mobile-icon-only" /> } @if (otherItems().length > 0) { - - + + } @@ -606,13 +593,13 @@ {{ t('synopsisTitle') }}
    -
    +
    @if (isExpanded || isOverflowing) { - }
    @@ -625,10 +612,10 @@ {{ t('comicDetailsTitle') }}
    - + - } @else {
    - +

    {{ t('loadingBookDetails') }}

    } diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts index e3af10bf9..153f60641 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts @@ -1,6 +1,6 @@ import {AfterViewChecked, Component, computed, DestroyRef, ElementRef, inject, Input, OnInit, signal, ViewChild} from '@angular/core'; import {Button} from '@openng/optimus-ui/button'; -import {DecimalPipe, NgClass} from '@angular/common'; +import {DecimalPipe} from '@angular/common'; import {BookService} from '../../../../book/service/book.service'; import {BookFileService} from '../../../../book/service/book-file.service'; import {Rating, RatingRateEvent} from '@openng/optimus-ui/rating'; @@ -61,11 +61,30 @@ interface ProviderBadge { standalone: true, templateUrl: './metadata-viewer.component.html', styleUrl: './metadata-viewer.component.scss', - imports: [Button, Rating, FormsModule, SplitButton, NgClass, Tooltip, DecimalPipe, ProgressBar, Menu, DatePicker, ProgressSpinner, TieredMenu, TagComponent, MetadataTabsComponent, TranslocoDirective, TranslocoPipe, Dialog, Checkbox, CoverComponent] + imports: [Button, Rating, FormsModule, SplitButton, Tooltip, DecimalPipe, ProgressBar, Menu, DatePicker, ProgressSpinner, TieredMenu, TagComponent, MetadataTabsComponent, TranslocoDirective, TranslocoPipe, Dialog, Checkbox, CoverComponent] }) export class MetadataViewerComponent implements OnInit, AfterViewChecked { - private bookService = inject(BookService); - private currentBook = signal(null); + private readonly bookService = inject(BookService); + private readonly t = inject(TranslocoService); + private readonly libraryService = inject(LibraryService); + private readonly bookDialogHelperService = inject(BookDialogHelperService) + private readonly emailService = inject(EmailService); + private readonly messageService = inject(MessageService); + private readonly bookFileService = inject(BookFileService); + private readonly taskHelperService = inject(TaskHelperService); + private readonly authorService = inject(AuthorService); + protected urlHelper = inject(UrlHelperService); + protected userService = inject(UserService); + protected languageResolver = inject(LanguageResolverService); + private readonly appSettingsService = inject(AppSettingsService); + private readonly confirmationService = inject(ConfirmationService); + private readonly router = inject(Router); + private readonly destroyRef = inject(DestroyRef); + private readonly dialogRef = inject(DynamicDialogRef, { optional: true }); + private readonly catalog = inject(MetadataCatalogService); + private readonly bookNavigationService = inject(BookNavigationService); + private readonly metadataHostService = inject(BookMetadataHostService); + private readonly currentBook = signal(null); private readonly seriesLookupBookId = computed(() => { const metadata = this.currentBook()?.metadata; return metadata?.seriesName ? metadata.bookId : null; @@ -112,28 +131,9 @@ export class MetadataViewerComponent implements OnInit, AfterViewChecked { set recommendedBooks(value: BookRecommendation[]) { this.originalRecommendedBooks.set(value); } - - private readonly t = inject(TranslocoService); private readonly activeLang = toSignal(this.t.langChanges$, {initialValue: this.t.getActiveLang()}); - private libraryService = inject(LibraryService); - private bookDialogHelperService = inject(BookDialogHelperService) - private emailService = inject(EmailService); - private messageService = inject(MessageService); - private bookFileService = inject(BookFileService); - private taskHelperService = inject(TaskHelperService); - private authorService = inject(AuthorService); - protected urlHelper = inject(UrlHelperService); - protected userService = inject(UserService); - protected languageResolver = inject(LanguageResolverService); - private appSettingsService = inject(AppSettingsService); - private confirmationService = inject(ConfirmationService); - - private router = inject(Router); - private destroyRef = inject(DestroyRef); - private dialogRef = inject(DynamicDialogRef, { optional: true }); - private userState = this.userService.currentUser; - private appSettings = this.appSettingsService.appSettings; - private readonly catalog = inject(MetadataCatalogService); + private readonly userState = this.userService.currentUser; + private readonly appSettings = this.appSettingsService.appSettings; readonly providerBadges = computed((): ProviderBadge[] => { const metadata = this.currentBook()?.metadata; @@ -500,9 +500,6 @@ export class MetadataViewerComponent implements OnInit, AfterViewChecked { {value: ReadStatus.WONT_READ, labelKey: 'metadata.viewer.readStatusWontRead'}, {value: ReadStatus.UNSET, labelKey: 'metadata.viewer.readStatusUnset'}, ]; - - private bookNavigationService = inject(BookNavigationService); - private metadataHostService = inject(BookMetadataHostService); readonly navigationState = this.bookNavigationService.navigationState; readonly canNavigatePrevious = this.bookNavigationService.canNavigatePrevious; readonly canNavigateNext = this.bookNavigationService.canNavigateNext; diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/sidecar-viewer/sidecar-viewer.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/sidecar-viewer/sidecar-viewer.component.ts index df1b1d9c1..a9b186e38 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/sidecar-viewer/sidecar-viewer.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/sidecar-viewer/sidecar-viewer.component.ts @@ -22,16 +22,15 @@ import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/tran imports: [Button, Tag, Tooltip, JsonPipe, DatePipe, TranslocoDirective, TranslocoPipe] }) export class SidecarViewerComponent implements OnDestroy { - readonly book = input(null); - readonly currentBookId = computed(() => this.book()?.id ?? null); - private readonly sidecarService = inject(SidecarService); private readonly sources = inject(MetadataSourceQueryService); private readonly queryClient = inject(QueryClient); private readonly messageService = inject(MessageService); private readonly t = inject(TranslocoService); + readonly book = input(null); + readonly currentBookId = computed(() => this.book()?.id ?? null); private readonly activeLang = toSignal(this.t.langChanges$, {initialValue: this.t.getActiveLang()}); - private destroy$ = new Subject(); + private readonly destroy$ = new Subject(); private readonly statusQuery = injectQuery(() => ({ ...this.sources.sidecarStatus(this.currentBookId() ?? 0), diff --git a/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.html b/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.html index 668df4005..1cbcfad0e 100644 --- a/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.html +++ b/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.html @@ -13,14 +13,13 @@ [text]="true" severity="secondary" (click)="ref.close()" - class="close-button"> -
    + class="close-button" />
    @if (loading) {
    - +
    } @@ -58,8 +57,7 @@ [suggestions]="filteredAuthors" (completeMethod)="filterAuthors($event)" (onKeyUp)="onAutoCompleteKeyUp('authors', $event)" - (onSelect)="onAutoCompleteSelect('authors', $event)"> - + (onSelect)="onAutoCompleteSelect('authors', $event)" />
    @@ -98,8 +96,7 @@ [showClear]="true" [forceSelection]="false" [suggestions]="filteredPublishers" - (completeMethod)="filterPublishers($event)"> - + (completeMethod)="filterPublishers($event)" /> @@ -123,8 +120,7 @@ [showIcon]="true" [iconDisplay]="'input'" fluid="true" - appendTo="body"> - + appendTo="body" /> @@ -150,8 +146,7 @@ [showClear]="true" [forceSelection]="false" [suggestions]="filteredSeries" - (completeMethod)="filterSeries($event)"> - + (completeMethod)="filterSeries($event)" /> @@ -250,8 +245,7 @@ [suggestions]="filteredGenres" (completeMethod)="filterGenres($event)" (onKeyUp)="onAutoCompleteKeyUp('genres', $event)" - (onSelect)="onAutoCompleteSelect('genres', $event)"> - + (onSelect)="onAutoCompleteSelect('genres', $event)" />
    - + (onSelect)="onAutoCompleteSelect('moods', $event)" />
    - + (onSelect)="onAutoCompleteSelect('tags', $event)" />
    - + tooltipPosition="top" />
    } @else { - + (onClick)="coverFileInput.click()" /> }
    diff --git a/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.ts b/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.ts index ed90257e2..02dd66b80 100644 --- a/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.ts +++ b/frontend/src/app/features/metadata/component/bulk-metadata-update/bulk-metadata-update-component.ts @@ -37,6 +37,12 @@ import {Select} from '@openng/optimus-ui/select'; styleUrl: './bulk-metadata-update-component.scss' }) export class BulkMetadataUpdateComponent implements OnInit { + private readonly config = inject(DynamicDialogConfig); + readonly ref = inject(DynamicDialogRef); + private readonly fb = inject(FormBuilder); + private readonly bookService = inject(BookService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly messageService = inject(MessageService); metadataForm!: FormGroup; bookIds: number[] = []; mergeCategories = true; @@ -62,13 +68,6 @@ export class BulkMetadataUpdateComponent implements OnInit { readonly ageRatingOptions = AGE_RATING_OPTIONS.map(({id, label}) => ({label, value: id})); readonly contentRatingOptions = Object.entries(CONTENT_RATING_LABELS) .map(([value, label]) => ({label, value})); - - private readonly config = inject(DynamicDialogConfig); - readonly ref = inject(DynamicDialogRef); - private readonly fb = inject(FormBuilder); - private readonly bookService = inject(BookService); - private readonly bookMetadataManageService = inject(BookMetadataManageService); - private readonly messageService = inject(MessageService); private readonly uniqueMetadata = computed(() => this.bookService.uniqueMetadata()); get allAuthors(): string[] { return this.uniqueMetadata().authors; } diff --git a/frontend/src/app/features/metadata/component/cover-search/cover-search.component.html b/frontend/src/app/features/metadata/component/cover-search/cover-search.component.html index 59be20373..572970daf 100644 --- a/frontend/src/app/features/metadata/component/cover-search/cover-search.component.html +++ b/frontend/src/app/features/metadata/component/cover-search/cover-search.component.html @@ -14,8 +14,7 @@ [text]="true" severity="secondary" (click)="dynamicDialogRef.close()" - class="close-button"> -
    + class="close-button" />
    @@ -62,8 +61,7 @@ [label]="t('searchBtn')" icon="pi pi-search" [loading]="loading()" - [disabled]="searchForm.invalid"> - + [disabled]="searchForm.invalid" /> - + tooltipPosition="top" />
    @@ -93,7 +90,7 @@ } @else if (loading()) {
    - +

    {{ t('searchingForCovers') }}

    } @else if (coverImages().length === 0 || failed()) { @@ -132,8 +129,7 @@ [src]="cover.url" [alt]="t('bookCoverAlt', { index: i + 1 })" appendTo="body" - [preview]="true"> - + [preview]="true" /> @if (cover.width && cover.height) {
    {{ cover.width }} x {{ cover.height }} @@ -144,8 +140,7 @@ (click)="selectAndSave(cover)" [label]="t('selectCover')" icon="pi pi-check" - size="small"> - + size="small" />
    diff --git a/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.html b/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.html index 1b9ee00e1..179ca8b41 100644 --- a/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.html +++ b/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.html @@ -4,7 +4,7 @@

    {{ t('title') }} - +

    {{ t('description') }} @@ -46,7 +46,7 @@ (onClick)="clearSelection(tab.type)" severity="secondary" size="small" - outlined> + outlined /> + outlined /> + outlined /> @@ -84,21 +84,21 @@ + (ngModelChange)="setSelectAll(tab.selectAllKey, $event); toggleAll(tab.type, $event, dataTable.filteredValue || dataTable.value)" />

    {{ t(tab.labelKey) }} - +
    {{ t('booksColumn') }} - +
    @@ -115,7 +115,7 @@ + (ngModelChange)="onRowSelect(tab.type)" />
    + (onClick)="selectSimilar(tab.type, item.value)" /> + (onClick)="openRenameDialog(tab.type, item)" /> + (onClick)="openDeleteDialog(tab.type, item)" /> @@ -211,14 +211,14 @@ (onClick)="showMergeDialog = false" [disabled]="mergingInProgress()" severity="secondary" - outlined>
    + outlined /> + severity="success" /> @@ -268,14 +268,14 @@ (onClick)="showRenameDialog = false" [disabled]="mergingInProgress()" severity="secondary" - outlined>
    + outlined /> + severity="success" /> @@ -331,14 +331,14 @@ (onClick)="showDeleteDialog = false" [disabled]="deletingInProgress()" severity="secondary" - outlined>
    + outlined /> + severity="danger" /> diff --git a/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.ts b/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.ts index 1a3e82329..35b51a350 100644 --- a/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.ts +++ b/frontend/src/app/features/metadata/component/metadata-manager/metadata-manager.component.ts @@ -64,12 +64,12 @@ interface TabConfig { styleUrls: ['./metadata-manager.component.scss'] }) export class MetadataManagerComponent implements OnInit, OnDestroy { - private bookService = inject(BookService); - private bookMetadataManageService = inject(BookMetadataManageService); - private messageService = inject(MessageService); - private router = inject(Router); - private route = inject(ActivatedRoute); - private pageTitle = inject(PageTitleService); + private readonly bookService = inject(BookService); + private readonly bookMetadataManageService = inject(BookMetadataManageService); + private readonly messageService = inject(MessageService); + private readonly router = inject(Router); + private readonly route = inject(ActivatedRoute); + private readonly pageTitle = inject(PageTitleService); private readonly t = inject(TranslocoService); private routeSub!: Subscription; @@ -100,9 +100,9 @@ export class MetadataManagerComponent implements OnInit, OnDestroy { selectAllPublishers = false; selectAllLanguages = false; - loading = signal(false); - mergingInProgress = signal(false); - deletingInProgress = signal(false); + readonly loading = signal(false); + readonly mergingInProgress = signal(false); + readonly deletingInProgress = signal(false); showMergeDialog = false; showRenameDialog = false; showDeleteDialog = false; @@ -112,7 +112,7 @@ export class MetadataManagerComponent implements OnInit, OnDestroy { currentRenameItem: MetadataItem | null = null; currentDeleteItem: MetadataItem | null = null; - private validTabs: MetadataType[] = ['authors', 'categories', 'moods', 'tags', 'series', 'publishers', 'languages']; + private readonly validTabs: MetadataType[] = ['authors', 'categories', 'moods', 'tags', 'series', 'publishers', 'languages']; private _activeTab: MetadataType = 'authors'; get activeTab(): MetadataType { @@ -497,7 +497,7 @@ export class MetadataManagerComponent implements OnInit, OnDestroy { } toggleAll(type: MetadataType, checked: boolean, filteredItems?: MetadataItem[]) { - const itemsToToggle = filteredItems || this[type]; + const itemsToToggle = filteredItems ?? this[type]; itemsToToggle.forEach(item => item.selected = checked); this.updateSelectAllState(type); } diff --git a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.html b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.html index 886a76e6b..bf9511d60 100644 --- a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.html +++ b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.html @@ -38,32 +38,28 @@ (ngModelChange)="setBulkProvider('p1', $event)" optionLabel="label" optionValue="value" [placeholder]="t('setAllP1')" appendTo="body" - class="select-full-width" size="small"> - + class="select-full-width" size="small" /> - + class="select-full-width" size="small" /> - + class="select-full-width" size="small" /> - + class="select-full-width" size="small" /> @@ -73,7 +69,7 @@ + tooltipPosition="top" /> {{ formatLabel(field) }} @@ -82,8 +78,7 @@ optionLabel="label" optionValue="value" [disabled]="!enabledFields[field]" [placeholder]="t('unset')" appendTo="body" - class="select-full-width" size="small"> - + class="select-full-width" size="small" /> - + class="select-full-width" size="small" /> - + class="select-full-width" size="small" /> - + class="select-full-width" size="small" /> } @@ -125,7 +117,7 @@
    + tooltipPosition="top" /> {{ formatLabel(field) }}
    } @@ -138,26 +130,25 @@

    {{ t('replaceModeLabel') }}

    - + appendTo="body" size="small" class="select-mode" />

    {{ t('updateCoversLabel') }}

    - +

    {{ t('mergeGenresLabel') }}

    - +

    {{ t('manualReviewLabel') }}

    - +
    - - + +
    diff --git a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.ts b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.ts index 58713ee15..30aa8ed9a 100644 --- a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.ts +++ b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component.ts @@ -1,4 +1,4 @@ -import {Component, computed, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges} from '@angular/core'; +import {Component, computed, inject, Input, OnChanges, output, SimpleChanges} from '@angular/core'; import {toSignal} from '@angular/core/rxjs-interop'; import {Select} from '@openng/optimus-ui/select'; import {FormsModule} from '@angular/forms'; @@ -27,13 +27,13 @@ import {MetadataSourceQueryService} from '../../../sources/metadata-source-query }) export class MetadataAdvancedFetchOptionsComponent implements OnChanges { - private messageService = inject(MessageService); + private readonly messageService = inject(MessageService); private readonly t = inject(TranslocoService); private readonly sources = inject(MetadataSourceQueryService); private readonly providerFields = inject(MetadataProviderFieldsService); private readonly activeLang = toSignal(this.t.langChanges$, {initialValue: this.t.getActiveLang()}); - @Output() metadataOptionsSubmitted = new EventEmitter(); + readonly metadataOptionsSubmitted = output(); @Input() currentMetadataOptions!: MetadataRefreshOptions; @Input() submitButtonLabel!: string; diff --git a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.html b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.html index e3a02d21e..4be5b7c79 100644 --- a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.html +++ b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.html @@ -4,8 +4,7 @@ - + [submitButtonLabel]="t('startRefresh')" /> diff --git a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.ts b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.ts index 14fadf57e..650c87269 100644 --- a/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.ts +++ b/frontend/src/app/features/metadata/component/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component.ts @@ -19,6 +19,10 @@ import {TranslocoDirective} from '@jsverse/transloco'; styleUrl: './metadata-fetch-options.component.scss' }) export class MetadataFetchOptionsComponent implements OnInit, OnChanges { + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); + dynamicDialogRef = inject(DynamicDialogRef); + private readonly taskHelperService = inject(TaskHelperService); + private readonly appSettingsService = inject(AppSettingsService); @Input() dialogData?: { libraryId?: number | null; bookIds?: number[]; @@ -30,11 +34,6 @@ export class MetadataFetchOptionsComponent implements OnInit, OnChanges { metadataRefreshType: MetadataRefreshType = MetadataRefreshType.BOOKS; currentMetadataOptions!: MetadataRefreshOptions; - private dynamicDialogConfig = inject(DynamicDialogConfig); - dynamicDialogRef = inject(DynamicDialogRef); - private taskHelperService = inject(TaskHelperService); - private appSettingsService = inject(AppSettingsService); - constructor() { const settings = this.appSettingsService.appSettings(); if (settings) { diff --git a/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.html b/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.html index 57a4b2b57..efd3ad8a4 100644 --- a/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.html +++ b/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.html @@ -24,8 +24,7 @@ - + (ngModelChange)="toggleField(field.name, $event)" /> } diff --git a/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.ts b/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.ts index c58fc5178..dcf5f4fcb 100644 --- a/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.ts +++ b/frontend/src/app/features/metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component.ts @@ -16,12 +16,11 @@ import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; styleUrl: './metadata-provider-field-selector.component.scss' }) export class MetadataProviderFieldSelectorComponent { + private readonly appSettingsService = inject(AppSettingsService); + private readonly t = inject(TranslocoService); + private readonly catalog = inject(MetadataCatalogService); + private readonly providerFields = inject(MetadataProviderFieldsService); @Input() selectedFields: string[] = []; - - private appSettingsService = inject(AppSettingsService); - private t = inject(TranslocoService); - private catalog = inject(MetadataCatalogService); - private providerFields = inject(MetadataProviderFieldsService); private readonly activeLang = toSignal(this.t.langChanges$, {initialValue: this.t.getActiveLang()}); readonly providerGroups = computed(() => { diff --git a/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.html b/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.html index 29cd729f1..7979b9e1f 100644 --- a/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.html +++ b/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.html @@ -13,8 +13,7 @@ [text]="true" severity="secondary" (click)="close()" - class="close-button"> -
    + class="close-button" /> @if (!loading()) { @@ -24,8 +23,7 @@ [fetchedMetadata]="proposed" [book]="currentBook()" (goBack)="close()" - [reviewMode]="true"> - + [reviewMode]="true" /> } @@ -35,8 +33,7 @@ - + showValue="false" /> Book {{ currentIndex() + 1 }} / {{ proposals().length }} @@ -49,8 +46,7 @@ icon="pi pi-times-circle" severity="secondary" [outlined]="true" - (click)="close()"> -
    + (click)="close()" /> @@ -59,16 +55,14 @@ icon="pi pi-lock" severity="warn" [outlined]="true" - (click)="lockAllMetadata()"> -
    + (click)="lockAllMetadata()" /> - + (click)="unlockAllMetadata()" /> @@ -78,8 +72,7 @@ iconPos="right" severity="success" [outlined]="true" - (click)="onSave()"> -
    + (click)="onSave()" /> @@ -89,13 +82,12 @@ iconPos="right" severity="info" [outlined]="true" - (click)="onNext()"> -
    + (click)="onNext()" /> } @else {
    - +
    } diff --git a/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.ts b/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.ts index 8ad2ae48c..9a57956f9 100644 --- a/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.ts +++ b/frontend/src/app/features/metadata/component/metadata-review-dialog/metadata-review-dialog-component.ts @@ -22,16 +22,15 @@ import {retryTransientQueryError} from '../../../../core/data/query-transport'; DecimalPipe,MetadataPickerComponent, ProgressSpinner, Button, Divider, ProgressBar, Tooltip], }) export class MetadataReviewDialogComponent implements OnInit { + private readonly config = inject(DynamicDialogConfig); + private readonly dialogRef = inject(DynamicDialogRef); + private readonly metadataTaskService = inject(MetadataTaskService); + private readonly bookService = inject(BookService); + private readonly progressService = inject(MetadataProgressService); @ViewChild(MetadataPickerComponent) pickerComponent!: MetadataPickerComponent; - private config = inject(DynamicDialogConfig); - private dialogRef = inject(DynamicDialogRef); - private metadataTaskService = inject(MetadataTaskService); - private bookService = inject(BookService); - private progressService = inject(MetadataProgressService); - readonly proposals = signal([]); readonly currentIndex = signal(0); private readonly currentBookId = computed(() => this.proposals()[this.currentIndex()]?.bookId ?? null); diff --git a/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.html b/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.html index ad2f49526..b1677a1c0 100644 --- a/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.html +++ b/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.html @@ -13,8 +13,7 @@ [text]="true" severity="secondary" (click)="ref.close()" - class="close-button"> -
    + class="close-button" />
    @@ -38,12 +37,12 @@ (previousBookClicked)="handlePreviousBook()" (closeDialogButtonClicked)="handleCloseDialogButton()" [showNavigationButtons]="true" - > + /> } @if (admin || canEditMetadata) { - + } diff --git a/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.ts b/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.ts index acf4eb9dd..66e03c2ff 100644 --- a/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.ts +++ b/frontend/src/app/features/metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component.ts @@ -33,9 +33,9 @@ export class MultiBookMetadataEditorComponent { bookIds: number[] = this.config.data?.bookIds ?? []; loading = false; - private currentIndex = signal(0); - private currentBookId = computed(() => this.bookIds[this.currentIndex()] ?? null); - private bookDetailQuery = injectQuery(() => ({ + private readonly currentIndex = signal(0); + private readonly currentBookId = computed(() => this.bookIds[this.currentIndex()] ?? null); + private readonly bookDetailQuery = injectQuery(() => ({ ...this.bookService.bookDetailQueryOptions(this.currentBookId() ?? -1, true), enabled: this.currentBookId() != null, })); diff --git a/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.html b/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.html index 69ebf3fa7..07aa91321 100644 --- a/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.html +++ b/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.html @@ -17,12 +17,11 @@ [text]="true" severity="secondary" (click)="dialogRef.close()" - class="close-button"> - + class="close-button" />
    + [dialogData]="{ bookIds: bookIds, libraryId: libraryId, metadataRefreshType: metadataRefreshType }" />
    diff --git a/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.ts b/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.ts index 2a7302092..e134981da 100644 --- a/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.ts +++ b/frontend/src/app/features/metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component.ts @@ -17,6 +17,9 @@ import {Button} from '@openng/optimus-ui/button'; imports: [MetadataFetchOptionsComponent, FormsModule, Button], }) export class MultiBookMetadataFetchComponent implements OnInit, OnChanges { + private readonly dynamicDialogConfig = inject(DynamicDialogConfig); + dialogRef = inject(DynamicDialogRef); + private readonly appSettingsService = inject(AppSettingsService); @Input() dialogData?: { libraryId?: number | null; bookIds?: number[]; @@ -27,10 +30,6 @@ export class MultiBookMetadataFetchComponent implements OnInit, OnChanges { libraryId: number | null = null; metadataRefreshType: MetadataRefreshType = MetadataRefreshType.BOOKS; currentMetadataOptions!: MetadataRefreshOptions; - - private dynamicDialogConfig = inject(DynamicDialogConfig); - dialogRef = inject(DynamicDialogRef); - private appSettingsService = inject(AppSettingsService); expanded = false; constructor() { diff --git a/frontend/src/app/features/metadata/data/metadata-refresh-submission.service.ts b/frontend/src/app/features/metadata/data/metadata-refresh-submission.service.ts index f06b8fdec..38a7afb2e 100644 --- a/frontend/src/app/features/metadata/data/metadata-refresh-submission.service.ts +++ b/frontend/src/app/features/metadata/data/metadata-refresh-submission.service.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {mutationOptions, QueryClient} from '@tanstack/angular-query-experimental'; import {lastValueFrom} from 'rxjs'; @@ -15,7 +15,7 @@ import {RefreshMetadataVariables} from './metadata-refresh-submission.models'; const ERROR_QUIET_PERIOD_MS = 5000; -@Injectable({providedIn: 'root'}) +@Service() export class MetadataRefreshSubmissionService { private readonly http = inject(HttpClient); private readonly queryClient = inject(QueryClient); diff --git a/frontend/src/app/features/metadata/service/sidecar.service.ts b/frontend/src/app/features/metadata/service/sidecar.service.ts index 409b36bdc..056e71867 100644 --- a/frontend/src/app/features/metadata/service/sidecar.service.ts +++ b/frontend/src/app/features/metadata/service/sidecar.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable, tap} from 'rxjs'; import {QueryClient} from '@tanstack/angular-query-experimental'; @@ -7,12 +7,10 @@ import {API_CONFIG} from '../../../core/config/api-config'; import {invalidateAllBookCaches, invalidateBooksById} from '../../book/service/legacy-book-cache'; import {invalidateAuthorsQuery} from '../../author-browser/service/author-query-cache'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class SidecarService { - private http = inject(HttpClient); - private queryClient = inject(QueryClient); + private readonly http = inject(HttpClient); + private readonly queryClient = inject(QueryClient); private readonly apiUrl = `${API_CONFIG.BASE_URL}/api/v1`; exportToSidecar(bookId: number): Observable<{message: string}> { diff --git a/frontend/src/app/features/metadata/sources/metadata-source-query.service.ts b/frontend/src/app/features/metadata/sources/metadata-source-query.service.ts index f4f85477b..24173b7c4 100644 --- a/frontend/src/app/features/metadata/sources/metadata-source-query.service.ts +++ b/frontend/src/app/features/metadata/sources/metadata-source-query.service.ts @@ -1,5 +1,5 @@ import {HttpClient, HttpErrorResponse} from '@angular/common/http'; -import {computed, effect, inject, Injectable} from '@angular/core'; +import {computed, effect, inject, Service} from '@angular/core'; import { experimental_streamedQuery, injectQuery, @@ -85,7 +85,7 @@ function normalizeCoverSearchParams(params: CoverSearchParams): CoverSearchParam }; } -@Injectable({providedIn: 'root'}) +@Service() export class MetadataSourceQueryService { private readonly http = inject(HttpClient); private readonly authService = inject(AuthService); diff --git a/frontend/src/app/features/notebook/components/notebook/notebook.component.html b/frontend/src/app/features/notebook/components/notebook/notebook.component.html index 73ed4ee61..fdce7cd65 100644 --- a/frontend/src/app/features/notebook/components/notebook/notebook.component.html +++ b/frontend/src/app/features/notebook/components/notebook/notebook.component.html @@ -48,7 +48,7 @@
    - - -
    + (hoverChange)="onFooterHovered($event)" />
    diff --git a/frontend/src/app/features/readers/cbx-reader/cbx-reader.component.ts b/frontend/src/app/features/readers/cbx-reader/cbx-reader.component.ts index a56275efd..0e56c0f83 100644 --- a/frontend/src/app/features/readers/cbx-reader/cbx-reader.component.ts +++ b/frontend/src/app/features/readers/cbx-reader/cbx-reader.component.ts @@ -87,157 +87,156 @@ export class CbxReaderComponent implements OnInit, OnDestroy { private static readonly INFINITE_SCROLL_MAX_DOM_PAGES = 18; private readonly destroyRef = inject(DestroyRef); - private progressSaveSubject$ = new Subject(); + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly cbxReaderService = inject(CbxReaderService); + private readonly bookService = inject(BookService); + private readonly bookQuery = inject(BookQueryService); + private readonly queryClient = inject(QueryClient); + private readonly userService = inject(UserService); + private readonly messageService = inject(MessageService); + private readonly t = inject(TranslocoService); + private readonly pageTitle = inject(PageTitleService); + private readonly readingSessionService = inject(ReadingSessionService); + private readonly headerService = inject(CbxHeaderService); + private readonly sidebarService = inject(CbxSidebarService); + private readonly footerService = inject(CbxFooterService); + private readonly quickSettingsService = inject(CbxQuickSettingsService); + private readonly pageDimensionService = inject(CbxPageDimensionService); + private readonly wakeLockService = inject(WakeLockService); + private readonly readerPreferencesService = inject(ReaderPreferencesService); + private readonly progressSaveSubject$ = new Subject(); - bookType = signal(null); - bookId = signal(null); - bookFileId = signal(null); - altBookType = signal(undefined); - pages = signal([]); - currentPage = signal(0); - isLoading = signal(true); + readonly bookType = signal(null); + readonly bookId = signal(null); + readonly bookFileId = signal(null); + readonly altBookType = signal(undefined); + readonly pages = signal([]); + readonly currentPage = signal(0); + readonly isLoading = signal(true); - pageSpread = signal(CbxPageSpread.EVEN); - pageViewMode = signal(CbxPageViewMode.SINGLE_PAGE); - backgroundColor = signal(CbxBackgroundColor.GRAY); - fitMode = signal(CbxFitMode.FIT_PAGE); - scrollMode = signal(CbxScrollMode.PAGINATED); + readonly pageSpread = signal(CbxPageSpread.EVEN); + readonly pageViewMode = signal(CbxPageViewMode.SINGLE_PAGE); + readonly backgroundColor = signal(CbxBackgroundColor.GRAY); + readonly fitMode = signal(CbxFitMode.FIT_PAGE); + readonly scrollMode = signal(CbxScrollMode.PAGINATED); private touchStartX = 0; private touchEndX = 0; - currentBook = signal(null); - nextBookInSeries = signal(null); - previousBookInSeries = signal(null); + readonly currentBook = signal(null); + readonly nextBookInSeries = signal(null); + readonly previousBookInSeries = signal(null); - infiniteScrollPages = signal([]); + readonly infiniteScrollPages = signal([]); preloadCount: number = CbxReaderComponent.PRELOAD_PAGE_WINDOW; /** True while a chunk of pages is being prepended/appended (does not block scroll UX). */ - isLoadingMore = signal(false); + readonly isLoadingMore = signal(false); private infiniteScrollPageDebounceTimer: ReturnType | null = null; // Long-strip state (Kavita-inspired webtoon reader) - longStripImages = signal<{ src: string; page: number }[]>([]); - private longStripLoadedPages = new Set(); + readonly longStripImages = signal<{ src: string; page: number }[]>([]); + private readonly longStripLoadedPages = new Set(); private longStripIntersectionObserver: IntersectionObserver | null = null; private longStripScrollHandler: (() => void) | null = null; private longStripScrollEndHandler: (() => void) | null = null; private longStripScrollDebounceTimer: ReturnType | null = null; private longStripScrollEndDebounceTimer: ReturnType | null = null; - private longStripIsScrolling = signal(false); - private longStripAllImagesLoaded = signal(false); - private longStripInitFinished = signal(false); + private readonly longStripIsScrolling = signal(false); + private readonly longStripAllImagesLoaded = signal(false); + private readonly longStripInitFinished = signal(false); private longStripPrevScrollTop = 0; - private preloadedImages = new Map(); - previousImageUrls = signal([]); - currentImageUrls = signal([]); - isPageTransitioning = signal(false); - imagesLoaded = signal(false); + private readonly preloadedImages = new Map(); + readonly previousImageUrls = signal([]); + readonly currentImageUrls = signal([]); + readonly isPageTransitioning = signal(false); + readonly imagesLoaded = signal(false); private visibilityManager!: ReaderHeaderFooterVisibilityManager; - isCurrentPageBookmarked = signal(false); - currentPageHasNotes = signal(false); - showNoteDialog = signal(false); - noteDialogData = signal(null); - private editingNote = signal(null); + readonly isCurrentPageBookmarked = signal(false); + readonly currentPageHasNotes = signal(false); + readonly showNoteDialog = signal(false); + readonly noteDialogData = signal(null); + private readonly editingNote = signal(null); // Fullscreen state - isFullscreen = signal(false); + readonly isFullscreen = signal(false); // Reading direction - readingDirection = signal(CbxReadingDirection.LTR); + readonly readingDirection = signal(CbxReadingDirection.LTR); // Slideshow state - isSlideshowActive = signal(false); - slideshowInterval = signal(CbxSlideshowInterval.FIVE_SECONDS); + readonly isSlideshowActive = signal(false); + readonly slideshowInterval = signal(CbxSlideshowInterval.FIVE_SECONDS); private slideshowTimer: ReturnType | null = null; // Double-tap zoom - private lastTapTime = 0; + private readonly lastTapTime = 0; private originalFitMode: CbxFitMode | null = null; // Shortcuts help dialog - showShortcutsHelp = signal(false); + readonly showShortcutsHelp = signal(false); // Magnifier - isMagnifierActive = signal(false); - private magnifierLensRef = viewChild>('magnifierLens'); - private imageScrollHostRef = viewChild>('imageScrollHost'); - magnifierZoom = signal(CbxMagnifierZoom.ZOOM_3X); - magnifierLensSize = signal(CbxMagnifierLensSize.MEDIUM); + readonly isMagnifierActive = signal(false); + private readonly magnifierLensRef = viewChild>('magnifierLens'); + private readonly imageScrollHostRef = viewChild>('imageScrollHost'); + readonly magnifierZoom = signal(CbxMagnifierZoom.ZOOM_3X); + readonly magnifierLensSize = signal(CbxMagnifierLensSize.MEDIUM); private lastMouseEvent: MouseEvent | null = null; // Page split option for wide pages - pageSplitOption = signal(CbxPageSplitOption.NO_SPLIT); + readonly pageSplitOption = signal(CbxPageSplitOption.NO_SPLIT); // Brightness filter (0-100, default 100) - brightness = signal(100); + readonly brightness = signal(100); /** 50–100: max width of strip column (infinite / long strip). */ - stripMaxWidthPercent = signal(100); + readonly stripMaxWidthPercent = signal(100); /** Kavita-style hint when archive looks like vertical webtoon strips. */ - showWebtoonSuggestion = signal(false); + readonly showWebtoonSuggestion = signal(false); /** Near bottom of strip + next in series: show subtle continuation hint. */ - continuationHintVisible = signal(false); + readonly continuationHintVisible = signal(false); - private cbxSettingsUsesGlobal = signal(true); - private readerLayoutGraceUntilMs = signal(0); + private readonly cbxSettingsUsesGlobal = signal(true); + private readonly readerLayoutGraceUntilMs = signal(0); /** Invalidates delayed scroll/layout work after book or scroll-mode changes. */ - private readerLayoutGeneration = signal(0); + private readonly readerLayoutGeneration = signal(0); /** Avoid continuation hint flicker when scroll height changes (hysteresis). */ - private continuationHintLatched = signal(false); + private readonly continuationHintLatched = signal(false); // Emulate book mode (spine shadow in two-page view) - emulateBook = signal(false); + readonly emulateBook = signal(false); // Click-to-paginate overlay - clickToPaginate = signal(false); + readonly clickToPaginate = signal(false); // Auto-close menu after interaction - autoCloseMenu = signal(false); + readonly autoCloseMenu = signal(false); private autoCloseMenuTimer: ReturnType | null = null; // Page dimensions from backend - pageDimensions = signal([]); + readonly pageDimensions = signal([]); // Double page detection (fallback cache for pages without backend dims) - private pageDimensionsCache = new Map(); + private readonly pageDimensionsCache = new Map(); // Swipe double-action prevention - private hasHitRightScroll = signal(false); - private hasHitZeroScroll = signal(false); + private readonly hasHitRightScroll = signal(false); + private readonly hasHitZeroScroll = signal(false); private touchMoveCount = 0; // Canvas split state - canvasSplitState = signal<'NO_SPLIT' | 'LEFT_PART' | 'RIGHT_PART'>('NO_SPLIT'); + readonly canvasSplitState = signal<'NO_SPLIT' | 'LEFT_PART' | 'RIGHT_PART'>('NO_SPLIT'); protected readonly CbxReadingDirection = CbxReadingDirection; protected readonly CbxSlideshowInterval = CbxSlideshowInterval; protected readonly CbxPageSplitOption = CbxPageSplitOption; - - private route = inject(ActivatedRoute); - private router = inject(Router); - private cbxReaderService = inject(CbxReaderService); - private bookService = inject(BookService); - private bookQuery = inject(BookQueryService); - private queryClient = inject(QueryClient); - private userService = inject(UserService); - private messageService = inject(MessageService); - private readonly t = inject(TranslocoService); - private pageTitle = inject(PageTitleService); - private readingSessionService = inject(ReadingSessionService); - private headerService = inject(CbxHeaderService); - private sidebarService = inject(CbxSidebarService); - private footerService = inject(CbxFooterService); - private quickSettingsService = inject(CbxQuickSettingsService); /** Template reads this signal so strip width tracks the slider (same source as quick settings panel). */ protected readonly cbxQuickSettingsState = this.quickSettingsService.state; - private pageDimensionService = inject(CbxPageDimensionService); - private wakeLockService = inject(WakeLockService); - private readerPreferencesService = inject(ReaderPreferencesService); protected readonly CbxScrollMode = CbxScrollMode; protected readonly CbxFitMode = CbxFitMode; @@ -248,11 +247,11 @@ export class CbxReaderComponent implements OnInit, OnDestroy { private static readonly TYPE_CBX = 'CBX'; private static readonly SETTING_GLOBAL = 'Global'; - isTwoPageView = computed(() => this.pageViewMode() === this.CbxPageViewMode.TWO_PAGE); + readonly isTwoPageView = computed(() => this.pageViewMode() === this.CbxPageViewMode.TWO_PAGE); - hasSeries = computed(() => !!this.currentBook()?.metadata?.seriesName); + readonly hasSeries = computed(() => !!this.currentBook()?.metadata?.seriesName); - isFooterVisible = computed(() => this.footerService.forceVisible()); + readonly isFooterVisible = computed(() => this.footerService.forceVisible()); private static readonly PAGE_COLORS: Record = { [CbxBackgroundColor.BLACK]: '#000', @@ -260,22 +259,22 @@ export class CbxReaderComponent implements OnInit, OnDestroy { [CbxBackgroundColor.WHITE]: '#fff', }; - pageColor = computed(() => CbxReaderComponent.PAGE_COLORS[this.backgroundColor()]); + readonly pageColor = computed(() => CbxReaderComponent.PAGE_COLORS[this.backgroundColor()]); - stripColor = computed(() => this.brightness() < 100 + readonly stripColor = computed(() => this.brightness() < 100 ? `color-mix(in srgb, ${this.pageColor()} ${this.brightness()}%, black)` : this.pageColor()); - topBarColor = computed(() => this.headerService.forceVisible() ? 'var(--reader-chrome-bg)' : this.stripColor()); + readonly topBarColor = computed(() => this.headerService.forceVisible() ? 'var(--reader-chrome-bg)' : this.stripColor()); - bottomBarColor = computed(() => this.isFooterVisible() ? 'var(--reader-chrome-bg)' : this.stripColor()); + readonly bottomBarColor = computed(() => this.isFooterVisible() ? 'var(--reader-chrome-bg)' : this.stripColor()); - showQuickSettings = computed(() => this.quickSettingsService.visible()); + readonly showQuickSettings = computed(() => this.quickSettingsService.visible()); - isAtLastPage = computed(() => this.currentPage() >= this.pages().length - 1); + readonly isAtLastPage = computed(() => this.currentPage() >= this.pages().length - 1); /** Last loaded long-strip page is the archive's final page (show next-book CTA when in series). */ - isAtEndOfLongStrip = computed(() => { + readonly isAtEndOfLongStrip = computed(() => { const images = this.longStripImages(); if (images.length === 0) return false; const last = images[images.length - 1]; @@ -283,7 +282,7 @@ export class CbxReaderComponent implements OnInit, OnDestroy { }); /** Last loaded infinite-scroll index is the archive's final page (show next-book CTA when in series). */ - isAtEndOfInfiniteScroll = computed(() => { + readonly isAtEndOfInfiniteScroll = computed(() => { const pages = this.infiniteScrollPages(); if (pages.length === 0) return false; const lastIdx = pages[pages.length - 1]; @@ -663,12 +662,12 @@ export class CbxReaderComponent implements OnInit, OnDestroy { this.quickSettingsService.stripMaxWidthChange$ .pipe( tap((value) => { - this.stripMaxWidthPercent.set(value as number); + this.stripMaxWidthPercent.set(value); }), debounceTime(CbxReaderComponent.STRIP_WIDTH_PERSIST_DEBOUNCE_MS), takeUntilDestroyed(this.destroyRef) ) - .subscribe((value) => this.persistStripMaxWidth(value as number)); + .subscribe((value) => this.persistStripMaxWidth(value)); } private updateServiceStates(): void { @@ -2113,20 +2112,20 @@ export class CbxReaderComponent implements OnInit, OnDestroy { private cycleMagnifierZoom(direction: 1 | -1): void { const values = Object.values(CbxMagnifierZoom).filter(v => typeof v === 'number') as number[]; values.sort((a, b) => a - b); - const currentIndex = values.indexOf(this.magnifierZoom() as number); + const currentIndex = values.indexOf(this.magnifierZoom()); const newIndex = currentIndex + direction; if (newIndex >= 0 && newIndex < values.length) { - this.onMagnifierZoomChange(values[newIndex] as CbxMagnifierZoom); + this.onMagnifierZoomChange(values[newIndex]); } } private cycleMagnifierLensSize(direction: 1 | -1): void { const values = Object.values(CbxMagnifierLensSize).filter(v => typeof v === 'number') as number[]; values.sort((a, b) => a - b); - const currentIndex = values.indexOf(this.magnifierLensSize() as number); + const currentIndex = values.indexOf(this.magnifierLensSize()); const newIndex = currentIndex + direction; if (newIndex >= 0 && newIndex < values.length) { - this.onMagnifierLensSizeChange(values[newIndex] as CbxMagnifierLensSize); + this.onMagnifierLensSizeChange(values[newIndex]); } } @@ -2138,7 +2137,7 @@ export class CbxReaderComponent implements OnInit, OnDestroy { this.onFitModeChange(CbxFitMode.ACTUAL_SIZE); } else { // Restore original fit mode - this.onFitModeChange(this.originalFitMode as CbxFitMode); + this.onFitModeChange(this.originalFitMode); this.originalFitMode = null; } } diff --git a/frontend/src/app/features/readers/cbx-reader/core/cbx-page-dimension.service.ts b/frontend/src/app/features/readers/cbx-reader/core/cbx-page-dimension.service.ts index dbfdc6aba..4d1da1494 100644 --- a/frontend/src/app/features/readers/cbx-reader/core/cbx-page-dimension.service.ts +++ b/frontend/src/app/features/readers/cbx-reader/core/cbx-page-dimension.service.ts @@ -1,5 +1,5 @@ import {HttpClient} from '@angular/common/http'; -import {Injectable, inject} from '@angular/core'; +import {Service, inject} from '@angular/core'; import {Observable, of, tap} from 'rxjs'; import {API_CONFIG} from '../../../../core/config/api-config'; import {AuthService} from '../../../../shared/service/auth.service'; @@ -12,14 +12,14 @@ export interface WebtoonDetectionResult { score: number; } -@Injectable({providedIn: 'root'}) +@Service() export class CbxPageDimensionService { + private readonly http = inject(HttpClient); + private readonly authService = inject(AuthService); private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/cbx`; - private http = inject(HttpClient); - private authService = inject(AuthService); - private dimensionCache = new Map(); + private readonly dimensionCache = new Map(); private getToken(): string | null { return this.authService.getInternalAccessToken(); diff --git a/frontend/src/app/features/readers/cbx-reader/core/cbx-reader-storage.ts b/frontend/src/app/features/readers/cbx-reader/core/cbx-reader-storage.ts index d0ead95d4..e13829fd9 100644 --- a/frontend/src/app/features/readers/cbx-reader/core/cbx-reader-storage.ts +++ b/frontend/src/app/features/readers/cbx-reader/core/cbx-reader-storage.ts @@ -31,9 +31,7 @@ export function readStripWidthPercent( let raw: string | null = null; if (userId != null && userId > 0) { raw = localStorage.getItem(stripWidthStorageKey(bookId, userId)); - if (raw == null) { - raw = localStorage.getItem(LEGACY_STRIP_WIDTH_BOOK_PREFIX + bookId); - } + raw ??= localStorage.getItem(LEGACY_STRIP_WIDTH_BOOK_PREFIX + bookId); } else { raw = localStorage.getItem(LEGACY_STRIP_WIDTH_BOOK_PREFIX + bookId); } diff --git a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.html b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.html index f498f51d3..8dd38f1da 100644 --- a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.html +++ b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.html @@ -2,8 +2,8 @@

    {{ isEditing ? ('readerCbx.noteDialog.editNote' | transloco) : ('readerCbx.noteDialog.addNote' | transloco) }}

    -
    @@ -29,7 +29,7 @@
    @for (color of noteColors; track color.value) { - - + +
    diff --git a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.ts b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.ts index 139162a0d..85fb88dab 100644 --- a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.ts +++ b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-note-dialog.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Input, Output, OnChanges, SimpleChanges} from '@angular/core'; +import {Component, inject, Input, output, OnChanges, SimpleChanges} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {TranslocoService, TranslocoPipe} from '@jsverse/transloco'; import {ReaderIconComponent} from '../../ebook-reader/shared/icon.component'; @@ -26,8 +26,8 @@ export class CbxNoteDialogComponent implements OnChanges { private readonly t = inject(TranslocoService); @Input() data: CbxNoteDialogData | null = null; - @Output() saved = new EventEmitter(); - @Output() cancelled = new EventEmitter(); + readonly saved = output(); + readonly cancelled = output(); noteContent = ''; selectedColor = '#FFC107'; diff --git a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.html b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.html index f2a1e840f..71e941528 100644 --- a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.html +++ b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.html @@ -2,8 +2,8 @@

    {{ 'readerCbx.shortcutsHelp.title' | transloco }}

    -
    @@ -36,7 +36,7 @@
    diff --git a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.ts b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.ts index 7c8ad57a0..f62e6f8ba 100644 --- a/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.ts +++ b/frontend/src/app/features/readers/cbx-reader/dialogs/cbx-shortcuts-help.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Output} from '@angular/core'; +import {Component, inject, output} from '@angular/core'; import {TranslocoService, TranslocoPipe} from '@jsverse/transloco'; import {ReaderIconComponent} from '../../ebook-reader/shared/icon.component'; @@ -23,7 +23,7 @@ interface ShortcutGroup { export class CbxShortcutsHelpComponent { private readonly t = inject(TranslocoService); - @Output() closed = new EventEmitter(); + readonly closed = output(); get shortcutGroups(): ShortcutGroup[] { return [ diff --git a/frontend/src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.html b/frontend/src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.html index 162003c2d..d695d997d 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.html +++ b/frontend/src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.html @@ -2,7 +2,7 @@ (mouseenter)="hoverChange.emit(true)" (mouseleave)="hoverChange.emit(false)"> @if (state().hasSeries) { - -
    @@ -27,10 +27,10 @@ {{ 'readerCbx.footer.of' | transloco }} {{ state().totalPages }}
    - - @@ -66,7 +66,7 @@ aria-label="{{ 'readerCbx.footer.pagePlaceholder' | transloco }}" (keyup.enter)="onGoToPage()" /> - - - - - -
    - @if (overflowOpen) {
    - - -
    }
    - - diff --git a/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.ts b/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.ts index 75c8e80cc..4b2766a19 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.ts +++ b/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Input, Output} from '@angular/core'; +import {Component, inject, Input, output} from '@angular/core'; import {TranslocoPipe} from '@jsverse/transloco'; import {CbxHeaderService} from './cbx-header.service'; import {ReaderIconComponent} from '../../../ebook-reader'; @@ -15,7 +15,7 @@ export class CbxHeaderComponent { @Input() isCurrentPageBookmarked = false; @Input() currentPageHasNotes = false; - @Output() hoverChange = new EventEmitter(); + readonly hoverChange = output(); readonly forceVisible = this.headerService.forceVisible; readonly state = this.headerService.state; diff --git a/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.service.ts b/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.service.ts index c3dd4b2f0..d00f4877e 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.service.ts +++ b/frontend/src/app/features/readers/cbx-reader/layout/header/cbx-header.service.ts @@ -11,15 +11,14 @@ export interface CbxHeaderState { @Injectable() export class CbxHeaderService { + private readonly sidebarService = inject(CbxSidebarService); + private readonly location = inject(Location); private readonly defaultState: CbxHeaderState = { isFullscreen: false, isSlideshowActive: false, isMagnifierActive: false }; - private sidebarService = inject(CbxSidebarService); - private location = inject(Location); - private readonly _bookTitle = signal(''); readonly bookTitle = this._bookTitle.asReadonly(); @@ -29,25 +28,25 @@ export class CbxHeaderService { private readonly _state = signal(this.defaultState); readonly state = this._state.asReadonly(); - private _showQuickSettings = new Subject(); + private readonly _showQuickSettings = new Subject(); showQuickSettings$ = this._showQuickSettings.asObservable(); - private _toggleBookmark = new Subject(); + private readonly _toggleBookmark = new Subject(); toggleBookmark$ = this._toggleBookmark.asObservable(); - private _openNoteDialog = new Subject(); + private readonly _openNoteDialog = new Subject(); openNoteDialog$ = this._openNoteDialog.asObservable(); - private _toggleFullscreen = new Subject(); + private readonly _toggleFullscreen = new Subject(); toggleFullscreen$ = this._toggleFullscreen.asObservable(); - private _toggleSlideshow = new Subject(); + private readonly _toggleSlideshow = new Subject(); toggleSlideshow$ = this._toggleSlideshow.asObservable(); - private _toggleMagnifier = new Subject(); + private readonly _toggleMagnifier = new Subject(); toggleMagnifier$ = this._toggleMagnifier.asObservable(); - private _showShortcutsHelp = new Subject(); + private readonly _showShortcutsHelp = new Subject(); showShortcutsHelp$ = this._showShortcutsHelp.asObservable(); initialize(title: string | undefined): void { diff --git a/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.html b/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.html index 813b4de84..ede6944e1 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.html +++ b/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.html @@ -10,7 +10,7 @@
    @for (option of fitModeOptions; track option.value) { - @@ -25,7 +25,7 @@
    @for (option of scrollModeOptions; track option.value) { - @@ -53,7 +53,7 @@
    {{ isTwoPageView ? ('readerCbx.quickSettings.twoPage' | transloco) : ('readerCbx.quickSettings.single' | transloco) }} -
    @@ -67,7 +67,7 @@
    {{ state().pageSpread === CbxPageSpread.ODD ? ('readerCbx.quickSettings.oddFirst' | transloco) : ('readerCbx.quickSettings.evenFirst' | transloco) }} - @@ -82,7 +82,7 @@ {{ state().readingDirection === CbxReadingDirection.LTR ? ('readerCbx.quickSettings.leftToRight' | transloco) : ('readerCbx.quickSettings.rightToLeft' | transloco) }} - @@ -95,7 +95,7 @@
    @for (option of slideshowIntervalOptions; track option.value) { - @@ -110,7 +110,7 @@
    @for (option of backgroundOptions; track option.value) { - @@ -125,7 +125,7 @@
    @for (option of magnifierLensSizeOptions; track option.value) { - @@ -140,7 +140,7 @@
    @for (option of magnifierZoomOptions; track option.value) { - @@ -166,7 +166,7 @@
    {{ state().emulateBook ? ('common.on' | transloco) : ('common.off' | transloco) }} -
    @@ -178,7 +178,7 @@
    {{ state().clickToPaginate ? ('common.on' | transloco) : ('common.off' | transloco) }} -
    @@ -190,7 +190,7 @@
    {{ state().autoCloseMenu ? ('common.on' | transloco) : ('common.off' | transloco) }} -
    diff --git a/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.service.ts b/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.service.ts index 13bace150..ce19a79a6 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.service.ts +++ b/frontend/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.service.ts @@ -45,46 +45,46 @@ export class CbxQuickSettingsService { private readonly _visible = signal(false); readonly visible = this._visible.asReadonly(); - private _fitModeChange = new Subject(); + private readonly _fitModeChange = new Subject(); fitModeChange$ = this._fitModeChange.asObservable(); - private _scrollModeChange = new Subject(); + private readonly _scrollModeChange = new Subject(); scrollModeChange$ = this._scrollModeChange.asObservable(); - private _pageViewModeChange = new Subject(); + private readonly _pageViewModeChange = new Subject(); pageViewModeChange$ = this._pageViewModeChange.asObservable(); - private _pageSpreadChange = new Subject(); + private readonly _pageSpreadChange = new Subject(); pageSpreadChange$ = this._pageSpreadChange.asObservable(); - private _backgroundColorChange = new Subject(); + private readonly _backgroundColorChange = new Subject(); backgroundColorChange$ = this._backgroundColorChange.asObservable(); - private _readingDirectionChange = new Subject(); + private readonly _readingDirectionChange = new Subject(); readingDirectionChange$ = this._readingDirectionChange.asObservable(); - private _slideshowIntervalChange = new Subject(); + private readonly _slideshowIntervalChange = new Subject(); slideshowIntervalChange$ = this._slideshowIntervalChange.asObservable(); - private _magnifierZoomChange = new Subject(); + private readonly _magnifierZoomChange = new Subject(); magnifierZoomChange$ = this._magnifierZoomChange.asObservable(); - private _magnifierLensSizeChange = new Subject(); + private readonly _magnifierLensSizeChange = new Subject(); magnifierLensSizeChange$ = this._magnifierLensSizeChange.asObservable(); - private _brightnessChange = new Subject(); + private readonly _brightnessChange = new Subject(); brightnessChange$ = this._brightnessChange.asObservable(); - private _emulateBookChange = new Subject(); + private readonly _emulateBookChange = new Subject(); emulateBookChange$ = this._emulateBookChange.asObservable(); - private _clickToPaginateChange = new Subject(); + private readonly _clickToPaginateChange = new Subject(); clickToPaginateChange$ = this._clickToPaginateChange.asObservable(); - private _autoCloseMenuChange = new Subject(); + private readonly _autoCloseMenuChange = new Subject(); autoCloseMenuChange$ = this._autoCloseMenuChange.asObservable(); - private _stripMaxWidthChange = new Subject(); + private readonly _stripMaxWidthChange = new Subject(); stripMaxWidthChange$ = this._stripMaxWidthChange.asObservable(); show(): void { diff --git a/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.component.html b/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.component.html index 2812b1932..7abc86705 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.component.html +++ b/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.component.html @@ -18,28 +18,28 @@
    - } } @else {
    - +

    {{ 'readerCbx.sidebar.noBookmarksYet' | transloco }}

    {{ 'readerCbx.sidebar.bookmarkHint' | transloco }}
    @@ -97,7 +97,7 @@
    @if (notes().length > 0) {
    - + @if (notesSearchQuery()) { - }
    @@ -127,11 +127,11 @@ {{ note.createdAt | date: 'MMM d, y' }}
    - -
    @@ -139,13 +139,13 @@ } @else if (notes().length > 0 && notesSearchQuery()) {
    - +

    {{ 'readerCbx.sidebar.noMatchingNotes' | transloco }}

    {{ 'readerCbx.sidebar.tryDifferentSearch' | transloco }}
    } @else {
    - +

    {{ 'readerCbx.sidebar.noNotesYet' | transloco }}

    {{ 'readerCbx.sidebar.notesHint' | transloco }}
    diff --git a/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.service.ts b/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.service.ts index a0dc66e2c..c898bbd06 100644 --- a/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.service.ts +++ b/frontend/src/app/features/readers/cbx-reader/layout/sidebar/cbx-sidebar.service.ts @@ -19,10 +19,10 @@ export type CbxSidebarTab = 'pages' | 'bookmarks' | 'notes'; @Injectable() export class CbxSidebarService { - private urlHelper = inject(UrlHelperService); - private cbxReaderService = inject(CbxReaderService); - private bookMarkService = inject(BookMarkService); - private bookNoteV2Service = inject(BookNoteV2Service); + private readonly urlHelper = inject(UrlHelperService); + private readonly cbxReaderService = inject(CbxReaderService); + private readonly bookMarkService = inject(BookMarkService); + private readonly bookNoteV2Service = inject(BookNoteV2Service); private readonly t = inject(TranslocoService); private readonly destroyRef = inject(DestroyRef); @@ -71,8 +71,8 @@ export class CbxSidebarService { ); }); - private _navigateToPage = new Subject(); - private _editNote = new Subject(); + private readonly _navigateToPage = new Subject(); + private readonly _editNote = new Subject(); navigateToPage$ = this._navigateToPage.asObservable(); editNote$ = this._editNote.asObservable(); @@ -83,7 +83,7 @@ export class CbxSidebarService { this._bookInfo.set({ id: book.id, title: book.metadata?.title || book.fileName || this.t.translate('readerCbx.sidebar.untitled'), - authors: (book.metadata?.authors || []).join(', '), + authors: (book.metadata?.authors ?? []).join(', '), coverUrl: this.urlHelper.getThumbnailUrl(book.id, book.metadata?.coverUpdatedOn) }); diff --git a/frontend/src/app/features/readers/cbx-reader/renderers/canvas-renderer.component.ts b/frontend/src/app/features/readers/cbx-reader/renderers/canvas-renderer.component.ts index 8a5f8aacd..b9ed2def0 100644 --- a/frontend/src/app/features/readers/cbx-reader/renderers/canvas-renderer.component.ts +++ b/frontend/src/app/features/readers/cbx-reader/renderers/canvas-renderer.component.ts @@ -156,7 +156,7 @@ export class CanvasRendererComponent implements OnChanges, AfterViewInit, OnDest private getMaxCanvasSize(): number { const ua = navigator.userAgent; - if (/Safari/.test(ua) && !/Chrome/.test(ua)) { + if (ua.includes('Safari') && !ua.includes('Chrome')) { return CanvasRendererComponent.MAX_CANVAS_SAFARI; } return CanvasRendererComponent.MAX_CANVAS_OTHER; diff --git a/frontend/src/app/features/readers/ebook-reader/core/epub-streaming.service.ts b/frontend/src/app/features/readers/ebook-reader/core/epub-streaming.service.ts index b81448820..658f47881 100644 --- a/frontend/src/app/features/readers/ebook-reader/core/epub-streaming.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/core/epub-streaming.service.ts @@ -1,4 +1,4 @@ -import {Injectable, inject} from '@angular/core'; +import {Service, inject} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {API_CONFIG} from '../../../../core/config/api-config'; @@ -35,13 +35,11 @@ export interface EpubBookInfo { coverPath?: string; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class EpubStreamingService { + private readonly http = inject(HttpClient); + private readonly authService = inject(AuthService); private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/epub`; - private http = inject(HttpClient); - private authService = inject(AuthService); getBookInfo(bookId: number, bookType?: string): Observable { if (bookType) { diff --git a/frontend/src/app/features/readers/ebook-reader/core/event.service.ts b/frontend/src/app/features/readers/ebook-reader/core/event.service.ts index 2893b9b25..8ce3f2920 100644 --- a/frontend/src/app/features/readers/ebook-reader/core/event.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/core/event.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {Subject} from 'rxjs'; import {ReaderAnnotationService} from '../features/annotations/annotation-renderer.service'; @@ -83,18 +83,15 @@ interface ViewCallbacks { isTapToTurnEnabled?: () => boolean; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class ReaderEventService { + private readonly annotationService = inject(ReaderAnnotationService); private readonly DOUBLE_CLICK_INTERVAL_MS = 300; private readonly LONG_HOLD_THRESHOLD_MS = 500; private readonly LEFT_ZONE_PERCENT = 0.3; private readonly RIGHT_ZONE_PERCENT = 0.7; private readonly SWIPE_THRESHOLD_PX = 50; - private annotationService = inject(ReaderAnnotationService); - private view: EventServiceView | null = null; private viewCallbacks: ViewCallbacks | null = null; private isNavigating = false; @@ -112,7 +109,7 @@ export class ReaderEventService { private selectionChangeTimeout: ReturnType | null = null; private lastTouchTime = 0; - private eventSubject = new Subject(); + private readonly eventSubject = new Subject(); public events$ = this.eventSubject.asObservable(); initialize(view: EventServiceView, callbacks: ViewCallbacks): void { diff --git a/frontend/src/app/features/readers/ebook-reader/core/loader.service.ts b/frontend/src/app/features/readers/ebook-reader/core/loader.service.ts index 49b7f86b6..f17b419d1 100644 --- a/frontend/src/app/features/readers/ebook-reader/core/loader.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/core/loader.service.ts @@ -1,10 +1,8 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {defer, from, Observable, of} from 'rxjs'; import {switchMap} from 'rxjs/operators'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class ReaderLoaderService { private scriptLoaded = false; diff --git a/frontend/src/app/features/readers/ebook-reader/core/style.service.ts b/frontend/src/app/features/readers/ebook-reader/core/style.service.ts index 22d1fbf3e..ff2765d41 100644 --- a/frontend/src/app/features/readers/ebook-reader/core/style.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/core/style.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {ReaderState} from '../state/reader-state.service'; import {EpubCustomFontService} from '../features/fonts/custom-font.service'; @@ -8,11 +8,9 @@ interface ReaderRenderer { setStyles?(css: string): void; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class ReaderStyleService { - private epubCustomFontService = inject(EpubCustomFontService); + private readonly epubCustomFontService = inject(EpubCustomFontService); generateCSS(state: ReaderState): string { const {lineHeight, justify, hyphenate, fontSize, theme, fontFamily} = state; diff --git a/frontend/src/app/features/readers/ebook-reader/core/view-manager.service.ts b/frontend/src/app/features/readers/ebook-reader/core/view-manager.service.ts index 36dc81f6b..31658e807 100644 --- a/frontend/src/app/features/readers/ebook-reader/core/view-manager.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/core/view-manager.service.ts @@ -1,4 +1,4 @@ -import {inject, Injectable} from '@angular/core'; +import {inject, Service} from '@angular/core'; import {defer, from, Observable, of, throwError, timer} from 'rxjs'; import {catchError, map, switchMap} from 'rxjs/operators'; import {ReaderAnnotationService, Annotation} from '../features/annotations/annotation-renderer.service'; @@ -103,14 +103,12 @@ interface StreamingBookFactoryWindow extends Window { ) => Promise; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class ReaderViewManagerService { - private annotationService = inject(ReaderAnnotationService); - private eventService = inject(ReaderEventService); - private epubStreamingService = inject(EpubStreamingService); - private readerStateService = inject(ReaderStateService); + private readonly annotationService = inject(ReaderAnnotationService); + private readonly eventService = inject(ReaderEventService); + private readonly epubStreamingService = inject(EpubStreamingService); + private readonly readerStateService = inject(ReaderStateService); private view: FoliateViewElement | null = null; public get events$(): Observable { @@ -151,7 +149,7 @@ export class ReaderViewManagerService { const file = new File([blob], epubPath.split('/').pop() || 'book.epub', { type: 'application/epub+zip' }); - return from(view.open(file) as Promise); + return from(view.open(file)); }), map(() => undefined), catchError(err => throwError(() => err)) @@ -198,7 +196,7 @@ export class ReaderViewManagerService { } const view = this.view; return defer(() => - from(view.goTo(resolvedTarget) as Promise) + from(view.goTo(resolvedTarget)) ).pipe( map(() => undefined) ); @@ -213,7 +211,7 @@ export class ReaderViewManagerService { return of(undefined); } const view = this.view; - return defer(() => from(view.goToFraction(fraction) as Promise)).pipe( + return defer(() => from(view.goToFraction(fraction))).pipe( map(() => undefined) ); } @@ -320,7 +318,7 @@ export class ReaderViewManagerService { const book = this.view.book; return defer(() => { const coverPromise = book.getCover?.(); - return coverPromise ? from(coverPromise as Promise) : of(null); + return coverPromise ? from(coverPromise) : of(null); }); } diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.html b/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.html index 72c85b718..b92d4262c 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.html +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.html @@ -3,7 +3,7 @@

    {{ t('title') }}

    - +
    diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.ts b/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.ts index 5ff038a37..92d6fd155 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/metadata-dialog.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Input, Output} from '@angular/core'; +import {Component, inject, Input, output} from '@angular/core'; import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/transloco'; import {Book} from '../../../book/model/book.model'; import {UrlHelperService} from '../../../../shared/service/url-helper.service'; @@ -14,13 +14,12 @@ import {MetadataCatalogService} from '../../../../shared/metadata/metadata-catal styleUrls: ['./metadata-dialog.component.scss'] }) export class ReaderBookMetadataDialogComponent { - @Input() book: Book | null = null; - @Output() closed = new EventEmitter(); - - private urlHelperService = inject(UrlHelperService); + private readonly urlHelperService = inject(UrlHelperService); private readonly t = inject(TranslocoService); protected readonly catalog = inject(MetadataCatalogService); protected readonly languageResolver = inject(LanguageResolverService); + @Input() book: Book | null = null; + readonly closed = output(); get metadata() { return this.book?.metadata; diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.html b/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.html index b90f717b6..15b698101 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.html +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.html @@ -3,8 +3,8 @@

    {{ isEditing ? t('editNote') : t('addNote') }}

    -
    @@ -32,7 +32,7 @@
    @for (color of noteColors; track color.value) { - - + +
    diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.ts b/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.ts index 58c9cd4b6..fd21c45fc 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/note-dialog.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, Input, Output, OnChanges, SimpleChanges} from '@angular/core'; +import {Component, Input, output, OnChanges, SimpleChanges} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {TranslocoDirective, TranslocoPipe} from '@jsverse/transloco'; import {ReaderIconComponent} from '../shared/icon.component'; @@ -26,8 +26,8 @@ export interface NoteDialogResult { }) export class ReaderNoteDialogComponent implements OnChanges { @Input() data: NoteDialogData | null = null; - @Output() saved = new EventEmitter(); - @Output() cancelled = new EventEmitter(); + readonly saved = output(); + readonly cancelled = output(); noteContent = ''; selectedColor = '#FFC107'; diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.html b/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.html index 928943413..b52717464 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.html +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.html @@ -3,26 +3,26 @@
    - - -
    - +
    @@ -32,7 +32,7 @@ {{ t('darkMode') }} ☀️ - 🌙 @@ -63,7 +63,7 @@
    {{ t('annotationHighlighter') }}
    @for (color of annotationColors; track color.name) { - + {{ state.fontSize }} - +
    @@ -96,9 +96,9 @@ {{ t('lineHeight') }}
    - + {{ state.lineHeight | number:'1.1-1' }} - +
    @@ -106,7 +106,7 @@
    {{ t('fontFamily') }}
    @for (font of fonts; track font.value) { - + {{ state.maxColumnCount }} - +
    @@ -182,9 +182,9 @@ {{ t('maxWidth') }}
    - + {{ state.maxInlineSize }} - +
    @@ -193,9 +193,9 @@ {{ t('maxHeight') }}
    - + {{ state.maxBlockSize }} - +
    @@ -204,14 +204,14 @@
    {{ t('justifyText') }} -
    {{ t('hyphenate') }} -
    diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.ts b/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.ts index 41c0c09b9..7718b7df6 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/settings-dialog.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Input, OnInit, Output, Renderer2} from '@angular/core'; +import {Component, inject, Input, OnInit, output, Renderer2} from '@angular/core'; import {DecimalPipe, DOCUMENT} from '@angular/common'; import {TranslocoDirective} from '@jsverse/transloco'; import {ReaderStateService} from '../state/reader-state.service'; @@ -21,11 +21,15 @@ interface AnnotationColor { styleUrls: ['./settings-dialog.component.scss'] }) export class ReaderSettingsDialogComponent implements OnInit { + private readonly bookService = inject(BookService); + private readonly customFontService = inject(EpubCustomFontService); + private readonly renderer = inject(Renderer2); + private readonly document = inject(DOCUMENT); @Input() stateService!: ReaderStateService; @Input() viewManager!: ReaderViewManagerService; @Input() bookId!: number; - @Output() closed = new EventEmitter(); + readonly closed = output(); activeTab: 'theme' | 'typography' | 'layout' = 'theme'; @@ -39,11 +43,6 @@ export class ReaderSettingsDialogComponent implements OnInit { {name: 'orange', value: '#FFD580', label: 'Orange'} ]; - private bookService = inject(BookService); - private customFontService = inject(EpubCustomFontService); - private renderer = inject(Renderer2); - private document = inject(DOCUMENT); - ngOnInit() { this.customFontService.injectCustomFontsStylesheet(this.renderer, this.document); this.selectedAnnotationColor = this.getSelectedAnnotationColor(); diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.html b/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.html index 602840afe..d61045e0f 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.html +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.html @@ -2,8 +2,8 @@

    {{ 'readerEbook.shortcutsHelp.title' | transloco }}

    -
    @@ -36,7 +36,7 @@
    diff --git a/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.ts b/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.ts index 22ea481ec..7dd821c2c 100644 --- a/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/dialogs/shortcuts-help.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Output} from '@angular/core'; +import {Component, inject, output} from '@angular/core'; import {TranslocoPipe, TranslocoService} from '@jsverse/transloco'; import {ReaderIconComponent} from '../shared/icon.component'; @@ -21,9 +21,8 @@ interface ShortcutGroup { styleUrls: ['./shortcuts-help.component.scss'] }) export class EbookShortcutsHelpComponent { - @Output() closed = new EventEmitter(); - private readonly t = inject(TranslocoService); + readonly closed = output(); get shortcutGroups(): ShortcutGroup[] { return [ diff --git a/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.html b/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.html index 21ead2a02..39570a601 100644 --- a/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.html +++ b/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.html @@ -27,7 +27,7 @@ } + (hoverChange)="onHeaderHovered($event)" />
    @if (isCurrentCfiBookmarked()) { @@ -45,19 +45,17 @@ [forceVisible]="forceNavbarVisible()" [sectionFractions]="sectionFractions()" (progressChange)="onProgressChange($event)" - (hoverChange)="onFooterHovered($event)"> - + (hoverChange)="onFooterHovered($event)" /> - - + + @if (showQuickSettings()) { - + (openFullSettings)="showControls.set(true)" /> } @if (showControls()) { @@ -65,15 +63,14 @@ [stateService]="stateService" [viewManager]="viewManager" [bookId]="bookId" - (closed)="showControls.set(false)"> - + (closed)="showControls.set(false)" /> } @if (showMetadata()) { + /> } + /> @if (noteDialogState().visible) { + /> } @if (showShortcutsHelp()) { - + }
    diff --git a/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.ts b/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.ts index c99fcf5d3..7c5bb9e00 100644 --- a/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/ebook-reader.component.ts @@ -85,20 +85,20 @@ export class EbookReaderComponent implements OnInit { private static readonly MAX_CHAPTER_PROGRESS_PERCENT = 99.9; private static readonly INITIAL_CHAPTER_RESTORE_RETRY_MS = 100; private static readonly INITIAL_CHAPTER_RESTORE_MAX_ATTEMPTS = 15; - private loaderService = inject(ReaderLoaderService); - private styleService = inject(ReaderStyleService); - private bookService = inject(BookService); - private bookFileService = inject(BookFileService); - private route = inject(ActivatedRoute); - private epubCustomFontService = inject(EpubCustomFontService); - private annotationService = inject(ReaderAnnotationHttpService); - private progressService = inject(ReaderProgressService); - private selectionService = inject(ReaderSelectionService); - private headerService = inject(ReaderHeaderService); - private noteService = inject(ReaderNoteService); - private wakeLockService = inject(WakeLockService); - private messageService = inject(MessageService); - private pageTitle = inject(PageTitleService); + private readonly loaderService = inject(ReaderLoaderService); + private readonly styleService = inject(ReaderStyleService); + private readonly bookService = inject(BookService); + private readonly bookFileService = inject(BookFileService); + private readonly route = inject(ActivatedRoute); + private readonly epubCustomFontService = inject(EpubCustomFontService); + private readonly annotationService = inject(ReaderAnnotationHttpService); + private readonly progressService = inject(ReaderProgressService); + private readonly selectionService = inject(ReaderSelectionService); + private readonly headerService = inject(ReaderHeaderService); + private readonly noteService = inject(ReaderNoteService); + private readonly wakeLockService = inject(WakeLockService); + private readonly messageService = inject(MessageService); + private readonly pageTitle = inject(PageTitleService); public sidebarService = inject(ReaderSidebarService); public leftSidebarService = inject(ReaderLeftSidebarService); @@ -117,21 +117,21 @@ export class EbookReaderComponent implements OnInit { private pendingInitialChapterRestoreTimeout?: ReturnType; @ViewChild(TextSelectionPopupComponent, {static: true}) - private selectionPopup!: TextSelectionPopupComponent; + private readonly selectionPopup!: TextSelectionPopupComponent; - isLoading = signal(true); - showQuickSettings = signal(false); - showControls = signal(false); - showMetadata = signal(false); - forceNavbarVisible = signal(false); - headerVisible = signal(false); - book = signal(null); - sectionFractions = signal([]); - isFullscreen = signal(false); - showShortcutsHelp = signal(false); - immersiveMode = signal(false); + readonly isLoading = signal(true); + readonly showQuickSettings = signal(false); + readonly showControls = signal(false); + readonly showMetadata = signal(false); + readonly forceNavbarVisible = signal(false); + readonly headerVisible = signal(false); + readonly book = signal(null); + readonly sectionFractions = signal([]); + readonly isFullscreen = signal(false); + readonly showShortcutsHelp = signal(false); + readonly immersiveMode = signal(false); private immersiveAutoHideTimer?: ReturnType; - protected progressData = signal(null); + protected readonly progressData = signal(null); readonly readerState = this.stateService.state; private readonly requestAutoFullscreen = setupReaderEdges(() => this.readerState().theme.bg ?? ''); diff --git a/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation-renderer.service.ts b/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation-renderer.service.ts index 95de0f4b0..993d5a1be 100644 --- a/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation-renderer.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation-renderer.service.ts @@ -1,4 +1,4 @@ -import {Injectable} from '@angular/core'; +import {Service} from '@angular/core'; import {defer, from, Observable, of} from 'rxjs'; import {AnnotationStyle} from '../../../../../shared/service/annotation.service'; @@ -16,11 +16,9 @@ interface AnnotationView { showAnnotation(annotation: { value: string }): Promise; } -@Injectable({ - providedIn: 'root' -}) +@Service() export class ReaderAnnotationService { - private annotationStyles = new Map(); + private readonly annotationStyles = new Map(); private allAnnotations: Annotation[] = []; addAnnotation(view: AnnotationView | null | undefined, annotation: Annotation): Observable<{ index: number; label: string } | undefined> { @@ -47,13 +45,13 @@ export class ReaderAnnotationService { this.annotationStyles.delete(cfi); this.allAnnotations = this.allAnnotations.filter(a => a.value !== cfi); - return defer(() => from(view.deleteAnnotation({value: cfi}) as Promise)); + return defer(() => from(view.deleteAnnotation({value: cfi}))); } showAnnotation(view: AnnotationView | null | undefined, cfi: string): Observable { if (!view) return of(undefined); - return defer(() => from(view.showAnnotation({value: cfi}) as Promise)); + return defer(() => from(view.showAnnotation({value: cfi}))); } addAnnotations(view: AnnotationView | null | undefined, annotations: Annotation[]): void { @@ -140,8 +138,8 @@ export class ReaderAnnotationService { const {color = 'yellow'} = options; const g = createSVGElement('g'); g.setAttribute('fill', color); - (g as SVGElement).style.opacity = 'var(--overlayer-highlight-opacity, .3)'; - (g as SVGElement).style.mixBlendMode = 'var(--overlayer-highlight-blend-mode, multiply)'; + (g).style.opacity = 'var(--overlayer-highlight-opacity, .3)'; + (g).style.mixBlendMode = 'var(--overlayer-highlight-blend-mode, multiply)'; for (const {left, top, height, width} of Array.from(rects)) { const el = createSVGElement('rect'); el.setAttribute('x', String(left)); diff --git a/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation.service.ts b/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation.service.ts index 414069710..13d39c1b2 100644 --- a/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/features/annotations/annotation.service.ts @@ -13,10 +13,10 @@ import {Annotation as ViewAnnotation, ReaderAnnotationService} from './annotatio @Injectable() export class ReaderAnnotationHttpService { - private annotationService = inject(AnnotationService); - private messageService = inject(MessageService); + private readonly annotationService = inject(AnnotationService); + private readonly messageService = inject(MessageService); private readonly t = inject(TranslocoService); - private readerAnnotationService = inject(ReaderAnnotationService); + private readonly readerAnnotationService = inject(ReaderAnnotationService); private currentChapterTitle: string | null = null; diff --git a/frontend/src/app/features/readers/ebook-reader/features/bookmarks/bookmark.service.ts b/frontend/src/app/features/readers/ebook-reader/features/bookmarks/bookmark.service.ts index 29d3705ba..ecc0a6828 100644 --- a/frontend/src/app/features/readers/ebook-reader/features/bookmarks/bookmark.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/features/bookmarks/bookmark.service.ts @@ -7,13 +7,12 @@ import {TranslocoService} from '@jsverse/transloco'; @Injectable() export class ReaderBookmarkService { + private readonly bookMarkService = inject(BookMarkService); + private readonly messageService = inject(MessageService); + private readonly t = inject(TranslocoService); private currentCFI: string | null = null; private currentChapterName: string | null = null; - private bookMarkService = inject(BookMarkService); - private messageService = inject(MessageService); - private readonly t = inject(TranslocoService); - updateCurrentPosition(cfi: string, chapterName?: string): void { this.currentCFI = cfi; diff --git a/frontend/src/app/features/readers/ebook-reader/features/fonts/custom-font.service.ts b/frontend/src/app/features/readers/ebook-reader/features/fonts/custom-font.service.ts index d1f3ac59a..1cc6d8d50 100644 --- a/frontend/src/app/features/readers/ebook-reader/features/fonts/custom-font.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/features/fonts/custom-font.service.ts @@ -1,17 +1,15 @@ -import {Injectable, inject, Renderer2} from '@angular/core'; +import {Service, inject, Renderer2} from '@angular/core'; import {CustomFontService} from '../../../../../shared/service/custom-font.service'; import {CustomFont} from '../../../../../shared/model/custom-font.model'; import {Observable, forkJoin, of, from} from 'rxjs'; import {map, switchMap, tap, catchError} from 'rxjs/operators'; -@Injectable({ - providedIn: 'root' -}) +@Service() export class EpubCustomFontService { - private customFontService = inject(CustomFontService); + private readonly customFontService = inject(CustomFontService); private customFonts: CustomFont[] = []; - private customFontBlobUrls = new Map(); + private readonly customFontBlobUrls = new Map(); loadAndCacheFonts(): Observable { return from(this.customFontService.ensureFonts()).pipe( diff --git a/frontend/src/app/features/readers/ebook-reader/features/notes/note.service.ts b/frontend/src/app/features/readers/ebook-reader/features/notes/note.service.ts index 7b09046a4..82b4be8bf 100644 --- a/frontend/src/app/features/readers/ebook-reader/features/notes/note.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/features/notes/note.service.ts @@ -16,13 +16,13 @@ export interface NoteDialogState { @Injectable() export class ReaderNoteService { - private bookNoteV2Service = inject(BookNoteV2Service); - private messageService = inject(MessageService); + private readonly bookNoteV2Service = inject(BookNoteV2Service); + private readonly messageService = inject(MessageService); private readonly t = inject(TranslocoService); - private selectionService = inject(ReaderSelectionService); - private progressService = inject(ReaderProgressService); - private leftSidebarService = inject(ReaderLeftSidebarService); - private viewManager = inject(ReaderViewManagerService); + private readonly selectionService = inject(ReaderSelectionService); + private readonly progressService = inject(ReaderProgressService); + private readonly leftSidebarService = inject(ReaderLeftSidebarService); + private readonly viewManager = inject(ReaderViewManagerService); private readonly destroyRef = inject(DestroyRef); private bookId!: number; diff --git a/frontend/src/app/features/readers/ebook-reader/features/selection/selection.service.ts b/frontend/src/app/features/readers/ebook-reader/features/selection/selection.service.ts index 850b78176..834614a6e 100644 --- a/frontend/src/app/features/readers/ebook-reader/features/selection/selection.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/features/selection/selection.service.ts @@ -28,9 +28,9 @@ export interface SelectionDetail { @Injectable() export class ReaderSelectionService { - private viewManager = inject(ReaderViewManagerService); - private annotationService = inject(ReaderAnnotationHttpService); - private leftSidebarService = inject(ReaderLeftSidebarService); + private readonly viewManager = inject(ReaderViewManagerService); + private readonly annotationService = inject(ReaderAnnotationHttpService); + private readonly leftSidebarService = inject(ReaderLeftSidebarService); private readonly destroyRef = inject(DestroyRef); private bookId!: number; @@ -58,7 +58,7 @@ export class ReaderSelectionService { private readonly _state = signal(this.defaultState); readonly state = this._state.asReadonly(); - private annotationsChangedSubject = new Subject(); + private readonly annotationsChangedSubject = new Subject(); public annotationsChanged$ = this.annotationsChangedSubject.asObservable(); initialize(bookId: number): void { @@ -76,7 +76,7 @@ export class ReaderSelectionService { this.currentSelection = detail; this._overlappingAnnotationId = this.findOverlappingAnnotation(detail.cfi); this._visible = true; - this._position = popupPosition || { x: 0, y: 0 }; + this._position = popupPosition ?? { x: 0, y: 0 }; this._showBelow = popupPosition?.showBelow || false; this.emitState(); diff --git a/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.html b/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.html index 3d828d11c..ac099265c 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.html +++ b/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.html @@ -1,12 +1,12 @@
    -
    - @@ -27,8 +27,8 @@
    - @@ -77,23 +77,23 @@ % - +
    - - - - -
    diff --git a/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.ts b/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.ts index 23e76584a..28fd2ba17 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/layout/footer/footer.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, HostListener, inject, Input, Output} from '@angular/core'; +import {Component, HostListener, inject, Input, output} from '@angular/core'; import {TranslocoDirective} from '@jsverse/transloco'; import {ReaderViewManagerService} from '../../core/view-manager.service'; import {ReaderIconComponent} from '../../shared/icon.component'; @@ -12,6 +12,7 @@ import {RelocateProgressData} from '../../state/progress.service'; styleUrls: ['./footer.component.scss'] }) export class ReaderNavbarComponent { + private readonly managerService = inject(ReaderViewManagerService); @Input() progressData: RelocateProgressData | null = null; @Input() forceVisible = false; @Input() set sectionFractions(value: number[]) { @@ -22,16 +23,14 @@ export class ReaderNavbarComponent { get displaySectionFractions(): number[] { return this._sectionFractions; } - @Output() progressChange = new EventEmitter(); - @Output() hoverChange = new EventEmitter(); - - private managerService = inject(ReaderViewManagerService); + readonly progressChange = output(); + readonly hoverChange = output(); showLocationPopover = false; @HostListener('document:click', ['$event']) onDocumentClick(event: MouseEvent) { const target = event.target as HTMLElement; - const clickedInside = target.closest('.location-popover') || target.closest('.location-btn'); + const clickedInside = target.closest('.location-popover') ?? target.closest('.location-btn'); if (!clickedInside && this.showLocationPopover) { this.showLocationPopover = false; } diff --git a/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.html b/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.html index af25655a6..9f46a55e8 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.html +++ b/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.html @@ -2,54 +2,54 @@
    - - -
    {{ bookTitle() }}
    - - -
    - @if (overflowOpen) {
    - - -
    }
    - -
    diff --git a/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.ts b/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.ts index da92e699e..0a07a0d15 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/layout/header/header.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Output} from '@angular/core'; +import {Component, inject, output} from '@angular/core'; import {TranslocoDirective} from '@jsverse/transloco'; import {ReaderHeaderService} from './header.service'; import {ReaderIconComponent} from '../../shared/icon.component'; @@ -20,7 +20,7 @@ export class ReaderHeaderComponent { readonly isFullscreen = this.headerService.isFullscreen; readonly bookTitle = this.headerService.bookTitle; readonly theme = this.headerService.theme; - @Output() hoverChange = new EventEmitter(); + readonly hoverChange = output(); overflowOpen = false; onShowChapters(): void { diff --git a/frontend/src/app/features/readers/ebook-reader/layout/header/header.service.ts b/frontend/src/app/features/readers/ebook-reader/layout/header/header.service.ts index 696a54f4a..78dcd947d 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/header/header.service.ts +++ b/frontend/src/app/features/readers/ebook-reader/layout/header/header.service.ts @@ -9,11 +9,11 @@ import {EbookViewerSetting} from '../../../../book/model/book.model'; @Injectable() export class ReaderHeaderService { - private stateService = inject(ReaderStateService); - private sidebarService = inject(ReaderSidebarService); - private leftSidebarService = inject(ReaderLeftSidebarService); - private bookService = inject(BookService); - private location = inject(Location); + private readonly stateService = inject(ReaderStateService); + private readonly sidebarService = inject(ReaderSidebarService); + private readonly leftSidebarService = inject(ReaderLeftSidebarService); + private readonly bookService = inject(BookService); + private readonly location = inject(Location); private bookId!: number; private readonly _bookTitle = signal(''); @@ -25,10 +25,10 @@ export class ReaderHeaderService { private readonly _isCurrentCfiBookmarked = signal(false); readonly isCurrentCfiBookmarked = this._isCurrentCfiBookmarked.asReadonly(); - private _showControls = new Subject(); - private _showMetadata = new Subject(); - private _toggleFullscreen = new Subject(); - private _showShortcutsHelp = new Subject(); + private readonly _showControls = new Subject(); + private readonly _showMetadata = new Subject(); + private readonly _toggleFullscreen = new Subject(); + private readonly _showShortcutsHelp = new Subject(); private readonly _isFullscreen = signal(false); readonly isFullscreen = this._isFullscreen.asReadonly(); showControls$ = this._showControls.asObservable(); diff --git a/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.html b/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.html index 9d9101d28..bf90aa176 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.html +++ b/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.html @@ -8,7 +8,7 @@ {{ t('darkMode') }}
    ☀️ - 🌙 @@ -20,9 +20,9 @@ {{ t('fontSize') }}
    - + {{ state.fontSize }}% - +
    @@ -32,17 +32,17 @@ {{ t('lineSpacing') }}
    - + {{ state.lineHeight | number:'1.1-1' }} - +
    diff --git a/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.ts b/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.ts index 3382190f8..00396eddc 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.ts +++ b/frontend/src/app/features/readers/ebook-reader/layout/header/quick-settings.component.ts @@ -1,4 +1,4 @@ -import {Component, EventEmitter, inject, Input, Output} from '@angular/core'; +import {Component, inject, Input, output} from '@angular/core'; import {DecimalPipe} from '@angular/common'; import {TranslocoDirective} from '@jsverse/transloco'; import {ReaderStateService} from '../../state/reader-state.service'; @@ -14,12 +14,11 @@ import {EbookViewerSetting} from '../../../../book/model/book.model'; styleUrls: ['./quick-settings.component.scss'] }) export class ReaderQuickSettingsComponent { + private readonly bookService = inject(BookService); @Input() stateService!: ReaderStateService; @Input() bookId!: number; - @Output() closed = new EventEmitter(); - @Output() openFullSettings = new EventEmitter(); - - private bookService = inject(BookService); + readonly closed = output(); + readonly openFullSettings = output(); get state() { return this.stateService.state(); diff --git a/frontend/src/app/features/readers/ebook-reader/layout/panel/panel.component.html b/frontend/src/app/features/readers/ebook-reader/layout/panel/panel.component.html index 61ff1823d..5ec8b1d7d 100644 --- a/frontend/src/app/features/readers/ebook-reader/layout/panel/panel.component.html +++ b/frontend/src/app/features/readers/ebook-reader/layout/panel/panel.component.html @@ -15,21 +15,21 @@