Merge branch 'feature/chat' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/chat

This commit is contained in:
Eudes Inácio
2021-07-26 14:10:33 +01:00
8 changed files with 48 additions and 31 deletions
+3
View File
@@ -103,6 +103,9 @@
<app-messages class=" height-100 flex-column"
*ngIf="showMessages"
[style.display]="showMessages ? 'flex' : 'none'"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
(showEmptyContainer)="showEmptyContainer()"
[style.display]="showMessages ? 'flex' : 'none'"
[roomId]="roomId" #messagecontainer>
</app-messages>
<app-contacts
@@ -37,19 +37,21 @@
<ion-label>Esta conversa passou a grupo</ion-label><br />
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div *ngFor="let msg of messages" class="messages" #scrollMe>
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
<div class="messages overflow-y-auto" #scrollMe>
<div *ngFor="let msg of messages" >
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
</div>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.t == 'r'" class="info-text">
<ion-label>Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
</div>
</div>
<div *ngIf="msg.t == 'r'" class="info-text">
<ion-label>Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
</div>
</div>
<div *ngIf="leaveStatus" class="info-text-leave">
<ion-label>{{leaveStatus}}</ion-label>
@@ -90,7 +92,7 @@
<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>
<button hidden class="btn-no-color" (click)="notImplemented()">
<button hidden class="btn-no-color">
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</button>
</ion-item>
@@ -14,7 +14,7 @@
padding: 30px 20px 0px 20px;
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
overflow: auto;
padding: 0 !important;
@@ -57,7 +57,7 @@
margin: 1px;
}
}
.title{
font-size: 25px;
}
@@ -71,7 +71,7 @@
.div-icon ion-icon{
float: right;
padding-left: 20px;
}
}
}
}
ion-content{
@@ -123,6 +123,8 @@
font-size: 13px;
font-family: Roboto;
overflow: auto;
width: 100%;
//height: 100%;
.incoming-true, .incoming-false{
width: 305px;
@@ -143,7 +145,7 @@
}
.title{
color: #0782c9;
font-weight: bold;
margin-bottom: 5px;
@@ -176,9 +178,9 @@
.container{
justify-content: center;
justify-content: space-evenly;
}
.chat-icon-options{
display:block !important;
font-size: 25px;
@@ -205,5 +207,5 @@
align-self: center;
}
}
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, ElementRef, OnInit, ViewChild } 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';
@@ -30,6 +30,8 @@ export class GroupMessagesPage implements OnInit {
roomId: string;
loggedUserChat:any;
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
constructor(
private menu: MenuController,
private modalController: ModalController,
@@ -51,8 +53,14 @@ export class GroupMessagesPage implements OnInit {
this.getRoomInfo();
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
ngAfterViewChecked() {
this.scrollToBottom();
}
scrollToBottom(): void {
try {
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
}
getRoomInfo(){
@@ -32,11 +32,12 @@
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="welcome-text">
<ion-label> {{message}} Esta conversa passou a grupo</ion-label><br />
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="messages" #scrollMe>
<div class="messages overflow-y-auto" #scrollMe>
<div class="welcome-text">
<ion-label> Esta conversa passou a grupo</ion-label><br />
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="container-width-100" *ngFor="let msg of messages" #scrollMe>
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="title">
@@ -117,7 +117,8 @@
.messages{
font-size: 13px;
font-family: Roboto;
overflow: auto;
width: 100%;
height: 100%;
.incoming-true, .incoming-false{
padding: 15px 20px;
@@ -45,7 +45,7 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
/* this.dm = this.navParams.get('dm'); */
}
ngOnChanges(changes: SimpleChanges): void {
//this.load();
this.load();
//throw new Error('Method not implemented.');
}
+2 -2
View File
@@ -4,8 +4,8 @@
export const environment = {
production: false,
/* apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/', */
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V4/api/',
apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/',
/* apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V4/api/', */
apiChatUrl: 'https://www.tabularium.pt/api/v1/',
/* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */
domain: 'gabinetedigital.local', //gabinetedigital.local