mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Edit event from home page
This commit is contained in:
@@ -3,7 +3,6 @@ import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
@@ -27,6 +26,11 @@ export class EditEventPage implements OnInit {
|
||||
selectedDate: Date;
|
||||
minDate: string;
|
||||
|
||||
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
@@ -36,6 +40,18 @@ export class EditEventPage implements OnInit {
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
this.postEvent = this.navParams.get('event');
|
||||
|
||||
this.taskParticipants = [];
|
||||
this.taskParticipantsCc = [];
|
||||
|
||||
if(this.postEvent.Attendees == null){
|
||||
this.taskParticipants = []
|
||||
} else {
|
||||
this.taskParticipants = this.postEvent.Attendees;
|
||||
}
|
||||
|
||||
this.taskParticipantsCc = [];
|
||||
|
||||
if(this.postEvent.IsRecurring == false){
|
||||
this.isRecurring = "Não se repete";
|
||||
}
|
||||
@@ -46,8 +62,6 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.profile);
|
||||
console.log(this.postEvent);
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
@@ -77,24 +91,50 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
async openAttendees()
|
||||
{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.postEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.adding = 'intervenient';
|
||||
|
||||
if(window.innerWidth == 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.setIntervenient(newattendees);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async setIntervenient(data){
|
||||
this.taskParticipants = data;
|
||||
|
||||
this.postEvent.Attendees = data;
|
||||
}
|
||||
|
||||
async setIntervenientCC(data){
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
|
||||
async addParticipants(){
|
||||
this.adding = 'intervenient'
|
||||
}
|
||||
|
||||
async addParticipantsCC(){
|
||||
this.adding = 'CC'
|
||||
}
|
||||
|
||||
async closeComponent(){}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user