+
+
{{file.title}}
diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts
index bab89164b..15f53070d 100644
--- a/src/app/pages/chat/messages/messages.page.ts
+++ b/src/app/pages/chat/messages/messages.page.ts
@@ -2,6 +2,7 @@ import { AfterViewChecked, AfterViewInit, Component, ElementRef, OnDestroy, OnIn
import {ActivatedRoute, Router} from '@angular/router'
import { GestureController, Gesture, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { map } from 'rxjs/operators';
+import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { EventPerson } from 'src/app/models/eventperson.model';
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
import { AlertService } from 'src/app/services/alert.service';
@@ -273,8 +274,28 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
})
}
- viewDocument(url:string){
- this.fileService.viewDocumentByUrl(url);
+ 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);
+ }
+ }
+
+ async openViewDocumentModal(file:any){
+ const modal = await this.modalController.create({
+ component: ViewDocumentPage,
+ componentProps: {
+ file: file,
+ },
+ cssClass: 'modal modal-desktop',
+ backdropDismiss: false
+ });
+ await modal.present();
+ modal.onDidDismiss();
}
getChatMembers() {
diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts
index 7c5ef6289..63f84472e 100644
--- a/src/app/services/functions/file.service.ts
+++ b/src/app/services/functions/file.service.ts
@@ -174,8 +174,8 @@ export class FileService {
"text": "",
"title_link": this.capturedImage,
"title_link_download": true,
- "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
"message_link": this.capturedImage,
+ "type": "file"
}],
"file":{
"name": this.capturedImageTitle,
@@ -233,6 +233,7 @@ export class FileService {
"title_link_download": true,
//"thumb_url": "assets/images/webtrix-logo.png",
"message_link": url_no_options,
+ "type": "webtrix"
}],
"file":{
"name": res.data.selected.Assunto,
@@ -252,7 +253,7 @@ export class FileService {
}
viewDocumentByUrl(url) {
- const browser = this.iab.create(url,"_parent");
+ const browser = this.iab.create(url,"_blank");
browser.show();
}
}
diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html
index e8a8bc4ab..4d6b615d8 100644
--- a/src/app/shared/chat/group-messages/group-messages.page.html
+++ b/src/app/shared/chat/group-messages/group-messages.page.html
@@ -59,10 +59,11 @@
-
-
+
+
+
{{file.title}}
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 3e4a60242..fb6883e1f 100644
--- a/src/app/shared/chat/group-messages/group-messages.page.ts
+++ b/src/app/shared/chat/group-messages/group-messages.page.ts
@@ -17,6 +17,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from 'src/app/services/processes.service';
import { FileService } from 'src/app/services/functions/file.service';
+import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
/*
@@ -607,8 +608,28 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
}
- viewDocument(url:string){
- this.fileService.viewDocumentByUrl(url);
+ 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);
+ }
+ }
+
+ async openViewDocumentModal(file:any){
+ const modal = await this.modalController.create({
+ component: ViewDocumentPage,
+ componentProps: {
+ file: file,
+ },
+ cssClass: 'modal modal-desktop',
+ backdropDismiss: false
+ });
+ await modal.present();
+ modal.onDidDismiss();
}
async _openChatOptions() {
diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html
index 594c4cb19..e8691256f 100644
--- a/src/app/shared/chat/messages/messages.page.html
+++ b/src/app/shared/chat/messages/messages.page.html
@@ -51,7 +51,7 @@
-
+
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts
index 842086692..05c97f4d4 100644
--- a/src/app/shared/chat/messages/messages.page.ts
+++ b/src/app/shared/chat/messages/messages.page.ts
@@ -15,6 +15,7 @@ import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
import { TimeService } from 'src/app/services/functions/time.service';
import { FileService } from 'src/app/services/functions/file.service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
@Component({
selector: 'app-messages',
@@ -241,14 +242,28 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
}
- viewDocument(url:string, documentType?:string){
- if(documentType == "application/webtrix"){
- this.fileService.viewDocumentByUrl(url);
- }
- else{
- let fullUrl = "https://www.tabularium.pt" + url;
+ 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);
+ }
+ }
+
+ async openViewDocumentModal(file:any){
+ const modal = await this.modalController.create({
+ component: ViewDocumentPage,
+ componentProps: {
+ file: file,
+ },
+ cssClass: 'modal modal-desktop',
+ backdropDismiss: false
+ });
+ await modal.present();
+ modal.onDidDismiss();
}
getChatMembers() {
diff --git a/src/global.scss b/src/global.scss
index a837a721a..061cc4197 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -1175,6 +1175,10 @@ ngx-mat-datetime-content{
.powerpoint-icon{
color: #d24726;
}
+.menu-icon{
+ color: #42b9fe;
+ padding: 0 5px 0 5px;
+}
@media only screen and (min-width: 665px) {
.loading-blocker {