Files
doneit-web/.angular/cache/14.2.12/babel-webpack/6bcaddbae29c0e691c1fa02ceb46d48d.json
T

1 line
14 KiB
JSON
Raw Normal View History

2023-06-30 09:54:21 +01:00
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./attendees.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./attendees.page.scss?ngResource\";\nimport { Component } from '@angular/core';\nimport { ModalController, NavParams } from '@ionic/angular';\nimport { ContactsService } from 'src/app/services/contacts.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nlet AttendeesPageModal = class AttendeesPageModal {\n constructor(modalCtrl, contactsService, navParams, modalController, ThemeService) {\n this.modalCtrl = modalCtrl;\n this.contactsService = contactsService;\n this.navParams = navParams;\n this.modalController = modalController;\n this.ThemeService = ThemeService;\n this.showLoader = false;\n this.selectedContact = [];\n this.currentPath = window.location.pathname;\n this.taskParticipants = [];\n this.taskParticipantsCc = [];\n this.adding = this.navParams.get('adding');\n this.taskParticipants = this.navParams.get('taskParticipants');\n this.taskParticipantsCc = this.navParams.get('taskParticipantsCc');\n }\n ngOnInit() {\n this.fetchContacts(\"\");\n if (this.taskParticipants == null || this.taskParticipants == undefined) {\n this.taskParticipants = [];\n }\n if (this.taskParticipantsCc == null || this.taskParticipantsCc == undefined) {\n this.taskParticipantsCc = [];\n }\n }\n ngOnChanges(event) {}\n save() {\n this.modalController.dismiss({\n 'taskParticipants': this.taskParticipants,\n 'taskParticipantsCc': this.taskParticipantsCc\n });\n }\n close() {\n this.modalController.dismiss(false);\n }\n onChange(evt) {\n this.fetchContacts(evt.detail.value);\n }\n filterSearchList(itm) {\n const result = this.taskParticipants.concat(this.taskParticipantsCc).find((contact, index) => {\n if (contact.Name.toLocaleLowerCase() == itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() == itm.EmailAddress.toLocaleLowerCase()) {\n index = index;\n return contact;\n }\n });\n return undefined == result;\n }\n remove(itm) {\n if (this.adding == \"intervenient\") {\n this.taskParticipants = this.taskParticipants.filter((contact, index) => {\n if (contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()) {\n return contact;\n }\n return false;\n });\n } else if (this.adding == \"CC\") {\n this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) => {\n if (contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()) {\n return contact;\n }\n return false;\n });\n }\n }\n selectContact(itm) {\n var _this = this;\n return _asyncToGenerator(function* () {\n if (_this.adding == \"intervenient\") {\n itm.IsRequired = true;\n _this.taskParticipants.push(itm);\n } else if (_this.adding == \"CC\") {\n itm.IsRequired = false;\n _this.taskParticipantsCc.push(itm);\n }\n })();\n }\n fetchContacts(filter) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n _this2.showLoader = true;\n _this2.contactsService.getContacts(filter).subscribe(result => {\n if (_this2.eventPersons != null) {\n _this2.eventPersons.forEach(attendee => {\n const index = result.findIndex(cont => {\n return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase();\n });\n result.splice(index, 1);\n });\n }\n _this2.contacts = _this2.sort(result);\n _this2.showLoader = false;\n });\n })();\n }\n sor