Upgrade from Angular 20 to 21 + update other dependencies (#1916)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+2
-3
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
|
||||
import { Select } from 'primeng/select';
|
||||
@@ -29,14 +29,13 @@ interface UploadingFile {
|
||||
selector: 'app-additional-file-uploader',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
Select,
|
||||
Button,
|
||||
FileUpload,
|
||||
Badge,
|
||||
Tooltip
|
||||
],
|
||||
],
|
||||
templateUrl: './additional-file-uploader.component.html',
|
||||
styleUrls: ['./additional-file-uploader.component.scss']
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, DestroyRef, inject, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {BookReview, BookReviewService} from './book-review-service';
|
||||
import {ProgressSpinner} from 'primeng/progressspinner';
|
||||
@@ -16,7 +16,7 @@ import {AppSettingsService} from '../../../../shared/service/app-settings.servic
|
||||
@Component({
|
||||
selector: 'app-book-reviews',
|
||||
standalone: true,
|
||||
imports: [CommonModule, ProgressSpinner, Rating, Tag, Button, FormsModule, Tooltip],
|
||||
imports: [ProgressSpinner, Rating, Tag, Button, FormsModule, Tooltip],
|
||||
templateUrl: './book-reviews.component.html',
|
||||
styleUrl: './book-reviews.component.scss'
|
||||
})
|
||||
|
||||
+90
-86
@@ -1,77 +1,77 @@
|
||||
@if (filteredBooks$ | async; as books) {
|
||||
<div class="rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]">
|
||||
<p-tabs [value]="tab" lazy="true" scrollable>
|
||||
<p-tablist>
|
||||
<p-tab value="view">
|
||||
<i [class]="'pi pi-crown'"></i>
|
||||
Series Details
|
||||
</p-tab>
|
||||
</p-tablist>
|
||||
<p-tabpanels class="tabpanels-responsive overflow-auto">
|
||||
<p-tabpanel value="view">
|
||||
<div class="rounded-xl overflow-hidden border-[1px] border-solid border-[var(--p-content-border-color)]">
|
||||
<p-tabs [value]="tab" lazy="true" scrollable>
|
||||
<p-tablist>
|
||||
<p-tab value="view">
|
||||
<i [class]="'pi pi-crown'"></i>
|
||||
Series Details
|
||||
</p-tab>
|
||||
</p-tablist>
|
||||
<p-tabpanels class="tabpanels-responsive overflow-auto">
|
||||
<p-tabpanel value="view">
|
||||
|
||||
@if (books[0]; as firstBook) {
|
||||
<div class="flex flex-col justify-between flex-grow">
|
||||
<div class="space-y-4 ">
|
||||
@if (books[0]; as firstBook) {
|
||||
<div class="flex flex-col justify-between flex-grow">
|
||||
<div class="space-y-4 ">
|
||||
|
||||
<!-- <div class="flex items-start justify-between"> -->
|
||||
<div class="flex flex-col text-center gap-4 md:text-left w-full">
|
||||
<!-- <div class="flex items-start justify-between"> -->
|
||||
<div class="flex flex-col text-center gap-4 md:text-left w-full">
|
||||
|
||||
<div class="flex flex-col items-center md:items-start gap-1">
|
||||
<div class="flex items-center gap-2 justify-center md:justify-start flex-wrap text-center md:text-left">
|
||||
<h2 class="text-2xl md:text-3xl font-extrabold leading-tight">
|
||||
{{ seriesTitle$ | async }}
|
||||
</h2>
|
||||
<div class="flex flex-col items-center md:items-start gap-1">
|
||||
<div class="flex items-center gap-2 justify-center md:justify-start flex-wrap text-center md:text-left">
|
||||
<h2 class="text-2xl md:text-3xl font-extrabold leading-tight">
|
||||
{{ seriesTitle$ | async }}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<p class="text-lg">
|
||||
@for (author of firstBook.metadata?.authors; track $index; let isLast = $last) {
|
||||
<a class="hover:underline dark:text-blue-400 cursor-pointer" (click)="goToAuthorBooks(author)">
|
||||
{{ author }}
|
||||
</a>
|
||||
@if (!isLast) {
|
||||
<span>, </span>
|
||||
}
|
||||
}
|
||||
</p>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<p class="text-lg">
|
||||
@for (author of firstBook.metadata?.authors; track $index; let isLast = $last) {
|
||||
<a class="hover:underline dark:text-blue-400 cursor-pointer" (click)="goToAuthorBooks(author)">
|
||||
{{ author }}
|
||||
</a>
|
||||
@if (!isLast) {
|
||||
<span>, </span>
|
||||
}
|
||||
}
|
||||
</p>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
@if (firstBook.metadata?.categories?.length) {
|
||||
<div class="overflow-x-auto scrollbar-hide max-w-7xl pt-2 md:pt-0">
|
||||
<div class="flex gap-2 w-max max-w-[1150px]">
|
||||
@for (category of firstBook.metadata?.categories; track category) {
|
||||
<a (click)="goToCategory(category)" class="shrink-0 no-underline cursor-pointer">
|
||||
<p-tag [value]="category"></p-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="px-1 md:px-0">
|
||||
<div
|
||||
class="grid md:grid-cols-5 p-3 gap-y-2.5 text-sm pt-2 md:pt-4 pb-2 text-gray-300 md:min-w-[60rem] md:max-w-[100rem]">
|
||||
<p>
|
||||
<span class="font-bold">Publisher: </span>
|
||||
@if (firstBook.metadata?.publisher; as publisher) {
|
||||
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(publisher)">
|
||||
{{publisher}}
|
||||
</span>
|
||||
} @else {
|
||||
<span>-</span>
|
||||
}
|
||||
</p>
|
||||
<p><strong>Years:</strong> {{ (yearsRange$ | async) || '-' }}</p>
|
||||
<p><strong>Number of books:</strong> {{ books.length || 0}}</p>
|
||||
<p><strong>Language:</strong> {{ firstBook.metadata?.language || "-"}}</p>
|
||||
<p><strong>Read Status: </strong>
|
||||
@if (firstBook.metadata?.categories?.length) {
|
||||
<div class="overflow-x-auto scrollbar-hide max-w-7xl pt-2 md:pt-0">
|
||||
<div class="flex gap-2 w-max max-w-[1150px]">
|
||||
@for (category of firstBook.metadata?.categories; track category) {
|
||||
<a (click)="goToCategory(category)" class="shrink-0 no-underline cursor-pointer">
|
||||
<p-tag [value]="category"></p-tag>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="px-1 md:px-0">
|
||||
<div
|
||||
class="grid md:grid-cols-5 p-3 gap-y-2.5 text-sm pt-2 md:pt-4 pb-2 text-gray-300 md:min-w-[60rem] md:max-w-[100rem]">
|
||||
<p>
|
||||
<span class="font-bold">Publisher: </span>
|
||||
@if (firstBook.metadata?.publisher; as publisher) {
|
||||
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(publisher)">
|
||||
{{publisher}}
|
||||
</span>
|
||||
} @else {
|
||||
<span>-</span>
|
||||
}
|
||||
</p>
|
||||
<p><strong>Years:</strong> {{ (yearsRange$ | async) || '-' }}</p>
|
||||
<p><strong>Number of books:</strong> {{ books.length || 0}}</p>
|
||||
<p><strong>Language:</strong> {{ firstBook.metadata?.language || "-"}}</p>
|
||||
<p><strong>Read Status: </strong>
|
||||
@let s = seriesReadStatus$ | async;
|
||||
<span class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
|
||||
[ngClass]="getStatusSeverityClass(s || 'UNREAD')">
|
||||
{{ getStatusLabel(s) }}
|
||||
@if (s === 'PARTIALLY_READ') {
|
||||
({{ seriesReadProgress$ | async }})
|
||||
}
|
||||
({{ seriesReadProgress$ | async }})
|
||||
}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
@@ -82,45 +82,49 @@
|
||||
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }"
|
||||
class="transition-all duration-300 overflow-hidden description-container">
|
||||
<div class="readonly-editor px-2"
|
||||
[innerHTML]="(firstDescription$ | async) || 'No description available.'"></div>
|
||||
[innerHTML]="(firstDescription$ | async) || 'No description available.'"></div>
|
||||
</div>
|
||||
@let desc = firstDescription$ | async;
|
||||
@if ((desc?.length ?? 0) > 500) {
|
||||
<p-button [label]="isExpanded ? 'Show less' : 'Show more'"
|
||||
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" iconPos="right" size="small" text
|
||||
(click)="toggleExpand()">
|
||||
</p-button>
|
||||
<p-button [label]="isExpanded ? 'Show less' : 'Show more'"
|
||||
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" iconPos="right" size="small" text
|
||||
(click)="toggleExpand()">
|
||||
</p-button>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="grid series-items-grid overflow-y-auto" #Container
|
||||
[ngStyle]="{'grid-template-columns': 'repeat(auto-fill, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
||||
<div class="grid-item" *ngFor="let book of books; let i = index"
|
||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||
<app-book-card [index]="i" [book]="book" [isCheckboxEnabled]="false" [isSelected]="false"
|
||||
[isSeriesCollapsed]="false">
|
||||
</app-book-card>
|
||||
</div>
|
||||
<div *ngIf="books.length === 0" class="empty-state">No books found for this series.</div>
|
||||
@for (book of books; track book; let i = $index) {
|
||||
<div class="grid-item"
|
||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||
<app-book-card [index]="i" [book]="book" [isCheckboxEnabled]="false" [isSelected]="false"
|
||||
[isSeriesCollapsed]="false">
|
||||
</app-book-card>
|
||||
</div>
|
||||
}
|
||||
@if (books.length === 0) {
|
||||
<div class="empty-state">No books found for this series.</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
</p-tabpanel>
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</p-tabpanel>
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</div>
|
||||
|
||||
} @else {
|
||||
<div class="flex flex-col justify-center items-center h-full gap-4">
|
||||
<p-progressSpinner strokeWidth="4" fill="transparent" animationDuration=".8s">
|
||||
</p-progressSpinner>
|
||||
<p style="color: var(--primary-color);">
|
||||
Loading series details...
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-col justify-center items-center h-full gap-4">
|
||||
<p-progressSpinner strokeWidth="4" fill="transparent" animationDuration=".8s">
|
||||
</p-progressSpinner>
|
||||
<p style="color: var(--primary-color);">
|
||||
Loading series details...
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, inject, ViewChild } from "@angular/core";
|
||||
import { FormsModule } from "@angular/forms";
|
||||
import { Button } from "primeng/button";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { AsyncPipe, NgClass, NgFor, NgIf, NgStyle } from "@angular/common";
|
||||
import { AsyncPipe, NgClass, NgStyle } from "@angular/common";
|
||||
import { map, filter, switchMap } from "rxjs/operators";
|
||||
import { Observable, combineLatest } from "rxjs";
|
||||
import { Book, ReadStatus } from "../../model/book.model";
|
||||
@@ -25,8 +25,6 @@ import { Router } from "@angular/router";
|
||||
AsyncPipe,
|
||||
Button,
|
||||
FormsModule,
|
||||
NgIf,
|
||||
NgFor,
|
||||
NgStyle,
|
||||
NgClass,
|
||||
BookCardComponent,
|
||||
@@ -37,9 +35,8 @@ import { Router } from "@angular/router";
|
||||
TabPanels,
|
||||
TabPanel,
|
||||
Tag,
|
||||
|
||||
VirtualScrollerModule,
|
||||
],
|
||||
VirtualScrollerModule
|
||||
],
|
||||
})
|
||||
export class SeriesPageComponent {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user