always use thumbnail component for files not supported by the media viewer, and switch to themed version of thumbnail component

This commit is contained in:
Art Lowel
2025-05-08 11:26:14 +02:00
parent 70d1e499c1
commit 283b345cdc
2 changed files with 4 additions and 9 deletions

View File

@@ -16,12 +16,7 @@
</ng-container> </ng-container>
</div> </div>
<ng-template #showThumbnail> <ng-template #showThumbnail>
<ds-themed-media-viewer-image *ngIf="mediaOptions.image && mediaOptions.video" <ds-themed-thumbnail [thumbnail]="(thumbnailsRD$ | async)?.payload?.page[0]">
[image]="(thumbnailsRD$ | async)?.payload?.page[0]?._links.content.href || thumbnailPlaceholder" </ds-themed-thumbnail>
[preview]="false"
></ds-themed-media-viewer-image>
<ds-thumbnail *ngIf="!(mediaOptions.image && mediaOptions.video)"
[thumbnail]="(thumbnailsRD$ | async)?.payload?.page[0]">
</ds-thumbnail>
</ng-template> </ng-template>
</ng-container> </ng-container>

View File

@@ -139,9 +139,9 @@ describe('MediaViewerComponent', () => {
expect(mediaItem.thumbnail).toBe(null); expect(mediaItem.thumbnail).toBe(null);
}); });
it('should display a default, thumbnail', () => { it('should display a default thumbnail', () => {
const defaultThumbnail = fixture.debugElement.query( const defaultThumbnail = fixture.debugElement.query(
By.css('ds-themed-media-viewer-image') By.css('ds-themed-thumbnail')
); );
expect(defaultThumbnail.nativeElement).toBeDefined(); expect(defaultThumbnail.nativeElement).toBeDefined();
}); });