mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -36,13 +36,6 @@
|
||||
<ion-list *ngSwitchCase="'Contactos'">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<!-- <ion-item *ngFor="let user of userConnectedList" (click)="openMessages()">
|
||||
<ion-icon slot="start" src="assets/images/icons-chat-chat-40.svg" class="iconschatchat-40"></ion-icon>
|
||||
<div>
|
||||
<h3>{{user.name}}</h3>
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</ion-item> -->
|
||||
<div *ngFor="let dm of userDirectMessages" class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
@@ -63,51 +56,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openMessages()" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>Secretário para o sector Agricola</ion-label>
|
||||
</div>
|
||||
<div class="item-date">15:00</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openMessages()" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>Secretário para o sector Adminstrativo</ion-label>
|
||||
</div>
|
||||
<div class="item-date">15:00</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</ion-list>
|
||||
<ion-list *ngSwitchCase="'Grupos'" >
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<!-- <ion-item *ngFor="let group of allGroups">
|
||||
<ion-icon slot="start" src="assets/images/icons-chat-group-chat-40.svg" class="iconschatgroup-chat-40"></ion-icon>
|
||||
<div>
|
||||
<h3>{{group.name}}</h3>
|
||||
<p>Grande momento.</p>
|
||||
</div>
|
||||
</ion-item> -->
|
||||
<div *ngFor="let group of allGroups" class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
@@ -123,23 +77,7 @@
|
||||
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openGroupMessages()" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>Secretário para o sector Produtivo</ion-label>
|
||||
</div>
|
||||
<div class="item-date">15:00</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ export class ChatPage implements OnInit {
|
||||
this.doRefresh();
|
||||
}
|
||||
doRefresh(){
|
||||
setInterval(()=>{
|
||||
/* setInterval(()=>{ */
|
||||
this.getDirectMessages();
|
||||
this.getGroups();
|
||||
}, 2000);
|
||||
/* }, 2000); */
|
||||
}
|
||||
|
||||
getDirectMessages(){
|
||||
|
||||
@@ -40,61 +40,6 @@
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<img src='assets/images/1.jpg' tappable>
|
||||
<ion-label hidden >Investidura Filipe Nyusi</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Presidente da República</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Pois é, momentos históricos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Ministro do interior</ion-label>
|
||||
<span class="time">16:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Grande momento</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -126,6 +126,9 @@ export class GroupMessagesPage implements OnInit {
|
||||
component: ChatOptionsPopoverPage,
|
||||
cssClass: 'chat-options-popover',
|
||||
event: ev,
|
||||
componentProps: {
|
||||
roomId: this.room._id,
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
|
||||
@@ -46,10 +46,10 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
|
||||
/* console.log(this.dm); */
|
||||
|
||||
setInterval(()=>{
|
||||
/* setInterval(()=>{ */
|
||||
this.checkUserPresence();
|
||||
this.loadMessages();
|
||||
}, 2000);
|
||||
/* }, 2000); */
|
||||
|
||||
this.getChatMembers();
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ 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');
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -171,7 +171,7 @@ export class ChatService {
|
||||
}
|
||||
return this.http.get(url, opts);
|
||||
}
|
||||
/* MESSAGES */
|
||||
/* GROUP MESSAGES */
|
||||
getPrivateGroupMessages(roomId:any){
|
||||
|
||||
let params = new HttpParams();
|
||||
@@ -194,5 +194,11 @@ export class ChatService {
|
||||
}
|
||||
return this.http.get(environment.apiChatUrl+'channels.history', opts);
|
||||
}
|
||||
closeGroup(body:any){
|
||||
return this.http.post(environment.apiChatUrl+'groups.close', body, this.options);
|
||||
}
|
||||
closeChannel(body:any){
|
||||
return this.http.post(environment.apiChatUrl+'channels.close', body, this.options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<ion-content>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<button class="btn-cancel" shape="round" >Sair do Grupo</button>
|
||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<button class="btn-ok" shape="round" >Alterar nome do grupo</button>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { PopoverController } from '@ionic/angular';
|
||||
import { NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-popover',
|
||||
@@ -7,15 +8,37 @@ import { PopoverController } from '@ionic/angular';
|
||||
styleUrls: ['./chat-popover.page.scss'],
|
||||
})
|
||||
export class ChatPopoverPage implements OnInit {
|
||||
room:any;
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
) { }
|
||||
private navParams: NavParams,
|
||||
private chatService: ChatService,
|
||||
) {
|
||||
this.room = this.navParams.get('room');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.room);
|
||||
|
||||
}
|
||||
close(){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
|
||||
//Top menu options
|
||||
leaveGroup(){
|
||||
let body = { "roomId":this.room._id, }
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.closeGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.chatService.closeChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V3/api/',
|
||||
apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V3/api/',
|
||||
apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/',
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: 'paulo.pinto',
|
||||
|
||||
Reference in New Issue
Block a user