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

View File

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