bugs solved

This commit is contained in:
Eudes Inácio
2023-08-11 16:14:25 +01:00
parent 2bfec82113
commit 408f68b22e
20 changed files with 263 additions and 129 deletions
@@ -6,6 +6,8 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { ThemeService } from 'src/app/services/theme.service'
import { ViewChild } from '@angular/core';
import { Searchbar } from 'ionic-angular';
import { LoginUserRespose } from 'src/app/models/user.model';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-attendee-modal',
@@ -16,6 +18,7 @@ export class AttendeePage implements OnInit {
// Defined by the API
contacts: EventPerson[];
filterEmptyEmail: EventPerson[];
showLoader: boolean = false;
eventPersons: EventPerson[];
inputFilter = ''
@@ -30,6 +33,7 @@ export class AttendeePage implements OnInit {
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
@Input() loggedAttendSon: boolean;
@Input() footer: boolean;
@@ -37,26 +41,34 @@ export class AttendeePage implements OnInit {
LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = [];
loggeduser: LoginUserRespose;
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService,
public ThemeService: ThemeService ) {
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.loggeduser = SessionStore.user;
}
ngOnChanges() {
this.LtaskParticipants = removeDuplicate(this.taskParticipants);
this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
console.log('PARTE PARTE',this.loggedAttendSon)
}
currentPath = window.location.pathname;
@Input() adding: "intervenient" | "CC";
ngOnInit() {
setTimeout(() => {
console.log('PARTE PARTE',this.loggedAttendSon)
});
this.fetchContacts("");
if(this.LtaskParticipants == null || this.LtaskParticipants == undefined) {
@@ -211,8 +223,20 @@ export class AttendeePage implements OnInit {
});
}
this.contacts = this.sort(result as any);
if(this.loggedAttendSon) {
this.contacts = this.sort(result as any);
this.showLoader = false;
} else {
this.contacts = this.sort(result as any);
console.log('Attendes Email',this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
console.log('Attendes Email', filterLoggedUserEmail)
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
this.contacts = filterEmptyEmail;
console.log('Attendes Email', this.contacts)
this.showLoader = false;
}
}
);
}