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:05:37 +02:00
parent c222c446b5
commit 9e8c0dc262
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-media-viewer-image *ngIf="mediaOptions.image && mediaOptions.video" <ds-thumbnail [thumbnail]="(thumbnailsRD$ | async)?.payload?.page[0]">
[image]="(thumbnailsRD$ | async)?.payload?.page[0]?._links.content.href || thumbnailPlaceholder"
[preview]="false"
></ds-media-viewer-image>
<ds-thumbnail *ngIf="!(mediaOptions.image && mediaOptions.video)"
[thumbnail]="(thumbnailsRD$ | async)?.payload?.page[0]">
</ds-thumbnail> </ds-thumbnail>
</ng-template> </ng-template>
</ng-container> </ng-container>

View File

@@ -55,7 +55,7 @@ describe('MediaViewerComponent', () => {
'dc.title': [ 'dc.title': [
{ {
language: null, language: null,
value: 'test_word.docx', value: 'test_image.jpg',
}, },
], ],
}, },
@@ -150,9 +150,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-media-viewer-image'), By.css('ds-thumbnail')
); );
expect(defaultThumbnail.nativeElement).toBeDefined(); expect(defaultThumbnail.nativeElement).toBeDefined();
}); });