Bug on notifications

This commit is contained in:
Eudes Inácio
2021-04-14 13:30:13 +01:00
17 changed files with 77 additions and 22 deletions
@@ -1,7 +1,9 @@
<ion-header class="ion-no-border">
<div class="header-content">
<div class="header-icon-left">
<ion-icon (click)="close()" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
<button class="btn-no-color" (click)="close()">
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</button>
</div>
<div class="header-title">
<label>Notas</label>
+2
View File
@@ -19,6 +19,7 @@ import { MessagesPage } from './messages/messages.page';
import { NewGroupPage } from './new-group/new-group.page';
import { NewchatPage } from './newchat/newchat.page';
import { Storage } from '@ionic/storage';
import { AlertService } from 'src/app/services/alert.service';
@Component({
selector: 'app-chat',
@@ -99,6 +100,7 @@ export class ChatPage implements OnInit {
console.log(this.roomId);
}
closeAllDesktopComponents() {
this.showMessages=false;
this.showContacts=false;
@@ -87,7 +87,9 @@
<div class="width-80">
<ion-item class="ion-no-padding type-message" lines="none">
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
<button class="btn-no-color" (click)="notImplemented()">
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</button>
</ion-item>
</div>
<div>
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
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 { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
@@ -36,6 +37,7 @@ export class GroupMessagesPage implements OnInit {
private chatService: ChatService,
private navParams: NavParams,
private authService: AuthService,
private alertService: AlertService,
) {
this.isGroupCreated = true;
this.roomId = this.navParams.get('roomId');
@@ -49,6 +51,10 @@ export class GroupMessagesPage implements OnInit {
this.getRoomInfo();
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
getRoomInfo(){
this.showLoader = true;
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
@@ -98,6 +98,8 @@ export class ContactsPage implements OnInit {
this.chatService.createRoom(body).subscribe(res => {
console.log(res);
this.room = res['room'];
console.log(this.room._id);
this.getDirectMessage(this.room._id);
});
}
@@ -106,21 +108,22 @@ export class ContactsPage implements OnInit {
this.chatService.getAllDirectMessages().subscribe(res=>{
let result = res['ims'].filter(data => data._id == roomId);
console.log(result[0]);
this.dm = result[0];
console.log(this.dm);
this.openModal(this.dm);
this.openModal(this.dm._id);
});
}
async openModal(dm:any){
async openModal(roomId:any){
this.close();
console.log(dm);
console.log(roomId);
const modal = await this.modalController.create({
component: MessagesPage,
cssClass: 'group-messages',
backdropDismiss: false,
componentProps: {
dm: dm,
roomId: roomId,
},
});
await modal.present();
@@ -82,7 +82,9 @@
<div class="width-70">
<ion-item class="ion-no-padding ion-no-margin type-message" lines="none">
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
<button class="btn-no-color" (click)="notImplemented()">
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</button>
</ion-item>
</div>
<div>
@@ -2,6 +2,7 @@ import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@ang
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { Status } from 'src/app/models/chat/status.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 { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
@@ -32,6 +33,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
private navParams: NavParams,
private chatService: ChatService,
private authService: AuthService,
private alertService: AlertService,
) {
this.roomId = this.navParams.get('roomId');
}
@@ -50,6 +52,11 @@ export class MessagesPage implements OnInit, AfterViewChecked {
/* }, 9000); */
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
close(){
this.modalController.dismiss();
}