+
diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts
index d5a28d934..53be72d59 100644
--- a/src/app/pages/chat/messages/messages.page.ts
+++ b/src/app/pages/chat/messages/messages.page.ts
@@ -282,16 +282,15 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
})
}
- viewDocument(file:any){
+ viewDocument(file:any, url?:string){
console.log(file);
- if(file.type == "file"){
- let fullUrl = "https://www.tabularium.pt" + file.title_link;
- this.fileService.viewDocumentByUrl(fullUrl);
+ if(file.type == "application/webtrix") {
+ this.openViewDocumentModal(file);
}
else{
- //this.fileService.viewDocumentByUrl(file.title_link);
- this.openViewDocumentModal(file);
+ let fullUrl = "https://www.tabularium.pt" + url;
+ this.fileService.viewDocumentByUrl(fullUrl);
}
}
diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts
index 5dd4174b3..d5f3af27b 100644
--- a/src/app/services/functions/file.service.ts
+++ b/src/app/services/functions/file.service.ts
@@ -267,8 +267,6 @@ export class FileService {
modal.onDidDismiss().then(async res=>{
const data = res.data;
- alert('HERE')
-
if(data.selected){
const loader = this.toastService.loading();
@@ -277,14 +275,9 @@ export class FileService {
console.log(res.data.selected.Id);
console.log(res.data.selected.ApplicationType);
- console.log('AQUIIIII');
-
- alert('HERE 2')
-
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
console.log(url_no_options);
- console.log('Oie');
let body = {
"message":
@@ -306,7 +299,6 @@ export class FileService {
"ApplicationId": res.data.selected.ApplicationType,
"DocId": res.data.selected.Id,
"Assunto": res.data.selected.Assunto,
- "title_link": url_no_options,
}
}
}
diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts
index 8dffd3b26..8b10e1990 100644
--- a/src/app/shared/chat/group-messages/group-messages.page.ts
+++ b/src/app/shared/chat/group-messages/group-messages.page.ts
@@ -608,15 +608,14 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
}
- 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){
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts
index 16dcb22ab..90519e085 100644
--- a/src/app/shared/chat/messages/messages.page.ts
+++ b/src/app/shared/chat/messages/messages.page.ts
@@ -242,17 +242,17 @@ 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: '',