mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve add event and edit event
This commit is contained in:
@@ -144,7 +144,7 @@
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="!taskParticipants" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
@@ -164,7 +164,7 @@
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label *ngIf="!taskParticipantsCc" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
@@ -224,7 +224,7 @@
|
||||
[taskParticipants]="taskParticipants"
|
||||
[taskParticipantsCc]="taskParticipantsCc"
|
||||
[adding]="adding"
|
||||
(dynamicSetIntervenient)="dynamicSetIntervenient($event)"
|
||||
|
||||
></app-attendee-modal>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -71,9 +71,11 @@ export class EditEventPage implements OnInit {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
save(){
|
||||
|
||||
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
@@ -90,13 +92,13 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
async openAttendees() {
|
||||
|
||||
this.adding = 'intervenient';
|
||||
|
||||
if(window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
taskParticipantsCc: this.taskParticipantsCc
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
@@ -105,41 +107,39 @@ export class EditEventPage implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.setIntervenient(newattendees);
|
||||
|
||||
if(data){
|
||||
data = data['data'];
|
||||
|
||||
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||
|
||||
this.setIntervenient(newAttendees);
|
||||
this.setIntervenientCC(newAttendeesCC);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async dynamicSetIntervenient(data){
|
||||
this.taskParticipants = data['taskParticipants'];
|
||||
this.taskParticipantsCc = data['taskParticipantsCc'];
|
||||
}
|
||||
|
||||
async setIntervenient(data){
|
||||
setIntervenient(data){
|
||||
this.taskParticipants = data;
|
||||
this.postEvent.Attendees = data;
|
||||
}
|
||||
|
||||
async setIntervenientCC(data){
|
||||
setIntervenientCC(data){
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
|
||||
async addParticipants(){
|
||||
addParticipants(){
|
||||
this.adding = 'intervenient'
|
||||
|
||||
this.openAttendees();
|
||||
}
|
||||
|
||||
async addParticipantsCC(){
|
||||
addParticipantsCC(){
|
||||
this.adding = 'CC'
|
||||
|
||||
this.openAttendees();
|
||||
}
|
||||
|
||||
async closeComponent(){}
|
||||
}
|
||||
Reference in New Issue
Block a user