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 9f325ca6d..28b95e615 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -431,7 +431,7 @@ export class DespachoPage implements OnInit { return this.animationController.create() .addElement(baseEl) .easing('ease-out') - .duration(500) + .duration(7000) .addAnimation([backdropAnimation, wrapperAnimation]); } @@ -474,7 +474,7 @@ export class DespachoPage implements OnInit { return this.animationController.create() .addElement(baseEl) .easing('ease-out') - .duration(500) + .duration(7000) .addAnimation([backdropAnimation, wrapperAnimation]); } diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.html b/src/app/pages/gabinete-digital/event-list/event-list.page.html index 4997ca3eb..d540dd5eb 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.html +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.html @@ -2,7 +2,7 @@ - + diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index cc7d94f67..0ef45e5b3 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -37,7 +37,7 @@ export class EventListPage implements OnInit { this.router.events.forEach((event) => { if(event instanceof NavigationEnd && event.url == this.router.url) { - this.LoadToApproveEvents(); + this.doRefresh(); } }); @@ -96,11 +96,10 @@ export class EventListPage implements OnInit { - doRefresh(event) { + doRefresh() { this.LoadToApproveEvents(); console.log('refresh'); setTimeout(() => { - event.target.complete(); }, 2000); } close(){ diff --git a/src/app/pages/login/login.page.scss b/src/app/pages/login/login.page.scss index 34de572c3..17037bc06 100644 --- a/src/app/pages/login/login.page.scss +++ b/src/app/pages/login/login.page.scss @@ -41,7 +41,8 @@ ion-item{ --background: transparent; } .form{ - width: 400px; + width: 300px; + margin: auto; overflow: auto; } .form-label{ @@ -159,4 +160,10 @@ ion-item{ bottom: 0 !important; text-align: center; } +} + +@media only screen and (min-width: 1024px){ + .form{ + width: 400px; + } } \ No newline at end of file diff --git a/src/app/services/alert.service.ts b/src/app/services/alert.service.ts index 9952f17e2..1e9a09ba9 100644 --- a/src/app/services/alert.service.ts +++ b/src/app/services/alert.service.ts @@ -1,12 +1,15 @@ import { Injectable } from '@angular/core'; -import { AlertController } from '@ionic/angular'; +import { AlertController, AnimationController } from '@ionic/angular'; @Injectable({ providedIn: 'root' }) export class AlertService { - constructor(public alertController: AlertController) { } + constructor( + public alertController: AlertController, + private animationController: AnimationController, + ) { } async presentAlert(message:string) { const alert = await this.alertController.create({ diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts index 584d9738f..60305a958 100644 --- a/src/app/services/toast.service.ts +++ b/src/app/services/toast.service.ts @@ -1,12 +1,18 @@ import { Injectable } from '@angular/core'; -import { ToastController } from '@ionic/angular'; +import { AnimationController, ModalController, ToastController } from '@ionic/angular'; +import { BadRequestPage } from '../shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from '../shared/popover/success-message/success-message.page'; @Injectable({ providedIn: 'root' }) export class ToastService { - constructor(public toastController: ToastController) { } + constructor( + public toastController: ToastController, + private animationController: AnimationController, + private modalController: ModalController, + ) { } async presentToast(infoMessage: string) { const toast = await this.toastController.create({ @@ -16,4 +22,90 @@ export class ToastService { toast.present(); } + async successMessage(message?: string) { + + 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: SuccessMessagePage, + componentProps: { + message: message || 'Processo efetuado' , + }, + cssClass: 'notification-modal' + }); + + modal.present() + + setTimeout(()=>{ + modal.dismiss() + },3000) + + } + + async badRequest(message?: string) { + 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(()=>{ + modal.dismiss() + },3000) + } + } diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts index b0a7f8e2d..1c71cf2a9 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts @@ -119,11 +119,6 @@ export class EventsToApprovePage implements OnInit { }); } */ - lis(){ - console.log('Teste'); - - } - doRefresh() { console.log('Refresh Events'); diff --git a/src/app/shared/popover/bad-request/bad-request.page.html b/src/app/shared/popover/bad-request/bad-request.page.html index 7ed6ca583..9922f668c 100644 --- a/src/app/shared/popover/bad-request/bad-request.page.html +++ b/src/app/shared/popover/bad-request/bad-request.page.html @@ -4,6 +4,4 @@ {{ message }}

- -