Merge branch 'feature/calendar' into developer

This commit is contained in:
tiago.kayaya
2021-03-30 16:27:02 +01:00
8 changed files with 57 additions and 36 deletions
@@ -47,7 +47,8 @@
</ion-content>
<ion-footer class="ion-no-border">
<!-- Hide footer in gabinete-digital -->
<ion-footer class="ion-no-border" *ngIf="currentPath != '/home/gabinete-digital' ">
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start">
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
@@ -22,6 +22,8 @@ export class AttendeeModalPage implements OnInit {
@Output() closeComponent = new EventEmitter<any>();
@Output() setContact = new EventEmitter<any>();
currentPath = window.location.pathname;
ngOnInit() {
this.fetchContacts("");
this.selectedContact = this.eventAttendees;
@@ -33,6 +35,12 @@ export class AttendeeModalPage implements OnInit {
this.closeComponent.emit();
}
setContactWithClose(){
if(this.currentPath == '/home/gabinete-digital'){
this.setContact.emit(this.selectedContact);
}
}
close(){
// this.modalCtrl.dismiss(null);
this.selectedContact = [];
@@ -66,22 +74,18 @@ export class AttendeeModalPage implements OnInit {
return false;
});
// run only in gabinete digital
this.setContactWithClose();
}
async selectContact(itm: EventPerson){
const index = 0;
const findIndex = this.selectedContact.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
return contact;
}
});
this.selectedContact.push(itm);
// run only in gabinete digital
this.setContactWithClose();
}
async fetchContacts(filter: string) {