mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Attendees Enhancments
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<ion-header>
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-title>attendees</ion-title>
|
||||
<ion-title>Intervenientes</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-button (click)="addAttendees()" expand="block">
|
||||
<ion-label>Adicionar intervenientes</ion-label>
|
||||
</ion-button>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
|
||||
<ion-segment-button value="required">
|
||||
@@ -14,10 +15,12 @@
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<div [ngSwitch]="segment">
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item lines="none" *ngFor="let attendee of eventAttendees">
|
||||
<ion-item lines="none" *ngFor="let attendee of showAttendees">
|
||||
<div class="div-item">
|
||||
<div class="div-up">
|
||||
<div class="div-content-attachment">
|
||||
@@ -32,7 +35,18 @@
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-button (click)="addAttendees()" expand="block">
|
||||
<ion-lable>Adicionar intervenientes</ion-lable>
|
||||
</ion-button>
|
||||
<ion-toolbar color="primary">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
<ion-icon name="close" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavController } from '@ionic/angular';
|
||||
import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
|
||||
|
||||
@Component({
|
||||
@@ -11,14 +11,15 @@ import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
|
||||
})
|
||||
export class AttendeesPage implements OnInit {
|
||||
|
||||
eventAttendeesInitial: EventPerson[];
|
||||
eventAttendees: EventPerson[];
|
||||
segment:string = "required";
|
||||
shouldShowCancel:boolean = true;
|
||||
showAttendees: EventPerson[];
|
||||
|
||||
searchCountryString = ''; // initialize your searchCountryString string empty
|
||||
|
||||
constructor(private eventService: EventsService, private modalCtrl: ModalController) {
|
||||
constructor(private eventService: EventsService, private modalCtrl: ModalController,
|
||||
private navCtrl: NavController) {
|
||||
}
|
||||
|
||||
|
||||
@@ -31,22 +32,49 @@ export class AttendeesPage implements OnInit {
|
||||
}
|
||||
|
||||
loadAttendees(){
|
||||
let isRequired: boolean = (this.segment == "required");
|
||||
this.eventAttendees = this.eventService.lastloadedevent.Attendees.filter(function(person) {
|
||||
return person.IsRequired == isRequired;
|
||||
let isrequired: boolean = (this.segment == "required");
|
||||
this.showAttendees = this.eventAttendees.filter(function(person) {
|
||||
return person.IsRequired == isrequired;
|
||||
});
|
||||
this.eventAttendeesInitial = this.eventAttendees;
|
||||
}
|
||||
|
||||
save(){
|
||||
this.modalCtrl.dismiss(this.eventAttendees);
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalCtrl.dismiss(null);
|
||||
}
|
||||
|
||||
async addAttendees()
|
||||
{
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeeModalPage,
|
||||
componentProps: {
|
||||
eventPersons: this.eventAttendees
|
||||
},
|
||||
cssClass: 'attendee-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
|
||||
if (newattendees != null)
|
||||
{
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
"EmailAddress": newattendee.EmailAddress,
|
||||
"Name": newattendee.Name,
|
||||
"IsRequired": (this.segment == "required")
|
||||
};
|
||||
this.eventAttendees.push(att);
|
||||
this.showAttendees.push(att);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user