[ACS-8841] Fix viewer rendering for doc files (#10251)

* [ACS-8841] fix viewer rendering for doc files

* [ACS-8841] fix test
This commit is contained in:
Mykyta Maliarchuk
2024-09-27 14:33:45 +02:00
committed by GitHub
parent da44b4cee0
commit 28f51424cf
2 changed files with 4 additions and 4 deletions

View File

@@ -478,7 +478,7 @@ describe('AlfrescoViewerComponent', () => {
}); });
describe('mimeType', () => { describe('mimeType', () => {
it('should set mime type based on nodeData content', async () => { it('should set mime type based on renditionMimeType rather then nodeData', async () => {
const defaultNode: Node = { const defaultNode: Node = {
id: 'mock-id', id: 'mock-id',
name: 'Mock Node', name: 'Mock Node',
@@ -496,7 +496,7 @@ describe('AlfrescoViewerComponent', () => {
spyOn(renditionService, 'getNodeRendition').and.returnValue( spyOn(renditionService, 'getNodeRendition').and.returnValue(
Promise.resolve({ Promise.resolve({
url: '', url: '',
mimeType: '' mimeType: 'application/pdf'
}) })
); );
@@ -510,7 +510,7 @@ describe('AlfrescoViewerComponent', () => {
} as Node); } as Node);
await fixture.whenStable(); await fixture.whenStable();
expect(component.mimeType).toEqual('application/msWord'); expect(component.mimeType).toEqual('application/pdf');
}); });
}); });

View File

@@ -346,7 +346,7 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit, OnDestroy {
const nodeMimeType = nodeData?.content?.mimeType; const nodeMimeType = nodeData?.content?.mimeType;
const renditionMimeType = nodeRendition.mimeType; const renditionMimeType = nodeRendition.mimeType;
mimeType = nodeMimeType || renditionMimeType; mimeType = renditionMimeType || nodeMimeType;
} }
} else if (viewerType === 'media') { } else if (viewerType === 'media') {
this.tracks = await this.renditionService.generateMediaTracksRendition(this.nodeId); this.tracks = await this.renditionService.generateMediaTracksRendition(this.nodeId);