diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 2b85de163..43c264baf 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -177,16 +177,11 @@ export class NewPublicationPage implements OnInit { FileBase64: this.capturedImage, FileExtension: 'jpeg', } - - /* console.log('Create'); - console.log(this.publication); */ - this.publications.CreatePublication(this.folderId, this.publication).toPromise(); - this.close(); - try { console.log(this.publication); - await this.publications.CreatePublication(this.folderId, this.publication).toPromise() + await this.publications.CreatePublication(this.folderId, this.publication).toPromise(); + this.close(); this.toastService.successMessage("Publicação criado") diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts index 007e5038e..6749127ed 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts @@ -11,6 +11,7 @@ import { EventsService } from 'src/app/services/events.service'; import { ProcessesService } from 'src/app/services/processes.service'; import { ToastService } from 'src/app/services/toast.service'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; +import { removeDuplicate } from 'src/plugin/removeDuplicate.js' const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -58,8 +59,6 @@ export class EditEventToApprovePage implements OnInit { @ViewChild('fim') fim: any; @ViewChild('inicio') inicio: any; @ViewChild('picker1') picker1: any; - - @Input() serialNumber: string loadedAttachments: Attachment[]= [] @@ -91,8 +90,6 @@ export class EditEventToApprovePage implements OnInit { eventAttendees: EventPerson[]; loadedEventAttachments: Attachment[]; - taskParticipants: any = []; - taskParticipantsCc: any = []; adding: "intervenient" | "CC" = "intervenient"; showAttendees = false; @@ -106,6 +103,9 @@ export class EditEventToApprovePage implements OnInit { @Output() closeComponent = new EventEmitter(); @Input() saveData: any; + @Input() serialNumber: string + @Input() taskParticipants: EventPerson[]; + @Input() taskParticipantsCc: EventPerson[]; constructor( private modalController: ModalController, @@ -161,6 +161,9 @@ export class EditEventToApprovePage implements OnInit { } }) } + + this.taskParticipants = removeDuplicate(this.taskParticipants) + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc) if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { this.isRecurring = "Não se repete"; @@ -274,21 +277,21 @@ export class EditEventToApprovePage implements OnInit { // } dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) { - this.taskParticipants = taskParticipants; - this.taskParticipantsCc = taskParticipantsCc; + this.taskParticipants = removeDuplicate(taskParticipants) ; + this.taskParticipantsCc = removeDuplicate(taskParticipantsCc) ; } - // async addParticipants() { + async addParticipants() { - // //this.saveTemporaryData(); + //this.saveTemporaryData(); - // this.openAttendeesComponent.emit({ - // type: "intervenient" - // }); + this.openAttendeesComponent.emit({ + type: "intervenient" + }); - // this.clearContact.emit(); - // } + this.clearContact.emit(); + } async addParticipantsCC() { diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.ts b/src/app/shared/event/attendee-modal/attendee-modal.page.ts index e6011df58..0c3a952e6 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -3,6 +3,7 @@ import { ModalController } from '@ionic/angular'; import { ContactsService } from 'src/app/services/contacts.service'; import { EventPerson } from 'src/app/models/eventperson.model'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' + @Component({ selector: 'app-attendee-modal', templateUrl: './attendee-modal.page.html', @@ -35,16 +36,14 @@ export class AttendeePage implements OnInit { private modalCtrl: ModalController, private contactsService: ContactsService ) { - this.LtaskParticipants = this.taskParticipants; - this.LtaskParticipantsCc = this.taskParticipantsCc; - + this.LtaskParticipants = removeDuplicate(this.taskParticipants); + this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); } ngOnChanges(){ - this.LtaskParticipants = this.taskParticipants; - this.LtaskParticipantsCc = this.taskParticipantsCc; + this.LtaskParticipants = removeDuplicate(this.taskParticipants); + this.LtaskParticipantsCc = removeDuplicate(this.taskParticipantsCc); } - currentPath = window.location.pathname; @Input() adding: "intervenient" | "CC";