diff --git a/src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page.html b/src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page.html
index ca7fdd41d..f654a2caa 100644
--- a/src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page.html
+++ b/src/app/pages/gabinete-digital/expediente/add-participants-modal/add-participants-modal.page.html
@@ -1,5 +1,5 @@
- Adicionar Intervenientes
+ Adicionar Intervenientes - TK
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html
index 048c8da40..110602c06 100644
--- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html
+++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html
@@ -65,7 +65,7 @@
- Adicionar intervenientes
+ Adicionar intervenientes
{{participant.Name}}
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
index ec60e0b5a..7905d4b08 100644
--- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
+++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
@@ -21,6 +21,7 @@ import { User } from 'src/app/models/user.model';
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 { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
@Component({
selector: 'app-expedient-task-modal',
@@ -249,10 +250,12 @@ export class ExpedientTaskModalPage implements OnInit {
"Note": "",
}
}
- this.taskResult = await this.processes.postParecer(this.postData).toPromise();
- await this.toastService.successMessage('Processo efetuado', () =>{
+ //this.taskResult = await this.processes.postParecer(this.postData).toPromise();
+ await this.toastService.successMessage('Processo efetuado');
+ setInterval(()=>{
this.modalController.dismiss(action_parecer);
- });
+ }, 7000);
+
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
}
@@ -367,89 +370,71 @@ export class ExpedientTaskModalPage implements OnInit {
});
}
-
- async addParticipants() {
- /* console.log('HERES'); */
-
- this.adding = "intervenient";
- this.contacts = this.taskParticipants;
-
- if(window.innerWidth <=800){
-
- this.showAttendees=false;
+ async openAttendees() {
+ if(window.innerWidth <= 1024) {
const modal = await this.modalController.create({
- component: AddParticipantsModalPage,
+ component: AttendeesPage,
componentProps: {
- eventPersons: this.participants
+ adding: this.adding,
+ taskParticipants: this.taskParticipants,
+ taskParticipantsCc: this.taskParticipantsCc
},
- cssClass: 'add-participants-modal',
+ cssClass: 'attendee modal modal-desktop',
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 = {
- 'UserEmail': newattendee.EmailAddress,
- 'UserType': 'I',
- };
- if(this.participants == null){
- this.participants = new Array();
- }
- this.participants.push(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);
}
- this.postData.UsersSelected = this.participants;
- console.log(this.postData);
});
} else {
- this.showAttendees=true
+ this.showAttendees = true
}
}
+
+ /* setIntervenient(data){
+ this.taskParticipants = data;
+ //this.postData.UsersSelected = data;
+ }
+
+ setIntervenientCC(data){
+ this.taskParticipantsCc = data;
+ } */
+
+
+ async setIntervenient(data) {
+ this.taskParticipants = data;
+ }
+
+ async setIntervenientCC(data) {
+ this.taskParticipantsCc = data;
+ }
+
+ async addParticipants() {
+ this.adding = 'intervenient'
+ this.openAttendees();
+ }
async addParticipantsCc() {
-
this.adding = "CC";
- this.contacts = this.taskParticipantsCc;
-
- if(window.innerWidth <=800){
- this.showAttendees=false;
-
- const modal = await this.modalController.create({
- component: AddParticipantsCcModalPage,
- componentProps: {
- eventPersons: this.participants
- },
- cssClass: 'add-participants-cc-modal',
- backdropDismiss: false
- });
- await modal.present();
- modal.onDidDismiss().then((res) => {
- this.taskParticipantsCc = res.data;
- let newattendees: EventPerson[] = res['data'];
- if(newattendees!= null){
- newattendees.forEach(newattendee => {
- let att = {
- 'UserEmail': newattendee.EmailAddress,
- 'UserType': 'CC',
- };
- if(this.participants == null){
- this.participants = new Array();
- }
- this.participants.push(att);
- });
- }
- this.postData.UsersSelected = this.participants;
- console.log(this.postData);
- });
- } else {
- this.showAttendees=true
- }
+ this.openAttendees();
+ }
+ dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
+ this.taskParticipants = taskParticipants;
+ this.taskParticipantsCc = taskParticipantsCc;
}
async distartExpedientModal() {
@@ -485,13 +470,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
- async setIntervenient(data) {
- this.taskParticipants = data;
- }
- async setIntervenientCC(data) {
- this.taskParticipantsCc = data;
- }
async closeComponent() {
this.showAttendees = false;
diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.html b/src/app/shared/event/attendee-modal/attendee-modal.page.html
index d0f026983..97b1d4b7b 100644
--- a/src/app/shared/event/attendee-modal/attendee-modal.page.html
+++ b/src/app/shared/event/attendee-modal/attendee-modal.page.html
@@ -1,6 +1,7 @@
Adicionar intervenientes
+ Agenda Desktop
diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts
index c55082221..1e58b380d 100644
--- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts
+++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts
@@ -8,6 +8,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
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 { Event, EventToApproveEdit } from '../../../models/event.model';
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
@@ -140,7 +141,8 @@ export class EditEventToApproveComponent implements OnInit {
public alertController: AlertController,
private attachmentsService: AttachmentsService,
private processes:ProcessesService,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService,
) {
this.serialNumber = this.navParams.get('serialNumber');
@@ -253,9 +255,9 @@ export class EditEventToApproveComponent implements OnInit {
}
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
- this.successMessage('Evento editado')
+ this.toastService.successMessage('Evento editado');
}, error =>{
- this.badRequest('Evento não editado')
+ this.toastService.badRequest('Evento não editado');
})
@@ -263,16 +265,16 @@ export class EditEventToApproveComponent implements OnInit {
if(document['action'] == 'add') {
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
- //this.successMessage()
+ this.toastService.successMessage();
}, error =>{
- this.badRequest()
+ this.toastService.badRequest();
});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
- //this.successMessage()
+ this.toastService.successMessage()
}, error =>{
- this.badRequest()
+ this.toastService.badRequest()
})
}
@@ -407,96 +409,4 @@ export class EditEventToApproveComponent implements OnInit {
});
}
- async successMessage(message?: any, callback?) {
-
- const enterAnimation = (baseEl: any) => {
- const backdropAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('ion-backdrop')!)
- .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
-
- const wrapperAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('.modal-wrapper')!)
- .keyframes([
- { offset: 0, opacity: '1', right: '-100%' },
- { offset: 1, opacity: '1', right: '0px' }
- ]);
-
- return this.animationController.create()
- .addElement(baseEl)
- .easing('ease-out')
- .duration(500)
- .addAnimation([backdropAnimation, wrapperAnimation]);
- }
-
- const leaveAnimation = (baseEl: any) => {
- return enterAnimation(baseEl).direction('reverse');
- }
-
-
- const modal = await this.modalController.create({
- enterAnimation,
- leaveAnimation,
- component: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
-
- async badRequest(message?: string, callback?) {
- const enterAnimation = (baseEl: any) => {
- const backdropAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('ion-backdrop')!)
- .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
-
- const wrapperAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('.modal-wrapper')!)
- .keyframes([
- { offset: 0, opacity: '1', right: '-100%' },
- { offset: 1, opacity: '1', right: '0px' }
- ]);
-
- return this.animationController.create()
- .addElement(baseEl)
- .easing('ease-out')
- .duration(500)
- .addAnimation([backdropAnimation, wrapperAnimation]);
- }
-
- const leaveAnimation = (baseEl: any) => {
- return enterAnimation(baseEl).direction('reverse');
- }
-
-
- const modal = await this.modalController.create({
- enterAnimation,
- leaveAnimation,
- component: BadRequestPage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
-
}
\ No newline at end of file