mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Fix merge
This commit is contained in:
@@ -28,13 +28,14 @@ import { EmptyChatPageModule } from 'src/app/shared/chat/empty-chat/empty-chat.m
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { NewEventPageModule } from 'src/app/shared/agenda/new-event/new-event.module';
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
|
||||
FontAwesomeModule,
|
||||
PipesModule,
|
||||
ChatPageRoutingModule,
|
||||
RouterModule,
|
||||
|
||||
@@ -67,6 +67,16 @@
|
||||
</div>
|
||||
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
|
||||
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
|
||||
<ion-label *ngIf="dm.lastMessage.file">
|
||||
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
|
||||
<span> {{dm.lastMessage.file.name}}</span>
|
||||
</ion-label>
|
||||
<ion-label *ngIf="dm.lastMessage.attachments">
|
||||
<div *ngIf="dm.lastMessage.attachments[0].image_url">
|
||||
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
|
||||
<span> Fotografia</span>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,8 +98,18 @@
|
||||
</div>
|
||||
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{showDateDuration(group._updatedAt)}}</div>
|
||||
</div>
|
||||
<div class="item-description" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
|
||||
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
|
||||
<div class="item-description d-flex align-items-center" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
|
||||
<div class="item-message">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
|
||||
<div class="item-files" *ngIf="group.lastMessage.file">
|
||||
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
|
||||
<span> {{group.lastMessage.file.name}}</span>
|
||||
</div>
|
||||
<div class="item-files" *ngIf="group.lastMessage.attachments">
|
||||
<div *ngIf="group.lastMessage.attachments[0].image_url">
|
||||
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
|
||||
<span> Fotografia</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,7 +86,7 @@ ion-content{
|
||||
}
|
||||
}
|
||||
.item-content{
|
||||
width: 317px;
|
||||
//width: 317px;
|
||||
float:right;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ ion-content{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.item-title{
|
||||
width: 80%;
|
||||
width: calc(100% - 75px);
|
||||
float: left;
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
@@ -105,7 +105,7 @@ ion-content{
|
||||
color: #fff;
|
||||
}
|
||||
.item-date{
|
||||
width: 20%;
|
||||
width: 75px;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
color: #797979;
|
||||
@@ -114,9 +114,19 @@ ion-content{
|
||||
.item-date-active{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item-description{
|
||||
font-size: 13px;
|
||||
color: #000;
|
||||
overflow: auto;
|
||||
|
||||
.item-message{
|
||||
float: left;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.item-files{
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
.item-description-active{
|
||||
color: #fff;
|
||||
@@ -130,7 +140,6 @@ ion-content{
|
||||
@media only screen and (min-width: 701px) {
|
||||
.main-content{
|
||||
|
||||
|
||||
.aside-wrapper{
|
||||
width: 35%;
|
||||
border-right: 1px solid #d8d8d8;
|
||||
|
||||
@@ -280,8 +280,6 @@ hideRefreshButton(){
|
||||
}
|
||||
|
||||
openGroupMessagesPage(rid) {
|
||||
console.log(rid);
|
||||
|
||||
if( window.innerWidth < 701){
|
||||
this.openGroupMessagesModal(rid);
|
||||
}
|
||||
@@ -392,21 +390,21 @@ hideRefreshButton(){
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.userDirectMessages);
|
||||
//console.log(this.userDirectMessages);
|
||||
|
||||
if(this.route.url != "/home/chat"){
|
||||
console.log("Timer message stop")
|
||||
//console.log("Timer message stop")
|
||||
}
|
||||
else {
|
||||
console.log('TIMER');
|
||||
//console.log('TIMER');
|
||||
//Check if modal is opened
|
||||
if(this.segment == "Contactos" && this.showMessages != true){
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await this.getDirectMessages();
|
||||
console.log('Timer contactos list running')
|
||||
//console.log('Timer contactos list running')
|
||||
}
|
||||
else{
|
||||
console.log('No timer!');
|
||||
//console.log('No timer!');
|
||||
|
||||
}
|
||||
}
|
||||
@@ -445,7 +443,7 @@ hideRefreshButton(){
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
//console.log(this.allGroups);
|
||||
/* }); */
|
||||
if(this.route.url != "/home/chat"){
|
||||
console.log("Timer message stop")
|
||||
@@ -455,7 +453,7 @@ hideRefreshButton(){
|
||||
if(this.segment == "Grupos" && this.showGroupMessages != true){
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await this.getGroups();
|
||||
console.log('Timer groups list running')
|
||||
//console.log('Timer groups list running')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
FormsModule,
|
||||
FontAwesomeModule,
|
||||
IonicModule,
|
||||
|
||||
GroupMessagesPageRoutingModule,
|
||||
ChatPopoverPageModule,
|
||||
BtnModalDismissPageModule,
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<ion-icon src="assets/icon/icons-user.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-bottom-contacts">
|
||||
<ion-label *ngFor="let member of members" >
|
||||
<ion-label class="contacts-list" *ngFor="let member of members" >
|
||||
{{member.name}},
|
||||
</ion-label>
|
||||
</div>
|
||||
@@ -50,15 +50,26 @@
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
<div *ngFor="let file of msg.attachments">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||
<div *ngIf="file.thumb_url">
|
||||
<div class="file d-flex">
|
||||
<ion-thumbnail slot="start">
|
||||
<img src="{{file.thumb_url}}" alt="image">
|
||||
</ion-thumbnail>
|
||||
<ion-label class="file-details">
|
||||
<h3 (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">{{file.title}}</h3>
|
||||
<p *ngIf="file.text">{{file.text}}</p>
|
||||
</ion-label>
|
||||
<div>
|
||||
<div>
|
||||
<div class="file">
|
||||
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||
<ion-label class="file-details" *ngIf="msg.file">
|
||||
<span (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">
|
||||
<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>
|
||||
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||
{{file.title}}
|
||||
</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div class="file-details-optional">
|
||||
<ion-label *ngIf="msg.file">
|
||||
<span *ngIf="file.description">{{file.description}}</span>
|
||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||
<span *ngIf="msg.file.type != 'application/webtrix'">{{msg.file.type.replace('application/','').toUpperCase()}}</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,6 +99,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
</ion-fab-button>
|
||||
</ion-fab>
|
||||
|
||||
</ion-content>
|
||||
<!--
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
}
|
||||
.header-bottom-contacts{
|
||||
width: 275px;
|
||||
width: calc(100% - 40px);
|
||||
font-size: 15px;
|
||||
color: #797979;
|
||||
white-space: nowrap;
|
||||
@@ -55,6 +55,12 @@
|
||||
float: left;
|
||||
padding: 5px;
|
||||
margin: 1px;
|
||||
|
||||
.contacts-list{
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||
import { FileService } from 'src/app/services/functions/file.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { NewEventPage } from '../../agenda/new-event/new-event.page';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -45,6 +48,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
capturedImage:any;
|
||||
capturedImageTitle:any;
|
||||
attendees: EventPerson[] = [];
|
||||
scrollToBottomBtn = false;
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
|
||||
@@ -99,17 +104,24 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||
}
|
||||
|
||||
onContentScrolled(e) {
|
||||
onContentScrolled(e) {
|
||||
this.startPosition = e.srcElement.scrollTop;
|
||||
let scroll = e.srcElement.scrollTop;
|
||||
let windowHeight = e.srcElement.scrollHeight;
|
||||
let containerHeight = windowHeight - e.srcElement.clientHeight;
|
||||
|
||||
if (scroll > this.currentPosition) {
|
||||
//this.showButton = false;
|
||||
//alert('BOTTOM');
|
||||
} else {
|
||||
//this.showButton = true;
|
||||
//alert('UP');
|
||||
this.scrollingOnce = false;
|
||||
}
|
||||
if((containerHeight - 100) > scroll){
|
||||
this.scrollToBottomBtn = true;
|
||||
}
|
||||
else{
|
||||
this.scrollToBottomBtn = false;
|
||||
}
|
||||
this.currentPosition = scroll;
|
||||
}
|
||||
|
||||
@@ -126,6 +138,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} catch(err) { }
|
||||
}
|
||||
|
||||
scrollToBottomClicked(): void {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
} catch(err) { }
|
||||
}
|
||||
|
||||
getRoomInfo(){
|
||||
this.showLoader = true;
|
||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||
@@ -320,6 +338,34 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.fileService.viewDocumentByUrl(url);
|
||||
}
|
||||
|
||||
async bookMeeting() {
|
||||
this.attendees = this.members.map((val)=>{
|
||||
return {
|
||||
Name: val.name,
|
||||
EmailAddress: val.username+"@"+environment.domain,
|
||||
IsRequired: "true",
|
||||
}
|
||||
});
|
||||
console.log(this.attendees);
|
||||
this.popoverController.dismiss();
|
||||
if( window.innerWidth <= 1024){
|
||||
const modal = await this.modalController.create({
|
||||
component: NewEventPage,
|
||||
componentProps:{
|
||||
attendees: this.attendees,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if(data){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async openChatOptions(ev?: any) {
|
||||
console.log(this.members);
|
||||
|
||||
@@ -336,34 +382,28 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
await popover.present();
|
||||
await popover.onDidDismiss().then((res)=>{
|
||||
if(res['data'] == "loadPicture"){
|
||||
this.loadPicture();
|
||||
console.log(res['data']);
|
||||
if(res['data'] == 'meeting'){
|
||||
this.bookMeeting();
|
||||
}
|
||||
else if(res['data'] == "takePicture"){
|
||||
let data = this.fileService.takePicture();
|
||||
if(data.name != null){
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": this.roomId,
|
||||
"msg": "",
|
||||
"attachments": [{
|
||||
"title": data.name,
|
||||
"title_link_download": false,
|
||||
"image_url": data.image,
|
||||
}]
|
||||
}
|
||||
}
|
||||
this.chatService.sendMessage(body).subscribe(res=> {
|
||||
console.log(res);
|
||||
},(error) => {
|
||||
else if(res['data'] == 'take-picture'){
|
||||
this.fileService.addCameraPictureToChat(this.roomId);
|
||||
//this.loadPicture();
|
||||
}
|
||||
else if(res['data'] == 'add-picture'){
|
||||
this.fileService.addPictureToChat(this.roomId);
|
||||
//this.loadPicture();
|
||||
}
|
||||
else if(res['data'] == 'add-document'){
|
||||
this.fileService.addDocumentToChat(this.roomId);
|
||||
//this.loadDocument();
|
||||
}
|
||||
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
|
||||
}
|
||||
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||
//this.addDocGestaoDocumental();
|
||||
}
|
||||
this.loadGroupMessages(this.roomId);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -400,7 +440,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
console.log(res.data);
|
||||
this.modalController.dismiss(res.data);
|
||||
this.getRoomInfo();
|
||||
//this.modalController.dismiss(res.data);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { MessagesPageRoutingModule } from './messages-routing.module';
|
||||
import { MessagesPage } from './messages.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.page';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
|
||||
|
||||
@NgModule({
|
||||
@@ -16,7 +17,7 @@ import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
|
||||
FontAwesomeModule,
|
||||
MessagesPageRoutingModule
|
||||
],
|
||||
declarations: [MessagesPage]
|
||||
|
||||
@@ -43,10 +43,42 @@
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
<div *ngFor="let file of msg.attachments">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||
<div>
|
||||
<div>
|
||||
<div class="file">
|
||||
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||
<ion-label class="file-details" *ngIf="msg.file">
|
||||
<span (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">
|
||||
<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>
|
||||
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||
{{file.title}}
|
||||
</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div class="file-details-optional">
|
||||
<ion-label *ngIf="msg.file">
|
||||
<span *ngIf="file.description">{{file.description}}</span>
|
||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||
<span *ngIf="msg.file.type != 'application/webtrix'">{{msg.file.type.replace('application/','').toUpperCase()}}</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
</ion-fab-button>
|
||||
</ion-fab>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
@@ -2,16 +2,20 @@ import { AfterViewChecked, AfterViewInit, Component, ElementRef, OnDestroy, OnIn
|
||||
import {ActivatedRoute, Router} from '@angular/router'
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { map } from 'rxjs/operators';
|
||||
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';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { FileService } from 'src/app/services/functions/file.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { NewEventPage } from 'src/app/shared/agenda/new-event/new-event.page';
|
||||
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
||||
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages',
|
||||
@@ -41,6 +45,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private scrollChangeCallback: () => void;
|
||||
currentPosition: any;
|
||||
startPosition: number;
|
||||
scrollToBottomBtn = false;
|
||||
attendees: EventPerson[] = [];
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
@@ -52,6 +58,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private toastService: ToastService,
|
||||
private route: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private fileService: FileService,
|
||||
) {
|
||||
/* this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
@@ -116,23 +123,37 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} catch(err) { }
|
||||
}
|
||||
|
||||
scrollToBottomClicked(): void {
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
} catch(err) { }
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||
}
|
||||
|
||||
onContentScrolled(e) {
|
||||
onContentScrolled(e) {
|
||||
this.startPosition = e.srcElement.scrollTop;
|
||||
let scroll = e.srcElement.scrollTop;
|
||||
let windowHeight = e.srcElement.scrollHeight;
|
||||
let containerHeight = windowHeight - e.srcElement.clientHeight;
|
||||
|
||||
if (scroll > this.currentPosition) {
|
||||
//this.showButton = false;
|
||||
//alert('BOTTOM');
|
||||
} else {
|
||||
//this.showButton = true;
|
||||
//alert('UP');
|
||||
this.scrollingOnce = false;
|
||||
}
|
||||
if((containerHeight - 100) > scroll){
|
||||
this.scrollToBottomBtn = true;
|
||||
}
|
||||
else{
|
||||
this.scrollToBottomBtn = false;
|
||||
}
|
||||
this.currentPosition = scroll;
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -157,7 +178,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
loadMessages() {
|
||||
this.showLoader = true;
|
||||
const roomId = this.roomId
|
||||
const roomId = this.roomId;
|
||||
|
||||
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
|
||||
/* console.log(res); */
|
||||
@@ -167,6 +188,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
|
||||
viewDocument(url:string){
|
||||
this.fileService.viewDocumentByUrl(url);
|
||||
}
|
||||
|
||||
getChatMembers() {
|
||||
this.showLoader = true;
|
||||
this.chatService.getMembers(this.roomId).subscribe(res=> {
|
||||
@@ -241,6 +267,34 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async bookMeeting() {
|
||||
this.attendees = this.members.map((val)=>{
|
||||
return {
|
||||
Name: val.name,
|
||||
EmailAddress: val.username+"@"+environment.domain,
|
||||
IsRequired: "true",
|
||||
}
|
||||
});
|
||||
console.log(this.attendees);
|
||||
this.popoverController.dismiss();
|
||||
if( window.innerWidth <= 1024){
|
||||
const modal = await this.modalController.create({
|
||||
component: NewEventPage,
|
||||
componentProps:{
|
||||
attendees: this.attendees,
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if(data){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async openChatOptions(ev?: any) {
|
||||
console.log(this.members);
|
||||
|
||||
@@ -255,7 +309,32 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
await popover.present();
|
||||
popover.onDidDismiss().then((res)=>{
|
||||
console.log(res['data']);
|
||||
if(res['data'] == 'meeting'){
|
||||
this.bookMeeting();
|
||||
}
|
||||
else if(res['data'] == 'take-picture'){
|
||||
this.fileService.addCameraPictureToChat(this.roomId);
|
||||
//this.loadPicture();
|
||||
}
|
||||
else if(res['data'] == 'add-picture'){
|
||||
this.fileService.addPictureToChat(this.roomId);
|
||||
//this.loadPicture();
|
||||
}
|
||||
else if(res['data'] == 'add-document'){
|
||||
this.fileService.addDocumentToChat(this.roomId);
|
||||
//this.loadDocument();
|
||||
}
|
||||
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||
|
||||
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||
//this.addDocGestaoDocumental();
|
||||
}
|
||||
this.loadMessages();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async serverLongPull() {
|
||||
@@ -276,7 +355,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// happens when the synchro was pending for too long
|
||||
// let's reconnect
|
||||
await this.serverLongPull();
|
||||
} else if (res != 200) {
|
||||
}
|
||||
else if (res != 200) {
|
||||
// Show Error
|
||||
//showMessage(response.statusText);
|
||||
//this.loadMessages()
|
||||
|
||||
Reference in New Issue
Block a user