refactor(ui): new component library (#1740)
This commit is contained in:
+2
-4
@@ -79,11 +79,9 @@
|
||||
@case ('rating') {
|
||||
<span class="rating-wrapper" [title]="cell.rating === null ? '' : cell.display">
|
||||
<app-rating
|
||||
[value]="cell.rating"
|
||||
readonly
|
||||
[value]="cell.rating ?? 0"
|
||||
[ariaLabel]="cell.rating === null ? t('book.table.noRating') : t('book.table.ratingOutOf', {rating: cell.display, max: 5})" />
|
||||
@if (cell.rating !== null) {
|
||||
<span class="rating-value">({{ cell.display }})</span>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@case ('clickable') {
|
||||
|
||||
-5
@@ -162,11 +162,6 @@
|
||||
min-width: 6.125rem;
|
||||
}
|
||||
|
||||
.rating-value {
|
||||
color: inherit;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.cell-link {
|
||||
overflow: hidden;
|
||||
color: var(--color-primary-text);
|
||||
|
||||
+2
-1
@@ -85,7 +85,8 @@ describe('BookTableRowComponent', () => {
|
||||
expect(links[0]?.textContent?.trim()).toBe('Alpha');
|
||||
expect(links[0]?.getAttribute('href')).toBe('/book/1');
|
||||
expect(links[1]?.textContent?.trim()).toBe('Test Author');
|
||||
expect(rating?.textContent).toContain('(4.2)');
|
||||
expect(rating?.querySelector('app-rating')).toBeTruthy();
|
||||
expect(rating?.getAttribute('title')).toBe('4.2');
|
||||
expect(cells[3]?.textContent?.trim()).toBe('1.5 MB');
|
||||
});
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ import {Book, BookMetadata} from '../../../model/book.model';
|
||||
import {ReadStatusHelper} from '../../../helpers/read-status.helper';
|
||||
import {UrlHelperService} from '../../../../../shared/service/url-helper.service';
|
||||
import {CoverPlaceholderComponent} from '../../../../../shared/components/cover-generator/cover-generator.component';
|
||||
import {RatingComponent} from '../../../../../shared/components/rating/rating.component';
|
||||
import {AppRatingComponent} from '../../../../../shared/ui/rating/app-rating.component';
|
||||
import {RATING_FIELDS, isMetadataFullyLocked} from './book-table.helpers';
|
||||
|
||||
interface BookTableCellLink {
|
||||
@@ -89,7 +89,7 @@ const CLICKABLE_FILTER_KEYS: Record<string, string> = {
|
||||
CoverPlaceholderComponent,
|
||||
FormsModule,
|
||||
NgClass,
|
||||
RatingComponent,
|
||||
AppRatingComponent,
|
||||
RouterLink,
|
||||
Tooltip,
|
||||
TranslocoDirective,
|
||||
|
||||
Reference in New Issue
Block a user