mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5027] Fix APS rendition (#5285)
* fix APS rendition * fix unit * fix unit
This commit is contained in:
@@ -194,7 +194,7 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
emitDocumentContent(content: any) {
|
emitDocumentContent(content: any) {
|
||||||
this.activitiContentService.getFileRawContent(content.id).subscribe(
|
this.activitiContentService.getContentPreview(content.id).subscribe(
|
||||||
(blob: Blob) => {
|
(blob: Blob) => {
|
||||||
content.contentBlob = blob;
|
content.contentBlob = blob;
|
||||||
this.attachmentClick.emit(content);
|
this.attachmentClick.emit(content);
|
||||||
|
@@ -32,6 +32,7 @@ describe('TaskAttachmentList', () => {
|
|||||||
let mockAttachment: any;
|
let mockAttachment: any;
|
||||||
let deleteContentSpy: jasmine.Spy;
|
let deleteContentSpy: jasmine.Spy;
|
||||||
let getFileRawContentSpy: jasmine.Spy;
|
let getFileRawContentSpy: jasmine.Spy;
|
||||||
|
let getContentPreviewSpy: jasmine.Spy;
|
||||||
let disposableSuccess: any;
|
let disposableSuccess: any;
|
||||||
|
|
||||||
setupTestBed({
|
setupTestBed({
|
||||||
@@ -87,6 +88,8 @@ describe('TaskAttachmentList', () => {
|
|||||||
deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(of({ successCode: true }));
|
deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(of({ successCode: true }));
|
||||||
|
|
||||||
const blobObj = new Blob();
|
const blobObj = new Blob();
|
||||||
|
|
||||||
|
getContentPreviewSpy = spyOn(service, 'getContentPreview').and.returnValue(of(blobObj));
|
||||||
getFileRawContentSpy = spyOn(service, 'getFileRawContent').and.returnValue(of(blobObj));
|
getFileRawContentSpy = spyOn(service, 'getFileRawContent').and.returnValue(of(blobObj));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -144,7 +147,7 @@ describe('TaskAttachmentList', () => {
|
|||||||
it('emit document when a user wants to view the document', () => {
|
it('emit document when a user wants to view the document', () => {
|
||||||
component.emitDocumentContent(mockAttachment.data[1]);
|
component.emitDocumentContent(mockAttachment.data[1]);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getFileRawContentSpy).toHaveBeenCalled();
|
expect(getContentPreviewSpy).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('download document when a user wants to view the document', () => {
|
it('download document when a user wants to view the document', () => {
|
||||||
|
@@ -204,7 +204,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
emitDocumentContent(content: any) {
|
emitDocumentContent(content: any) {
|
||||||
this.activitiContentService.getFileRawContent(content.id).subscribe(
|
this.activitiContentService.getContentPreview(content.id).subscribe(
|
||||||
(blob: Blob) => {
|
(blob: Blob) => {
|
||||||
content.contentBlob = blob;
|
content.contentBlob = blob;
|
||||||
this.attachmentClick.emit(content);
|
this.attachmentClick.emit(content);
|
||||||
|
Reference in New Issue
Block a user