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

This commit is contained in:
Eudes Inácio
2022-01-27 15:57:28 +01:00
15 changed files with 441 additions and 186 deletions
+1 -1
View File
@@ -121,7 +121,7 @@
<div class="item-date" [class.item-date-active]="group.value.id ==idSelected" *ngIf="group.value.customFields.countDownDate">{{countDownDate(group.value.customFields.countDownDate, group.value.id)}}</div>
</div>
<div *ngIf="group.value.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.value.id ==idSelected">
<div class="item-message">{{group.value.lastMessage.u.name}}: {{group.value.lastMessage.msg}} </div>
<div *ngIf="group.value.lastMessage.u.name" class="item-message">{{group.value.lastMessage.u.name}}: {{group.value.lastMessage.msg}} </div>
<div class="item-files add-ellipsis" *ngIf="group.value.file">
<fa-icon *ngIf="group.value.lastMessage.file.type != 'application/meeting'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group.value.id == idSelected"></fa-icon>
<fa-icon *ngIf="group.value.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="group.value.id == idSelected"></fa-icon>
+1 -1
View File
@@ -548,7 +548,7 @@ export class ChatPage implements OnInit {
return dateB - dateA;
});
//console.log('GROUPS FROM DB', this.allGroups)
})
@@ -333,12 +333,14 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
cssClass: 'chat-popover',
componentProps: {
roomId: this.roomId,
members: this.members,
},
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res.data == 'leave'){
console.log('saiu do grupo');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room);
}
else if(res.data == 'cancel'){
console.log('cancel');
+32 -2
View File
@@ -6,6 +6,8 @@ import { GroupContactsPage } from '../group-messages/group-contacts/group-contac
import { ThemeService } from 'src/app/services/theme.service'
import { ChatService } from 'src/app/services/chat.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { AuthService } from 'src/app/services/auth.service';
@Component({
selector: 'app-new-group',
@@ -21,6 +23,7 @@ export class NewGroupPage implements OnInit {
thedate:any;
groupName:string;
documents:any;
loggedUserChat: any;
constructor(
private pickerController: PickerController,
@@ -30,8 +33,11 @@ export class NewGroupPage implements OnInit {
public ThemeService: ThemeService,
private chatService: ChatService,
private processesService: ProcessesService,
public wsChatMethodsService: WsChatMethodsService,
private authService: AuthService,
)
{
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = false;
this.groupName = this.navParams.get('name');
this.documents = this.navParams.get('documents');
@@ -55,10 +61,34 @@ export class NewGroupPage implements OnInit {
this.modalController.dismiss();
}
createGroup(){
async createGroup(){
let name = this.groupName.split(' ').join('-');
//Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
let customFields = {}
let res:any;
if(this.thedate){
let customFields = {
"countDownDate":this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, this.loggedUserChat.me.username, customFields);
console.log(res);
}
else{
res = await this.wsChatMethodsService.createPrivateRoom(name, this.loggedUserChat.me.username, customFields);
console.log(res);
}
this.isGroupCreated = true;
this.addContacts(res.result);
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
//this.addGroupMessage.emit(res.result.rid);
/*
let body = { "name":name, }
this.chatService.addGroup(body).subscribe(res=>{
console.log('group created');
@@ -112,7 +142,7 @@ export class NewGroupPage implements OnInit {
this.chatService.sendMessage(body).toPromise();
});
}
});
}); */
}
async addContacts(room){