From d18030dbc3a0f73e7c8a99ceb0466b01872b66bf Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 17 Jun 2021 09:13:48 +0100 Subject: [PATCH] Improve notification --- src/app/modals/add-note/add-note.page.ts | 67 -------------- .../modals/dar-parecer/dar-parecer.page.ts | 63 ------------- src/app/modals/delegar/delegar.page.ts | 67 -------------- .../agenda/edit-event/edit-event.page.ts | 68 -------------- .../event-actions-popover.page.ts | 69 -------------- .../despacho-pr/despacho-pr.page.ts | 65 ------------- .../despachos/despacho/despacho.page.ts | 66 -------------- .../diploma-assinar/diploma-assinar.page.ts | 46 ---------- .../diplomas/diploma/diploma.page.ts | 44 --------- .../approve-event-modal.page.ts | 46 ---------- .../approve-event/approve-event.page.ts | 46 ---------- .../expedient-task-modal.page.ts | 2 +- .../expediente-detail.page.ts | 47 ---------- .../approve-event/approve-event.page.ts | 46 ---------- .../shared/fingerprint/fingerprint.page.ts | 91 ------------------- .../deploma-options/deploma-options.page.ts | 65 ------------- .../despachos-options.page.ts | 25 +---- .../despachos-pr-options.page.ts | 24 ----- .../request-options/request-options.page.ts | 45 --------- 19 files changed, 2 insertions(+), 990 deletions(-) diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index 088d02219..2178ed4c0 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -61,72 +61,5 @@ export class AddNotePage implements OnInit { this.documents = this.documents.filter( (e, i) => index != i); } - async successMessage(message?: any, callback?) { - - let notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` - -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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 diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index 4fbdc6800..f30737ada 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -98,69 +98,6 @@ export class DarParecerPage implements OnInit { }); } - - async successMessage(message?: any, callback?) { - - var notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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(()=>{ - modal.dismiss() - },1000) - } } diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 7e565b6f2..5b6a388d2 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -173,71 +173,4 @@ export class DelegarPage implements OnInit { this.taskParticipants = taskParticipants; } - async successMessage(message?: any, callback?) { - var notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` - -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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 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 74bcbc503..66b4c70c9 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -241,72 +241,4 @@ export class EditEventPage implements OnInit { }); } - async successMessage(message?: any, callback?) { - - var notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` - -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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 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 d5e5a1d41..2f2ae7020 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,73 +93,4 @@ export class EventActionsPopoverPage implements OnInit { } - - async successMessage(message?: any, callback?) { - var notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` - -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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) - } - - } 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 02662517c..6a687823c 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 @@ -466,70 +466,5 @@ export class DespachoPrPage implements OnInit { return await popover.present(); } - async successMessage(message?: any, callback?) { - var notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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) - } } 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 eb5fee874..b2490b13d 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -446,70 +446,4 @@ export class DespachoPage implements OnInit { return await popover.present(); } - async successMessage(message?: any, callback?) { - var notification = document.createElement('div') - notification.id = 'notification' - notification.innerHTML = ` - -
-

- -

{{ message }}

-

- -
- ` - - document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo efetuado' - setTimeout(()=>{ - 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' } - ]); - - 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: BadRequestPage, - componentProps: { - message: message || 'Processo efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } } 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 5a790858f..df663c0fa 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 @@ -166,50 +166,4 @@ export class DiplomaAssinarPage implements OnInit { } - - 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) - } - } 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 cf9ec1936..8e76d7eee 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -279,49 +279,5 @@ export class DiplomaPage implements OnInit { - 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) - } } 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 9b4fe24c5..6f68af7f9 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 @@ -221,50 +221,4 @@ export class ApproveEventModalPage implements OnInit { } - - 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) - } - } 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 266a168ac..31c8ede5d 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 @@ -242,50 +242,4 @@ export class ApproveEventPage implements OnInit { - - 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) - } - } 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 f40d72574..741838569 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 @@ -344,7 +344,7 @@ export class ExpedientTaskModalPage implements OnInit { } this.taskResult = await this.processes.postParecerPr(this.postData).toPromise(); - await this.toastService.badRequest('Processo efetuado'); + await this.toastService.badRequest('Processo não efetuado'); this.modalController.dismiss(action_parecer_pr); } catch (error) { 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 dac1f2c21..d8a004d70 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 @@ -361,51 +361,4 @@ export class ExpedienteDetailPage implements OnInit { - - - 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) - } - } 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 20a45e21a..5d9909a2d 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -239,50 +239,4 @@ export class ApproveEventPage implements OnInit { - - 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) - } - } diff --git a/src/app/shared/fingerprint/fingerprint.page.ts b/src/app/shared/fingerprint/fingerprint.page.ts index 356cf0a65..16e798444 100644 --- a/src/app/shared/fingerprint/fingerprint.page.ts +++ b/src/app/shared/fingerprint/fingerprint.page.ts @@ -69,95 +69,4 @@ export class FingerprintPage 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(()=>{ - - this.close() - modal.dismiss() - },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 efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } - } \ 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 5dd759f56..4102f6242 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -147,71 +147,6 @@ export class DeplomaOptionsPage 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({ - component: BadRequestPage, - componentProps: { - message: message || 'Processo efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } - goBack() { this.close() } 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 8d0d743e0..6e0a995d6 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -286,30 +286,7 @@ export class DespachosOptionsPage implements OnInit { } - - - - async badRequest(message?: string, callback?) { - const modal = await this.modalController.create({ - component: BadRequestPage, - componentProps: { - message: message || 'Processo efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } - - - + async reexecutar(note:string, documents:any){ let body = { "serialNumber": this.serialnumber, 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 3d6cc62e0..2b80d3d58 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 @@ -282,30 +282,6 @@ export class DespachosPrOptionsPage implements OnInit { } } - - - - - async badRequest(message?: string, callback?) { - const modal = await this.modalController.create({ - component: BadRequestPage, - componentProps: { - message: message || 'Processo efetuado' , - }, - cssClass: 'notification-modal' - }); - - modal.present() - - setTimeout(()=>{ - if (callback) { - callback() - } - modal.dismiss() - },7000) - } - - async reexecutar(note:string, documents:any){ let body = { 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 b838e0723..f071413ce 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -286,49 +286,4 @@ export class RequestOptionsPage implements OnInit { } - - - - 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(()=>{ - modal.dismiss() - },1000) - } - }