mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
GitHub
parent
da44b4cee0
commit
28f51424cf
@@ -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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user