This commit is contained in:
Peter Maquiran
2022-08-04 16:52:35 +01:00
15 changed files with 176 additions and 78 deletions
@@ -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([]);
@@ -459,8 +459,13 @@ export class NewEventPage implements OnInit {
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": id,
"calendarId": CalendarId
}
this.chatMethodService.sendMessage(this.roomId,data);
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
},
error => {
loader.remove()
@@ -472,10 +477,12 @@ export class NewEventPage implements OnInit {
else if(this.loggeduser.Profile == 'PR') {
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
loader.remove()
const eventId: any = id;
@@ -503,7 +510,24 @@ export class NewEventPage implements OnInit {
if(DocumentToSave.length == 0){
this.afterSave();
}
this.toastService._successMessage('Evento criado');
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": id,
"calendarId": CalendarId
}
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},()=>{
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
} else {
@@ -511,10 +535,12 @@ export class NewEventPage implements OnInit {
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
loader.remove();
const eventId: any = id;
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
@@ -541,7 +567,24 @@ export class NewEventPage implements OnInit {
if(DocumentToSave.length == 0){
this.afterSave();
}
this.toastService._successMessage('Evento criado');
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": id,
"calendarId": CalendarId
}
if(this.roomId) {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},()=>{
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
}
@@ -564,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([]);
@@ -627,7 +673,7 @@ export class NewEventPage implements OnInit {
return true;
} else {
return false;
}
}