Fix magic shelf physical book filter, shorten badge, and punch up heart icon (#2888)
This commit is contained in:
+1
-1
@@ -365,7 +365,7 @@
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.book-type-physical {
|
||||
.book-type-phy {
|
||||
background: var(--book-type-physical-color);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
+1
-1
@@ -800,7 +800,7 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
getDisplayFormat(): string | null {
|
||||
if (!this.book?.primaryFile) {
|
||||
return 'PHYSICAL';
|
||||
return 'PHY';
|
||||
}
|
||||
if (this.forceEbookMode && this.book.primaryFile?.bookType === 'AUDIOBOOK') {
|
||||
const ebookType = this.getEbookType(this.book);
|
||||
|
||||
+7
-3
@@ -677,9 +677,13 @@ describe('BookRuleEvaluatorService', () => {
|
||||
expect(service.evaluateGroup(book, rule('audiobookDuration', 'is_empty', null))).toBe(true);
|
||||
});
|
||||
|
||||
it('should filter by isPhysical', () => {
|
||||
const book = createBook({isPhysical: true});
|
||||
expect(service.evaluateGroup(book, rule('isPhysical', 'equals', true))).toBe(true);
|
||||
it('should filter by isPhysical with string value from UI', () => {
|
||||
const physical = createBook({isPhysical: true});
|
||||
const digital = createBook({isPhysical: false});
|
||||
expect(service.evaluateGroup(physical, rule('isPhysical', 'equals', 'true'))).toBe(true);
|
||||
expect(service.evaluateGroup(digital, rule('isPhysical', 'equals', 'true'))).toBe(false);
|
||||
expect(service.evaluateGroup(digital, rule('isPhysical', 'equals', 'false'))).toBe(true);
|
||||
expect(service.evaluateGroup(physical, rule('isPhysical', 'not_equals', 'true'))).toBe(false);
|
||||
});
|
||||
|
||||
it('should filter by lubimyczytacRating', () => {
|
||||
|
||||
@@ -30,6 +30,7 @@ export class BookRuleEvaluatorService {
|
||||
const normalize = (val: unknown): unknown => {
|
||||
if (val === null || val === undefined) return val;
|
||||
if (val instanceof Date) return val;
|
||||
if (typeof val === 'boolean') return String(val);
|
||||
if (typeof val === 'string') {
|
||||
const date = new Date(val);
|
||||
if (!isNaN(date.getTime())) return date;
|
||||
|
||||
Reference in New Issue
Block a user