Uncomment all method that use k2 service

This commit is contained in:
Peter Maquiran
2021-04-21 14:27:55 +01:00
parent 7d882d3a11
commit ef1c260f77
9 changed files with 98 additions and 63 deletions
@@ -15,20 +15,29 @@ export class AttendeeModalPage implements OnInit {
showLoader: boolean = false;
eventPersons: EventPerson[];
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService ) {
}
@Output() closeComponent = new EventEmitter<any>();
@Output() setIntervenient = new EventEmitter<any>();
@Output() setIntervenientCC = new EventEmitter<any>();
@Output() dynamicSetIntervenient = new EventEmitter<any>();
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
LtaskParticipants: EventPerson[] = [];
LtaskParticipantsCc: EventPerson[] = [];
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService ) {
this.LtaskParticipants = this.taskParticipants;
this.LtaskParticipantsCc = this.taskParticipantsCc;
}
currentPath = window.location.pathname;
@Input() adding: "intervenient" | "CC";
@@ -37,12 +46,12 @@ export class AttendeeModalPage implements OnInit {
this.fetchContacts("");
if(this.taskParticipants == null || this.taskParticipants == undefined) {
this.taskParticipants = [];
if(this.LtaskParticipants == null || this.LtaskParticipants == undefined) {
this.LtaskParticipants = [];
}
if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined) {
this.taskParticipantsCc = [];
if(this.LtaskParticipantsCc == null || this.LtaskParticipantsCc == undefined) {
this.LtaskParticipantsCc = [];
}
}
@@ -52,23 +61,26 @@ export class AttendeeModalPage implements OnInit {
}
save(){
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
this.setIntervenient.emit(this.LtaskParticipants);
this.setIntervenientCC.emit(this.LtaskParticipantsCc);
this.closeComponent.emit();
}
setContactWithClose(){
if(this.currentPath == '/home/gabinete-digital'){
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
setContactWithClose() {
if(this.currentPath == '/home/gabinete-digital') {
console.log('set!!!!! ')
this.setIntervenient.emit(this.LtaskParticipants);
this.setIntervenientCC.emit(this.LtaskParticipantsCc);
}
console.log('data', this.taskParticipants, this.taskParticipantsCc );
/* console.log('data', this.LtaskParticipants, this.LtaskParticipantsCc ); */
this.dynamicSetIntervenient.emit({
taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc
LtaskParticipants: this.LtaskParticipants,
LtaskParticipantsCc: this.LtaskParticipantsCc
})
}
async selectContact(itm: EventPerson){
@@ -76,12 +88,12 @@ export class AttendeeModalPage implements OnInit {
if(this.adding == "intervenient") {
itm.IsRequired = true;
this.taskParticipants.push(itm);
this.LtaskParticipants.push(itm);
} else if (this.adding == "CC") {
itm.IsRequired = false;
this.taskParticipantsCc.push(itm);
this.LtaskParticipantsCc.push(itm);
} else {
// alert('bug')
}
@@ -101,7 +113,7 @@ export class AttendeeModalPage implements OnInit {
filterSearchList(itm: EventPerson): boolean {
const result1 = this.taskParticipants.find((contact, index)=>{
const result1 = this.LtaskParticipants.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
@@ -115,7 +127,7 @@ export class AttendeeModalPage implements OnInit {
}
const result2 = this.taskParticipantsCc.find((contact, index)=>{
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
@@ -137,7 +149,7 @@ export class AttendeeModalPage implements OnInit {
if(this.adding == "intervenient"){
this.taskParticipants = this.taskParticipants.filter((contact, index) =>{
this.LtaskParticipants = this.LtaskParticipants.filter((contact, index) =>{
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
return contact;
@@ -148,7 +160,7 @@ export class AttendeeModalPage implements OnInit {
} else if (this.adding == "CC") {
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
this.LtaskParticipantsCc = this.LtaskParticipantsCc.filter((contact, index) =>{
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
return contact;