From 93ac1c47366114d65db745bc5935e4f35548ae87 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 11 Jun 2021 15:17:01 +0100 Subject: [PATCH 01/27] Improve --- .../book-meeting-modal/book-meeting-modal.page.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index f30920797..f07882156 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -155,8 +155,11 @@ export class BookMeetingModalPage implements OnInit { await this.calendarService.createTaskEvent(this.task.FolderId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise(); break; } - this.successMessage('Reunião criada') - this.close(); + + this.successMessage('Reunião criada', ()=>{ + this.close(); + }) + } catch (error) { this.badRequest() } From 5f280283c89bac8c98f1bf649d4efd018ef73a28 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 14 Jun 2021 12:07:07 +0100 Subject: [PATCH 02/27] Improve scroll --- src/app/pages/agenda/agenda.page.html | 3 +- src/app/pages/agenda/agenda.page.scss | 6 ++- src/app/pages/agenda/agenda.page.ts | 8 ++-- src/global.scss | 58 +++++++++++++-------------- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 54aaa51db..b45fb6b51 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -224,7 +224,7 @@
-
+
{{event.event.StartDate | date: 'HH:mm'}}
@@ -267,6 +267,7 @@
+
{{event.event.StartDate | date: 'HH:mm'}}
--
diff --git a/src/app/pages/agenda/agenda.page.scss b/src/app/pages/agenda/agenda.page.scss index 1ed94dde5..956477c93 100644 --- a/src/app/pages/agenda/agenda.page.scss +++ b/src/app/pages/agenda/agenda.page.scss @@ -427,6 +427,7 @@ td.monthview-primary-with-event { font-family: Roboto; font-size: 15px; margin-right: 25px; + width: 55px; } ul{ @@ -710,13 +711,14 @@ app-approve-event{ .filter-Pessoal { - .content-pr-Pessoal, .content-mdgpr-Pessoal { + .content-pr-Oficial, .content-mdgpr-Oficial, .content-md-Pessoal { display: none !important; } } .filter-Oficial { - .content-pr-Oficial, .content-mdgpr-Oficial { + .content-pr-Pessoal, .content-mdgpr-Pessoal, .content-md-Pessoal { display: none !important; } + } \ No newline at end of file diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 3065381a4..d52189326 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -586,7 +586,7 @@ export class AgendaPage implements OnInit { }); }); - const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md'); + const list = this.timelineFilter(this.timelineFilterState, this.eventsList, 'mdgpr'); this.TimelineMDList = this.eventListBox(list) @@ -679,7 +679,7 @@ export class AgendaPage implements OnInit { }); }); - const list = this.timelineFilter(this.timelineFilterState, this.eventsListPessoal, 'md'); + const list = this.timelineFilter(this.timelineFilterState, this.eventsListPessoal, 'mdgpr'); this.TimelineMDList = this.eventListBox(list) @@ -759,7 +759,7 @@ export class AgendaPage implements OnInit { }); }); - const list = this.timelineFilter(this.timelineFilterState, this.eventsListOficial, 'md'); + const list = this.timelineFilter(this.timelineFilterState, this.eventsListOficial, 'mdgpr'); this.TimelineMDList = this.eventListBox(list) @@ -853,7 +853,7 @@ export class AgendaPage implements OnInit { }); - const MDEventList = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md'); + const MDEventList = this.timelineFilter(this.timelineFilterState, this.eventsList, 'mdgpr'); diff --git a/src/global.scss b/src/global.scss index 9428fbef0..a7ee0e322 100644 --- a/src/global.scss +++ b/src/global.scss @@ -790,40 +790,38 @@ ion-icon{ -@media only screen and (min-width: 800px) { +::-webkit-scrollbar { + width: 10px; + height: 10px; +} + +/* Track */ +::-webkit-scrollbar-track { +background: #f1f1f1; +border-radius: 5px; +-webkit-border-radius: 5px; +-moz-border-radius: 5px; +-ms-border-radius: 5px; +-o-border-radius: 5px; +} - ::-webkit-scrollbar { - width: 10px; - height: 10px; - } - - /* Track */ - ::-webkit-scrollbar-track { - background: #f1f1f1; - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - } - - /* Handle */ - ::-webkit-scrollbar-thumb { - background: #888; - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - } - - /* Handle on hover */ - ::-webkit-scrollbar-thumb:hover { - background: rgb(92, 92, 92); - } +/* Handle */ +::-webkit-scrollbar-thumb { +background: #888; +border-radius: 5px; +-webkit-border-radius: 5px; +-moz-border-radius: 5px; +-ms-border-radius: 5px; +-o-border-radius: 5px; +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { +background: rgb(92, 92, 92); } +// =================================== .hide-scroll::-webkit-scrollbar { display: none !important; } From 0dff00c6a2362997f3d8fef8608f60d571417128 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 14 Jun 2021 13:33:46 +0100 Subject: [PATCH 03/27] Improve scrollbar --- src/global.scss | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/src/global.scss b/src/global.scss index a7ee0e322..37ea09951 100644 --- a/src/global.scss +++ b/src/global.scss @@ -751,40 +751,11 @@ ion-icon{ } - - - - -@media only screen and (min-width: 300px) { +@media only screen and (max-width: 500px) { ::-webkit-scrollbar { - width: 5px; - height: 5px; - } - - /* Track */ - ::-webkit-scrollbar-track { - background: #f1f1f1; - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - } - - /* Handle */ - ::-webkit-scrollbar-thumb { - background: #888; - border-radius: 5px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - } - - /* Handle on hover */ - ::-webkit-scrollbar-thumb:hover { - background: rgb(92, 92, 92); + width: 5px !important; + height: 5px !important; } } From f77abeec498a6bc87839799408acfe9ab16a26e4 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 13:48:02 +0100 Subject: [PATCH 04/27] save --- .../create-process/create-process.page.html | 8 +- .../create-process/create-process.page.ts | 98 +++++++++++-------- .../agenda/view-event/view-event.page.ts | 80 +-------------- .../approve-event-modal.page.ts | 2 +- .../approve-event/approve-event.page.ts | 2 +- .../expedient-task-modal.page.html | 9 +- .../expedient-task-modal.page.ts | 22 ++++- .../approve-event/approve-event.page.ts | 2 +- 8 files changed, 93 insertions(+), 130 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.html b/src/app/modals/create-process/create-process.page.html index 8a11e6799..4b8f33e43 100644 --- a/src/app/modals/create-process/create-process.page.html +++ b/src/app/modals/create-process/create-process.page.html @@ -43,9 +43,15 @@
- + + Tipo de assunto + {{type.Description}} +
diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index ca879bbf0..b63ddec75 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -19,6 +19,7 @@ import { SearchPage } from 'src/app/pages/search/search.page'; 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 { User } from 'src/app/models/user.model'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-create-process', @@ -72,6 +73,7 @@ export class CreateProcessPage implements OnInit { private authService: AuthService, private userAuth: AuthService, private animationController: AnimationController, + private toastService: ToastService, ) { this.loggeduser = userAuth.ValidatedUser; this.user = environment.defaultuser +'@'+ environment.domain; @@ -91,11 +93,12 @@ export class CreateProcessPage implements OnInit { SourceType: 'DOC', //FOLDER SourceId: this.task.workflowInstanceDataFields.SourceID, //FolderId DeadlineType: '', - SubjectTypes: ['99999844'], + SubjectTypes: ['99999850'], NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber, }; - + //Initialize SubjectTypes Array with the value "Indefinido" + this.selectedTypes = ['99999850']; this.postData.DispatchFolder = this.dispatchFolder; this.postData.UsersSelected = this.participants; /* By Default TypeDeadline should be 'Normal' */ @@ -110,8 +113,25 @@ export class CreateProcessPage implements OnInit { } ngOnInit() { + console.log(this.postData.DispatchFolder.SubjectTypes); this.taskDate = new Date(this.task.taskStartDate); this.getSubjectType(); + + if(this.selectedTypes.length > 1){ + console.log('Yes'); + + } + } + + onSelectedTypesChanged(ev:any){ + console.log(ev); + if(ev.length > 1){ + console.log(ev.filter(data => data != '99999850')); + this.selectedTypes = ev.filter(data => data != '99999850'); + } + if(ev.length == 0){ + this.selectedTypes = ["99999850"]; + } } close(){ @@ -176,10 +196,11 @@ export class CreateProcessPage implements OnInit { console.log('this.postData', this.postData, this.taskType); try { - await this.processes.postDespatcho(this.postData).toPromise() - //this.successMessage('') + await this.processes.postDespatcho(this.postData).toPromise(); + this.executado(); + this.toastService.successMessage('Despacho criado'); } catch (error) { - this.badRequest() + this.toastService.badRequest('Processo não efectuado'); } break; @@ -196,10 +217,12 @@ export class CreateProcessPage implements OnInit { await this.processes.postParecer(this.postData).toPromise() try { - await this.processes.postParecer(this.postData).toPromise() - // this.successMessage() - } catch (error) { - this.badRequest() + await this.processes.postParecer(this.postData).toPromise(); + this.executado(); + this.toastService.successMessage('Pedido de Parecer criado'); + } + catch (error) { + this.toastService.badRequest('Processo não efectuado'); } break; @@ -215,19 +238,19 @@ export class CreateProcessPage implements OnInit { console.log(this.postData); try { - await this.processes.postDeferimento(this.postData).toPromise() - // this.successMessage() - } catch (error) { - this.badRequest() + await this.processes.postDeferimento(this.postData).toPromise(); + this.executado(); + this.toastService.successMessage('Pedido de Deferimento criado'); + } + catch (error) { + this.toastService.badRequest('Processo não efectuado'); } - break; } - this.executado(); this.modalController.dismiss(); } else { - this.alertController.presentAlert("Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes."); + this.toastService.badRequest('Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.'); } break; @@ -246,10 +269,11 @@ export class CreateProcessPage implements OnInit { console.log('this.postData', this.postData, this.taskType); try { - await this.processes.postDespatcho(this.postData).toPromise() - // this.successMessage() + await this.processes.postDespatcho(this.postData).toPromise(); + this.executado(); + this.toastService.successMessage('Despacho criado'); } catch (error) { - this.badRequest() + this.toastService.badRequest('Processo não efectuado'); } break; @@ -266,10 +290,12 @@ export class CreateProcessPage implements OnInit { await this.processes.postParecer(this.postData).toPromise() try { - await this.processes.postParecer(this.postData).toPromise() - // this.successMessage() - } catch (error) { - this.badRequest() + await this.processes.postParecer(this.postData).toPromise(); + this.executado(); + this.toastService.successMessage('Pedido de Parecer criado'); + } + catch (error) { + this.toastService.badRequest('Processo não efectuado'); } break; @@ -285,22 +311,22 @@ export class CreateProcessPage implements OnInit { console.log(this.postData); try { - await this.processes.postDeferimento(this.postData).toPromise() - // this.successMessage() - } catch (error) { - this.badRequest() + await this.processes.postDeferimento(this.postData).toPromise(); + this.executado(); + this.toastService.successMessage('Pedido de Deferimento criado'); + } + catch (error) { + this.toastService.badRequest('Processo não efectuado'); } break; } - this.executado(); this.modalController.dismiss(); break; } - - } + async executado() { let body = { "serialNumber": this.task.serialNumber, @@ -311,19 +337,11 @@ export class CreateProcessPage implements OnInit { }, "AttachmentList" :null, - } - try { - await this.processes.CompleteTask(body).toPromise() - this.successMessage() - } catch (error) { - this.badRequest() - } - - + } + await this.processes.CompleteTask(body).toPromise(); } async addParticipants() { - /* console.log('HERES'); */ this.adding = "intervenient"; this.contacts = this.taskParticipants; diff --git a/src/app/pages/agenda/view-event/view-event.page.ts b/src/app/pages/agenda/view-event/view-event.page.ts index 229d22fdb..58bf4807c 100644 --- a/src/app/pages/agenda/view-event/view-event.page.ts +++ b/src/app/pages/agenda/view-event/view-event.page.ts @@ -219,87 +219,9 @@ export class ViewEventPage implements OnInit { }); } - // async openBookMeetingModal() { - - // const doc = this.loadedAttachments[ this.dicIndex]; - - // let task = { - // serialNumber: doc.SourceId, - // taskStartDate: doc.CreateDate, - // isEvent: true, - // workflowInstanceDataFields: { - // FsId: doc.ApplicationId, - // FolderID: null, - // DocId: doc.SourceId, - // Subject: doc.SourceName - // }, - // } - - // let classs; - // if( window.innerWidth <= 800){ - // classs = 'book-meeting-modal modal modal-desktop' - // } else { - // classs = 'modal modal-desktop showAsideOptions' - // } - // const modal = await this.modalController.create({ - // component: BookMeetingModalPage, - // componentProps: { - // task: task, - // }, - // cssClass: classs, - // backdropDismiss: false - // }); - // await modal.present(); - // modal.onDidDismiss(); - // } - - // async openExpedientActionsModal(taskAction: any) { - // //this.modalController.dismiss(); - // let classs; - // if( window.innerWidth <= 800){ - // classs = 'modal modal-desktop' - // } else { - // classs = 'modal modal-desktop showAsideOptions' - // } - - // const doc = this.loadedAttachments[ this.dicIndex]; - - // let task = { - // serialNumber: doc.SourceId, - // taskStartDate: doc.CreateDate, - // isEvent: true, - // workflowInstanceDataFields: { - // FsId: doc.ApplicationId, - // FolderID: null, - // DocId: doc.SourceId, - // Subject: doc.SourceName - // }, - // } - - // const modal = await this.modalController.create({ - // component: ExpedientTaskModalPage, - // componentProps: { - // taskAction: taskAction, - // task: task, - // profile: this.profile, - // }, - // cssClass: classs, - // }); - // await modal.present(); - // modal.onDidDismiss().then(res=>{ - // console.log(res['data']); - // if(res['data']=='openDiscart'){ - // console.log('open discart'); - // // this.distartExpedientModal(); - // } - - // }); - // } - - async openTaskOptions() { - const doc = this.loadedAttachments[ this.dicIndex]; + const doc = this.loadedAttachments[this.dicIndex]; let customTask = { serialNumber: doc.SourceId, diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index 805251e85..a2a422460 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -178,7 +178,7 @@ export class ApproveEventModalPage implements OnInit { "serialNumber": serialNumber, "action": "Emendar", "dataFields": { - "ReviewerUseComment": res.data, + "ReviewUseComment": res.data, } } diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index 981b159d6..c4af50dbb 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -189,7 +189,7 @@ export class ApproveEventPage implements OnInit { let body = { "serialNumber": serialNumber, "action": "Emendar", "dataFields": { - "ReviewerUseComment": res.data, + "ReviewUseComment": res.data, } } console.log(body); 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 0fb9d0476..048c8da40 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 @@ -43,9 +43,12 @@
- - Tipos de assunto - + + Tipo de assunto + {{type.Description}} 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 10021e2db..e86b448c3 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 @@ -20,6 +20,7 @@ import { EventAttachment } from 'src/app/models/attachment.model'; 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'; @Component({ selector: 'app-expedient-task-modal', @@ -76,11 +77,11 @@ export class ExpedientTaskModalPage implements OnInit { private alertController: AlertService, private authService: AuthService, private userAuth: AuthService, - private animationController: AnimationController) { - + private animationController: AnimationController, + private toastService: ToastService, + ) { this.loggeduser = userAuth.ValidatedUser; - this.user = environment.defaultuser +'@'+ environment.domain; this.task = this.navParams.get('task'); @@ -88,6 +89,8 @@ export class ExpedientTaskModalPage implements OnInit { this.taskType = this.navParams.get('taskAction'); + this.selectedTypes = ['99999850']; + this.postData = new Despacho(); this.participants = this.participants = new Array(); this.dispatchFolder = { @@ -98,7 +101,7 @@ export class ExpedientTaskModalPage implements OnInit { SourceType: 'DOC', //FOLDER SourceId: this.task.workflowInstanceDataFields.DocID, //FolderId DeadlineType: '', - SubjectTypes: ['99999844'], + SubjectTypes: ['99999850'], NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber, }; @@ -126,6 +129,17 @@ export class ExpedientTaskModalPage implements OnInit { this.getSubjectType(); } + onSelectedTypesChanged(ev:any){ + console.log(ev); + if(ev.length > 1){ + console.log(ev.filter(data => data != '99999850')); + this.selectedTypes = ev.filter(data => data != '99999850'); + } + if(ev.length == 0){ + this.selectedTypes = ["99999850"]; + } + } + close(){ this.router.navigate(['/home/gabinete-digital/expediente']); this.modalController.dismiss(null); diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index 321717fb4..d05fbc58d 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -180,7 +180,7 @@ export class ApproveEventPage implements OnInit { let body = { "serialNumber": serialNumber, "action": "Emendar", "dataFields": { - "ReviewerUseComment": res.data, + "ReviewUseComment": res.data, } } console.log(body); From f9016271474f1dad61ef2a02f0bcfea862c9c682 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 14:04:00 +0100 Subject: [PATCH 05/27] save --- .../create-process/create-process.page.ts | 10 +++-- .../approve-event-modal.page.ts | 8 ++-- .../expedient-task-modal.page.ts | 41 +++++++++++-------- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index b63ddec75..bf2c8c092 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -85,6 +85,9 @@ export class CreateProcessPage implements OnInit { this.postData = new Despacho(); this.participants = this.participants = new Array(); + //Initialize SubjectTypes Array with the value "Indefinido" + this.selectedTypes = ['99999850']; + this.dispatchFolder = { Nad: 30, Subject: '', @@ -93,12 +96,11 @@ export class CreateProcessPage implements OnInit { SourceType: 'DOC', //FOLDER SourceId: this.task.workflowInstanceDataFields.SourceID, //FolderId DeadlineType: '', - SubjectTypes: ['99999850'], + SubjectTypes: this.selectedTypes, NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber, }; - //Initialize SubjectTypes Array with the value "Indefinido" - this.selectedTypes = ['99999850']; + this.postData.DispatchFolder = this.dispatchFolder; this.postData.UsersSelected = this.participants; /* By Default TypeDeadline should be 'Normal' */ @@ -198,7 +200,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDespatcho(this.postData).toPromise(); this.executado(); - this.toastService.successMessage('Despacho criado'); + this.toastService.badRequest('Despacho criado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index a2a422460..8600df563 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -11,6 +11,7 @@ import { SuccessMessagePage } from 'src/app/shared/popover/success-message/succe import { EmendMessageModalPage } from '../../../agenda/emend-message-modal/emend-message-modal.page'; import { EventActionsPopoverPage } from '../../../agenda/event-actions-popover/event-actions-popover.page'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-approve-event-modal', @@ -41,6 +42,7 @@ export class ApproveEventModalPage implements OnInit { private activatedRoute: ActivatedRoute, private iab: InAppBrowser, private animationController: AnimationController, + private toastService: ToastService, ) { @@ -129,13 +131,11 @@ export class ApproveEventModalPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() - this.successMessage('Evento rejeitado', () =>{ + this.toastService.successMessage('Evento rejeitado', () =>{ this.router.navigate(['/home/gabinete-digital/event-list']); }) - - } catch (error) { - this.badRequest('Evento não rejeitado') + this.toastService.badRequest('Evento não rejeitado') } this.modalController.dismiss(null); 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 e86b448c3..ec60e0b5a 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 @@ -89,6 +89,7 @@ export class ExpedientTaskModalPage implements OnInit { this.taskType = this.navParams.get('taskAction'); + //Initialize SubjectTypes Array with the value "Indefinido" this.selectedTypes = ['99999850']; this.postData = new Despacho(); @@ -101,7 +102,7 @@ export class ExpedientTaskModalPage implements OnInit { SourceType: 'DOC', //FOLDER SourceId: this.task.workflowInstanceDataFields.DocID, //FolderId DeadlineType: '', - SubjectTypes: ['99999850'], + SubjectTypes: this.selectedTypes, NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber, }; @@ -205,7 +206,6 @@ export class ExpedientTaskModalPage implements OnInit { UsersSelected: attendees, DispatchFolder: this.dispatchFolder, AttachmentList: docs, - //SubjectTypes: [], } try { let action_despacho = { @@ -219,11 +219,12 @@ export class ExpedientTaskModalPage implements OnInit { console.log(this.postData); this.taskResult = await this.processes.postDespatcho(this.postData).toPromise(); - this.modalController.dismiss(action_despacho); - //await this.successMessage('Processo efetuado'); + await this.toastService.successMessage('Processo efetuado', () =>{ + this.modalController.dismiss(action_despacho); + }); } catch (error) { - await this.badRequest('Processo não efetuado') + await this.toastService.badRequest('Processo não efetuado') } console.log('this.taskResult', this.taskResult); break; @@ -249,10 +250,11 @@ export class ExpedientTaskModalPage implements OnInit { } } this.taskResult = await this.processes.postParecer(this.postData).toPromise(); - this.modalController.dismiss(action_parecer); - //await this.successMessage('Processo efetuado') + await this.toastService.successMessage('Processo efetuado', () =>{ + this.modalController.dismiss(action_parecer); + }); } catch (error) { - await this.badRequest('Processo não efetuado') + await this.toastService.badRequest('Processo não efetuado') } break; case '2': @@ -276,10 +278,11 @@ export class ExpedientTaskModalPage implements OnInit { } } this.taskResult = await this.processes.postDeferimento(this.postData).toPromise(); - this.modalController.dismiss(action_deferimento); - //await this.successMessage('Processo efetuado') + await this.toastService.successMessage('Processo efetuado', () =>{ + this.modalController.dismiss(action_deferimento); + }); } catch (error) { - await this.badRequest('Processo não efetuado') + await this.toastService.badRequest('Processo não efetuado') } console.log('this.taskResult', this.taskResult); break; @@ -313,10 +316,12 @@ export class ExpedientTaskModalPage implements OnInit { } } this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise(); - this.modalController.dismiss(action_despacho_pr); - //await this.successMessage('Processo efetuado') + + await this.toastService.successMessage('Processo efetuado', () =>{ + this.modalController.dismiss(action_despacho_pr); + }); } catch (error) { - await this.badRequest('Processo não efetuado') + await this.toastService.badRequest('Processo não efetuado') } console.log('this.taskResult', this.taskResult); break; @@ -342,10 +347,12 @@ export class ExpedientTaskModalPage implements OnInit { } } this.taskResult = await this.processes.postParecerPr(this.postData).toPromise(); - this.modalController.dismiss(action_parecer_pr); - //await this.successMessage('Processo efetuado') + + await this.toastService.badRequest('Processo efetuado', () =>{ + this.modalController.dismiss(action_parecer_pr); + }) } catch (error) { - await this.badRequest('Processo não efetuado') + await this.toastService.badRequest('Processo não efetuado') } break; } From 9fb66fc1fd8ebeee3f9890e743ead58d34725e3d Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 14 Jun 2021 14:16:16 +0100 Subject: [PATCH 06/27] Improve despacho options --- .../despachos/despacho/despacho.page.ts | 11 ++++++----- .../despachos-options.page.html | 19 ++++++++++++++++--- .../despachos-options.page.ts | 19 ++++++++++++++----- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 57dbf26c0..d54c89460 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -20,6 +20,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; 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 { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page'; @Component({ selector: 'app-despacho', @@ -90,11 +91,11 @@ export class DespachoPage implements OnInit { let navigationExtras: NavigationExtras = { queryParams: { // "serialNumber": serialNumber, - 'despachos': true + //'despachos': true } } - this.router.navigate(['/home/gabinete-digital'], navigationExtras); + this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras); } @@ -409,13 +410,14 @@ export class DespachoPage implements OnInit { } async openOptions(taskAction?: any) { + const popover = await this.popoverController.create({ - component: OptsExpedientePage, + component: DespachosOptionsPage, cssClass: 'exp-options', componentProps: { task: this.task, fulltask: this.fulltask, - taskAction:taskAction, + taskAction: taskAction, showEnviarPendentes: false }, translucent: true @@ -423,7 +425,6 @@ export class DespachoPage implements OnInit { return await popover.present(); } - async successMessage(message?: any, callback?) { const enterAnimation = (baseEl: any) => { diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html index 5158a629c..1ef3745fc 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.html +++ b/src/app/shared/popover/despachos-options/despachos-options.page.html @@ -8,7 +8,16 @@
- +
+ + + +
+ +
+
+ +
@@ -17,10 +26,14 @@
- - + +
+ + +
+
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index fac026cb2..8a14c56d0 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -5,7 +5,7 @@ import { EventsService } from 'src/app/services/events.service'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { formatDate } from '@angular/common'; -import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { AlertService } from 'src/app/services/alert.service'; import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page'; import { momentG } from 'src/plugin/momentG' @@ -42,7 +42,13 @@ export class DespachosOptionsPage implements OnInit { private alertService: AlertService, public popoverController: PopoverController, private activatedRoute: ActivatedRoute, - private animationController: AnimationController) { } + private animationController: AnimationController, + private navParams: NavParams) { + + this.task = this.navParams.get('task') + this.fulltask = this.navParams.get('fulltask') + + } ngOnInit() { @@ -371,12 +377,15 @@ export class DespachosOptionsPage implements OnInit { goBack() { + alert(' goback') + let navigationExtras: NavigationExtras = { queryParams: { - "despachospr": true, + // "despachospr": true, } - }; - this.router.navigate(['/home/gabinete-digital'], navigationExtras); + } + + this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras); // window.history.back() } From de1fdde153afcd4f2ba68f1a238bfc6f25d55d00 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 14:28:10 +0100 Subject: [PATCH 07/27] save --- .../create-process/create-process.page.ts | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index bf2c8c092..14b4419b1 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -199,7 +199,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDespatcho(this.postData).toPromise(); - this.executado(); + this.FinalizarDespacho(); this.toastService.badRequest('Despacho criado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); @@ -220,7 +220,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postParecer(this.postData).toPromise(); - this.executado(); + this.FinalizarParecer(); this.toastService.successMessage('Pedido de Parecer criado'); } catch (error) { @@ -241,7 +241,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDeferimento(this.postData).toPromise(); - this.executado(); + //this.executado(); this.toastService.successMessage('Pedido de Deferimento criado'); } catch (error) { @@ -338,7 +338,32 @@ export class CreateProcessPage implements OnInit { "ReviewUserComment": '', }, "AttachmentList" :null, + } + await this.processes.CompleteTask(body).toPromise(); + } + async FinalizarDespacho() { + let body = { + "serialNumber": this.task.serialNumber, + "action": "Despacho", + "ActionTypeId": 94, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, + } + await this.processes.CompleteTask(body).toPromise(); + } + + async FinalizarParecer() { + let body = { + "serialNumber": this.task.serialNumber, + "action": "Parecer", + "ActionTypeId": 92, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, } await this.processes.CompleteTask(body).toPromise(); } From 519d7081b029f6400d9793140993f706a1c89abd Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 14:34:18 +0100 Subject: [PATCH 08/27] save --- src/global.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/global.scss b/src/global.scss index 37ea09951..adb2c8b8a 100644 --- a/src/global.scss +++ b/src/global.scss @@ -632,7 +632,8 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent- // center app-approve-event ion-content .main-content, -app-view-event ion-content .main-content{ +app-view-event ion-content .main-content, +app-expediente-pr .main-content{ max-width: 1366px !important; margin: 0px auto !important; } From 55918ffefb789db53cf7efe4f0ccc40339cbb1c2 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 14:43:57 +0100 Subject: [PATCH 09/27] save --- .../create-process/create-process.page.ts | 3 +-- .../despachos/despacho/despacho.page.ts | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 14b4419b1..7bca80223 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -216,7 +216,6 @@ export class CreateProcessPage implements OnInit { DispatchFolder: this.dispatchFolder, } console.log(this.postData); - await this.processes.postParecer(this.postData).toPromise() try { await this.processes.postParecer(this.postData).toPromise(); @@ -241,7 +240,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDeferimento(this.postData).toPromise(); - //this.executado(); + this.executado(); this.toastService.successMessage('Pedido de Deferimento criado'); } catch (error) { diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 57dbf26c0..7961e7819 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -219,7 +219,7 @@ export class DespachoPage implements OnInit { } - async reexecute(note:string, documents:any) { + async reencaminhar(note:string, documents:any) { let body = { "serialNumber": this.serialnumber, "action": "Reencaminhar", @@ -229,6 +229,25 @@ export class DespachoPage implements OnInit { }, "AttachmentList" :documents, } + try { + await this.processes.CompleteTask(body).toPromise() + this.successMessage() + this.close(); + } catch (error) { + this.badRequest() + } + } + + async reexecute(note:string, documents:any) { + let body = { + "serialNumber": this.serialnumber, + "action": "Reexecução", + "ActionTypeId": 100000010, + "dataFields": { + "ReviewUserComment": note, + }, + "AttachmentList" :documents, + } try { await this.processes.CompleteTask(body).toPromise() From 65dff2104d4a2f6912793d41de107cc167429375 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 14:45:52 +0100 Subject: [PATCH 10/27] save --- src/app/modals/create-process/create-process.page.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 7bca80223..ea6f739ce 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -288,7 +288,6 @@ export class CreateProcessPage implements OnInit { DispatchFolder: this.dispatchFolder, } console.log(this.postData); - await this.processes.postParecer(this.postData).toPromise() try { await this.processes.postParecer(this.postData).toPromise(); From 4eabda4ae7af71164f45b2305b3f2317d1b82600 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 14 Jun 2021 15:34:34 +0100 Subject: [PATCH 11/27] save --- .../event-list/approve-event-modal/approve-event-modal.page.ts | 2 +- .../event-list/approve-event/approve-event.page.ts | 2 +- src/app/pages/gabinete-digital/expediente/expediente.page.scss | 1 - src/app/shared/agenda/approve-event/approve-event.page.ts | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index 8600df563..49c8d84c6 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -178,7 +178,7 @@ export class ApproveEventModalPage implements OnInit { "serialNumber": serialNumber, "action": "Emendar", "dataFields": { - "ReviewUseComment": res.data, + "ReviewUserComment": res.data, } } diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index c4af50dbb..10dcecb64 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -189,7 +189,7 @@ export class ApproveEventPage implements OnInit { let body = { "serialNumber": serialNumber, "action": "Emendar", "dataFields": { - "ReviewUseComment": res.data, + "ReviewUserComment": res.data, } } console.log(body); diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.scss b/src/app/pages/gabinete-digital/expediente/expediente.page.scss index d05e043cd..e015a7eb4 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.scss +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.scss @@ -34,7 +34,6 @@ //DIV ion-item{ - border: 1px solid blue; margin: 0 !important; padding: 0 !important; --background: none; diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index d05fbc58d..9926f8951 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -180,7 +180,7 @@ export class ApproveEventPage implements OnInit { let body = { "serialNumber": serialNumber, "action": "Emendar", "dataFields": { - "ReviewUseComment": res.data, + "ReviewUserComment": res.data, } } console.log(body); From 9644cfb6b5ce368af1a897ebc7d5194117e8c6a2 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 11:39:59 +0100 Subject: [PATCH 12/27] Improve attendies --- config.xml | 2 +- package-lock.json | 286 +++++++++++++++--- package.json | 2 + src/app/app.module.ts | 5 +- .../create-process/create-process.page.ts | 82 ++--- src/app/pages/agenda/agenda.module.ts | 11 +- src/app/pages/agenda/agenda.page.html | 6 +- src/app/pages/agenda/agenda.page.ts | 1 - .../agenda/edit-event/edit-event.page.html | 2 +- .../attendee-modal/attendee-modal.page.ts | 8 +- .../despachos/despacho/despacho.page.ts | 2 +- .../book-meeting-modal.module.ts | 3 - .../expedient-task-modal.module.ts | 2 - .../attendees/attendees-routing.module.ts | 12 - .../event/attendees/attendees.module.ts | 21 -- .../event/attendees/attendees.page.html | 57 ---- .../event/attendees/attendees.page.scss | 4 - .../event/attendees/attendees.page.spec.ts | 24 -- .../shared/event/attendees/attendees.page.ts | 93 ------ .../despachos-options.page.ts | 7 +- 20 files changed, 296 insertions(+), 334 deletions(-) delete mode 100644 src/app/shared/event/attendees/attendees-routing.module.ts delete mode 100644 src/app/shared/event/attendees/attendees.module.ts delete mode 100644 src/app/shared/event/attendees/attendees.page.html delete mode 100644 src/app/shared/event/attendees/attendees.page.scss delete mode 100644 src/app/shared/event/attendees/attendees.page.spec.ts delete mode 100644 src/app/shared/event/attendees/attendees.page.ts diff --git a/config.xml b/config.xml index 438ba0ed4..e9aeeda7b 100644 --- a/config.xml +++ b/config.xml @@ -135,7 +135,7 @@ 0 - 8.0.0.00-20210214-154410 + 8.0.0.00-20210308-063916 diff --git a/package-lock.json b/package-lock.json index 9623efb6e..58aca939c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -616,6 +616,138 @@ "integrity": "sha512-jzIutEzUbfBZxLWftpi5oXusL3rwbe2P/6HnNd8NUeBos9+G859R7hCsstAQ61XPn41a2/Fbl+YOwYhdjoBQrw==", "dev": true }, + "@angular/localize": { + "version": "11.2.14", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-11.2.14.tgz", + "integrity": "sha512-ssMuquxxqxA98LgEICEO/3JdmSflWxu5rlm/HPo28bnGiZ4IzDamZjJ1cu4S6RgsonJ1drB3Z8wkidXfEYZiWA==", + "requires": { + "@babel/core": "7.8.3", + "glob": "7.1.2", + "yargs": "^16.2.0" + }, + "dependencies": { + "@babel/core": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.3.tgz", + "integrity": "sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA==", + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.8.3", + "@babel/helpers": "^7.8.3", + "@babel/parser": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==" + } + } + }, "@angular/platform-browser": { "version": "11.2.2", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-11.2.2.tgz", @@ -644,7 +776,6 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", - "dev": true, "requires": { "@babel/highlight": "^7.12.13" } @@ -708,6 +839,37 @@ } } }, + "@babel/generator": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz", + "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==", + "requires": { + "@babel/types": "^7.14.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", + "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==" + }, + "@babel/types": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz", + "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==", + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "to-fast-properties": "^2.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, "@babel/helper-annotate-as-pure": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz", @@ -783,7 +945,6 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", - "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.12.13", "@babel/template": "^7.12.13", @@ -794,7 +955,6 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", - "dev": true, "requires": { "@babel/code-frame": "^7.12.13", "@babel/parser": "^7.12.13", @@ -807,7 +967,6 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", - "dev": true, "requires": { "@babel/types": "^7.12.13" } @@ -935,7 +1094,6 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", - "dev": true, "requires": { "@babel/types": "^7.12.13" } @@ -1055,7 +1213,6 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.0.tgz", "integrity": "sha512-aan1MeFPxFacZeSz6Ld7YZo5aPuqnKlD7+HZY75xQsueczFccP9A7V05+oe0XpLwHK3oLorPe9eaAUljL7WEaQ==", - "dev": true, "requires": { "@babel/template": "^7.12.13", "@babel/traverse": "^7.13.0", @@ -1141,7 +1298,6 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.12.11", "chalk": "^2.0.0", @@ -1151,8 +1307,7 @@ "@babel/parser": { "version": "7.13.4", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.4.tgz", - "integrity": "sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==", - "dev": true + "integrity": "sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.13.5", @@ -1907,11 +2062,59 @@ "regenerator-runtime": "^0.13.4" } }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", + "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==" + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.5.tgz", + "integrity": "sha512-TM8C+xtH/9n1qzX+JNHi7AN2zHMTiPUtspO0ZdHflW8KaskkALhMmuMHb4bCmNdv9VAPzJX3/bXqkVLnAvsPfg==" + }, + "@babel/types": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz", + "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==", + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "to-fast-properties": "^2.0.0" + } + } + } + }, "@babel/traverse": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.0.tgz", "integrity": "sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ==", - "dev": true, "requires": { "@babel/code-frame": "^7.12.13", "@babel/generator": "^7.13.0", @@ -1928,7 +2131,6 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.0.tgz", "integrity": "sha512-zBZfgvBB/ywjx0Rgc2+BwoH/3H+lDtlgD4hBOpEv5LxRnYsm/753iRuLepqnYlynpjC3AdQxtxsoeHJoEEwOAw==", - "dev": true, "requires": { "@babel/types": "^7.13.0", "jsesc": "^2.5.1", @@ -1938,8 +2140,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -3095,6 +3296,14 @@ "lodash": "^4.17.15" } }, + "@ng-bootstrap/ng-bootstrap": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-9.1.2.tgz", + "integrity": "sha512-oZt05AjwIY/oagS3QtST2GIlW9LQgTM7gX+wsuLQvHQt8bh9THOHAws8rDobeZi9fTUR3OvuxK56Mvj1jvyljw==", + "requires": { + "tslib": "^2.0.0" + } + }, "@ngtools/webpack": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-11.2.1.tgz", @@ -4173,8 +4382,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -4434,7 +4642,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5223,8 +5430,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -5309,7 +5515,6 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -8554,8 +8759,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "emojis-list": { "version": "3.0.0", @@ -8821,8 +9025,7 @@ "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "escape-html": { "version": "1.0.3", @@ -9581,8 +9784,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.3.2", @@ -9594,8 +9796,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "gauge": { "version": "2.7.4", @@ -9648,14 +9849,12 @@ "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-intrinsic": { "version": "1.1.1", @@ -9723,8 +9922,7 @@ "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "globby": { "version": "11.0.2", @@ -9776,7 +9974,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -10380,7 +10577,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -10672,7 +10868,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, "requires": { "has": "^1.0.3" } @@ -11168,7 +11363,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -12129,7 +12323,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -13328,8 +13521,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -13346,8 +13538,7 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-to-regexp": { "version": "0.1.7", @@ -15746,8 +15937,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { "version": "2.0.0", @@ -15765,7 +15955,6 @@ "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, "requires": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -17343,7 +17532,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, "requires": { "ansi-regex": "^5.0.0" }, @@ -17351,8 +17539,7 @@ "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" } } }, @@ -18862,7 +19049,8 @@ }, "ssri": { "version": "6.0.1", - "resolved": "", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", "dev": true, "requires": { "figgy-pudding": "^3.5.1" diff --git a/package.json b/package.json index b0ce55e7a..26d5f6e96 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@angular/common": "^11.2.2", "@angular/core": "^11.2.2", "@angular/forms": "~11.2.2", + "@angular/localize": "^11.2.2", "@angular/platform-browser": "~11.2.2", "@angular/platform-browser-dynamic": "~11.2.2", "@angular/router": "~11.2.2", @@ -43,6 +44,7 @@ "@ionic/pwa-elements": "^3.0.2", "@ionic/storage": "^2.3.1", "@logisticinfotech/ionic4-datepicker": "^1.4.4", + "@ng-bootstrap/ng-bootstrap": "^9.1.2", "angular-calendar": "^0.28.22", "angular-tag-cloud-module": "^5.2.2", "cordova-plugin-camera": "^5.0.1", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 642a4a317..11c958951 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -26,10 +26,11 @@ import { FormsModule } from '@angular/forms'; import { CalendarModule, DateAdapter } from 'angular-calendar'; import { adapterFactory } from 'angular-calendar/date-adapters/date-fns'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MessagesPage } from './pages/chat/messages/messages.page'; import { WebsocketService } from './services/websocket.service' -import { ChatService } from './services/chat.service' +import { ChatService } from './services/chat.service'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap' // import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index ca879bbf0..be914e1cb 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -19,6 +19,7 @@ import { SearchPage } from 'src/app/pages/search/search.page'; 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 { User } from 'src/app/models/user.model'; +import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; @Component({ selector: 'app-create-process', @@ -328,37 +329,37 @@ export class CreateProcessPage implements OnInit { this.adding = "intervenient"; this.contacts = this.taskParticipants; - if(window.innerWidth <=800){ + if(window.innerWidth <=800) { this.showAttendees=false; const modal = await this.modalController.create({ - component: AddParticipantsModalPage, - componentProps: { - eventPersons: this.participants + component: AttendeesPage, + componentProps: { + adding: this.adding, + taskParticipants: this.taskParticipants, + taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'add-participants-modal', + cssClass: '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 = { - '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 } @@ -373,32 +374,31 @@ export class CreateProcessPage implements OnInit { this.showAttendees=false; const modal = await this.modalController.create({ - component: AddParticipantsCcModalPage, - componentProps: { - eventPersons: this.participants + component: AttendeesPage, + componentProps: { + adding: this.adding, + taskParticipants: this.taskParticipants, + taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'add-participants-cc-modal', + cssClass: 'attendee', 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); - }); + + 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 } diff --git a/src/app/pages/agenda/agenda.module.ts b/src/app/pages/agenda/agenda.module.ts index 06d3a91a7..2f445093c 100644 --- a/src/app/pages/agenda/agenda.module.ts +++ b/src/app/pages/agenda/agenda.module.ts @@ -12,14 +12,6 @@ import { CalModalPageModule } from '../cal-modal/cal-modal.module'; import { registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/pt'; -import { SharedModule } from 'src/app/shared/shared.module'; -import { NewEventPage } from "src/app/shared/agenda/new-event/new-event.page" -import { EditEventPage } from 'src/app/shared/agenda/edit-event/edit-event.page'; -import { ViewEventPage } from 'src/app/shared/agenda/view-event/view-event.page'; -import { EventListPage } from "src/app/shared/agenda/event-list/event-list.page"; -import { AttendeesPage } from 'src/app/shared/event/attendees/attendees.page'; -import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; - registerLocaleData(localeDe); @@ -28,7 +20,7 @@ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns'; import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page'; import { ComponentsModule } from 'src/app/components/components.module'; -import { AttendeesPageModule } from '../events/attendees/attendees.module'; + import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; import { HeaderPageModule } from 'src/app/shared/header/header.module'; import { ViewEventPageModule } from 'src/app/shared/agenda/view-event/view-event.module'; @@ -58,7 +50,6 @@ import { EditEventPageModule } from 'src/app/shared/agenda/edit-event/edit-event // entryComponents HeaderPageModule, ViewEventPageModule, - AttendeesPageModule, AttendeeModalPageModule, EventsToApprovePageModule, ApproveEventPageModule, diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index b45fb6b51..d56fbeab8 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -213,7 +213,7 @@
--> -
+
@@ -256,7 +256,7 @@
-
+
@@ -297,7 +297,7 @@
-
+
diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index d52189326..7458cf873 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -738,7 +738,6 @@ export class AgendaPage implements OnInit { case "Oficial": - alert('Oficial') //Inicializa o array eventSource this.eventsListOficial = []; diff --git a/src/app/pages/agenda/edit-event/edit-event.page.html b/src/app/pages/agenda/edit-event/edit-event.page.html index d56dcd8d8..2e86d039c 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.html +++ b/src/app/pages/agenda/edit-event/edit-event.page.html @@ -93,7 +93,7 @@
- +
diff --git a/src/app/pages/events/attendee-modal/attendee-modal.page.ts b/src/app/pages/events/attendee-modal/attendee-modal.page.ts index bd4ca69d2..3f2431d0e 100644 --- a/src/app/pages/events/attendee-modal/attendee-modal.page.ts +++ b/src/app/pages/events/attendee-modal/attendee-modal.page.ts @@ -21,15 +21,15 @@ export class AttendeeModalPage implements OnInit { this.fetchContacts(""); } - save(){ + save() { this.modalCtrl.dismiss( this.contacts.filter(function(contact) { - return contact.IsRequired == true; - }) + return contact.IsRequired == true; + }) ); } - close(){ + close() { this.modalCtrl.dismiss(null); } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index d54c89460..49ae7cc44 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -63,7 +63,7 @@ export class DespachoPage implements OnInit { } }); - } + } ngOnInit() { this.profile = "mdgpr"; diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts index 2223c9033..004bdb6a2 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts @@ -8,7 +8,6 @@ import { BookMeetingModalPageRoutingModule } from './book-meeting-modal-routing. import { BookMeetingModalPage } from './book-meeting-modal.page'; import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; -import { AttendeesPageModule } from 'src/app/shared/event/attendees/attendees.module'; import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module'; import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; @@ -19,8 +18,6 @@ import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/att FormsModule, IonicModule, BookMeetingModalPageRoutingModule, - // - // AttendeesPageModule, EmptyContainerPageModule, diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts index 10d4ca393..b1122467f 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts @@ -9,7 +9,6 @@ import { ExpedientTaskModalPageRoutingModule } from './expedient-task-modal-rout import { ExpedientTaskModalPage } from './expedient-task-modal.page'; import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page'; -import { AttendeesPageModule } from 'src/app/shared/event/attendees/attendees.module'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module'; import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module'; @@ -21,7 +20,6 @@ import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn- IonicModule, ExpedientTaskModalPageRoutingModule, // - AttendeesPageModule, AttendeeModalPageModule, EmptyContainerPageModule, BtnModalDismissPageModule, diff --git a/src/app/shared/event/attendees/attendees-routing.module.ts b/src/app/shared/event/attendees/attendees-routing.module.ts deleted file mode 100644 index 9f8738216..000000000 --- a/src/app/shared/event/attendees/attendees-routing.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { AttendeesPage } from './attendees.page'; - -const routes: Routes = []; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class AttendeesPageRoutingModule {} diff --git a/src/app/shared/event/attendees/attendees.module.ts b/src/app/shared/event/attendees/attendees.module.ts deleted file mode 100644 index 36e9da0d5..000000000 --- a/src/app/shared/event/attendees/attendees.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { AttendeesPageRoutingModule } from './attendees-routing.module'; - -import { AttendeesPage } from './attendees.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - AttendeesPageRoutingModule - ], - declarations: [AttendeesPage], - exports: [AttendeesPage] -}) -export class AttendeesPageModule {} diff --git a/src/app/shared/event/attendees/attendees.page.html b/src/app/shared/event/attendees/attendees.page.html deleted file mode 100644 index 4a71dcbc8..000000000 --- a/src/app/shared/event/attendees/attendees.page.html +++ /dev/null @@ -1,57 +0,0 @@ - - - Participantes - - - - - Intervenientes - - - Com Conhecimento - - - - - - - - Adicionar participantes - - - - - - - Apagar - - - - -

{{ attendee.Name }}

-

{{ attendee.EmailAddress }}

-
-
-
-
-
-
- - - - - - - Cancelar - - - - - - - OK - - - - - \ No newline at end of file diff --git a/src/app/shared/event/attendees/attendees.page.scss b/src/app/shared/event/attendees/attendees.page.scss deleted file mode 100644 index 853c08fcf..000000000 --- a/src/app/shared/event/attendees/attendees.page.scss +++ /dev/null @@ -1,4 +0,0 @@ - -ion-item{ - border-bottom:1px solid #ccc; -} diff --git a/src/app/shared/event/attendees/attendees.page.spec.ts b/src/app/shared/event/attendees/attendees.page.spec.ts deleted file mode 100644 index d2cb216ae..000000000 --- a/src/app/shared/event/attendees/attendees.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { AttendeesPage } from './attendees.page'; - -describe('AttendeesPage', () => { - let component: AttendeesPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AttendeesPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(AttendeesPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/shared/event/attendees/attendees.page.ts b/src/app/shared/event/attendees/attendees.page.ts deleted file mode 100644 index 64a8dce6d..000000000 --- a/src/app/shared/event/attendees/attendees.page.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { EventsService } from 'src/app/services/events.service'; -import { ModalController, NavController } from '@ionic/angular'; -// import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page'; - -@Component({ - selector: 'app-attendees', - templateUrl: './attendees.page.html', - styleUrls: ['./attendees.page.scss'], -}) -export class AttendeesPage implements OnInit { - - - segment:string = "true"; - shouldShowCancel:boolean = true; - - searchCountryString = ''; // initialize your searchCountryString string empty - - @Output() openAttendeeModal = new EventEmitter(); - @Output() openAddEvent = new EventEmitter(); - @Input() eventAttendees: EventPerson[]; - @Output() GoBackEditOrAdd = new EventEmitter(); - - - constructor(private eventService: EventsService, private modalCtrl: ModalController, - private navCtrl: NavController) { - } - - - ngOnInit() { - } - - save(){ - this.GoBackEditOrAdd.emit(); - //this.openAddEvent.emit(); - // this.modalCtrl.dismiss(this.eventAttendees); - } - - close(){ - this.GoBackEditOrAdd.emit(); - // this.modalCtrl.dismiss(null); - //this.openAddEvent.emit(); - } - - removeAttendee(attendee: EventPerson) - { - let index: number = this.eventAttendees.findIndex((att) => { - return att.EmailAddress == attendee.EmailAddress - }); - - this.eventAttendees.splice(index, 1); - } - - async addAttendees() { - - console.log('Event Intervenient'); - this.openAttendeeModal.emit(); - - /* const modal = await this.modalCtrl.create({ - component: AttendeeModalPage, - componentProps: { - eventPersons: this.eventAttendees - }, - cssClass: 'attendee-modal', - backdropDismiss: false - }); - - await modal.present(); - - modal.onDidDismiss().then((data) => { - let newattendees: EventPerson[] = data['data']; - - if (newattendees != null) - { - newattendees.forEach(newattendee => { - let att = { - "EmailAddress": newattendee.EmailAddress, - "Name": newattendee.Name, - "IsRequired": (this.segment == "true") - }; - if (this.eventAttendees == null) - { - this.eventAttendees = new Array(); - } - this.eventAttendees.push(att); - }); - } - }); */ - - } - -} \ No newline at end of file diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index 8a14c56d0..735f21371 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -208,9 +208,7 @@ export class DespachosOptionsPage implements OnInit { modal.onDidDismiss().then(res => { console.log(res); - if(res.data){ - - + if(res.data) { const DocumentToSave = res.data.documents.map((e) => { return { @@ -244,7 +242,7 @@ export class DespachosOptionsPage implements OnInit { }); } - async arquivar(note:string, documents:any){ + async arquivar(note:string, documents:any) { let body = { "serialNumber": this.serialnumber, "action": "Arquivo", @@ -377,7 +375,6 @@ export class DespachosOptionsPage implements OnInit { goBack() { - alert(' goback') let navigationExtras: NavigationExtras = { queryParams: { From dd813618f6cb293778cd8ed88e7d0b81fc995b6c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 15 Jun 2021 11:55:36 +0100 Subject: [PATCH 13/27] save --- .../create-process/create-process.page.ts | 2 +- .../events/attendees/attendees.page.html | 2 +- src/app/pages/events/events.page.html | 2 +- .../add-participants-modal.page.html | 2 +- .../expedient-task-modal.page.html | 2 +- .../expedient-task-modal.page.ts | 125 +++++++----------- .../attendee-modal/attendee-modal.page.html | 1 + .../event/attendees/attendees.page.html | 2 +- .../edit-event-to-approve/edit-event.page.ts | 108 ++------------- 9 files changed, 67 insertions(+), 179 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index ea6f739ce..6f8595440 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -198,7 +198,7 @@ export class CreateProcessPage implements OnInit { console.log('this.postData', this.postData, this.taskType); try { - await this.processes.postDespatcho(this.postData).toPromise(); + //await this.processes.postDespatcho(this.postData).toPromise(); this.FinalizarDespacho(); this.toastService.badRequest('Despacho criado'); } catch (error) { diff --git a/src/app/pages/events/attendees/attendees.page.html b/src/app/pages/events/attendees/attendees.page.html index 179d98509..4cc65b424 100644 --- a/src/app/pages/events/attendees/attendees.page.html +++ b/src/app/pages/events/attendees/attendees.page.html @@ -1,6 +1,6 @@ - Adicionar intervenientes + Adicionar intervenientes - A.M. diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index dcc5c5cf7..54e6d6ad3 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -79,7 +79,7 @@
Correspondência por ler
-
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..922d9e945 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', @@ -175,7 +176,7 @@ export class ExpedientTaskModalPage implements OnInit { attendees = attendees.map(function(val) { return { UserEmail: val.EmailAddress, - UserType: val.IsRequired?"I": "CC" + UserType: val.IsRequired?"intervenient": "CC" }; }) @@ -218,7 +219,7 @@ export class ExpedientTaskModalPage implements OnInit { } console.log(this.postData); - this.taskResult = await this.processes.postDespatcho(this.postData).toPromise(); + //this.taskResult = await this.processes.postDespatcho(this.postData).toPromise(); await this.toastService.successMessage('Processo efetuado', () =>{ this.modalController.dismiss(action_despacho); }); @@ -367,89 +368,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 +468,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/event/attendees/attendees.page.html b/src/app/shared/event/attendees/attendees.page.html index 4a71dcbc8..50bae5f8d 100644 --- a/src/app/shared/event/attendees/attendees.page.html +++ b/src/app/shared/event/attendees/attendees.page.html @@ -16,7 +16,7 @@ - Adicionar participantes + Adicionar participantes XV 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 From 15abb5051af16563ccc5a6ba22c20ffba08053ac Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 15 Jun 2021 11:58:53 +0100 Subject: [PATCH 14/27] save --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26d5f6e96..531533ba1 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "socket.io-client": "^2.3.0", "tslib": "^2.0.0", "wordcloud": "^1.1.2", - "ws": "^7.4.5", + "ws": "^7.4.6", "zone.js": "~0.10.2" }, "devDependencies": { From ee136a460246324cc5f945ee5b1608b4707cacb6 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 15 Jun 2021 13:42:47 +0100 Subject: [PATCH 15/27] save --- .../create-process/create-process.page.html | 2 +- .../create-process/create-process.page.ts | 42 +++++++++++++------ .../pages/events/attendees/attendees.page.ts | 4 +- .../despachos/despacho/despacho.page.html | 35 ---------------- .../expedient-task-modal.page.ts | 12 +++--- 5 files changed, 39 insertions(+), 56 deletions(-) diff --git a/src/app/modals/create-process/create-process.page.html b/src/app/modals/create-process/create-process.page.html index 4b8f33e43..b0e9b3338 100644 --- a/src/app/modals/create-process/create-process.page.html +++ b/src/app/modals/create-process/create-process.page.html @@ -65,7 +65,7 @@
- Adicionar intervenientes + Adicionar intervenientes {{participant.Name}} diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 29baba605..8817f1424 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -199,9 +199,9 @@ export class CreateProcessPage implements OnInit { console.log('this.postData', this.postData, this.taskType); try { - //await this.processes.postDespatcho(this.postData).toPromise(); + await this.processes.postDespatcho(this.postData).toPromise(); this.FinalizarDespacho(); - this.toastService.badRequest('Despacho criado'); + this.toastService.successMessage('Despacho criado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } @@ -220,6 +220,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postParecer(this.postData).toPromise(); + this.FinalizarParecer(); this.toastService.successMessage('Pedido de Parecer criado'); } @@ -342,23 +343,38 @@ export class CreateProcessPage implements OnInit { } async FinalizarDespacho() { - let body = { - "serialNumber": this.task.serialNumber, - "action": "Despacho", - "ActionTypeId": 94, - "dataFields": { - "ReviewUserComment": '', - }, - "AttachmentList" :null, - } - await this.processes.CompleteTask(body).toPromise(); + + if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho'){ + let body = { + "serialNumber": this.task.serialNumber, + "action": "Conhecimento", + "ActionTypeId": 104, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, + } + await this.processes.CompleteTask(body).toPromise(); + } + else if(this.task.activityInstanceName =='Concluir Despacho'){ + let body = { + "serialNumber": this.task.serialNumber, + "action": "Despacho", + "ActionTypeId": 94, + "dataFields": { + "ReviewUserComment": '', + }, + "AttachmentList" :null, + } + await this.processes.CompleteTask(body).toPromise(); + } } async FinalizarParecer() { let body = { "serialNumber": this.task.serialNumber, "action": "Parecer", - "ActionTypeId": 92, + "ActionTypeId": 96, "dataFields": { "ReviewUserComment": '', }, diff --git a/src/app/pages/events/attendees/attendees.page.ts b/src/app/pages/events/attendees/attendees.page.ts index dc5ebab7a..eaef16cfb 100644 --- a/src/app/pages/events/attendees/attendees.page.ts +++ b/src/app/pages/events/attendees/attendees.page.ts @@ -118,11 +118,11 @@ export class AttendeesPage implements OnInit { async selectContact(itm: EventPerson){ if(this.adding == "intervenient"){ - + itm.IsRequired = true; this.taskParticipants.push(itm); } else if (this.adding == "CC") { - + itm.IsRequired = false; this.taskParticipantsCc.push(itm); } } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 8ca8a90b3..da81230b7 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -2,41 +2,6 @@ - - - - Menu - - - - - - - Efectuar Despacho - - - - Pedido de Parecer - - - - Pedido de Deferimento - - - - Marcar reunião - - - - - -
- -
-
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 922d9e945..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 @@ -176,7 +176,7 @@ export class ExpedientTaskModalPage implements OnInit { attendees = attendees.map(function(val) { return { UserEmail: val.EmailAddress, - UserType: val.IsRequired?"intervenient": "CC" + UserType: val.IsRequired?"I": "CC" }; }) @@ -219,7 +219,7 @@ export class ExpedientTaskModalPage implements OnInit { } console.log(this.postData); - //this.taskResult = await this.processes.postDespatcho(this.postData).toPromise(); + this.taskResult = await this.processes.postDespatcho(this.postData).toPromise(); await this.toastService.successMessage('Processo efetuado', () =>{ this.modalController.dismiss(action_despacho); }); @@ -250,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') } From 256b208a29395aea3ab354a69765e3f2bc557110 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 15 Jun 2021 14:01:06 +0100 Subject: [PATCH 16/27] save --- .../expedient-task-modal/expedient-task-modal.page.ts | 5 +++++ 1 file changed, 5 insertions(+) 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 7905d4b08..4be6cb5ab 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 @@ -221,8 +221,13 @@ export class ExpedientTaskModalPage implements OnInit { this.taskResult = await this.processes.postDespatcho(this.postData).toPromise(); await this.toastService.successMessage('Processo efetuado', () =>{ + console.log('Hoje Teste T'); this.modalController.dismiss(action_despacho); }); + /* setInterval(()=>{ + console.log('Hoje Teste T'); + this.modalController.dismiss(action_despacho); + }, 7000); */ } catch (error) { await this.toastService.badRequest('Processo não efetuado') From e3811d7f8b8b49c21a73e0d3ad562ef16c623a63 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 14:05:14 +0100 Subject: [PATCH 17/27] Remove unused component --- src/app/pages/agenda/agenda.module.ts | 3 - src/app/pages/agenda/agenda.page.ts | 34 --- .../cal-modal/cal-modal-routing.module.ts | 17 -- src/app/pages/cal-modal/cal-modal.module.ts | 23 -- src/app/pages/cal-modal/cal-modal.page.html | 130 --------- src/app/pages/cal-modal/cal-modal.page.scss | 34 --- .../pages/cal-modal/cal-modal.page.spec.ts | 24 -- src/app/pages/cal-modal/cal-modal.page.ts | 260 ------------------ .../attendee-modal-routing.module.ts | 17 -- .../attendee-modal/attendee-modal.module.ts | 22 -- .../attendee-modal/attendee-modal.page.html | 39 --- .../attendee-modal/attendee-modal.page.scss | 6 - .../attendee-modal.page.spec.ts | 24 -- .../attendee-modal/attendee-modal.page.ts | 66 ----- .../pages/events/attendees/attendees.page.ts | 6 +- src/app/pages/events/events-routing.module.ts | 73 +++-- .../despachos/despacho/despacho.page.ts | 2 +- .../book-meeting-modal.page.ts | 94 ++++--- 18 files changed, 86 insertions(+), 788 deletions(-) delete mode 100644 src/app/pages/cal-modal/cal-modal-routing.module.ts delete mode 100644 src/app/pages/cal-modal/cal-modal.module.ts delete mode 100644 src/app/pages/cal-modal/cal-modal.page.html delete mode 100644 src/app/pages/cal-modal/cal-modal.page.scss delete mode 100644 src/app/pages/cal-modal/cal-modal.page.spec.ts delete mode 100644 src/app/pages/cal-modal/cal-modal.page.ts delete mode 100644 src/app/pages/events/attendee-modal/attendee-modal-routing.module.ts delete mode 100644 src/app/pages/events/attendee-modal/attendee-modal.module.ts delete mode 100644 src/app/pages/events/attendee-modal/attendee-modal.page.html delete mode 100644 src/app/pages/events/attendee-modal/attendee-modal.page.scss delete mode 100644 src/app/pages/events/attendee-modal/attendee-modal.page.spec.ts delete mode 100644 src/app/pages/events/attendee-modal/attendee-modal.page.ts diff --git a/src/app/pages/agenda/agenda.module.ts b/src/app/pages/agenda/agenda.module.ts index 2f445093c..089f41bd4 100644 --- a/src/app/pages/agenda/agenda.module.ts +++ b/src/app/pages/agenda/agenda.module.ts @@ -8,7 +8,6 @@ import { AgendaPageRoutingModule } from './agenda-routing.module'; import { AgendaPage } from './agenda.page'; import { NgCalendarModule } from 'ionic2-calendar'; -import { CalModalPageModule } from '../cal-modal/cal-modal.module'; import { registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/pt'; @@ -45,8 +44,6 @@ import { EditEventPageModule } from 'src/app/shared/agenda/edit-event/edit-event ComponentsModule, AgendaPageRoutingModule, NgCalendarModule, - CalModalPageModule, - // entryComponents HeaderPageModule, ViewEventPageModule, diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 7458cf873..14cf2df7c 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -2,7 +2,6 @@ import { Component, OnInit, ViewChild, Inject, LOCALE_ID, Input } from '@angular import { CalendarComponent } from 'ionic2-calendar'; import { AlertController, ModalController } from '@ionic/angular'; import { formatDate } from '@angular/common'; -import { CalModalPage } from '../cal-modal/cal-modal.page'; import { EventsService } from 'src/app/services/events.service'; import { Event } from '../../models/event.model'; import { Router, NavigationEnd } from '@angular/router'; @@ -289,39 +288,6 @@ export class AgendaPage implements OnInit { this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); } - async openCalModal() { - const modal = await this.modalCtrl.create({ - component: CalModalPage, - componentProps:{ - segment: this.segment, - profile: this.profile, - eventSelectedDate: this.eventSelectedDate, - }, - cssClass: 'cal-modal modal-desktop', - backdropDismiss: false - }); - - await modal.present(); - - modal.onDidDismiss().then((data) => { - let postEvent: Event = data['data']; - if (postEvent.Subject != null) - { - this.eventSource.push({ - title: postEvent.Subject, - startTime: new Date(postEvent.StartDate), - endTime: new Date(postEvent.EndDate), - allDay: false, - event: postEvent - }); - - this.myCal.update(); - this.myCal.loadEvents(); - this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); - } - }); - } - // for calendar currentDayEventDisplayBorder(day: any, id: any){ diff --git a/src/app/pages/cal-modal/cal-modal-routing.module.ts b/src/app/pages/cal-modal/cal-modal-routing.module.ts deleted file mode 100644 index e3cb6d5d6..000000000 --- a/src/app/pages/cal-modal/cal-modal-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { CalModalPage } from './cal-modal.page'; - -const routes: Routes = [ - { - path: '', - component: CalModalPage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class CalModalPageRoutingModule {} diff --git a/src/app/pages/cal-modal/cal-modal.module.ts b/src/app/pages/cal-modal/cal-modal.module.ts deleted file mode 100644 index fb8f9ea1e..000000000 --- a/src/app/pages/cal-modal/cal-modal.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { CalModalPageRoutingModule } from './cal-modal-routing.module'; - -import { CalModalPage } from './cal-modal.page'; -import { NgCalendarModule } from 'ionic2-calendar'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - CalModalPageRoutingModule, - ReactiveFormsModule, - NgCalendarModule - ], - declarations: [CalModalPage] -}) -export class CalModalPageModule {} diff --git a/src/app/pages/cal-modal/cal-modal.page.html b/src/app/pages/cal-modal/cal-modal.page.html deleted file mode 100644 index 33a8a12a7..000000000 --- a/src/app/pages/cal-modal/cal-modal.page.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - Novo Evento - - - - -
-
- - Assunto * - - - - - Campo obrigatório - - - Descrição * - - - - - Campo obrigatório - - - Localização * - - - - - Campo obrigatório - - - - Selecione a Agenda * - - Pessoal - Oficial - - - - - Campo obrigatório - - - - Tipo de evento * - - Reunião - Viagem - Conferência - Encontro - - - - - Campo obrigatório - - - - Data Início * - - - - - - - Data Fim * - - - - -
-
- - - Participantes - -
-
-
- - - Anexos - -
-
-
-
- - - - - Cancelar - - - - {{ viewTitle }} - - - Enviar - - - - - diff --git a/src/app/pages/cal-modal/cal-modal.page.scss b/src/app/pages/cal-modal/cal-modal.page.scss deleted file mode 100644 index e7a445d83..000000000 --- a/src/app/pages/cal-modal/cal-modal.page.scss +++ /dev/null @@ -1,34 +0,0 @@ -.div-ion-content{ - margin: 15px; -} -:host ::ng-deep{ - .monthview-container { - height: auto !important; - } - .event-detail-container{ - display: none; - } -} -.div-attach{ - border: 1px solid #ccc; - margin: 15px 0 0 0; - padding: 15px; -} -.error{ - color:red; - font-size: 12px; - font-weight: bold; - padding-bottom: 20px; - } -/* ion-item{ - display: block; - border: 1px solid red; - width: 100%; - float: left; -} */ -.span-color{ - color:red; -} -/* .ion-badge{ - -} */ \ No newline at end of file diff --git a/src/app/pages/cal-modal/cal-modal.page.spec.ts b/src/app/pages/cal-modal/cal-modal.page.spec.ts deleted file mode 100644 index 31a780adc..000000000 --- a/src/app/pages/cal-modal/cal-modal.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { CalModalPage } from './cal-modal.page'; - -describe('CalModalPage', () => { - let component: CalModalPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CalModalPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(CalModalPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/cal-modal/cal-modal.page.ts b/src/app/pages/cal-modal/cal-modal.page.ts deleted file mode 100644 index f6331ba78..000000000 --- a/src/app/pages/cal-modal/cal-modal.page.ts +++ /dev/null @@ -1,260 +0,0 @@ -import { Component, OnInit, AfterViewInit, Input } from '@angular/core'; -import { ModalController, NavParams } from '@ionic/angular'; - -import { Event } from '../../models/event.model'; -import { EventsService } from 'src/app/services/events.service'; -import { EventBody } from 'src/app/models/eventbody.model'; -import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; - -import { AttendeeModalPage } from '../events/attendee-modal/attendee-modal.page'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { AlertService } from 'src/app/services/alert.service'; -import { FormGroup, FormBuilder, Validators } from "@angular/forms"; -import { identifierModuleUrl } from '@angular/compiler'; - -@Component({ - selector: 'app-cal-modal', - templateUrl: './cal-modal.page.html', - styleUrls: ['./cal-modal.page.scss'], -}) -export class CalModalPage implements OnInit { - - calendar = { - mode: 'month', - currentDate: new Date() - }; - - eventAttendees: EventPerson[]; - segment:string = "true"; - selectedSegment: string; - selectedDate: Date; - - viewTitle: string; - postEvent: Event; - eventBody: EventBody; - modalReady = false; - - minDate: string; - - ionicForm: FormGroup; - isSubmitted = false; - - formSubjectSatus: boolean = false; - formDescriptionSatus: boolean = false; - formLocationSatus: boolean = false; - formEventTypeSatus: boolean = false; - - profile:string; - - constructor( - public formBuilder: FormBuilder, - private modalCtrl: ModalController, - private eventService: EventsService, - private alertController:AlertService, - private navParams: NavParams - ) - { - this.postEvent = new Event(); - this.eventBody = { BodyType : "1", Text : ""}; - this.postEvent.Body = this.eventBody; - this.profile = this.navParams.get('profile'); - } - - ngOnInit() { - - - this.selectedSegment = this.navParams.get('segment'); - this.selectedDate = this.navParams.get('eventSelectedDate'); - - let selectedStartdDate = this.selectedDate; - let selectedEndDate = new Date(this.selectedDate); - /* Set + 30minutes to seleted datetime */ - selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) - - this.minDate = this.selectedDate.toString(); - - if(this.selectedSegment != "Combinada"){ - this.postEvent ={ - EventId: '', - Subject: '', - Body: this.eventBody, - Location: '', - CalendarId: '', - CalendarName: this.selectedSegment, - StartDate: selectedStartdDate, - EndDate: new Date(selectedEndDate), - EventType: 'Reunião', - Attendees: null, - IsMeeting: false, - IsRecurring: false, - AppointmentState: 0, - TimeZone: '', - Organizer: '', - Categories: null, - HasAttachments: false, - }; - } - else{ - this.postEvent ={ - EventId: '', - Subject: '', - Body: this.eventBody, - Location: '', - CalendarId: '', - CalendarName: 'Oficial', - StartDate: selectedStartdDate, - EndDate: new Date(selectedEndDate), - EventType: 'Reunião', - Attendees: null, - IsMeeting: false, - IsRecurring: false, - AppointmentState: 0, - TimeZone: '', - Organizer: '', - Categories: null, - HasAttachments: false, - }; - } - - this.ionicForm = this.formBuilder.group({ - subject: ['', [Validators.required]], - agenda: ['', [Validators.required]], - startdate: ['', [Validators.required]], - enddate: ['', [Validators.required]], - description: ['', [Validators.required]], - location: ['', [Validators.required]], - eventtype: ['', [Validators.required]] - }) - } - - get errorControl() { - return this.ionicForm.controls; - } - - ngAfterViewInit(): void { - setTimeout(()=>{ - this.modalReady = true; - }, 0); - } - - save(){ - if (this.ionicForm.valid) { - if(this.profile=='mdgpr'){ - this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(); - - } - else if(this.profile=='pr'){ - this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(); - } - this.modalCtrl.dismiss(this.postEvent); - } - else{ - this.validateFormInputs(); - } - } - - validateFormInputs(){ - let formSubject = this.postEvent.Subject.trim(); - let formDescription = this.postEvent.Body.Text.trim(); - let formLocation = this.postEvent.Location.trim(); - - if (!this.postEvent.Subject && formSubject.length <= 0){ - this.formSubjectSatus=true; - } - else{ - this.formSubjectSatus=false; - if(!this.postEvent.Body.Text && formDescription.length <= 0){ - this.formDescriptionSatus=true; - } - else{ - this.formDescriptionSatus=false; - if (!this.postEvent.Location && formLocation.length <= 0){ - this.formLocationSatus=true; - } - else{ - this.formLocationSatus=false; - } - } - } - /* return (this.postEvent.Subject && formSubject.length > 0); */ - } - - onViewTitleChanged(title){ - this.viewTitle = title; - } - - onTimeSelected(ev){ - /* this.postEvent.startTime = new Date(ev.selectedTime); */ - - } - - close(){ - this.modalCtrl.dismiss(); - /* this.modalCtrl.dismiss(this.postEvent); */ - } - - async addAttendees() - { - const modal = await this.modalCtrl.create({ - component: AttendeeModalPage, - componentProps: { - eventPersons: this.postEvent.Attendees - }, - cssClass: 'attendee-modal', - backdropDismiss: false - }); - - await modal.present(); - - modal.onDidDismiss().then((data) => { - let newattendees: EventPerson[] = data['data']; - - - if (newattendees != null) - { - newattendees.forEach(newattendee => { - let att = { - "EmailAddress": newattendee.EmailAddress, - "Name": newattendee.Name, - "IsRequired": (this.segment == "true") - }; - if (this.eventAttendees == null) - { - this.eventAttendees = new Array(); - } - this.eventAttendees.push(att); - - }); - } - this.postEvent.Attendees = this.eventAttendees; - }); - } - - showAlert(){ - this.alertController.presentAlert("Funcionalidade em desenvolvimento"); - } - - async openAttendees() - { - const modal = await this.modalCtrl.create({ - component: AttendeesPage, - componentProps: { - eventAttendees: this.postEvent.Attendees - }, - cssClass: 'attendee', - backdropDismiss: false - }); - - await modal.present(); - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.postEvent.Attendees = newattendees; - } - }); -} - - -} diff --git a/src/app/pages/events/attendee-modal/attendee-modal-routing.module.ts b/src/app/pages/events/attendee-modal/attendee-modal-routing.module.ts deleted file mode 100644 index 384a9efd2..000000000 --- a/src/app/pages/events/attendee-modal/attendee-modal-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { AttendeeModalPage } from './attendee-modal.page'; - -const routes: Routes = [ - { - path: '', - component: AttendeeModalPage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class AttendeeModalPageRoutingModule {} diff --git a/src/app/pages/events/attendee-modal/attendee-modal.module.ts b/src/app/pages/events/attendee-modal/attendee-modal.module.ts deleted file mode 100644 index 9d90be080..000000000 --- a/src/app/pages/events/attendee-modal/attendee-modal.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { AttendeeModalPageRoutingModule } from './attendee-modal-routing.module'; - -import { AttendeeModalPage } from './attendee-modal.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - AttendeeModalPageRoutingModule - ], - declarations: [AttendeeModalPage], - exports: [AttendeeModalPage] - -}) -export class AttendeeModalPageModule {} diff --git a/src/app/pages/events/attendee-modal/attendee-modal.page.html b/src/app/pages/events/attendee-modal/attendee-modal.page.html deleted file mode 100644 index 20e71cf0b..000000000 --- a/src/app/pages/events/attendee-modal/attendee-modal.page.html +++ /dev/null @@ -1,39 +0,0 @@ - - - Adicionar intervenientes - - - - - - - - - - - - -

{{ attendee.Name }}

-

{{ attendee.EmailAddress }}

-
-
-
-
-
-
- - - - - Cancelar - - - - - - Adicionar - - - - - \ No newline at end of file diff --git a/src/app/pages/events/attendee-modal/attendee-modal.page.scss b/src/app/pages/events/attendee-modal/attendee-modal.page.scss deleted file mode 100644 index 9cee55e1d..000000000 --- a/src/app/pages/events/attendee-modal/attendee-modal.page.scss +++ /dev/null @@ -1,6 +0,0 @@ -ion-item-group{ - margin: 15px; - } -ion-searchbar{ - --border-radius: 20px; -} \ No newline at end of file diff --git a/src/app/pages/events/attendee-modal/attendee-modal.page.spec.ts b/src/app/pages/events/attendee-modal/attendee-modal.page.spec.ts deleted file mode 100644 index f247abe63..000000000 --- a/src/app/pages/events/attendee-modal/attendee-modal.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { AttendeeModalPage } from './attendee-modal.page'; - -describe('AttendeeModalPage', () => { - let component: AttendeeModalPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AttendeeModalPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(AttendeeModalPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/events/attendee-modal/attendee-modal.page.ts b/src/app/pages/events/attendee-modal/attendee-modal.page.ts deleted file mode 100644 index 3f2431d0e..000000000 --- a/src/app/pages/events/attendee-modal/attendee-modal.page.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ModalController } from '@ionic/angular'; -import { ContactsService } from 'src/app/services/contacts.service'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { ThrowStmt, removeSummaryDuplicates } from '@angular/compiler'; - -@Component({ - selector: 'app-attendee-modal', - templateUrl: './attendee-modal.page.html', - styleUrls: ['./attendee-modal.page.scss'], -}) -export class AttendeeModalPage implements OnInit { - - contacts: EventPerson[]; - showLoader: boolean = false; - eventPersons: EventPerson[]; - - constructor(private modalCtrl: ModalController, private contactsService: ContactsService) { } - - ngOnInit() { - this.fetchContacts(""); - } - - save() { - this.modalCtrl.dismiss( - this.contacts.filter(function(contact) { - return contact.IsRequired == true; - }) - ); - } - - close() { - this.modalCtrl.dismiss(null); - } - - onChange(evt: any) { - this.fetchContacts(evt.detail.value); - } - - selectContact(itm: EventPerson){ - itm.IsRequired = !itm.IsRequired; - } - - async fetchContacts(filter: string) { - this.showLoader = true; - - this.contactsService.getContacts(filter).subscribe(result => - { - if (this.eventPersons != null) - { - this.eventPersons.forEach(attendee => { - const index: number = result.findIndex((cont) => { - return cont.EmailAddress == attendee.EmailAddress - }); - - result.splice(index, 1); - }); - } - - this.contacts = result; - this.showLoader = false; - } - ); - } - -} diff --git a/src/app/pages/events/attendees/attendees.page.ts b/src/app/pages/events/attendees/attendees.page.ts index dc5ebab7a..271a1645b 100644 --- a/src/app/pages/events/attendees/attendees.page.ts +++ b/src/app/pages/events/attendees/attendees.page.ts @@ -26,9 +26,11 @@ export class AttendeesPage implements OnInit { private contactsService: ContactsService, private navParams: NavParams, private modalController: ModalController) { + this.adding = this.navParams.get('adding'); this.taskParticipants = this.navParams.get('taskParticipants'); this.taskParticipantsCc = this.navParams.get('taskParticipantsCc'); + } ngOnInit() { @@ -44,7 +46,7 @@ export class AttendeesPage implements OnInit { } - ngOnChanges(event){} + ngOnChanges(event) {} save(){ @@ -54,7 +56,7 @@ export class AttendeesPage implements OnInit { }); } - close(){ + close() { this.modalController.dismiss(false); } diff --git a/src/app/pages/events/events-routing.module.ts b/src/app/pages/events/events-routing.module.ts index 0d6a85ab4..5b2cbdb3c 100644 --- a/src/app/pages/events/events-routing.module.ts +++ b/src/app/pages/events/events-routing.module.ts @@ -1,42 +1,39 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { EventsPage } from './events.page'; - -const routes: Routes = [ - { - path: '', - component: EventsPage - }, - { - path: 'event-detail', - loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule) - }, - { - path: 'attachments', - loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule) - }, - { - path: 'attendees', - loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule) - }, - { - path: 'attendee-modal', - loadChildren: () => import('./attendee-modal/attendee-modal.module').then( m => m.AttendeeModalPageModule) - }, - { - path: 'event-detail-modal', - loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule) - }, { +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { EventsPage } from './events.page'; + +const routes: Routes = [ + { + path: '', + component: EventsPage + }, + { + path: 'event-detail', + loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule) + }, + { + path: 'attachments', + loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule) + }, + { + path: 'attendees', + loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule) + }, + { + path: 'event-detail-modal', + loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule) + }, + { path: 'edit-event', loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule) } - -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class EventsPageRoutingModule {} + +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class EventsPageRoutingModule {} diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 998d67550..137f40b47 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -36,7 +36,7 @@ export class DespachoPage implements OnInit { task: any; attachments:any; fulltask: any; - eventsList: Event[]; + eventsList: Event[] = []; serialnumber: string; profile: string; intervenientes: any; diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index f07882156..9228b6f1e 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -16,6 +16,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { User } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; +import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; @Component({ selector: 'app-book-meeting-modal', @@ -175,34 +176,31 @@ export class BookMeetingModalPage implements OnInit { if(window.innerWidth <= 800){ const modal = await this.modalController.create({ - component: AddParticipantsModalPage, - componentProps: { - eventPersons: this.eventAttendees + component: AttendeesPage, + componentProps: { + adding: this.adding, + taskParticipants: this.taskParticipants, + taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'book-meeting-modal', + cssClass: '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 = new Array(); - } - this.eventAttendees.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.Attendees = this.eventAttendees; }); + } else { this.showAttendees = true; } @@ -214,38 +212,29 @@ export class BookMeetingModalPage implements OnInit { if(window.innerWidth <= 800) { const modal = await this.modalController.create({ - component: AddParticipantsCcModalPage, - componentProps: { - eventPersons: this.eventAttendees + component: AttendeesPage, + componentProps: { + adding: this.adding, + taskParticipants: this.taskParticipants, + taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'add-participants-cc-modal', + cssClass: 'attendee', backdropDismiss: false }); - + await modal.present(); - - modal.onDidDismiss().then((res) => { - this.taskParticipantsCc = res.data; - let newattendees: EventPerson[] = res['data']; + + modal.onDidDismiss().then((data) => { - - if (newattendees != null) - { - newattendees.forEach(newattendee => { - let att = { - "EmailAddress": newattendee.EmailAddress, - "Name": newattendee.Name, - "IsRequired": false - }; - if (this.eventAttendees == null) - { - this.eventAttendees = new Array(); - } - this.eventAttendees.push(att); - - }); + if(data){ + data = data['data']; + + const newAttendees: EventPerson[] = data['taskParticipants']; + const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; + + this.setIntervenient(newAttendees); + this.setIntervenientCC(newAttendeesCC); } - this.postData.Attendees = this.eventAttendees; }); } else { this.showAttendees = true; @@ -403,4 +392,13 @@ export class BookMeetingModalPage implements OnInit { } + setIntervenient(data){ + this.taskParticipants = data; + } + + setIntervenientCC(data){ + this.taskParticipantsCc = data; + } + + } \ No newline at end of file From 8cca73ec38977f44c6cb1d612f61b2d8122750e3 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 15 Jun 2021 14:19:17 +0100 Subject: [PATCH 18/27] save --- .../event-list/approve-event/approve-event.page.ts | 4 ++-- .../expedient-task-modal/expedient-task-modal.page.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index 10dcecb64..646c4ee53 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -96,8 +96,8 @@ export class ApproveEventPage implements OnInit { console.log(body); try { - //await this.processes.PostTaskAction(body).toPromise() - //this.successMessage() + await this.processes.PostTaskAction(body).toPromise() + this.successMessage() this.toastService.successMessage('Evento aprovado', ()=>{ this.goBack(); }); 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 4be6cb5ab..27fe69f98 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 @@ -7,8 +7,6 @@ import { Participant } from 'src/app/models/participant.model'; import { Folder } from 'src/app/models/folder.model'; import { AuthService } from 'src/app/services/auth.service'; import { ProcessesService } from 'src/app/services/processes.service'; -import { AddParticipantsCcModalPage } from '../add-participants-cc-modal/add-participants-cc-modal.page'; -import { AddParticipantsModalPage } from '../add-participants-modal/add-participants-modal.page'; import { environment } from 'src/environments/environment'; import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page'; import { AttachmentsService } from 'src/app/services/attachments.service'; From 365b32e34c7b3b83ee374bcc260f0ed0b5e9f12e Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 14:30:32 +0100 Subject: [PATCH 19/27] Improve message --- src/app/modals/add-note/add-note.page.ts | 52 +++------ .../create-process/create-process.page.ts | 53 +++------ .../modals/dar-parecer/dar-parecer.page.ts | 53 +++------ src/app/modals/delegar/delegar.page.ts | 53 +++------ src/app/pages/agenda/agenda.page.ts | 1 + .../agenda/edit-event/edit-event.page.ts | 52 +++------ .../event-actions-popover.page.ts | 53 +++------ .../pages/agenda/new-event/new-event.page.ts | 53 +++------ .../despacho-pr/despacho-pr.page.ts | 53 +++------ .../despachos/despacho/despacho.page.ts | 53 +++------ .../expedient-task-modal.page.ts | 105 +++++------------- src/global.scss | 36 ++++++ 12 files changed, 192 insertions(+), 425 deletions(-) diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index eda5c0545..7bd14e22e 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -63,47 +63,23 @@ export class AddNotePage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 8817f1424..f58036c4a 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -564,48 +564,23 @@ export class CreateProcessPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index 945ede90e..e9db3f63b 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -99,49 +99,24 @@ export class DarParecerPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) - } async badRequest(message?: string, callback?) { diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 122b9c6ff..2398b3f13 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -172,48 +172,23 @@ export class DelegarPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 14cf2df7c..f84d707ba 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -173,6 +173,7 @@ export class AgendaPage implements OnInit { if(this.loggeduser.Profile == 'MDGPR') { this.mobileComponent.showEventList = true; } + } diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 3c708b28e..3b1241fd1 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -241,47 +241,23 @@ export class EditEventPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index 9549c9482..87ca74636 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -93,48 +93,23 @@ export class EventActionsPopoverPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index b54e8af7c..7e00d3854 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -170,48 +170,23 @@ export class NewEventPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index e0a66ff92..ea149356d 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -465,48 +465,23 @@ export class DespachoPrPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 137f40b47..ef0c21a68 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -445,48 +445,23 @@ export class DespachoPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - return this.animationController.create() - .addElement(baseEl) - .easing('ease-out') - .duration(7000) - .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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) } 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 7905d4b08..7b33c6eb5 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 @@ -530,94 +530,47 @@ export class ExpedientTaskModalPage 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)'); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },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' } - ]); + var notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = 'hello' setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() + notification.remove() },7000) + } } \ No newline at end of file diff --git a/src/global.scss b/src/global.scss index adb2c8b8a..4a4c6ce11 100644 --- a/src/global.scss +++ b/src/global.scss @@ -812,3 +812,39 @@ background: rgb(92, 92, 92); .hide-scroll::-webkit-scrollbar-thumb:hover { display: none !important; } + + + +#notification{ + position: absolute; + top: 23px; + right: 0px; + height: 87px; + max-width: 400px; + border-radius: 9px; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + -ms-border-radius: 9px; + -o-border-radius: 9px; + background-color: white; + text-align: center; + align-items: center; + display: flex; + justify-content: center; + background-image: url("/assets/background/background-circle-negative.svg"); + background-size: 686px 674px; + background-position: center; + background-position-y: 0px; + background-repeat: no-repeat; + min-width: 340px; + box-shadow: 0px 2px 10px #0000003d; + display: flex; + align-items: center; + .main-content { + display: flex; + align-items: center; + } + .message { + font-size: 12pt; + } +} \ No newline at end of file From 0048058bac9a640da410e9fbb17eecb78bec8430 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 14:31:17 +0100 Subject: [PATCH 20/27] Improve message --- .../expedient-task-modal/expedient-task-modal.page.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4e731d14f..416663076 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 @@ -547,7 +547,7 @@ export class ExpedientTaskModalPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) @@ -569,7 +569,7 @@ export class ExpedientTaskModalPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) From 1682d63a42b1614e9d21e986155f0fba28932581 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 14:32:12 +0100 Subject: [PATCH 21/27] Improve message --- src/app/modals/add-note/add-note.page.ts | 2 +- src/app/modals/create-process/create-process.page.ts | 2 +- src/app/modals/dar-parecer/dar-parecer.page.ts | 2 +- src/app/modals/delegar/delegar.page.ts | 2 +- src/app/pages/agenda/edit-event/edit-event.page.ts | 2 +- .../agenda/event-actions-popover/event-actions-popover.page.ts | 2 +- src/app/pages/agenda/new-event/new-event.page.ts | 2 +- .../despachos-pr/despacho-pr/despacho-pr.page.ts | 2 +- .../pages/gabinete-digital/despachos/despacho/despacho.page.ts | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index 7bd14e22e..efec5c3b2 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -77,7 +77,7 @@ export class AddNotePage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index f58036c4a..4ab5dd4d7 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -578,7 +578,7 @@ export class CreateProcessPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index e9db3f63b..ce388045b 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -113,7 +113,7 @@ export class DarParecerPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 2398b3f13..3645189f2 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -186,7 +186,7 @@ export class DelegarPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 3b1241fd1..96b7fe77a 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -255,7 +255,7 @@ export class EditEventPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index 87ca74636..1e8064ab4 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -107,7 +107,7 @@ export class EventActionsPopoverPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 7e00d3854..223d7ef60 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -184,7 +184,7 @@ export class NewEventPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index ea149356d..bda57b2b2 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -479,7 +479,7 @@ export class DespachoPrPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index ef0c21a68..674d5199f 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -459,7 +459,7 @@ export class DespachoPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = 'hello' + notification.querySelector('.text').innerHTML = message setTimeout(()=>{ notification.remove() },7000) From b21fa3a3a2f77090fb08c48d345ae4edc70114cd Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 14:48:25 +0100 Subject: [PATCH 22/27] Improve message --- src/app/modals/add-note/add-note.page.ts | 2 +- .../modals/dar-parecer/dar-parecer.page.ts | 2 +- src/app/modals/delegar/delegar.page.ts | 2 +- .../agenda/edit-event/edit-event.page.ts | 2 +- .../event-actions-popover.page.ts | 2 +- .../pages/agenda/new-event/new-event.page.ts | 2 +- .../despacho-pr/despacho-pr.page.ts | 3 +- .../despachos/despacho/despacho.page.ts | 2 +- .../expedient-task-modal.page.ts | 4 +- src/app/services/toast.service.ts | 98 ++++++------------- 10 files changed, 40 insertions(+), 79 deletions(-) diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index efec5c3b2..2c30b10c8 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -63,7 +63,7 @@ export class AddNotePage implements OnInit { async successMessage(message?: any, callback?) { - var notification = document.createElement('div') + let notification = document.createElement('div') notification.id = 'notification' notification.innerHTML = ` diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index ce388045b..f794b9e14 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -113,7 +113,7 @@ export class DarParecerPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 3645189f2..37b37e512 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -186,7 +186,7 @@ export class DelegarPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 96b7fe77a..e842acb0e 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -255,7 +255,7 @@ export class EditEventPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index 1e8064ab4..09d44fe82 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -107,7 +107,7 @@ export class EventActionsPopoverPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 223d7ef60..2b1958597 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -184,7 +184,7 @@ export class NewEventPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index bda57b2b2..39e6ff8d8 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -479,10 +479,11 @@ export class DespachoPrPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) + } async badRequest(message?: string, callback?) { diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 674d5199f..a81f02a97 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -459,7 +459,7 @@ export class DespachoPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) 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 416663076..2fec50acb 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 @@ -547,7 +547,7 @@ export class ExpedientTaskModalPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) @@ -569,7 +569,7 @@ export class ExpedientTaskModalPage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo não efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts index 04b4726e4..f96db770f 100644 --- a/src/app/services/toast.service.ts +++ b/src/app/services/toast.service.ts @@ -24,94 +24,54 @@ export class ToastService { 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)'); + let notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - const wrapperAnimation = this.animationController.create() - .addElement(baseEl.querySelector('.modal-wrapper')!) - .keyframes([ - { offset: 0, opacity: '1', right: '-100%' }, - { offset: 1, opacity: '1', right: '0px' } - ]); +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ if (callback) { callback() } - modal.dismiss() + notification.remove() },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' } - ]); + let notification = document.createElement('div') + notification.id = 'notification' + notification.innerHTML = ` - return this.animationController.create() - .addElement(baseEl) - .easing('ease-out') - .duration(500) - .addAnimation([backdropAnimation, wrapperAnimation]); - } +
+

+ +

{{ message }}

+

+ +
+ ` - 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() - + document.body.append(notification) + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ if (callback) { callback() } - modal.dismiss() + notification.remove() },7000) + } } From bfb81fd84f1fc5d73df7177d1f4430f9894bbfa1 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 14:49:41 +0100 Subject: [PATCH 23/27] Improve message --- src/app/services/toast.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts index f96db770f..4260275e8 100644 --- a/src/app/services/toast.service.ts +++ b/src/app/services/toast.service.ts @@ -64,7 +64,7 @@ export class ToastService { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' + notification.querySelector('.text').innerHTML = message || 'Processo não efetuado' setTimeout(()=>{ if (callback) { callback() From c856cc2927eacd9165a10d6b99d8346b94fdf0c2 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 15:09:20 +0100 Subject: [PATCH 24/27] Improve notification --- src/app/modals/add-note/add-note.page.ts | 2 +- .../modals/dar-parecer/dar-parecer.page.ts | 6 +- src/app/modals/delegar/delegar.page.ts | 6 +- .../agenda/edit-event/edit-event.page.ts | 8 +- .../event-actions-popover.page.ts | 12 +- .../pages/agenda/new-event/new-event.page.ts | 6 +- .../despacho-pr/despacho-pr.page.ts | 26 +++-- .../despachos/despacho/despacho.page.ts | 22 ++-- .../diploma-assinar/diploma-assinar.page.ts | 51 +-------- .../diplomas/diploma/diploma.page.ts | 61 ++-------- .../approve-event-modal.page.ts | 53 +-------- .../approve-event/approve-event.page.ts | 59 ++-------- .../book-meeting-modal.page.ts | 12 +- .../expediente-detail.page.ts | 65 ++--------- .../expediente-pr/expediente-pr.page.ts | 71 +++--------- .../pedidos/pedido/pedido.page.ts | 57 ++-------- src/app/pages/login/login.page.ts | 50 +-------- .../new-action/new-action.page.ts | 94 +--------------- .../publication-detail.page.ts | 96 +--------------- .../publication-detail.page.ts | 96 +--------------- .../approve-event/approve-event.page.ts | 63 ++--------- .../shared/agenda/new-event/new-event.page.ts | 96 +--------------- .../shared/fingerprint/fingerprint.page.ts | 4 +- src/app/shared/pin/pin.page.ts | 89 +-------------- .../deploma-options/deploma-options.page.ts | 12 +- .../despachos-options.page.ts | 65 ++--------- .../despachos-pr-options.page.ts | 65 ++--------- .../opts-expediente-pr.page.ts | 65 ++--------- .../request-options/request-options.page.ts | 57 ++-------- .../publication/new-action/new-action.page.ts | 96 +--------------- .../new-publication/new-publication.page.ts | 104 ++---------------- .../publication-detail.page.ts | 96 +--------------- 32 files changed, 218 insertions(+), 1447 deletions(-) diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index 2c30b10c8..088d02219 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -77,7 +77,7 @@ export class AddNotePage implements OnInit { ` document.body.append(notification) - notification.querySelector('.text').innerHTML = message + notification.querySelector('.text').innerHTML = message || 'Processo efetuado' setTimeout(()=>{ notification.remove() },7000) diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index f794b9e14..4fbdc6800 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -3,6 +3,7 @@ import { AnimationController, ModalController, NavParams } from '@ionic/angular' import { SearchDocument } from 'src/app/models/search-document'; import { SearchPage } from 'src/app/pages/search/search.page'; import { ProcessesService } from 'src/app/services/processes.service'; +import { ToastService } from 'src/app/services/toast.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'; @@ -22,6 +23,7 @@ export class DarParecerPage implements OnInit { private modalController: ModalController, private navParams: NavParams, private animationController: AnimationController, + private toastService: ToastService, ) { this.serialNumber = this.navParams.get('serialNumber'); this.instanceId = this.navParams.get('ProcessInstanceID'); @@ -65,9 +67,9 @@ export class DarParecerPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise(); this.modalController.dismiss(); - this.successMessage('Pedido de Parecer solicitado') + this.toastService.successMessage('Pedido de Parecer solicitado') } catch (error) { - this.badRequest("Pedido de Parecer não solicitado") + this.toastService.badRequest("Pedido de Parecer não solicitado") } diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 37b37e512..7e565b6f2 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -13,6 +13,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar 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'; @Component({ selector: 'app-delegar', @@ -48,6 +49,7 @@ export class DelegarPage implements OnInit { public alertController: AlertController, private alertService: AlertService, private animationController: AnimationController, + private toastService: ToastService, ) { this.task = this.navParams.get('task'); this.postData = new Event(); @@ -97,10 +99,10 @@ export class DelegarPage implements OnInit { console.log(body); this.processes.DelegateTask(body).subscribe(res=>{ console.log(res); - this.successMessage('Processo delegado') + this.toastService.successMessage('Processo delegado') }, (error)=>{ - this.badRequest("Processo não delegado") + this.toastService.badRequest("Processo não delegado") }); } } diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index e842acb0e..76f04df4b 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -6,6 +6,7 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { AlertService } from 'src/app/services/alert.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { EventsService } from 'src/app/services/events.service'; +import { ToastService } from 'src/app/services/toast.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 { Event } from '../../../models/event.model'; @@ -47,6 +48,7 @@ export class EditEventPage implements OnInit { public alertController: AlertController, private attachmentsService: AttachmentsService, private animationController: AnimationController, + private toastService: ToastService, ) { this.isEventEdited = false; this.postEvent = this.navParams.get('event'); @@ -116,16 +118,16 @@ export class EditEventPage implements OnInit { }); await alert.present(); */ - this.successMessage() + this.toastService.successMessage() }, error => { - this.badRequest() + this.toastService.badRequest() }); this.isEventEdited = true; this.modalController.dismiss(this.isEventEdited); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index 09d44fe82..d5e5a1d41 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ProcessesService } from 'src/app/services/processes.service'; +import { ToastService } from 'src/app/services/toast.service'; import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @@ -21,7 +22,8 @@ export class EventActionsPopoverPage implements OnInit { private router:Router, private modalController: ModalController, private popoverController: PopoverController, - private animationController: AnimationController,) { + private animationController: AnimationController, + private toastService: ToastService,) { this.serialNumber = this.navParams.get('serialNumber'); this.instanceId = this.navParams.get('InstanceId'); } @@ -45,9 +47,9 @@ export class EventActionsPopoverPage implements OnInit { this.processes.PostTaskAction(body).toPromise() this.router.navigate(['/home/gabinete-digital/event-list']); this.modalController.dismiss(null); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -61,9 +63,9 @@ export class EventActionsPopoverPage implements OnInit { this.processes.PostTaskAction(body).toPromise() this.router.navigate(['/home/gabinete-digital/event-list']); this.modalController.dismiss(null); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 2b1958597..0750b12b3 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -6,6 +6,7 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { SearchDocument } from 'src/app/models/search-document'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { EventsService } from 'src/app/services/events.service'; +import { ToastService } from 'src/app/services/toast.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 { Event } from '../../../models/event.model'; @@ -41,6 +42,7 @@ export class NewEventPage implements OnInit { private eventService: EventsService, private attachmentsService: AttachmentsService, private animationController: AnimationController, + private toastService: ToastService, ) { this.postEvent = new Event(); this.eventBody = { BodyType : "1", Text : ""}; @@ -158,12 +160,12 @@ export class NewEventPage implements OnInit { }); - this.successMessage() + this.toastService.successMessage() this.modalController.dismiss(this.postEvent); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 39e6ff8d8..02662517c 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -21,6 +21,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts- 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 { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-despacho-pr', @@ -53,7 +54,8 @@ export class DespachoPrPage implements OnInit { private alertService: AlertService, public popoverController: PopoverController, private activatedRoute: ActivatedRoute, - private animationController: AnimationController) { + private animationController: AnimationController, + private toastService: ToastService,) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { this.serialnumber = params["serialNumber"]; @@ -188,9 +190,9 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch(error) { - this.badRequest() + this.toastService.badRequest() } } @@ -206,10 +208,10 @@ export class DespachoPrPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('Processo arquivado') + this.toastService.successMessage('Processo arquivado') this.close(); } catch (error) { - this.badRequest('Processo não arquivado') + this.toastService.badRequest('Processo não arquivado') } } @@ -227,10 +229,10 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('Processo criado') + this.toastService.successMessage('Processo criado') this.close(); } catch (error) { - this.badRequest('Processo não criado') + this.toastService.badRequest('Processo não criado') } } @@ -247,10 +249,10 @@ export class DespachoPrPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('') + this.toastService.successMessage('') this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -268,10 +270,10 @@ export class DespachoPrPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -281,7 +283,7 @@ export class DespachoPrPage implements OnInit { console.log(res); this.close(); - this.successMessage('Processo enviado para pendentes') + this.toastService.successMessage('Processo enviado para pendentes') }); } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index a81f02a97..eb5fee874 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -21,6 +21,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts- 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 { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-despacho', @@ -54,6 +55,7 @@ export class DespachoPage implements OnInit { private activatedRoute: ActivatedRoute, private router: Router, private animationController: AnimationController, + private toastService: ToastService, ) { this.activatedRoute.queryParams.subscribe(params => { @@ -194,9 +196,9 @@ export class DespachoPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage('Processo criado') + this.toastService.successMessage('Processo criado') } catch(error) { - this.badRequest("Processo não criado") + this.toastService.badRequest("Processo não criado") } } @@ -212,10 +214,10 @@ export class DespachoPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('Processo descartado') + this.toastService.successMessage('Processo descartado') this.close(); } catch (error) { - this.badRequest("Processo não descartado") + this.toastService.badRequest("Processo não descartado") } } @@ -232,10 +234,10 @@ export class DespachoPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -252,11 +254,11 @@ export class DespachoPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -265,10 +267,10 @@ export class DespachoPage implements OnInit { this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ console.log(res); this.close(); - this.successMessage('Processo enviado para despacho') + this.toastService.successMessage('Processo enviado para despacho') }, error => { - this.badRequest("Processo não enviado para despacho") + this.toastService.badRequest("Processo não enviado para despacho") }); } diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts index bfdd64f4a..5a790858f 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts @@ -11,6 +11,7 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m 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 { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-diploma-assinar', @@ -38,6 +39,7 @@ export class DiplomaAssinarPage implements OnInit { private activatedRoute: ActivatedRoute, private router: Router, private animationController: AnimationController, + private toastService: ToastService ) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -151,11 +153,11 @@ export class DiplomaAssinarPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage(false, ()=>{ + this.toastService.successMessage(false, ()=>{ this.goBack(); }) } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -163,52 +165,7 @@ export class DiplomaAssinarPage implements OnInit { this.modalController.dismiss(); } - 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) => { diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts index 13bbb623e..cf9ec1936 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -11,6 +11,7 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m 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 { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-diploma', @@ -38,7 +39,8 @@ export class DiplomaPage implements OnInit { private iab: InAppBrowser, private activatedRoute: ActivatedRoute, private router: Router, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService, ) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -154,12 +156,12 @@ export class DiplomaPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage(false, ()=>{ + this.toastService.successMessage(false, ()=>{ this.close(); }) } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -176,9 +178,9 @@ export class DiplomaPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -195,9 +197,9 @@ export class DiplomaPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise(); - this.successMessage('Processo concluído') + this.toastService.successMessage('Processo concluído') } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -275,52 +277,7 @@ export class DiplomaPage implements OnInit { this.modalController.dismiss(); } - 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) => { diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index 49c8d84c6..9b4fe24c5 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -105,13 +105,13 @@ export class ApproveEventModalPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() - this.successMessage('Evento aprovado', ()=>{ + this.toastService.successMessage('Evento aprovado', ()=>{ this.router.navigate(['/home/gabinete-digital/event-list']); this.modalController.dismiss(null); }) } catch (error) { - this.badRequest('Evento não aprovado') + this.toastService.badRequest('Evento não aprovado') } } @@ -187,9 +187,9 @@ export class ApproveEventModalPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() this.router.navigate(['/home/gabinete-digital/event-list']); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() this.router.navigate(['/home/gabinete-digital/event-list']); } @@ -220,52 +220,7 @@ export class ApproveEventModalPage 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) => { diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index 646c4ee53..266a168ac 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -97,13 +97,13 @@ export class ApproveEventPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.toastService.successMessage('Evento aprovado', ()=>{ this.goBack(); }); } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -126,16 +126,16 @@ export class ApproveEventPage implements OnInit { async rejeitar(serialNumber:string){ let body = { "serialNumber": serialNumber, "action": "Rejeitar" } console.log(body); - this.successMessage('Process'); + this.toastService.successMessage('Process'); try { this.processes.PostTaskAction(body).toPromise(); - await this.successMessage('Processo rejeitado'); + await this.toastService.successMessage('Processo rejeitado'); await this.toastService.successMessage('Processo rejeitado', ()=>{ this.goBack(); }); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -196,10 +196,10 @@ export class ApproveEventPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise(); - this.successMessage(); + this.toastService.successMessage(); this.goBack(); } catch (error) { - this.badRequest(); + this.toastService.badRequest(); } } else{ @@ -241,52 +241,7 @@ export class ApproveEventPage 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) => { diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index 9228b6f1e..aa2eb4575 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -17,6 +17,7 @@ import { SuccessMessagePage } from 'src/app/shared/popover/success-message/succe import { User } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-book-meeting-modal', @@ -53,7 +54,8 @@ export class BookMeetingModalPage implements OnInit { private attachmentsService: AttachmentsService, private calendarService: EventsService, authService: AuthService, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService, ) { this.loggeduser = authService.ValidatedUser; this.task = this.navParams.get('task'); @@ -138,9 +140,9 @@ export class BookMeetingModalPage implements OnInit { } this.distartExpedientModal(); - this.successMessage('Reunião criada') + this.toastService.successMessage('Reunião criada') } catch (error) { - this.badRequest('Reunião não criada') + this.toastService.badRequest('Reunião não criada') } @@ -157,12 +159,12 @@ export class BookMeetingModalPage implements OnInit { break; } - this.successMessage('Reunião criada', ()=>{ + this.toastService.successMessage('Reunião criada', ()=>{ this.close(); }) } catch (error) { - this.badRequest() + this.toastService.badRequest() } } diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index afa3def5c..8e2063760 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -56,7 +56,7 @@ export class ExpedienteDetailPage implements OnInit { public popoverController: PopoverController, private activatedRoute: ActivatedRoute, private toastService: ToastService, - private animationController: AnimationController + private animationController: AnimationController, ) { this.activateRoute.paramMap.subscribe(params => { @@ -120,14 +120,14 @@ export class ExpedienteDetailPage implements OnInit { }); } - sendExpedienteToPending(){ + sendExpedienteToPending() { this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ console.log(res); - this.successMessage('Processo enviado para pendentes') + this.toastService.successMessage('Processo enviado para pendentes') this.goBack(); }, (error)=>{ - this.badRequest('Processo não enviado para pendentes') + this.toastService.badRequest('Processo não enviado para pendentes') }); } @@ -266,10 +266,10 @@ export class ExpedienteDetailPage implements OnInit { try { await this.processes.CompleteTask(otherbody).toPromise() - this.successMessage('Processo descartado'); + this.toastService.successMessage('Processo descartado'); this.goBack(); } catch (error) { - this.badRequest('Processo não descartado') + this.toastService.badRequest('Processo não descartado') } } @@ -281,10 +281,10 @@ export class ExpedienteDetailPage implements OnInit { if(res['data']== 'Yes'){ try { await this.processes.CompleteTask(body).toPromise(); - this.successMessage('Processo descartado'); + this.toastService.successMessage('Processo descartado'); this.goBack(); } catch (error) { - this.badRequest('Processo não descartado') + this.toastService.badRequest('Processo não descartado') } this.goBack(); } @@ -292,10 +292,10 @@ export class ExpedienteDetailPage implements OnInit { console.log('Update'); try { await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise(); - this.successMessage(); + this.toastService.successMessage(); this.goBack(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } } @@ -361,52 +361,7 @@ export class ExpedienteDetailPage 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) => { diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts index 94327f159..f3bef7308 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts +++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts @@ -21,6 +21,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; 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 { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-expediente-pr', @@ -56,6 +57,7 @@ export class ExpedientePrPage implements OnInit { private activatedRoute: ActivatedRoute, private userAuth: AuthService, private animationController: AnimationController, + private toastService: ToastService, ) { this.loggeduser = userAuth.ValidatedUser; @@ -102,11 +104,11 @@ export class ExpedientePrPage implements OnInit { sendExpedienteToPending(){ this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ console.log(res); - this.successMessage('Processo enviado para pendentes') + this.toastService.successMessage('Processo enviado para pendentes') this.goBack(); }, (error)=>{ - this.badRequest('Processo não enviado para pendentes') + this.toastService.badRequest('Processo não enviado para pendentes') }); } @@ -201,9 +203,9 @@ export class ExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage('Processo aprovado') + this.toastService.successMessage('Processo aprovado') } catch(error) { - this.badRequest('Processo não aprovado') + this.toastService.badRequest('Processo não aprovado') } } @@ -221,9 +223,9 @@ export class ExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch(error) { - this.badRequest() + this.toastService.badRequest() } } @@ -329,9 +331,9 @@ export class ExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(otherbody).toPromise(); - this.successMessage('Processo descartado') + this.toastService.successMessage('Processo descartado') } catch (error) { - this.badRequest('Processo não descartado') + this.toastService.badRequest('Processo não descartado') } @@ -345,10 +347,10 @@ export class ExpedientePrPage implements OnInit { try { //await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.goBack(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -360,9 +362,9 @@ export class ExpedientePrPage implements OnInit { try { await this.processes.UpdateTaskStatus(this.task.FolderId); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -440,52 +442,7 @@ export class ExpedientePrPage implements OnInit { return await popover.present(); } - 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) => { diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index d3b28cdd0..e947f2181 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -24,6 +24,7 @@ import { AuthService } from 'src/app/services/auth.service'; 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'; @Component({ selector: 'app-pedido', @@ -56,7 +57,8 @@ export class PedidoPage implements OnInit { private alertService: AlertService, public popoverController: PopoverController, authService: AuthService, - private animationController: AnimationController) { + private animationController: AnimationController, + private toastService: ToastService,) { this.loggeduser = authService.ValidatedUser; this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -199,10 +201,10 @@ export class PedidoPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -221,10 +223,10 @@ export class PedidoPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('Processo arquivado') + this.toastService.successMessage('Processo arquivado') this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -418,52 +420,7 @@ export class PedidoPage 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) => { diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 61caa66f5..e6d604414 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -50,6 +50,7 @@ export class LoginPage implements OnInit { public alertController: AlertController, private modalController: ModalController, private animationController: AnimationController, + //private fcm: FCM ) { @@ -186,10 +187,10 @@ export class LoginPage implements OnInit { const encrypted = crypto.SHA1(code) if( encrypted == localStorage.getItem('PIN')) { - //this.successMessage() + //this.toastService.successMessage() this.router.navigate(['/home/events']); } else { - this.badRequest('Pin incorreto') + this.toastService.badRequest('Pin incorreto') this.code = [] } @@ -206,52 +207,7 @@ export class LoginPage 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?) { diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 0def7afd9..74e1a0924 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AnimationController, ModalController } from '@ionic/angular'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.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'; @@ -19,6 +20,7 @@ export class NewActionPage implements OnInit { private modalController: ModalController, private publication: PublicationsService, private animationController: AnimationController, + private toastService: ToastService ) { this.folder = new PublicationFolder(); @@ -45,10 +47,10 @@ export class NewActionPage implements OnInit { try { await this.publication.CreatePublicationFolder(this.folder).toPromise() - this.successMessage("Ação presidencial criado") + this.toastService.successMessage("Ação presidencial criado") this.close(); } catch (error) { - this.badRequest("Ação presidencial não criado") + this.toastService.badRequest("Ação presidencial não criado") } } @@ -56,96 +58,8 @@ export class NewActionPage implements OnInit { this.modalController.dismiss(); } - 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 não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts index 0d4a520af..70f9891df 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Publication } from 'src/app/models/publication'; import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.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 { ImageModalPage } from '../gallery/image-modal/image-modal.page'; @@ -23,7 +24,8 @@ export class PublicationDetailPage implements OnInit { private modalController: ModalController, private navParams:NavParams, private publications:PublicationsService, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService ) { this.publicationId = this.navParams.get('publicationId'); /* this.folderId = this.navParams.get('folderIdId'); */ @@ -83,10 +85,10 @@ export class PublicationDetailPage implements OnInit { try { await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); - this.successMessage('Publicação eliminado') + this.toastService.successMessage('Publicação eliminado') this.close(); } catch (error) { - this.badRequest('Publicação não eliminado') + this.toastService.badRequest('Publicação não eliminado') } } @@ -122,95 +124,7 @@ export class PublicationDetailPage 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 não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index cced89669..423a66043 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Publication } from 'src/app/models/publication'; import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.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 { ImageModalPage } from '../../gallery/image-modal/image-modal.page'; @@ -22,7 +23,8 @@ export class PublicationDetailPage implements OnInit { private modalController: ModalController, private navParams:NavParams, private publications:PublicationsService, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService, ) { this.publicationId = this.navParams.get('publicationId'); this.folderId = this.navParams.get('folderId'); @@ -83,13 +85,13 @@ export class PublicationDetailPage implements OnInit { try { await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); - this.successMessage('Publicaçao eliminado') + this.toastService.successMessage('Publicaçao eliminado') this.close(); //this.goBackToViewPublications.emit(); } catch (error) { - this.badRequest('Publicaçao não eliminado') + this.toastService.badRequest('Publicaçao não eliminado') } } @@ -124,96 +126,8 @@ export class PublicationDetailPage 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: 'Processo não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index 9926f8951..20a45e21a 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -11,6 +11,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { EditEventToApproveComponent } from '../../gabinete-digital/edit-event-to-approve/edit-event.page'; import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -47,7 +48,8 @@ export class ApproveEventPage implements OnInit { private menu: MenuController, private alertService: AlertService, private iab: InAppBrowser, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService ) { // $$$ @@ -88,9 +90,9 @@ export class ApproveEventPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() this.modalController.dismiss(serialNumber); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } /* this.approveEventDismiss.emit({ @@ -112,7 +114,7 @@ export class ApproveEventPage implements OnInit { await this.openEmendMessageModal(serialNumber); this.modalController.dismiss(null); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -126,9 +128,9 @@ export class ApproveEventPage implements OnInit { await this.processes.PostTaskAction(body).toPromise() this.router.navigate(['/home/gabinete-digital/event-list']); this.modalController.dismiss(null); - this.successMessage('Evento rejeitado') + this.toastService.successMessage('Evento rejeitado') } catch (error) { - this.badRequest('Evento não rejeitado') + this.toastService.badRequest('Evento não rejeitado') } } @@ -189,9 +191,9 @@ export class ApproveEventPage implements OnInit { await this.processes.PostTaskAction(body).toPromise() //this.router.navigate(['/home/gabinete-digital/event-list']); this.goToEventsToApprove(); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -236,52 +238,7 @@ export class ApproveEventPage 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) => { diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index df0c2ec93..a12e0824b 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -11,6 +11,7 @@ import { SearchDocument } from "src/app/models/search-document"; import { EventAttachment } from 'src/app/models/attachment.model'; import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -49,6 +50,7 @@ export class NewEventPage implements OnInit { private eventService: EventsService, private attachmentsService: AttachmentsService, private animationController: AnimationController, + private toastService: ToastService ) {} @@ -206,11 +208,11 @@ export class NewEventPage implements OnInit { this.afterSave(); } - this.successMessage('Evento criado') + this.toastService.successMessage('Evento criado') }, error => { - this.badRequest('Evento não criado') + this.toastService.badRequest('Evento não criado') }); } else if(this.profile=='pr') { @@ -247,7 +249,7 @@ export class NewEventPage implements OnInit { this.afterSave(); } - this.successMessage('Evento criado') + this.toastService.successMessage('Evento criado') }); } } @@ -315,97 +317,9 @@ export class NewEventPage implements OnInit { window['temp.path:/home/agenda/new-event.component.ts'] = {} } - 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 não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } diff --git a/src/app/shared/fingerprint/fingerprint.page.ts b/src/app/shared/fingerprint/fingerprint.page.ts index d1997b19e..356cf0a65 100644 --- a/src/app/shared/fingerprint/fingerprint.page.ts +++ b/src/app/shared/fingerprint/fingerprint.page.ts @@ -59,12 +59,12 @@ export class FingerprintPage implements OnInit { // }) // .then((FingerPrintHash: any) => { - // this.successMessage() + // this.toastService.successMessage() // localStorage.setItem('FingerPrintHash', FingerPrintHash) // }) // .catch((error: any) => { - // this.badRequest() + // this.toastService.badRequest() // }); } diff --git a/src/app/shared/pin/pin.page.ts b/src/app/shared/pin/pin.page.ts index 0646d4796..1dcae286e 100644 --- a/src/app/shared/pin/pin.page.ts +++ b/src/app/shared/pin/pin.page.ts @@ -3,6 +3,7 @@ import { AnimationController, ModalController } from '@ionic/angular'; import { BadRequestPage } from '../popover/bad-request/bad-request.page'; import { SuccessMessagePage } from '../popover/success-message/success-message.page'; import crypto from 'crypto-js' +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-pin', templateUrl: './pin.page.html', @@ -12,7 +13,8 @@ export class PinPage implements OnInit { code = [] constructor( private modalController: ModalController, - private animationController: AnimationController) { } + private animationController: AnimationController, + private toastService: ToastService) { } ngOnInit() { } @@ -41,7 +43,7 @@ export class PinPage implements OnInit { if(this.code.length == 4) { this.close() - //this.successMessage() + //this.toastService.successMessage() const code = this.code.join('') const encrypted = crypto.SHA1(code) @@ -49,94 +51,13 @@ export class PinPage implements OnInit { localStorage.setItem('PIN', encrypted) } else { - this.badRequest() + this.toastService.badRequest() } } - 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() - - modal.dismiss() - - } - - 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(()=>{ - this.close() - modal.dismiss() - },3000) - } } \ No newline at end of file diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts index 827cdc242..5dd759f56 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -4,6 +4,7 @@ import { AnimationController, ModalController, PopoverController } from '@ionic/ import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { ProcessesService } from 'src/app/services/processes.service'; +import { ToastService } from 'src/app/services/toast.service'; import { BadRequestPage } from '../bad-request/bad-request.page'; import { SuccessMessagePage } from '../success-message/success-message.page'; @@ -25,7 +26,8 @@ export class DeplomaOptionsPage implements OnInit { private modalController: ModalController, private activatedRoute: ActivatedRoute, private processes: ProcessesService, - private animationController: AnimationController) { + private animationController: AnimationController, + private toastService: ToastService) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { this.serialnumber = params["serialNumber"]; @@ -99,9 +101,9 @@ export class DeplomaOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -138,9 +140,9 @@ export class DeplomaOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } } diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index 735f21371..8d0d743e0 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -17,6 +17,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -43,7 +44,8 @@ export class DespachosOptionsPage implements OnInit { public popoverController: PopoverController, private activatedRoute: ActivatedRoute, private animationController: AnimationController, - private navParams: NavParams) { + private navParams: NavParams, + private toastService: ToastService) { this.task = this.navParams.get('task') this.fulltask = this.navParams.get('fulltask') @@ -181,10 +183,10 @@ export class DespachosOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -254,10 +256,10 @@ export class DespachosOptionsPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('Processo arquivado') + this.toastService.successMessage('Processo arquivado') this.close(); } catch (error) { - this.badRequest('Processo não arquivado') + this.toastService.badRequest('Processo não arquivado') } } @@ -277,60 +279,15 @@ export class DespachosOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch(error) { - this.badRequest() + this.toastService.badRequest() } } - 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 modal = await this.modalController.create({ @@ -365,10 +322,10 @@ export class DespachosOptionsPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts index fd4e0b524..3d6cc62e0 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts @@ -17,6 +17,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -43,7 +44,8 @@ export class DespachosPrOptionsPage implements OnInit { private alertService: AlertService, public popoverController: PopoverController, private activatedRoute: ActivatedRoute, - private animationController: AnimationController) { } + private animationController: AnimationController, + private toastService: ToastService) { } ngOnInit() { @@ -176,10 +178,10 @@ export class DespachosPrOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -251,10 +253,10 @@ export class DespachosPrOptionsPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage('Processo arquivado') + this.toastService.successMessage('Processo arquivado') this.close(); } catch (error) { - this.badRequest('Processo não arquivado') + this.toastService.badRequest('Processo não arquivado') } } @@ -274,60 +276,15 @@ export class DespachosPrOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch(error) { - this.badRequest() + this.toastService.badRequest() } } - 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 modal = await this.modalController.create({ @@ -362,10 +319,10 @@ export class DespachosPrOptionsPage implements OnInit { } try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.close(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } } diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts index 4608d15dd..141bf24f5 100644 --- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts +++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts @@ -11,6 +11,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service'; import { AuthService } from 'src/app/services/auth.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 { BadRequestPage } from '../bad-request/bad-request.page'; import { SuccessMessagePage } from '../success-message/success-message.page'; @@ -43,7 +44,8 @@ export class OptsExpedientePrPage implements OnInit { private userAuth: AuthService, private navParams: NavParams, private animationController: AnimationController, - private router: Router + private router: Router, + private toastService: ToastService ) { @@ -122,9 +124,9 @@ export class OptsExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch(error) { - this.badRequest() + this.toastService.badRequest() } } @@ -148,11 +150,11 @@ export class OptsExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.successMessage() + this.toastService.successMessage() this.goBack(); } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -169,9 +171,9 @@ export class OptsExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(otherbody).toPromise() - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } @@ -198,9 +200,9 @@ export class OptsExpedientePrPage implements OnInit { try { await this.processes.CompleteTask(body); this.close(); - this.successMessage() + this.toastService.successMessage() } catch(error) { - this.badRequest() + this.toastService.badRequest() } } @@ -289,52 +291,7 @@ export class OptsExpedientePrPage 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 modal = await this.modalController.create({ diff --git a/src/app/shared/popover/request-options/request-options.page.ts b/src/app/shared/popover/request-options/request-options.page.ts index 65f5c9507..b838e0723 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -8,6 +8,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ProcessesService } from 'src/app/services/processes.service'; +import { ToastService } from 'src/app/services/toast.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'; @@ -31,7 +32,8 @@ export class RequestOptionsPage implements OnInit { private navParams: NavParams, private processes: ProcessesService, private activatedRoute: ActivatedRoute, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService ) { this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); @@ -166,9 +168,9 @@ export class RequestOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage() + this.toastService.successMessage() } catch (error) { - this.badRequest() + this.toastService.badRequest() } } @@ -232,9 +234,9 @@ export class RequestOptionsPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.close(); - this.successMessage('Processo arquivado') + this.toastService.successMessage('Processo arquivado') } catch (error) { - this.badRequest('Processo não arquivado') + this.toastService.badRequest('Processo não arquivado') } @@ -285,52 +287,7 @@ export class RequestOptionsPage 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) => { diff --git a/src/app/shared/publication/new-action/new-action.page.ts b/src/app/shared/publication/new-action/new-action.page.ts index 3c982c133..530df12c8 100644 --- a/src/app/shared/publication/new-action/new-action.page.ts +++ b/src/app/shared/publication/new-action/new-action.page.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { AnimationController, ModalController } from '@ionic/angular'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.service'; import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; @@ -20,7 +21,8 @@ export class NewActionPage implements OnInit { constructor( private modalController: ModalController, private publication: PublicationsService, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService ) { this.folder = new PublicationFolder(); } @@ -47,9 +49,9 @@ export class NewActionPage implements OnInit { try { await this.publication.CreatePublicationFolder(this.folder).toPromise() this.close(); - this.successMessage('Publicação criado') + this.toastService.successMessage('Publicação criado') } catch (error) { - this.badRequest('Publicação não criado') + this.toastService.badRequest('Publicação não criado') } } @@ -59,96 +61,8 @@ export class NewActionPage 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: 'Processo não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index b09b55bee..2d82d4b0d 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -18,6 +18,7 @@ import { ViewPublicationsPage } from '../view-publications/view-publications.pag import { LoadingService } from 'src/app/services/loading.service'; import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-new-publication', @@ -57,7 +58,8 @@ export class NewPublicationPage implements OnInit { public photoService: PhotoService, private publications: PublicationsService, private camera: Camera, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService, ) { this.publicationTitle = 'Nova Publicação'; } @@ -159,11 +161,11 @@ export class NewPublicationPage implements OnInit { console.log(this.publication); await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() - this.successMessage("Publicação criado") + this.toastService.successMessage("Publicação criado") this.goBack(); } catch (error) { - this.badRequest("Publicação não criado") + this.toastService.badRequest("Publicação não criado") } } @@ -183,11 +185,11 @@ export class NewPublicationPage implements OnInit { try { console.log(this.publication); await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() - this.successMessage("Publicação criado") + this.toastService.successMessage("Publicação criado") this.goBack(); } catch (error) { - this.badRequest("Publicação não criado") + this.toastService.badRequest("Publicação não criado") } } @@ -209,11 +211,11 @@ export class NewPublicationPage implements OnInit { try { console.log(this.publication); await this.publications.CreatePublication(this.folderId, this.publication).toPromise() - this.successMessage("Publicação criado") + this.toastService.successMessage("Publicação criado") this.goBackToViewPublications.emit(); } catch (error) { - this.badRequest("Publicação não criado") + this.toastService.badRequest("Publicação não criado") } } @@ -275,96 +277,8 @@ export class NewPublicationPage 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: 'Processo não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts index e6dbee632..47260d6fc 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts @@ -4,6 +4,7 @@ import { Publication } from 'src/app/models/publication'; import { ImageModalPage } from 'src/app/pages/publications/gallery/image-modal/image-modal.page'; import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page'; import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.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'; @@ -26,7 +27,8 @@ export class PublicationDetailPage implements OnInit { constructor( private modalController: ModalController, private publications:PublicationsService, - private animationController: AnimationController + private animationController: AnimationController, + private toastService: ToastService, ) { /* this.folderId = this.navParams.get('folderIdId'); */ @@ -88,10 +90,10 @@ export class PublicationDetailPage implements OnInit { try { await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); - this.successMessage("Publicação eliminado") + this.toastService.successMessage("Publicação eliminado") this.goBackToViewPublications.emit(); } catch (error) { - this.badRequest("Publicação não eliminado") + this.toastService.badRequest("Publicação não eliminado") } } @@ -141,96 +143,8 @@ export class PublicationDetailPage 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: 'Processo não realizado com sucesso', - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } From 57c35ca3ffe1107aec021ec724f4fff29320cafc Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 15:28:03 +0100 Subject: [PATCH 25/27] Change component name --- .../modals/create-process/create-process.module.ts | 1 - src/app/modals/create-process/create-process.page.ts | 6 +++--- src/app/modals/delegar/delegar.module.ts | 1 - src/app/pages/agenda/edit-event/edit-event.module.ts | 1 - src/app/pages/agenda/edit-event/edit-event.page.ts | 4 ++-- src/app/pages/agenda/new-event/new-event.page.ts | 4 ++-- .../events/attendees/attendees-routing.module.ts | 4 ++-- src/app/pages/events/attendees/attendees.module.ts | 6 +++--- src/app/pages/events/attendees/attendees.page.ts | 2 +- src/app/pages/events/edit-event/edit-event.page.ts | 4 ++-- .../event-detail-modal/event-detail-modal.page.ts | 4 ++-- .../pages/events/event-detail/event-detail.page.ts | 4 ++-- .../book-meeting-modal/book-meeting-modal.module.ts | 1 - .../book-meeting-modal/book-meeting-modal.page.ts | 6 +++--- .../expedient-task-modal.module.ts | 1 - .../expedient-task-modal.page.ts | 4 ++-- .../attendee-modal/attendee-modal-routing.module.ts | 4 ++-- .../event/attendee-modal/attendee-modal.module.ts | 6 +++--- .../event/attendee-modal/attendee-modal.page.spec.ts | 12 ++++++------ .../event/attendee-modal/attendee-modal.page.ts | 2 +- .../edit-event-to-approve/edit-event.page.ts | 4 ++-- 21 files changed, 38 insertions(+), 43 deletions(-) diff --git a/src/app/modals/create-process/create-process.module.ts b/src/app/modals/create-process/create-process.module.ts index 5574afdd6..7a83ca089 100644 --- a/src/app/modals/create-process/create-process.module.ts +++ b/src/app/modals/create-process/create-process.module.ts @@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular'; import { CreateProcessPageRoutingModule } from './create-process-routing.module'; import { CreateProcessPage } from './create-process.page'; -import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page'; import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 4ab5dd4d7..bc2011682 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -19,7 +19,7 @@ import { SearchPage } from 'src/app/pages/search/search.page'; 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 { User } from 'src/app/models/user.model'; -import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -393,7 +393,7 @@ export class CreateProcessPage implements OnInit { this.showAttendees=false; const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, @@ -433,7 +433,7 @@ export class CreateProcessPage implements OnInit { this.showAttendees=false; const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, diff --git a/src/app/modals/delegar/delegar.module.ts b/src/app/modals/delegar/delegar.module.ts index a7df223e4..debc9fbb9 100644 --- a/src/app/modals/delegar/delegar.module.ts +++ b/src/app/modals/delegar/delegar.module.ts @@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular'; import { DelegarPageRoutingModule } from './delegar-routing.module'; import { DelegarPage } from './delegar.page'; -import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; @NgModule({ diff --git a/src/app/pages/agenda/edit-event/edit-event.module.ts b/src/app/pages/agenda/edit-event/edit-event.module.ts index 303186c06..c1162fa5a 100644 --- a/src/app/pages/agenda/edit-event/edit-event.module.ts +++ b/src/app/pages/agenda/edit-event/edit-event.module.ts @@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular'; import { EditEventPageRoutingModule } from './edit-event-routing.module'; import { EditEventPage } from './edit-event.page'; -import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; @NgModule({ diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 76f04df4b..74bcbc503 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -10,7 +10,7 @@ import { ToastService } from 'src/app/services/toast.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 { Event } from '../../../models/event.model'; -import { AttendeesPage } from '../../events/attendees/attendees.page'; +import { AttendeesPageModal } from '../../events/attendees/attendees.page'; import { SearchPage } from '../../search/search.page'; @Component({ @@ -138,7 +138,7 @@ export class EditEventPage implements OnInit { } else{ const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 0750b12b3..57f0520d5 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -10,7 +10,7 @@ import { ToastService } from 'src/app/services/toast.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 { Event } from '../../../models/event.model'; -import { AttendeesPage } from '../../events/attendees/attendees.page'; +import { AttendeesPageModal } from '../../events/attendees/attendees.page'; import { SearchPage } from '../../search/search.page'; @Component({ @@ -241,7 +241,7 @@ export class NewEventPage implements OnInit { async openAttendees() { const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { eventAttendees: this.postEvent.Attendees, adding: this.adding, diff --git a/src/app/pages/events/attendees/attendees-routing.module.ts b/src/app/pages/events/attendees/attendees-routing.module.ts index 7c59381bf..00f6f262b 100644 --- a/src/app/pages/events/attendees/attendees-routing.module.ts +++ b/src/app/pages/events/attendees/attendees-routing.module.ts @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AttendeesPage } from './attendees.page'; +import { AttendeesPageModal } from './attendees.page'; const routes: Routes = [ { path: '', - component: AttendeesPage + component: AttendeesPageModal } ]; diff --git a/src/app/pages/events/attendees/attendees.module.ts b/src/app/pages/events/attendees/attendees.module.ts index 36e9da0d5..f21feadb2 100644 --- a/src/app/pages/events/attendees/attendees.module.ts +++ b/src/app/pages/events/attendees/attendees.module.ts @@ -6,7 +6,7 @@ import { IonicModule } from '@ionic/angular'; import { AttendeesPageRoutingModule } from './attendees-routing.module'; -import { AttendeesPage } from './attendees.page'; +import { AttendeesPageModal } from './attendees.page'; @NgModule({ imports: [ @@ -15,7 +15,7 @@ import { AttendeesPage } from './attendees.page'; IonicModule, AttendeesPageRoutingModule ], - declarations: [AttendeesPage], - exports: [AttendeesPage] + declarations: [AttendeesPageModal], + exports: [AttendeesPageModal] }) export class AttendeesPageModule {} diff --git a/src/app/pages/events/attendees/attendees.page.ts b/src/app/pages/events/attendees/attendees.page.ts index 66ec466da..d79630879 100644 --- a/src/app/pages/events/attendees/attendees.page.ts +++ b/src/app/pages/events/attendees/attendees.page.ts @@ -8,7 +8,7 @@ import { ContactsService } from 'src/app/services/contacts.service'; templateUrl: './attendees.page.html', styleUrls: ['./attendees.page.scss'], }) -export class AttendeesPage implements OnInit { +export class AttendeesPageModal implements OnInit { // Defined by the API contacts: EventPerson[]; diff --git a/src/app/pages/events/edit-event/edit-event.page.ts b/src/app/pages/events/edit-event/edit-event.page.ts index c3ea2c912..787ae3e99 100644 --- a/src/app/pages/events/edit-event/edit-event.page.ts +++ b/src/app/pages/events/edit-event/edit-event.page.ts @@ -6,7 +6,7 @@ import { Event } from '../../../models/event.model'; import { EventBody } from 'src/app/models/eventbody.model'; import { AlertController, ModalController } from '@ionic/angular'; import { EventPerson } from 'src/app/models/eventperson.model'; -import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AlertService } from 'src/app/services/alert.service'; import { Attachment } from 'src/app/models/attachment.model'; import { AttachmentsService } from 'src/app/services/attachments.service'; @@ -87,7 +87,7 @@ export class EditEventPage implements OnInit { async openAttendees(){ const modal = await this.modalCtrl.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { eventAttendees: this.loadedEvent.Attendees }, diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts b/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts index 76304f437..461c74cde 100644 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts +++ b/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts @@ -10,7 +10,7 @@ import { AlertService } from 'src/app/services/alert.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { EventsService } from 'src/app/services/events.service'; import { AttachmentsPage } from '../attachments/attachments.page'; -import { AttendeesPage } from '../attendees/attendees.page'; +import { AttendeesPageModal } from '../attendees/attendees.page'; @Component({ selector: 'app-event-detail-modal', @@ -81,7 +81,7 @@ export class EventDetailModalPage implements OnInit { async openAttendees(){ const modal = await this.modalCtrl.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { eventAttendees: this.loadedEvent.Attendees }, diff --git a/src/app/pages/events/event-detail/event-detail.page.ts b/src/app/pages/events/event-detail/event-detail.page.ts index e52d331a7..bc5a58008 100644 --- a/src/app/pages/events/event-detail/event-detail.page.ts +++ b/src/app/pages/events/event-detail/event-detail.page.ts @@ -6,7 +6,7 @@ import { Event } from '../../../models/event.model'; import { EventBody } from 'src/app/models/eventbody.model'; import { AlertController, ModalController } from '@ionic/angular'; import { EventPerson } from 'src/app/models/eventperson.model'; -import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AlertService } from 'src/app/services/alert.service'; import { Attachment } from 'src/app/models/attachment.model'; import { AttachmentsService } from 'src/app/services/attachments.service'; @@ -87,7 +87,7 @@ export class EventDetailPage implements OnInit { async openAttendees(){ const modal = await this.modalCtrl.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { eventAttendees: this.loadedEvent.Attendees }, diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts index 004bdb6a2..743fe38aa 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.module.ts @@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular'; import { BookMeetingModalPageRoutingModule } from './book-meeting-modal-routing.module'; import { BookMeetingModalPage } from './book-meeting-modal.page'; -import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module'; import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index aa2eb4575..ce18428f8 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -16,7 +16,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { User } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; -import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -178,7 +178,7 @@ export class BookMeetingModalPage implements OnInit { if(window.innerWidth <= 800){ const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, @@ -214,7 +214,7 @@ export class BookMeetingModalPage implements OnInit { if(window.innerWidth <= 800) { const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts index b1122467f..08212fb16 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module.ts @@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular'; import { ExpedientTaskModalPageRoutingModule } from './expedient-task-modal-routing.module'; import { ExpedientTaskModalPage } from './expedient-task-modal.page'; -import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page'; import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module'; 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 2fec50acb..9a0e38226 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 @@ -19,7 +19,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'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; @Component({ selector: 'app-expedient-task-modal', @@ -378,7 +378,7 @@ export class ExpedientTaskModalPage implements OnInit { if(window.innerWidth <= 1024) { const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, diff --git a/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts b/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts index 384a9efd2..b1c0e4fea 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AttendeeModalPage } from './attendee-modal.page'; +import { AttendeePage } from './attendee-modal.page'; const routes: Routes = [ { path: '', - component: AttendeeModalPage + component: AttendeePage } ]; diff --git a/src/app/shared/event/attendee-modal/attendee-modal.module.ts b/src/app/shared/event/attendee-modal/attendee-modal.module.ts index bc1113349..f8fc059de 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.module.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.module.ts @@ -6,7 +6,7 @@ import { IonicModule } from '@ionic/angular'; import { AttendeeModalPageRoutingModule } from './attendee-modal-routing.module'; -import { AttendeeModalPage } from './attendee-modal.page'; +import { AttendeePage } from './attendee-modal.page'; @NgModule({ imports: [ @@ -15,7 +15,7 @@ import { AttendeeModalPage } from './attendee-modal.page'; IonicModule, AttendeeModalPageRoutingModule ], - declarations: [AttendeeModalPage], - exports: [AttendeeModalPage] + declarations: [AttendeePage], + exports: [AttendeePage] }) export class AttendeeModalPageModule {} diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts b/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts index f247abe63..47eefcadd 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts @@ -1,19 +1,19 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { AttendeeModalPage } from './attendee-modal.page'; +import { AttendeePage } from './attendee-modal.page'; -describe('AttendeeModalPage', () => { - let component: AttendeeModalPage; - let fixture: ComponentFixture; +describe('AttendeePage', () => { + let component: AttendeePage; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AttendeeModalPage ], + declarations: [ AttendeePage ], imports: [IonicModule.forRoot()] }).compileComponents(); - fixture = TestBed.createComponent(AttendeeModalPage); + fixture = TestBed.createComponent(AttendeePage); component = fixture.componentInstance; fixture.detectChanges(); })); 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 418700419..0ad3d1275 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -8,7 +8,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js' templateUrl: './attendee-modal.page.html', styleUrls: ['./attendee-modal.page.scss'], }) -export class AttendeeModalPage implements OnInit { +export class AttendeePage implements OnInit { // Defined by the API contacts: EventPerson[]; 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 1e58b380d..dd027d5b5 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 @@ -3,7 +3,7 @@ import { AlertController, AnimationController, ModalController, NavParams } from import { Attachment } from 'src/app/models/attachment.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { SearchDocument } from 'src/app/models/search-document'; -import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page'; +import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; 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'; @@ -289,7 +289,7 @@ export class EditEventToApproveComponent implements OnInit { if(window.innerWidth <= 1024) { const modal = await this.modalController.create({ - component: AttendeesPage, + component: AttendeesPageModal, componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, From 68d03492f88b42cc6a753d356077340395050059 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 15:45:34 +0100 Subject: [PATCH 26/27] Improve attendees components --- .../pages/events/attendees/attendees.page.ts | 28 ++++++------------- .../attendee-modal/attendee-modal.page.ts | 4 +-- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/app/pages/events/attendees/attendees.page.ts b/src/app/pages/events/attendees/attendees.page.ts index d79630879..3c26142f7 100644 --- a/src/app/pages/events/attendees/attendees.page.ts +++ b/src/app/pages/events/attendees/attendees.page.ts @@ -66,28 +66,16 @@ export class AttendeesPageModal implements OnInit { filterSearchList(itm: EventPerson): boolean { - if(this.adding == "intervenient"){ - const result = this.taskParticipants.find((contact, index)=>{ - - if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){ - index = index; - return contact; - } - }); - return undefined == result; - - } else if (this.adding == "CC") { - - const result = this.taskParticipantsCc.find((contact, index)=>{ - + const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{ + if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){ - index = index; - return contact; - } - }); + index = index; + return contact; + } - return undefined == result; - } + }) + + return undefined == result; } 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 0ad3d1275..e6011df58 100644 --- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts +++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts @@ -118,7 +118,7 @@ export class AttendeePage implements OnInit { filterSearchList(itm: EventPerson): boolean { - const result1 = this.LtaskParticipants.find((contact, index)=>{ + const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{ if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){ index = index; @@ -127,7 +127,7 @@ export class AttendeePage implements OnInit { }); // if to show - if(undefined != result1){ + if(undefined != result){ return false; } From 9650255eee8079c657dde04844cd76bebc900bdc Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Jun 2021 15:51:12 +0100 Subject: [PATCH 27/27] Improve mook metting --- .../book-meeting-modal.page.ts | 95 +------------------ 1 file changed, 2 insertions(+), 93 deletions(-) diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index ce18428f8..1f525c6c1 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -184,7 +184,7 @@ export class BookMeetingModalPage implements OnInit { taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'attendee', + cssClass: 'modal modal-desktop', backdropDismiss: false }); @@ -220,7 +220,7 @@ export class BookMeetingModalPage implements OnInit { taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc }, - cssClass: 'attendee', + cssClass: 'modal modal-desktop', backdropDismiss: false }); @@ -298,97 +298,6 @@ export class BookMeetingModalPage 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(()=>{ - modal.dismiss() - this.goToGabinete() - },3000) - - } - - 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 não efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } - goToGabinete() { this.router.navigate(['/home/gabinete-digital']); }