mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
Integration beetwen Viewer and Activiti Content (#1765)
* Provide a FormService event when you click on the uploaded content * Add a formContentClick event to the Form component * Provide a way to pass Blob to viewer * Provide a way to use the viewer using a Blob - Fix the pdf viewer - Fix the image viewer - Fix the media viewer * Update the viewer documentation * Use the ContentService provided by the core * Fix and improve unit test * Add unit test blob viewer
This commit is contained in:
committed by
Eugenio Romano
parent
8132f79e97
commit
fde08bb573
@@ -94,8 +94,15 @@ export class ActivitiContent implements OnChanges {
|
||||
}
|
||||
|
||||
openViewer(content: ContentLinkModel): void {
|
||||
this.contentClick.emit(content);
|
||||
this.logService.info('Content clicked' + content.id);
|
||||
this.formService.getFileRawContent(content.id).subscribe(
|
||||
(blob: Blob) => {
|
||||
content.contentBlob = blob;
|
||||
this.contentClick.emit(content);
|
||||
this.logService.info('Content clicked' + content.id);
|
||||
this.formService.formContentClicked.next(content);
|
||||
},
|
||||
error => this.logService.error(error)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,6 +21,7 @@ import { EcmModelService } from './../services/ecm-model.service';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { NodeService } from './../services/node.service';
|
||||
import { FormModel, FormOutcomeModel, FormValues, FormFieldModel, FormOutcomeEvent } from './widgets/core/index';
|
||||
import { ContentLinkModel } from './widgets/core/content-link.model';
|
||||
import { FormEvent, FormErrorEvent } from './../events/index';
|
||||
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
@@ -134,6 +135,9 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
@Output()
|
||||
formCompleted: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
||||
|
||||
@Output()
|
||||
formContentClicked: EventEmitter<ContentLinkModel> = new EventEmitter<ContentLinkModel>();
|
||||
|
||||
@Output()
|
||||
formLoaded: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
||||
|
||||
@@ -202,6 +206,10 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.formService.formContentClicked.subscribe((content: ContentLinkModel) => {
|
||||
this.formContentClicked.emit(content);
|
||||
});
|
||||
|
||||
if (this.nodeId) {
|
||||
this.loadFormForEcmNode();
|
||||
} else {
|
||||
|
@@ -29,6 +29,7 @@ export class ContentLinkModel {
|
||||
simpleType: string;
|
||||
thumbnailUrl: string;
|
||||
contentRawUrl: string;
|
||||
contentBlob: Blob;
|
||||
thumbnailStatus: string;
|
||||
|
||||
constructor(obj?: any) {
|
||||
|
Reference in New Issue
Block a user