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) + } }