Improve attendess

This commit is contained in:
Peter Maquiran
2021-04-08 13:39:48 +01:00
parent 2b60d175c7
commit afc4f68cdd
9 changed files with 99 additions and 63 deletions
+3
View File
@@ -349,9 +349,12 @@
></app-new-event>
<!-- Edit -->
<app-edit-event *ngIf="mobileComponent.showEditEvent"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[profile]="profile"
[selectedSegment]="segment"
[postEvent]="postEvent"
(clearPostEvent)="clearPostEvent"
(clearContact)="clearContact()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(setContact)="setContact($event)"
+12 -8
View File
@@ -94,11 +94,11 @@ export class AgendaPage implements OnInit {
selectedEventId: string | number;
postEvent: any;
// temporary data
taskParticipants: any = [];
taskParticipantsCc: any = [];
adding: "intervenient" | "CC" = "intervenient";
@ViewChild(CalendarComponent) myCal: CalendarComponent;
segment: "Combinado" | "Pessoal" | "Oficial";
@@ -209,6 +209,11 @@ export class AgendaPage implements OnInit {
// show information about the clicked event in timeline
eventClicked({ event }: { event: CalendarEvent }): void {
/* console.log('Event clicked', event); */
//clear
this.setIntervenient([]);
this.setIntervenientCC([]);
this.clearPostEvent();
this.IsEvent= "view";
@@ -995,12 +1000,7 @@ export class AgendaPage implements OnInit {
// open component
async openAttendeesComponent(data) {
if(Array.isArray(data)){
if(data.length >= 1){
this.contacts = data ;
}
}
this.adding = data.type
this.cloneAllmobileComponent();
this.mobileComponent.showAttendees = true;
@@ -1061,4 +1061,8 @@ export class AgendaPage implements OnInit {
this.adding = adding;
}
async clearPostEvent(){
this.postEvent = false;
}
}
@@ -1,4 +1,5 @@
<ion-content>
<!-- Edit event for Inicio -->
<div class="main-content height-100">
<div class="content d-flex flex-column width-md-100 height-100">
@@ -224,7 +225,7 @@
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[adding]="adding"
(dynamicSetIntervenient)="dynamicSetIntervenient($event)"
></app-attendee-modal>
</div>
@@ -44,17 +44,20 @@ export class EditEventPage implements OnInit {
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
}
this.taskParticipants = [];
this.taskParticipantsCc = [];
if(this.postEvent.Attendees == null){
this.taskParticipants = []
} else {
this.taskParticipants = this.postEvent.Attendees;
this.postEvent.Attendees.forEach(e =>{
if(e.IsRequired){
this.taskParticipants.push(e);
} else {
this.taskParticipantsCc.push(e);
}
})
}
this.taskParticipantsCc = [];
if(this.postEvent.IsRecurring == false){
this.isRecurring = "Não se repete";
}
@@ -80,7 +83,9 @@ export class EditEventPage implements OnInit {
}
save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
@@ -122,7 +127,6 @@ export class EditEventPage implements OnInit {
}
});
}
}
setIntervenient(data){
@@ -145,4 +149,10 @@ export class EditEventPage implements OnInit {
this.openAttendees();
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
}
}