Merge branch 'bugfix/open-chat-on-create-event' into develop_bitOut

This commit is contained in:
Peter Maquiran
2022-08-09 17:05:54 +01:00
3 changed files with 46 additions and 14 deletions
+2 -6
View File
@@ -251,15 +251,11 @@
[taskParticipantsCc]="taskParticipantsCc"
[selectedDate]="eventSelectedDate"
[eventAttendees]="contacts"
(onAddEvent)="closeNewEventComponent()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(cloneAllmobileComponent)="closeNewEventComponent()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(onAddEvent)="closeNewEventComponentAndOpenChat($event)"
(openAttendeesComponent)="closeNewEventComponentAndOpenChat($event)"
[style.display]="showNewEvent ? 'flex' : 'none'"
class=" height-100 flex-column">
</app-new-event>
<app-attendee-modal
[adding]="adding"
[taskParticipants]="taskParticipants"
+27 -2
View File
@@ -229,6 +229,9 @@ export class ChatPage implements OnInit {
}
}
openMessagesPage(rid) {
this.roomId = rid;
if (window.innerWidth < 701) {
this.openMessagesModal(rid);
}
@@ -236,7 +239,6 @@ export class ChatPage implements OnInit {
this.idSelected = rid;
this.closeAllDesktopComponents();
this.showEmptyComponent = false;
this.roomId = rid;
this.showMessages = true;
}
}
@@ -275,6 +277,8 @@ export class ChatPage implements OnInit {
}
openGroupMessagesPage(rid) {
this.roomId = rid;
if (window.innerWidth < 701) {
this.openGroupMessagesModal(rid);
}
@@ -282,7 +286,7 @@ export class ChatPage implements OnInit {
this.idSelected = rid;
this.closeAllDesktopComponents();
this.showEmptyComponent = false;
this.roomId = rid;
this.showGroupMessages = true;
}
@@ -339,6 +343,27 @@ export class ChatPage implements OnInit {
this.idSelected = "";
}
async closeNewEventComponentAndOpenChat({roomId}) {
this.closeAllDesktopComponents();
console.log(roomId)
this.wsChatMethodsService._group.forEach((room)=>{
if(room.id == roomId) {
this.openGroupMessagesPage(roomId)
}
})
this.wsChatMethodsService._dm.forEach((room)=>{
if(room.id == roomId) {
this.openMessagesPage(roomId)
}
})
}
onSegmentChange() {
this.wsChatMethodsService.getAllRooms();
}
@@ -331,10 +331,10 @@ export class NewEventPage implements OnInit {
});
}
close(){
close() {
this.deleteTemporaryData();
this.cloneAllmobileComponent.emit();
this.cloneAllmobileComponent.emit({roomId:this.roomId});
this.clearContact.emit();
this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
@@ -461,7 +461,11 @@ export class NewEventPage implements OnInit {
"id": id,
"calendarId": CalendarId
}
this.chatMethodService.sendMessage(this.roomId,data);
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
},
error => {
loader.remove()
@@ -515,7 +519,9 @@ export class NewEventPage implements OnInit {
"id": id,
"calendarId": CalendarId
}
this.chatMethodService.sendMessage(this.roomId,data);
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},()=>{
@@ -571,7 +577,9 @@ export class NewEventPage implements OnInit {
"id": id,
"calendarId": CalendarId
}
this.chatMethodService.sendMessage(this.roomId,data);
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},()=>{
loader.remove()
@@ -599,7 +607,10 @@ export class NewEventPage implements OnInit {
afterSave() {
this.deleteTemporaryData();
this.onAddEvent.emit(this.postEvent);
this.onAddEvent.emit(Object.assign(this.postEvent, {
roomId: this.roomId
}));
this.GoBackEditOrAdd.emit();
this.setIntervenient.emit([]);