Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into pdfviewer

This commit is contained in:
Peter Maquiran
2021-10-07 09:43:31 +01:00
25 changed files with 414 additions and 90 deletions
@@ -59,10 +59,11 @@
<div>
<div class="file">
<!-- <canvas id="pdf_canvas"></canvas> -->
<div class="file-details add-ellipsis" *ngIf="msg.file">
<span (click)="viewDocument(file.title_link)" class="cursor-pointer">
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
</span>
<ion-label class="file-title">{{file.title}}</ion-label>
@@ -126,9 +127,31 @@
<ion-footer>
<div class="container width-100 d-flex">
<div>
<button class="btn-no-color" (click)="openSendGroupMessageOptions()">
<!-- <button class="btn-no-color" (click)="openSendGroupMessageOptions()">
<ion-icon class="chat-icon-options" src="assets/images/icons-add-new-event.svg"></ion-icon>
</button>
</button> -->
<ion-fab horizontal="start" vertical="bottom" slot="fixed">
<ion-fab-button color="light" size="small">
<ion-icon name="add"></ion-icon>
</ion-fab-button>
<ion-fab-list side="top">
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
</div>
<div class="width-80">
<ion-item class="ion-no-padding type-message" lines="none">
@@ -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';
/*
@@ -89,7 +90,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
ngOnChanges(changes: SimpleChanges): void {
//this.getRoomInfo();
this.getRoomInfo();
//this.scrollToBottom();
}
@@ -607,8 +608,48 @@ 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();
}
takePicture(){
this.fileService.addCameraPictureToChat(this.roomId);
}
addImage(){
this.fileService.addPictureToChat(this.roomId);
}
addFile(){
this.fileService.addDocumentToChat(this.roomId);
}
addFileWebtrix(){
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
}
bookMeeting(){
let data = {
roomId: this.roomId,
members: this.members
}
this.openNewEventPage.emit(data);
}
async _openChatOptions() {
@@ -51,8 +51,8 @@
<div>
<div class="file">
<!-- <canvas id="pdf_canvas"></canvas> -->
<div class="file-details add-ellipsis" *ngIf="msg.file">
<span *ngIf="msg.file.type" (click)="viewDocument(file.title_link)" class="cursor-pointer">
<div (click)="viewDocument(file)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
@@ -99,9 +99,33 @@
<ion-footer>
<div class="container width-100 d-flex">
<div>
<button class="btn-no-color" (click)="openSendMessageOptions()">
<!-- <button class="btn-no-color" (click)="openSendMessageOptions()">
<ion-icon class="chat-icon-options" src="assets/images/icons-add-new-event.svg"></ion-icon>
</button>
</button> -->
<ion-fab horizontal="start" vertical="bottom" slot="fixed">
<ion-fab-button color="light" size="small">
<ion-icon name="add"></ion-icon>
</ion-fab-button>
<ion-fab-list side="top">
<ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light">
<ion-icon src="assets/icon/webtrix.svg"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon>
</ion-fab-button>
<ion-fab-button (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon>
</ion-fab-button>
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon>
</ion-fab-button>
</ion-fab-list>
</ion-fab>
</div>
<div class="width-80">
<ion-item class="ion-no-padding type-message" lines="none">
+47 -2
View File
@@ -14,6 +14,8 @@ import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
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',
@@ -68,6 +70,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private timeService: TimeService,
private fileService: FileService,
private gestureController: GestureController,
private http:HttpClient,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
@@ -239,8 +242,28 @@ export class MessagesPage implements OnInit, OnChanges, 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() {
@@ -356,6 +379,28 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
takePicture(){
this.fileService.addCameraPictureToChat(this.roomId);
}
addImage(){
this.fileService.addPictureToChat(this.roomId);
}
addFile(){
this.fileService.addDocumentToChat(this.roomId);
}
addFileWebtrix(){
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
}
bookMeeting(){
let data = {
roomId: this.roomId,
members: this.members
}
this.openNewEventPage.emit(data);
}
async _openChatOptions() {
const enterAnimation = (baseEl: any) => {