diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 9cc716326..8899495e2 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -187,16 +187,6 @@ const routes: Routes = [ path:':folderId/:publicationId', loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule) }, - { - path:'publication-detail', - children: [ - { - path: ':id', - loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule) - }, - ] - - }, ] }, { diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 117cf2f25..32abc8554 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -410,7 +410,7 @@ export class CreateProcessPage implements OnInit { taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'attendee', + cssClass: 'modal attendee', backdropDismiss: false }); @@ -428,8 +428,6 @@ export class CreateProcessPage implements OnInit { this.setIntervenientCC(newAttendeesCC); } }); - - } else { this.showAttendees=true } diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index e18ed8185..2f2b46f6a 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -14,6 +14,7 @@ import { AlertService } from 'src/app/services/alert.service'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { ToastService } from 'src/app/services/toast.service'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; @Component({ selector: 'app-delegar', @@ -82,7 +83,10 @@ export class DelegarPage implements OnInit { } async saveTask() { - if(this.taskParticipants.length > 1){ + if(this.taskParticipants.length < 1){ + this.toastService.badRequest("Selecione um destinatário"); + } + else if(this.taskParticipants.length > 1){ this.toastService.badRequest("Selecione apenas um destinatário"); } else { @@ -98,6 +102,7 @@ export class DelegarPage implements OnInit { this.processes.DelegateTask(body).subscribe(res=>{ console.log(res); this.toastService.successMessage('Processo delegado') + this.close(); }, (error)=>{ this.toastService.badRequest("Processo não delegado") @@ -105,46 +110,60 @@ export class DelegarPage implements OnInit { } } - async addParticipants(){ - console.log('HERE'); - + async addParticipants() { this.adding = "intervenient"; - if(window.innerWidth <= 800){ + if(window.innerWidth <=800) { + this.showAttendees=false; const modal = await this.modalController.create({ - component: AddParticipantsModalPage, - componentProps: { - eventPersons: this.eventAttendees + component: AttendeesPageModal, + componentProps: { + adding: this.adding, + taskParticipants: this.taskParticipants, + taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'book-meeting-modal', + cssClass: 'modal attendee', backdropDismiss: false }); - + await modal.present(); - - modal.onDidDismiss().then((res) => { - /* this.taskParticipants = res.data; - let newattendees: EventPerson[] = res['data']; - if(newattendees != null){ - newattendees.forEach(newattendee => { - let att = { - "EmailAddress": newattendee.EmailAddress, - "Name": newattendee.Name, - "IsRequired": true - }; - if(this.eventAttendees == null){ - this.eventAttendees = null; - } - this.eventAttendees = att; - console.log(att); - - }); - } */ + + modal.onDidDismiss().then((data) => { + if(data) { + data = data['data']; + const newAttendees: EventPerson[] = data['taskParticipants']; + const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; + this.setIntervenient(newAttendees); + this.setIntervenientCC(newAttendeesCC); + } }); } else { - this.showAttendees = true; + this.showAttendees=true } } + async setContact(data:EventPerson[]) { + + if(this.adding == "intervenient"){ + this.taskParticipants = data; + } else if (this.adding == "CC") { + + this.taskParticipantsCc = data; + } + + } + + async setIntervenient(data) { + this.taskParticipants = data; + } + + async setIntervenientCC(data) { + this.taskParticipantsCc = data; + } + + async closeComponent() { + this.showAttendees = false; + } + async distartExpedientModal(){ const modal = await this.modalController.create({ component: DiscartExpedientModalPage, diff --git a/src/app/modals/forward/forward.page.html b/src/app/modals/forward/forward.page.html index 00f97ee0b..44bba9acb 100644 --- a/src/app/modals/forward/forward.page.html +++ b/src/app/modals/forward/forward.page.html @@ -4,7 +4,7 @@