From 571f790362dc2f914d94120797bd28e00be260a0 Mon Sep 17 00:00:00 2001 From: 4gray Date: Mon, 20 Jul 2026 21:08:23 +0200 Subject: [PATCH] fix(portal): remove redundant catalog type badges --- .../grid-list/grid-list.component.scss | 29 ------------------- .../grid-list/grid-list.component.spec.ts | 19 +++++++++--- .../grid-list/grid-list.component.ts | 10 ------- 3 files changed, 15 insertions(+), 43 deletions(-) diff --git a/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.scss b/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.scss index 4c5c04304..aead84cdc 100644 --- a/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.scss +++ b/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.scss @@ -106,35 +106,6 @@ mat-card:hover { } } -// ─── Type badge ────────────────────────────────────────────────────────────── -.type-badge { - position: absolute; - top: 6px; - left: 6px; - z-index: 1; - padding: 3px 6px; - border-radius: 5px; - font-size: 0.58rem; - font-weight: 700; - line-height: 1; - text-transform: uppercase; - letter-spacing: 0.04em; - background: rgba(0, 0, 0, 0.85); - color: #fff; - - &.live { - color: #ef5350; - } - - &.movie { - color: #42a5f5; - } - - &.series { - color: #66bb6a; - } -} - // ─── Rating badge ───────────────────────────────────────────────────────────── .rating { position: absolute; diff --git a/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.spec.ts b/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.spec.ts index 20ccfcb16..4bd36a133 100644 --- a/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.spec.ts +++ b/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.spec.ts @@ -59,7 +59,7 @@ describe('GridListComponent', () => { fixture = TestBed.createComponent(GridListComponent); }); - it('renders live logo cards with stream icons and a live badge', () => { + it('renders live logo cards with stream icons', () => { fixture.componentRef.setInput('items', [ { name: 'Live Channel', @@ -73,16 +73,27 @@ describe('GridListComponent', () => { const card = fixture.debugElement.query(By.css('mat-card')); const image = fixture.debugElement.query(By.css('.stream-icon')); - const badge = fixture.debugElement.query(By.css('.type-badge')); expect(card.nativeElement.classList).toContain('grid-card--logo'); expect(image.nativeElement.getAttribute('src')).toBe( 'channel-logo.png' ); - expect(badge.nativeElement.classList).toContain('live'); - expect(badge.nativeElement.textContent.trim()).toBe('live'); }); + it.each(['live', 'vod', 'series'] as const)( + 'does not render a redundant %s type badge in homogeneous grids', + (type) => { + fixture.componentRef.setInput('items', [ + { name: 'Catalog item', stream_icon: 'catalog-item.png' }, + ]); + fixture.componentRef.setInput('type', type); + fixture.detectChanges(); + expect( + fixture.debugElement.query(By.css('.type-badge')) + ).toBeNull(); + } + ); + it('renders the live placeholder for logo cards without artwork', () => { fixture.componentRef.setInput('items', [ { diff --git a/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.ts b/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.ts index 1b1d59565..d4be4c1a7 100644 --- a/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.ts +++ b/libs/portal/shared/ui/src/lib/components/grid-list/grid-list.component.ts @@ -106,16 +106,6 @@ function normalizeArtworkUrl(value: string | undefined): string | undefined { > @let poster = resolvePoster(i);
- @if (type()) { -
- {{ type() }} -
- } @if (poster && !hasArtworkFailed(poster)) {