+
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts
index 3b20a5099..90519e085 100644
--- a/src/app/shared/chat/messages/messages.page.ts
+++ b/src/app/shared/chat/messages/messages.page.ts
@@ -242,28 +242,64 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
}
- viewDocument(file:any){
- if(file.type == "file"){
- let fullUrl = "https://www.tabularium.pt" + file.title_link;
- this.fileService.viewDocumentByUrl(fullUrl);
- }
- else{
- this.fileService.viewDocumentByUrl(file.title_link);
- //this.openViewDocumentModal(file);
- }
+ viewDocument(file:any, url?:string){
+ if(file.type == "application/webtrix") {
+ this.openViewDocumentModal(file);
+ }
+ else{
+ let fullUrl = "https://www.tabularium.pt" + url;
+ this.fileService.viewDocumentByUrl(fullUrl);
+ }
}
+
async openViewDocumentModal(file:any){
+ let task = {
+ serialNumber: '',
+ taskStartDate: '',
+ isEvent: true,
+ workflowInstanceDataFields: {
+ FolderID: '',
+ Subject: file.Assunto,
+ SourceSecFsID: file.ApplicationId,
+ SourceType: 'DOC',
+ SourceID: file.DocId,
+ DispatchNumber: ''
+ }
+ }
+
+ let doc = {
+ "Id": "",
+ "ParentId": "",
+ "Source": 1,
+ "ApplicationId": file.ApplicationId,
+ "CreateDate": "",
+ "Data": null,
+ "Description":"",
+ "Link": null,
+ "SourceId": file.DocId,
+ "SourceName": file.Assunto,
+ "Stakeholders": "",
+ }
+
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
- file: file,
+ trustedUrl: '',
+ file: {
+ title: file.Assunto,
+ url: '',
+ title_link: '',
+ },
+ Document: doc,
+ applicationId: file.ApplicationId,
+ docId: file.DocId,
+ folderId: '',
+ task: task
},
- cssClass: 'modal modal-desktop',
- backdropDismiss: false
+ cssClass: 'modal modal-desktop'
});
await modal.present();
- modal.onDidDismiss();
}
getChatMembers() {