mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -16,6 +16,7 @@ import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.pag
|
||||
import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page';
|
||||
import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-contacts/group-contacts.page';
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -33,6 +34,7 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
ContactsPage,
|
||||
GroupMessagesPage,
|
||||
NewGroupPage,
|
||||
EditGroupPage,
|
||||
GroupContactsPage,
|
||||
EmptyChatPage,
|
||||
],
|
||||
@@ -42,6 +44,7 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
ContactsPage,
|
||||
GroupMessagesPage,
|
||||
NewGroupPage,
|
||||
EditGroupPage,
|
||||
GroupContactsPage,
|
||||
EmptyChatPage,
|
||||
]
|
||||
|
||||
@@ -94,16 +94,40 @@
|
||||
</div>
|
||||
<!-- Aside right -->
|
||||
<div class="aside-content d-none flex-column height-100">
|
||||
<app-empty-chat [texto]="emptyTextDescription" class="d-flex height-100 flex-column" *ngIf="showEmptyComponent" #messagecontainer></app-empty-chat>
|
||||
<app-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showMessages" #messagecontainer></app-messages>
|
||||
<app-contacts (openMessage)="openMessagesPage($event)" *ngIf="showContacts" class="d-flex height-100 flex-column"></app-contacts>
|
||||
<app-new-group (addGroupMessage)="openGroupContactsPage($event)" *ngIf="showNewGroup" class="d-flex height-100 flex-column"></app-new-group>
|
||||
<app-group-contacts (openGroupMessage)="openGroupMessagesPage($event)" [roomId]="groupRoomId" class="d-flex height-100 flex-column" *ngIf="showGroupContacts"></app-group-contacts>
|
||||
<app-empty-chat [texto]="emptyTextDescription"
|
||||
class="d-flex height-100 flex-column"
|
||||
*ngIf="showEmptyComponent" #messagecontainer>
|
||||
</app-empty-chat>
|
||||
<app-messages class="d-flex height-100 flex-column"
|
||||
[roomId]="roomId" *ngIf="showMessages" #messagecontainer>
|
||||
</app-messages>
|
||||
<app-contacts
|
||||
(openMessage)="openMessagesPage($event)"
|
||||
*ngIf="showContacts" class="d-flex height-100 flex-column">
|
||||
</app-contacts>
|
||||
<app-new-group
|
||||
(addGroupMessage)="openGroupContactsPage($event)"
|
||||
*ngIf="showNewGroup" class="d-flex height-100 flex-column">
|
||||
</app-new-group>
|
||||
<app-edit-group [roomId]="roomId"
|
||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||
(openGroupMessage)="openGroupMessagesPage($event)"
|
||||
*ngIf="showEditGroup" class="d-flex height-100 flex-column">
|
||||
</app-edit-group>
|
||||
<app-group-contacts
|
||||
(openGroupMessage)="openGroupMessagesPage($event)"
|
||||
[roomId]="groupRoomId" class="d-flex height-100 flex-column"
|
||||
*ngIf="showGroupContacts">
|
||||
</app-group-contacts>
|
||||
<app-group-messages
|
||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
(openGroupContacts)="openGroupContactsPage($event)"
|
||||
*ngIf="showGroupMessages" class="d-flex height-100 flex-column" [roomId]="roomId" #messagecontainer></app-group-messages>
|
||||
(openGroupContacts)="openGroupContactsPage($event)"
|
||||
(openEditGroupPage)="openEditGroupPage($event)"
|
||||
*ngIf="showGroupMessages"
|
||||
class="d-flex height-100 flex-column"
|
||||
[roomId]="roomId" #messagecontainer>
|
||||
</app-group-messages>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -20,6 +20,7 @@ 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';
|
||||
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
@@ -63,6 +64,7 @@ export class ChatPage implements OnInit {
|
||||
showMessages=false;
|
||||
showContacts=false;
|
||||
showNewGroup=false;
|
||||
showEditGroup=false;
|
||||
showGroupMessages=false;
|
||||
showGroupContacts=false;
|
||||
emptyTextDescription = 'Sem conversa selecionada';
|
||||
@@ -105,6 +107,7 @@ export class ChatPage implements OnInit {
|
||||
this.showMessages=false;
|
||||
this.showContacts=false;
|
||||
this.showNewGroup=false;
|
||||
this.showEditGroup=false;
|
||||
this.showGroupMessages=false;
|
||||
this.showEmptyComponent=false;
|
||||
this.showGroupContacts=false;
|
||||
@@ -157,6 +160,17 @@ export class ChatPage implements OnInit {
|
||||
this.showNewGroup=true;
|
||||
}
|
||||
}
|
||||
|
||||
openEditGroupPage(rid) {
|
||||
if( window.innerWidth <= 1024){
|
||||
this.editGroup(rid);
|
||||
}
|
||||
else{
|
||||
this.closeAllDesktopComponents();
|
||||
this.showEditGroup=true;
|
||||
}
|
||||
}
|
||||
|
||||
openGroupMessagesPage(data) {
|
||||
console.log('HERE');
|
||||
|
||||
@@ -252,7 +266,6 @@ export class ChatPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: ContactsPage,
|
||||
cssClass: 'contacts',
|
||||
backdropDismiss: false,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
@@ -261,11 +274,26 @@ export class ChatPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: NewGroupPage,
|
||||
cssClass: 'new-group',
|
||||
backdropDismiss: false,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async editGroup(roomId){
|
||||
const modal = await this.modalController.create({
|
||||
component: EditGroupPage,
|
||||
cssClass: 'edit-group',
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
console.log(res.data);
|
||||
this.modalController.dismiss(res.data);
|
||||
});
|
||||
}
|
||||
|
||||
async openMessagesModal(roomId:any){
|
||||
this.closeAllDesktopComponents();
|
||||
|
||||
@@ -280,7 +308,6 @@ export class ChatPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: MessagesPage,
|
||||
cssClass: classs,
|
||||
backdropDismiss: false,
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
@@ -301,7 +328,6 @@ export class ChatPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
cssClass: classs,
|
||||
backdropDismiss: false,
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="left">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<button class="btn-no-color" (click)="close()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="middle">
|
||||
<ion-label class="title">Alterar assunto</ion-label>
|
||||
|
||||
@@ -14,6 +14,7 @@ export class EditGroupPage implements OnInit {
|
||||
selectedDuration = ['','',''];
|
||||
groupName:string;
|
||||
room:any;
|
||||
roomId:string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -21,12 +22,19 @@ export class EditGroupPage implements OnInit {
|
||||
private chatService: ChatService,
|
||||
private navParams: NavParams,
|
||||
) {
|
||||
this.room = this.navParams.get('room');
|
||||
this.groupName = this.room.name.split('-').join(' ');
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.room);
|
||||
this.getRoomInfo();
|
||||
}
|
||||
|
||||
getRoomInfo(){
|
||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
console.log(this.room);
|
||||
this.groupName = this.room.name.split('-').join(' ');
|
||||
});
|
||||
}
|
||||
|
||||
close(){
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="back-icon">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<button class="btn-no-color" (click)="close()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Contactos</ion-label>
|
||||
@@ -33,11 +35,16 @@
|
||||
<div *ngIf="members">
|
||||
<ion-label class="members-label">Contactos selecção:</ion-label>
|
||||
<ion-list class="members-list" *ngFor="let user of members">
|
||||
<div class="members-checkbox">
|
||||
<ion-checkbox checked color="primary"></ion-checkbox>
|
||||
<p>{{user.name}}</p>
|
||||
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
|
||||
</div>
|
||||
<ion-item-sliding>
|
||||
<ion-item lines="none" class="members-checkbox ion-no-border ion-no-padding">
|
||||
<ion-checkbox checked color="primary"></ion-checkbox>
|
||||
<p>{{user.name}}</p>
|
||||
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
|
||||
</ion-item>
|
||||
<ion-item-options (click)="deleteMember(user)" class="members-options" side="end">
|
||||
<ion-item-option color="danger">Apagar</ion-item-option>
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -93,10 +93,15 @@
|
||||
|
||||
.members-checkbox{
|
||||
display: flex;
|
||||
margin: .5px 20px .5px 20px !important;
|
||||
margin: 0px 20px 0px 20px !important;
|
||||
overflow: auto;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
.members-options{
|
||||
margin: 0px 20px 0px 19px !important;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.item-divider{
|
||||
@@ -114,11 +119,17 @@
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.members-checkbox ion-checkbox{
|
||||
--border-color: #0d89d1;
|
||||
--background-checked:#0d89d1;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.item-checkbox ion-checkbox, .members-checkbox ion-checkbox{
|
||||
.item-checkbox ion-checkbox{
|
||||
--border-color: #0d89d1;
|
||||
--background-checked:#0d89d1;
|
||||
float: left;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.item-checkbox p, .members-checkbox p{
|
||||
|
||||
@@ -53,10 +53,47 @@ export class GroupContactsPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.loadUsers();
|
||||
this.getMembers();
|
||||
console.log(this.groupName);
|
||||
console.log(this.isGroupCreated);
|
||||
}
|
||||
|
||||
deleteMember(data:any){
|
||||
let body = {
|
||||
"roomId": this.room._id,
|
||||
"userId": data._id,
|
||||
}
|
||||
console.log(body);
|
||||
if(this.room.t == "p"){
|
||||
this.chatService.removeGroupMember(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.getMembers();
|
||||
});
|
||||
}
|
||||
else if(this.room.t == "c"){
|
||||
this.chatService.removeChannelMember(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.getMembers();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getMembers(){
|
||||
if(this.room.t == "p"){
|
||||
this.chatService.getGroupMembers(this.room._id).subscribe(res=>{
|
||||
this.members = res['members'];
|
||||
this.loadUsers();
|
||||
});
|
||||
}
|
||||
else if(this.room.t == "c"){
|
||||
this.chatService.getChannelMembers(this.room._id).subscribe(res=>{
|
||||
this.members = res['members'];
|
||||
this.loadUsers();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
loadUsers(){
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
@@ -68,7 +105,6 @@ export class GroupContactsPage implements OnInit {
|
||||
else{
|
||||
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
|
||||
}
|
||||
|
||||
this.users = this.contacts.sort((a,b) => {
|
||||
if(a.name < b.name){
|
||||
return -1;
|
||||
@@ -98,8 +134,10 @@ export class GroupContactsPage implements OnInit {
|
||||
return null;
|
||||
}
|
||||
|
||||
doRefresh(event){
|
||||
|
||||
doRefresh(ev){
|
||||
this.loadUsers();
|
||||
this.getMembers();
|
||||
ev.target.complete();
|
||||
}
|
||||
|
||||
async close(){
|
||||
|
||||
@@ -48,9 +48,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="msg.t == 'r'" class="info-text">
|
||||
<ion-label>Alterou o assunto de para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
<!--
|
||||
|
||||
@@ -103,6 +103,24 @@
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
border-radius: 8px;
|
||||
}
|
||||
.info-text-leave{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
padding: 10px;
|
||||
background: #e0e9ee;
|
||||
border-radius: 8px;
|
||||
margin: 10px auto;
|
||||
color: #797979 !important;
|
||||
font-size: 13px !important;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
|
||||
.info-text-leave ion-label{
|
||||
font-size: 13px !important;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
}
|
||||
.messages{
|
||||
font-size: 13px;
|
||||
font-family: Roboto;
|
||||
|
||||
@@ -19,8 +19,8 @@ export class GroupMessagesPage implements OnInit {
|
||||
isGroupCreated:boolean;
|
||||
loggedUser: any;
|
||||
message:any;
|
||||
leaveStatus:any;
|
||||
messages:any;
|
||||
|
||||
|
||||
room:any;
|
||||
roomName:any;
|
||||
@@ -66,7 +66,6 @@ export class GroupMessagesPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* load(){
|
||||
this.getGroupContacts();
|
||||
this.loadGroupMessages();
|
||||
@@ -145,9 +144,12 @@ export class GroupMessagesPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res.data == 'leave'){
|
||||
this.leaveStatus = this.loggedUser.me.name + ' saiu do grupo';
|
||||
}
|
||||
console.log('OK2');
|
||||
|
||||
console.log(res);
|
||||
console.log(res.data);
|
||||
/* if(res.data ==){
|
||||
this.roomName = res.data.name.split('-').join(' ');
|
||||
console.log(this.roomName);
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="left">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<button class="btn-no-color" (click)="close()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="middle">
|
||||
<ion-label class="title">Novo Grupo</ion-label>
|
||||
|
||||
Reference in New Issue
Block a user