This commit is contained in:
tiago.kayaya
2021-01-20 13:17:54 +01:00
parent 38765d4da9
commit bae1f89b73
6 changed files with 28 additions and 13 deletions
-4
View File
@@ -24,10 +24,6 @@
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
<ion-label>Acções</ion-label>
</ion-tab-button>
<ion-tab-button tab="search">
<ion-icon name="search"></ion-icon>
<ion-label>Pesquisa</ion-label>
</ion-tab-button>
<ion-tab-button tab="chat">
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
<ion-label>Chat</ion-label>
+9 -1
View File
@@ -1,4 +1,4 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
@@ -70,8 +70,16 @@ export class ChatPage implements OnInit {
/* setInterval(()=>{ */
this.getDirectMessages();
this.getGroups();
this.customRoom();
/* }, 2000); */
}
customRoom(){
let params = new HttpParams();
params = params.set("types", "c");
this.chatService.customsRooms(params).subscribe(res=>{
console.log(res);
});
}
getDirectMessages(){
this.showLoader = true;
@@ -117,6 +117,9 @@ export class GroupMessagesPage implements OnInit {
component: ChatPopoverPage,
cssClass: 'chat-popover',
event: ev,
componentProps: {
room: this.room,
},
translucent: true
});
return await popover.present();
@@ -127,7 +130,7 @@ export class GroupMessagesPage implements OnInit {
cssClass: 'chat-options-popover',
event: ev,
componentProps: {
roomId: this.room._id,
room: this.room,
},
translucent: true
});
+7 -7
View File
@@ -55,19 +55,19 @@ export class LoginPage implements OnInit {
await alert.present();
}
/* loginRocketChat(){
loginRocketChat(){
this.authService.loginChat(this.postData).subscribe((res: any) =>{
this.storageService.store(AuthConnstants.AUTH, res.data);
console.log('Login to Rocket chat OK');
},(error:any) =>{
console.log('Network error');
});
} */
}
async Login(){
/* try { */
try {
//Go to our home in home/feed.
//this.router.navigate(['/home/events']);
if(this.validateInput()){
@@ -78,7 +78,7 @@ export class LoginPage implements OnInit {
BasicAuthKey: ""
}
if (await this.authService.login(this.userattempt)){
/* this.loginRocketChat(); */
this.loginRocketChat();
this.router.navigate(['/home/events']);
}
else
@@ -91,9 +91,9 @@ export class LoginPage implements OnInit {
//this.toastService.presentToast('Preencha todos campos');
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
}
/* } catch (error) {
} catch (error) {
error
this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema. '+ error);
} */
this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema. ');
}
}
}
+7
View File
@@ -67,6 +67,13 @@ export class ChatService {
getAllRooms(){
return this.http.get(environment.apiChatUrl+'rooms.get', this.options);
}
customsRooms(params:any){
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'rooms.get', opts);
}
getAllPrivateGroups(){
return this.http.get(environment.apiChatUrl+'groups.list', this.options);
}
+1
View File
@@ -5,6 +5,7 @@
export const environment = {
production: false,
apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V3/api/',
/* apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V3/api/', */
apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/',
domain: 'gabinetedigital.local',
defaultuser: 'paulo.pinto',