This commit is contained in:
Peter Maquiran
2022-02-10 20:16:15 +01:00
24 changed files with 400 additions and 257 deletions
@@ -49,12 +49,12 @@
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
<button (click)="deleteMessage(msg._id, msg)" class="menuButton">Apagar mensagem</button>
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
</mat-menu>
</div>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
<span class="time">{{msg.duration}}</span>
</div>
<div class="message">
<ion-label>{{msg.msg}}</ion-label>
@@ -68,11 +68,11 @@
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
<button (click)="deleteMessage(msg._id, msg)" class="menuButton">Apagar mensagem</button>
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
</mat-menu>
</div>
<div class="title">
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
<span class="time">{{msg.duration}}</span>
</div>
<div class="message">
<div *ngIf="msg.attachments" class="message-attachments">
@@ -126,7 +126,7 @@
</div>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
<span class="time">{{msg.duration}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -234,7 +234,7 @@
<div class="width-100">
<ion-item class="ion-no-padding type-message" lines="none">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getGroupRoom(roomId).message" (ionChange)="changeInput()"></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getGroupRoom(roomId).message" (ionChange)="wsChatMethodsService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
<button hidden class="btn-no-color">
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</button>
@@ -121,7 +121,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.getRoomInfo();
//this.scrollToBottom();
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory();
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
// console.log('MESSAGES'+ this.wsChatMethodsService.getGroupRoom(this.roomId).messages);
this.wsChatMethodsService.openRoom(this.roomId)
this.wsChatMethodsService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -230,9 +230,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
changeInput() {
this.wsChatMethodsService.getDmRoom(this.roomId).typing()
}
async getChatMembers() {
//return await this.chatService.getMembers(roomId).toPromise();
@@ -272,7 +269,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
async getRoomInfo() {
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory();
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
this.room = room['room'];
if (this.room.name) {
@@ -310,7 +307,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
}
deleteMessage(msgId: string, room:any) {
deleteMessage(msgId: string) {
const room = this.wsChatMethodsService.getGroupRoom(this.roomId)
this.alertService.confirmDeleteMessage(msgId, room);
}
@@ -632,7 +630,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const data = res.data;
if(data.selected) {
const loader = this.toastService.loading();
this.wsChatMethodsService.getGroupRoom(roomId).send({
file:{
@@ -657,7 +654,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
temporaryData: res
})
loader.remove();
}
});
@@ -34,8 +34,7 @@ export class ContactsPage implements OnInit {
private authService: AuthService,
public ThemeService: ThemeService,
public WsChatMethodsService: WsChatMethodsService
)
{
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.textSearch="";
this.dm=null;
@@ -44,12 +44,12 @@
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
</fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
<button (click)="deleteMessage(msg._id, msg)" class="menuButton">Apagar mensagem</button>
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
</mat-menu>
</div>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
<span class="time">{{msg.duration}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -63,12 +63,12 @@
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
</fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
<button (click)="deleteMessage(msg._id, msg)" class="menuButton">Apagar mensagem</button>
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
</mat-menu>
</div>
<div class="title">
<ion-label>{{msg.u.name}} </ion-label>
<span class="time">{{showDateDuration(msg.duration)}}</span>
<span class="time">{{msg.duration}}</span>
</div>
<div>
<div *ngIf="msg.attachments" class="message-attachments">
@@ -134,7 +134,7 @@
</div>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
<span class="time">{{msg.duration}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -215,7 +215,7 @@
<div class="width-100">
<ion-item class="ion-no-padding type-message" lines="none">
<ion-textarea (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem"
class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="changeInput()"></ion-textarea>
class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="wsChatMethodsService.getDmRoom(roomId).sendTyping()"></ion-textarea>
<button hidden class="btn-no-color" (click)="notImplemented()">
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</button>
@@ -111,7 +111,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
ngOnChanges(changes: SimpleChanges): void {
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory()
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -125,7 +125,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.scrollToBottomClicked()
}, 150)
}
ngOnInit() {
@@ -251,7 +250,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
}
deleteMessage(msgId: string, room:any) {
deleteMessage(msgId: string) {
const room = this.wsChatMethodsService.getDmRoom(this.roomId)
this.alertService.confirmDeleteMessage(msgId, room);
}
@@ -278,9 +278,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
}
changeInput() {
this.wsChatMethodsService.getDmRoom(this.roomId).typing()
}
async openViewDocumentModal(file: any) {
let task = {
@@ -533,7 +530,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId
if(data.selected) {
const loader = this.toastService.loading();
this.wsChatMethodsService.getDmRoom(roomId).send({
file:{
@@ -553,7 +549,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}],
})
loader.remove();
}
});
@@ -29,7 +29,7 @@ export class EditActionPage implements OnInit {
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
folder: PublicationFolder;
@Input() folderId: string;
@Output() closeDesktopComponent= new EventEmitter<any>();
@@ -39,7 +39,7 @@ export class EditActionPage implements OnInit {
constructor(
private publicationsService: PublicationsService,
private toastService: ToastService,
) {
) {
this.folder = new PublicationFolder();
}
@@ -54,7 +54,7 @@ export class EditActionPage implements OnInit {
getPublicationDetail() {
this.publicationsService.GetPresidentialAction(this.folderId).subscribe( res => {
this.folder = res;
this.dateControlStart = new FormControl(moment(new Date(this.folder.DateBegin)));
this.dateControlEnd = new FormControl(moment(new Date(this.folder.DateEnd)));
@@ -62,7 +62,7 @@ export class EditActionPage implements OnInit {
}
get dateValid() {
if (window.innerWidth <= 800) {
if (window.innerWidth < 701) {
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
} else {
return ['ok']
@@ -96,7 +96,7 @@ export class EditActionPage implements OnInit {
ActionType: this.folder.ActionType,
}
console.log(body);
const loader = this.toastService.loading()
try {
@@ -111,6 +111,6 @@ export class EditActionPage implements OnInit {
} finally {
loader.remove()
}
}
}
@@ -70,7 +70,7 @@ export class NewActionPage implements OnInit {
}
get dateValid() {
if (window.innerWidth >= 800) {
if (window.innerWidth > 700) {
return new Date(this.folder.DateBegin).toLocaleString('pt') < new Date(this.folder.DateEnd).toLocaleString("pt")? ['ok'] : []
} else {
return ['ok']
@@ -108,7 +108,7 @@ export class PublicationDetailPage implements OnInit {
async editPost(publicationType:any) {
console.log(this.publication);
if(window.innerWidth <= 1024){
if(window.innerWidth < 701){
const modal = await this.modalController.create({
component: NewPublicationPage,
componentProps:{
@@ -180,7 +180,7 @@ export class ViewPublicationsPage implements OnInit {
async AddPublication(publicationType:any, folderId:any) {
if( window.innerWidth <= 1024) {
if( window.innerWidth < 701) {
const modal = await this.modalController.create({
component: NewPublicationPage,
componentProps:{