diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 564618489..4ba03b687 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,144 +1,152 @@ -import { NgModule } from '@angular/core'; -import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import { ChatPage } from './pages/chat/chat.page'; -import { MessagesPage } from './pages/chat/messages/messages.page'; - -const routes: Routes = [ - { - path: '', - loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule) +import { NgModule } from '@angular/core'; +import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; +import { ChatPage } from './pages/chat/chat.page'; +import { MessagesPage } from './pages/chat/messages/messages.page'; + +const routes: Routes = [ + { + path: '', + loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule) + }, + { + path: '', + loadChildren: () => import('./home/home.module').then( m => m.HomePageModule) + }, + { + path: 'empty-chat', + loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule) + }, + { + path: 'empty-container', + loadChildren: () => import('./shared/empty-container/empty-container.module').then( m => m.EmptyContainerPageModule) + }, + { + path: 'events-to-approve', + loadChildren: () => import('./shared/gabinete-digital/events-to-approve/events-to-approve.module').then( m => m.EventsToApprovePageModule) + }, + { + path: 'expedients', + loadChildren: () => import('./shared/gabinete-digital/expedients/expedients.module').then( m => m.ExpedientsPageModule) + }, + { + path: 'document-detail', + loadChildren: () => import('./modals/document-detail/document-detail.module').then( m => m.DocumentDetailPageModule) + }, + { + path: 'edit-group', + loadChildren: () => import('./shared/chat/edit-group/edit-group.module').then( m => m.EditGroupPageModule) + }, + { + path: 'pedidos', + loadChildren: () => import('./shared/gabinete-digital/pedidos/pedidos.module').then( m => m.PedidosPageModule) + }, + { + path: 'event-list', + loadChildren: () => import('./pages/gabinete-digital/event-list/event-list.module').then(m =>m.EventListPageModule) + }, + { + path: 'despachos', + loadChildren: () => import('./shared/gabinete-digital/despachos/despachos.module').then( m => m.DespachosPageModule) + }, + { + path: 'create-process', + loadChildren: () => import('./modals/create-process/create-process.module').then( m => m.CreateProcessPageModule) + }, + { + path: 'pendentes', + loadChildren: () => import('./shared/gabinete-digital/pendentes/pendentes.module').then( m => m.PendentesPageModule) + }, + { + path: 'delegar', + loadChildren: () => import('./modals/delegar/delegar.module').then( m => m.DelegarPageModule) + }, + { + path: 'add-note', + loadChildren: () => import('./modals/add-note/add-note.module').then( m => m.AddNotePageModule) + }, + { + path: 'dar-parecer', + loadChildren: () => import('./modals/dar-parecer/dar-parecer.module').then( m => m.DarParecerPageModule) + }, + { + path: 'opts-expediente', + loadChildren: () => import('./shared/popover/opts-expediente/opts-expediente.module').then( m => m.OptsExpedientePageModule) + }, + { + path: 'despachos-pr', + loadChildren: () => import('./shared/gabinete-digital/despachos-pr/despachos-pr.module').then( m => m.DespachosPrPageModule) + }, + { + path: 'diplomas', + loadChildren: () => import('./shared/gabinete-digital/diplomas/diplomas.module').then( m => m.DiplomasPageModule) + }, + { + path: 'expedientes-pr', + loadChildren: () => import('./shared/gabinete-digital/expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule) + }, + { + path: 'diplomas-assinar', + loadChildren: () => import('./shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule) + }, + { + path: 'opts-expediente-pr', + loadChildren: () => import('./shared/popover/opts-expediente-pr/opts-expediente-pr.module').then( m => m.OptsExpedientePrPageModule) + }, + { + path: 'despachos-options', + loadChildren: () => import('./shared/popover/despachos-options/despachos-options.module').then( m => m.DespachosOptionsPageModule) + }, + { + path: 'despachos-pr-options', + loadChildren: () => import('./shared/popover/despachos-pr-options/despachos-pr-options.module').then( m => m.DespachosPrOptionsPageModule) + }, + { + path: 'deploma-options', + loadChildren: () => import('./shared/popover/deploma-options/deploma-options.module').then( m => m.DeplomaOptionsPageModule) + }, + { + path: 'pin', + loadChildren: () => import('./shared/pin/pin.module').then( m => m.PinPageModule) + }, + { + path: 'fingerprint', + loadChildren: () => import('./shared/fingerprint/fingerprint.module').then( m => m.FingerprintPageModule) + }, + { + path: 'new-event', + loadChildren: () => import('./shared/agenda/new-event/new-event.module').then( m => m.NewEventPageModule) + }, + { + path: 'edit-event', + loadChildren: () => import('./shared/agenda/edit-event/edit-event.module').then( m => m.EditEventPageModule) + }, + { + path: 'event-list', + loadChildren: () => import('./shared/agenda/event-list/event-list.module').then( m => m.EventListPageModule) + }, + { + path: 'approve-event', + loadChildren: () => import('./shared/agenda/approve-event/approve-event.module').then( m => m.ApproveEventPageModule) + }, { + path: 'bad-request', + loadChildren: () => import('./shared/popover/bad-request/bad-request.module').then( m => m.BadRequestPageModule) }, { - path: '', - loadChildren: () => import('./home/home.module').then( m => m.HomePageModule) - }, - { - path: 'empty-chat', - loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule) - }, - { - path: 'empty-container', - loadChildren: () => import('./shared/empty-container/empty-container.module').then( m => m.EmptyContainerPageModule) - }, - { - path: 'events-to-approve', - loadChildren: () => import('./shared/gabinete-digital/events-to-approve/events-to-approve.module').then( m => m.EventsToApprovePageModule) - }, - { - path: 'expedients', - loadChildren: () => import('./shared/gabinete-digital/expedients/expedients.module').then( m => m.ExpedientsPageModule) - }, - { - path: 'document-detail', - loadChildren: () => import('./modals/document-detail/document-detail.module').then( m => m.DocumentDetailPageModule) - }, - { - path: 'edit-group', - loadChildren: () => import('./shared/chat/edit-group/edit-group.module').then( m => m.EditGroupPageModule) - }, - { - path: 'pedidos', - loadChildren: () => import('./shared/gabinete-digital/pedidos/pedidos.module').then( m => m.PedidosPageModule) - }, - { - path: 'event-list', - loadChildren: () => import('./pages/gabinete-digital/event-list/event-list.module').then(m =>m.EventListPageModule) - }, - { - path: 'despachos', - loadChildren: () => import('./shared/gabinete-digital/despachos/despachos.module').then( m => m.DespachosPageModule) - }, - { - path: 'create-process', - loadChildren: () => import('./modals/create-process/create-process.module').then( m => m.CreateProcessPageModule) - }, - { - path: 'pendentes', - loadChildren: () => import('./shared/gabinete-digital/pendentes/pendentes.module').then( m => m.PendentesPageModule) - }, - { - path: 'delegar', - loadChildren: () => import('./modals/delegar/delegar.module').then( m => m.DelegarPageModule) - }, - { - path: 'add-note', - loadChildren: () => import('./modals/add-note/add-note.module').then( m => m.AddNotePageModule) - }, - { - path: 'dar-parecer', - loadChildren: () => import('./modals/dar-parecer/dar-parecer.module').then( m => m.DarParecerPageModule) - }, - { - path: 'opts-expediente', - loadChildren: () => import('./shared/popover/opts-expediente/opts-expediente.module').then( m => m.OptsExpedientePageModule) - }, - { - path: 'despachos-pr', - loadChildren: () => import('./shared/gabinete-digital/despachos-pr/despachos-pr.module').then( m => m.DespachosPrPageModule) - }, - { - path: 'diplomas', - loadChildren: () => import('./shared/gabinete-digital/diplomas/diplomas.module').then( m => m.DiplomasPageModule) - }, - { - path: 'expedientes-pr', - loadChildren: () => import('./shared/gabinete-digital/expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule) - }, - { - path: 'diplomas-assinar', - loadChildren: () => import('./shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule) - }, - { - path: 'opts-expediente-pr', - loadChildren: () => import('./shared/popover/opts-expediente-pr/opts-expediente-pr.module').then( m => m.OptsExpedientePrPageModule) - }, - { - path: 'despachos-options', - loadChildren: () => import('./shared/popover/despachos-options/despachos-options.module').then( m => m.DespachosOptionsPageModule) - }, - { - path: 'despachos-pr-options', - loadChildren: () => import('./shared/popover/despachos-pr-options/despachos-pr-options.module').then( m => m.DespachosPrOptionsPageModule) - }, - { - path: 'deploma-options', - loadChildren: () => import('./shared/popover/deploma-options/deploma-options.module').then( m => m.DeplomaOptionsPageModule) - }, - { - path: 'pin', - loadChildren: () => import('./shared/pin/pin.module').then( m => m.PinPageModule) - }, - { - path: 'fingerprint', - loadChildren: () => import('./shared/fingerprint/fingerprint.module').then( m => m.FingerprintPageModule) - }, - { - path: 'new-event', - loadChildren: () => import('./shared/agenda/new-event/new-event.module').then( m => m.NewEventPageModule) - }, - { - path: 'edit-event', - loadChildren: () => import('./shared/agenda/edit-event/edit-event.module').then( m => m.EditEventPageModule) - }, - { - path: 'event-list', - loadChildren: () => import('./shared/agenda/event-list/event-list.module').then( m => m.EventListPageModule) - }, - { - path: 'approve-event', - loadChildren: () => import('./shared/agenda/approve-event/approve-event.module').then( m => m.ApproveEventPageModule) + path: 'success-message', + loadChildren: () => import('./shared/popover/success-message/success-message.module').then( m => m.SuccessMessagePageModule) }, - /* { - path: 'chat', - component: ChatPage - } */ - -]; -@NgModule({ - imports: [ - RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) - ], - exports: [RouterModule] -}) -export class AppRoutingModule {} + + /* { + path: 'chat', + component: ChatPage + } */ + +]; +@NgModule({ + imports: [ + RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) + ], + exports: [RouterModule] +}) +export class AppRoutingModule {} diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index b3bb75e3d..2a0a66c75 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController } from '@ionic/angular'; +import { AnimationController, ModalController } from '@ionic/angular'; import { SearchDocument } from 'src/app/models/search-document'; import { SearchPage } from 'src/app/pages/search/search.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-add-note', @@ -17,6 +17,7 @@ export class AddNotePage implements OnInit { constructor( private modalController: ModalController, + private animationController: AnimationController, ) { this.note = ''; } @@ -62,12 +63,38 @@ export class AddNotePage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -79,12 +106,38 @@ export class AddNotePage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 1239d592d..38ffde662 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Despacho } from 'src/app/models/despacho.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { Participant } from 'src/app/models/participant.model'; @@ -16,8 +16,8 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'; import { SearchDocument } from 'src/app/models/search-document'; import { SearchPage } from 'src/app/pages/search/search.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; @Component({ @@ -71,6 +71,7 @@ export class CreateProcessPage implements OnInit { private alertController: AlertService, private authService: AuthService, private userAuth: AuthService, + private animationController: AnimationController, ) { this.loggeduser = userAuth.ValidatedUser; this.user = environment.defaultuser +'@'+ environment.domain; @@ -505,12 +506,38 @@ export class CreateProcessPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -522,12 +549,38 @@ export class CreateProcessPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index e724f7e13..a9a08305a 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -1,10 +1,10 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, NavParams } from '@ionic/angular'; +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 { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-dar-parecer', @@ -21,6 +21,7 @@ export class DarParecerPage implements OnInit { private processes: ProcessesService, private modalController: ModalController, private navParams: NavParams, + private animationController: AnimationController, ) { this.serialNumber = this.navParams.get('serialNumber'); this.instanceId = this.navParams.get('ProcessInstanceID'); @@ -98,12 +99,38 @@ export class DarParecerPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -114,13 +141,39 @@ export class DarParecerPage implements OnInit { } - async badRequest() { + async badRequest(message?) { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: 'hello', + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index 83ab31cef..1b532099a 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { AlertController, ModalController, NavParams } from '@ionic/angular'; +import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Event } from 'src/app/models/event.model' import { EventBody } from 'src/app/models/eventbody.model'; import { ProcessesService } from 'src/app/services/processes.service'; @@ -11,8 +11,8 @@ import { AddParticipantsModalPage } from 'src/app/pages/gabinete-digital/expedie import { AddParticipantsCcModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-cc-modal/add-participants-cc-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { AlertService } from 'src/app/services/alert.service'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-delegar', @@ -47,6 +47,7 @@ export class DelegarPage implements OnInit { private calendarService: EventsService, public alertController: AlertController, private alertService: AlertService, + private animationController: AnimationController, ) { this.task = this.navParams.get('task'); this.postData = new Event(); @@ -175,12 +176,38 @@ export class DelegarPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -192,12 +219,38 @@ export class DelegarPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 d62a3d958..b955f38ca 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -1,13 +1,13 @@ import { Component, OnInit } from '@angular/core'; -import { AlertController, ModalController, NavParams } from '@ionic/angular'; +import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Attachment } from 'src/app/models/attachment.model'; import { EventBody } from 'src/app/models/eventbody.model'; 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 { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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 { SearchPage } from '../../search/search.page'; @@ -46,6 +46,7 @@ export class EditEventPage implements OnInit { private eventsService: EventsService, public alertController: AlertController, private attachmentsService: AttachmentsService, + private animationController: AnimationController, ) { this.isEventEdited = false; this.postEvent = this.navParams.get('event'); @@ -235,12 +236,38 @@ export class EditEventPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -251,13 +278,39 @@ export class EditEventPage implements OnInit { } - async badRequest() { + async badRequest(message?) { + 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({ - component: BadRequestComponent, - componentProps: { - message: 'Processo não realizado com sucesso', + enterAnimation, + leaveAnimation, + component: BadRequestPage, + componentProps: { + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 85c8e0df0..d122be70b 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 @@ -1,10 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ProcessesService } from 'src/app/services/processes.service'; import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-event-actions-popover', @@ -20,7 +20,8 @@ export class EventActionsPopoverPage implements OnInit { private processes:ProcessesService, private router:Router, private modalController: ModalController, - private popoverController: PopoverController,) { + private popoverController: PopoverController, + private animationController: AnimationController,) { this.serialNumber = this.navParams.get('serialNumber'); this.instanceId = this.navParams.get('InstanceId'); } @@ -93,12 +94,38 @@ export class EventActionsPopoverPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -110,12 +137,38 @@ export class EventActionsPopoverPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 50db84145..854f9a005 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -1,13 +1,13 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { EventAttachment } from 'src/app/models/attachment.model'; import { EventBody } from 'src/app/models/eventbody.model'; 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 { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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 { SearchPage } from '../../search/search.page'; @@ -39,7 +39,8 @@ export class NewEventPage implements OnInit { private modalController: ModalController, private navParams: NavParams, private eventService: EventsService, - private attachmentsService: AttachmentsService + private attachmentsService: AttachmentsService, + private animationController: AnimationController, ) { this.postEvent = new Event(); this.eventBody = { BodyType : "1", Text : ""}; @@ -170,12 +171,38 @@ export class NewEventPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -186,13 +213,39 @@ export class NewEventPage implements OnInit { } - async badRequest() { + async badRequest(message?) { + 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({ - component: BadRequestComponent, - componentProps: { - message: 'Processo não realizado com sucesso', + enterAnimation, + leaveAnimation, + component: BadRequestPage, + componentProps: { + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 d0505f731..bb2f46d55 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 @@ -7,7 +7,7 @@ import { DailyWorkTask } from '../../../../models/dailyworktask.model'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { formatDate } from '@angular/common'; import { Event } from '../../../../models/event.model'; -import { MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, 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' @@ -18,8 +18,8 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process. import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; @Component({ @@ -52,7 +52,8 @@ export class DespachoPrPage implements OnInit { private modalController: ModalController, private alertService: AlertService, public popoverController: PopoverController, - private activatedRoute: ActivatedRoute,) { + private activatedRoute: ActivatedRoute, + private animationController: AnimationController) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { this.serialnumber = params["serialNumber"]; @@ -463,12 +464,38 @@ export class DespachoPrPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, - componentProps: { + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, + componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -476,16 +503,41 @@ export class DespachoPrPage implements OnInit { setTimeout(()=>{ modal.dismiss() },3000) - } - async badRequest(message?: string) { + async badRequest(message?) { + 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({ - component: BadRequestComponent, - componentProps: { - message: message || 'Processo não efetuado' , + enterAnimation, + leaveAnimation, + component: BadRequestPage, + componentProps: { + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 a149ce9fa..74b48ad7c 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -7,7 +7,7 @@ import { DailyWorkTask } from '../../../../models/dailyworktask.model'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { formatDate } from '@angular/common'; import { Event } from '../../../../models/event.model'; -import { MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, 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' @@ -18,8 +18,8 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process. import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-despacho', @@ -52,6 +52,7 @@ export class DespachoPage implements OnInit { public popoverController: PopoverController, private activatedRoute: ActivatedRoute, private router: Router, + private animationController: AnimationController, ) { this.activatedRoute.queryParams.subscribe(params => { @@ -415,12 +416,38 @@ export class DespachoPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -432,12 +459,38 @@ export class DespachoPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 1ebd8f565..791955cde 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 @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, ModalController, PopoverController } from '@ionic/angular'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { ProcessesService } from 'src/app/services/processes.service'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; @@ -8,8 +8,8 @@ import { momentG } from 'src/plugin/momentG'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; @Component({ @@ -37,6 +37,7 @@ export class DiplomaAssinarPage implements OnInit { private iab: InAppBrowser, private activatedRoute: ActivatedRoute, private router: Router, + private animationController: AnimationController, ) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -156,12 +157,38 @@ export class DiplomaAssinarPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -173,12 +200,38 @@ export class DiplomaAssinarPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 91c7b2be1..acc56e9d8 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, ModalController, PopoverController } from '@ionic/angular'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { ProcessesService } from 'src/app/services/processes.service'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; @@ -8,8 +8,8 @@ import { momentG } from 'src/plugin/momentG'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; @Component({ @@ -38,6 +38,7 @@ export class DiplomaPage implements OnInit { private iab: InAppBrowser, private activatedRoute: ActivatedRoute, private router: Router, + private animationController: AnimationController ) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -272,12 +273,38 @@ export class DiplomaPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -289,12 +316,38 @@ export class DiplomaPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 bc49bd76a..b1860ecdc 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 @@ -1,13 +1,13 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { Event } from 'src/app/models/event.model'; import { AlertService } from 'src/app/services/alert.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { ProcessesService } from 'src/app/services/processes.service'; import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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 { 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'; @@ -40,6 +40,7 @@ export class ApproveEventModalPage implements OnInit { private alertService: AlertService, private activatedRoute: ActivatedRoute, private iab: InAppBrowser, + private animationController: AnimationController, ) { @@ -215,12 +216,38 @@ export class ApproveEventModalPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -232,12 +259,38 @@ export class ApproveEventModalPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 2c28d3921..e167d2331 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 @@ -1,6 +1,6 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; -import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { Event } from 'src/app/models/event.model'; import { AlertService } from 'src/app/services/alert.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; @@ -9,8 +9,8 @@ import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/ import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-approve-event', @@ -45,7 +45,8 @@ export class ApproveEventPage implements OnInit { private popoverController: PopoverController, private menu: MenuController, private alertService: AlertService, - private iab: InAppBrowser + private iab: InAppBrowser, + private animationController: AnimationController ) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -244,12 +245,38 @@ export class ApproveEventPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -261,12 +288,38 @@ export class ApproveEventPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 14e5c9210..99ef3d3a1 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 @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { AddParticipantsCcModalPage } from '../add-participants-cc-modal/add-participants-cc-modal.page'; import { AddParticipantsModalPage } from '../add-participants-modal/add-participants-modal.page'; import { Event } from 'src/app/models/event.model' @@ -12,8 +12,8 @@ import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart import { AttachmentsService } from 'src/app/services/attachments.service'; import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchDocument } from 'src/app/models/search-document'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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 { AuthService } from 'src/app/services/auth.service'; @@ -52,6 +52,7 @@ export class BookMeetingModalPage implements OnInit { private attachmentsService: AttachmentsService, private calendarService: EventsService, authService: AuthService, + private animationController: AnimationController ) { this.loggeduser = authService.ValidatedUser; this.task = this.navParams.get('task'); @@ -306,12 +307,38 @@ export class BookMeetingModalPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -324,12 +351,38 @@ export class BookMeetingModalPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, - componentProps: { - message: message || 'Processo não efetuado' , - }, - cssClass: 'modal modal-desktop' + enterAnimation, + leaveAnimation, + component: BadRequestPage, + componentProps: { + message: message || 'Processo não efetuado' , + }, + cssClass: 'modal modal-desktop' }); modal.present() 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 edd554cd2..0733c95ac 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 @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Despacho } from 'src/app/models/despacho.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { Participant } from 'src/app/models/participant.model'; @@ -18,8 +18,8 @@ import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchDocument } from 'src/app/models/search-document'; import { EventAttachment } from 'src/app/models/attachment.model'; import { User } from 'src/app/models/user.model'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-expedient-task-modal', @@ -75,7 +75,8 @@ export class ExpedientTaskModalPage implements OnInit { private navParams: NavParams, private alertController: AlertService, private authService: AuthService, - private userAuth: AuthService) { + private userAuth: AuthService, + private animationController: AnimationController) { this.loggeduser = userAuth.ValidatedUser; @@ -529,12 +530,38 @@ export class ExpedientTaskModalPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -546,12 +573,38 @@ export class ExpedientTaskModalPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 fa727f46d..ca5e66521 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 @@ -7,7 +7,7 @@ import { DailyWorkTask } from '../../../../models/dailyworktask.model'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { formatDate } from '@angular/common'; import { Event } from '../../../../models/event.model'; -import { MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular'; import { AlertService } from 'src/app/services/alert.service'; import { ExpedientTaskModalPage } from '../expedient-task-modal/expedient-task-modal.page'; import { BookMeetingModalPage } from '../book-meeting-modal/book-meeting-modal.page'; @@ -15,8 +15,8 @@ import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page'; import { momentG } from 'src/plugin/momentG' import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { ToastService } from 'src/app/services/toast.service'; @Component({ @@ -51,6 +51,7 @@ export class ExpedienteDetailPage implements OnInit { public popoverController: PopoverController, private activatedRoute: ActivatedRoute, private toastService: ToastService, + private animationController: AnimationController ) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -335,12 +336,38 @@ export class ExpedienteDetailPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -352,12 +379,38 @@ export class ExpedienteDetailPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 9c5d77a5b..dcd46821a 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 @@ -7,7 +7,7 @@ import { DailyWorkTask } from '../../../../models/dailyworktask.model'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { formatDate } from '@angular/common'; import { Event } from '../../../../models/event.model'; -import { MenuController, ModalController, NavParams, 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' @@ -18,8 +18,8 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m import { User } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; @Component({ @@ -54,7 +54,9 @@ export class ExpedientePrPage implements OnInit { private alertService: AlertService, public popoverController: PopoverController, private activatedRoute: ActivatedRoute, - private userAuth: AuthService + private userAuth: AuthService, + private animationController: AnimationController, + ) { this.loggeduser = userAuth.ValidatedUser; this.activatedRoute.queryParams.subscribe(params => { @@ -440,12 +442,38 @@ export class ExpedientePrPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -456,13 +484,39 @@ export class ExpedientePrPage implements OnInit { } - async badRequest() { + async badRequest(message?) { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: 'hello', + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 72a47b435..289a1639a 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -7,7 +7,7 @@ import { DailyWorkTask } from '../../../../models/dailyworktask.model'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { formatDate } from '@angular/common'; import { Event } from '../../../../models/event.model'; -import { MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, 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' @@ -22,8 +22,8 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts- import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page'; import { AuthService } from 'src/app/services/auth.service'; import { User } from 'src/app/models/user.model'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-pedido', @@ -55,7 +55,8 @@ export class PedidoPage implements OnInit { private modalController: ModalController, private alertService: AlertService, public popoverController: PopoverController, - authService: AuthService) { + authService: AuthService, + private animationController: AnimationController) { this.loggeduser = authService.ValidatedUser; this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { @@ -415,12 +416,38 @@ export class PedidoPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -431,13 +458,39 @@ export class PedidoPage implements OnInit { } - async badRequest() { + async badRequest(message?) { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: 'hello', + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 805b12836..4404c99a1 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -66,5 +66,4 @@ - - + \ No newline at end of file diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 3280944bf..6dc444ef0 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -4,15 +4,15 @@ import { AuthService } from 'src/app/services/auth.service'; import { User, UserForm } from 'src/app/models/user.model'; import { ToastService } from 'src/app/services/toast.service'; import { environment } from 'src/environments/environment'; -import { AlertController, ModalController } from '@ionic/angular'; +import { AlertController, AnimationController, ModalController } from '@ionic/angular'; import { StorageService } from 'src/app/services/storage.service'; import { AuthConnstants } from 'src/app/config/auth-constants'; import { PhotoService } from 'src/app/services/photo.service'; import { NotificationsService } from 'src/app/services/notifications.service'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import crypto from 'crypto-js' -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; //import { Token } from '../../models/token.model'; //import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; @@ -48,7 +48,8 @@ export class LoginPage implements OnInit { private toastService: ToastService, private photoService: PhotoService, public alertController: AlertController, - private modalController: ModalController + private modalController: ModalController, + private animationController: AnimationController, //private fcm: FCM ) { @@ -170,7 +171,7 @@ export class LoginPage implements OnInit { //this.successMessage() this.router.navigate(['/home/events']); } else { - this.badRequest() + this.badRequest('Pin incorreto') this.code = [] } @@ -189,12 +190,38 @@ export class LoginPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -206,17 +233,45 @@ export class LoginPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: message || 'Processo não efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() - setTimeout(()=>{ + setTimeout(()=> { modal.dismiss() },3000) } 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 9e2d6cb5d..66e91d50b 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController } from '@ionic/angular'; +import { AnimationController, ModalController } from '@ionic/angular'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationsService } from 'src/app/services/publications.service'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-new-action', @@ -17,7 +17,9 @@ export class NewActionPage implements OnInit { constructor( private modalController: ModalController, - private publication: PublicationsService + private publication: PublicationsService, + private animationController: AnimationController, + ) { this.folder = new PublicationFolder(); } @@ -56,12 +58,38 @@ export class NewActionPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -73,8 +101,34 @@ export class NewActionPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, 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 7d820a3ce..d7331a992 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Publication } from 'src/app/models/publication'; import { PublicationsService } from 'src/app/services/publications.service'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; import { NewPublicationPage } from '../new-publication/new-publication.page'; @@ -23,6 +23,7 @@ export class PublicationDetailPage implements OnInit { private modalController: ModalController, private navParams:NavParams, private publications:PublicationsService, + private animationController: AnimationController ) { this.publicationId = this.navParams.get('publicationId'); /* this.folderId = this.navParams.get('folderIdId'); */ @@ -123,12 +124,38 @@ export class PublicationDetailPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -140,8 +167,34 @@ export class PublicationDetailPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, 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 b8bdca889..74b9c7378 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 @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Publication } from 'src/app/models/publication'; import { PublicationsService } from 'src/app/services/publications.service'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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'; import { NewPublicationPage } from '../../new-publication/new-publication.page'; @@ -22,6 +22,7 @@ export class PublicationDetailPage implements OnInit { private modalController: ModalController, private navParams:NavParams, private publications:PublicationsService, + private animationController: AnimationController ) { this.publicationId = this.navParams.get('publicationId'); this.folderId = this.navParams.get('folderId'); @@ -125,12 +126,38 @@ export class PublicationDetailPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -142,8 +169,34 @@ export class PublicationDetailPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, 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 57f76257d..db7d30017 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { NavigationExtras, Router } from '@angular/router'; -import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { Event } from 'src/app/models/event.model'; import { AlertService } from 'src/app/services/alert.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; @@ -9,8 +9,8 @@ import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/ import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { EditEventToApproveComponent } from '../../gabinete-digital/edit-event-to-approve/edit-event.page'; -import { BadRequestComponent } from '../../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../../popover/success-message/success-message.component'; +import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; +import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; @Component({ @@ -46,7 +46,8 @@ export class ApproveEventPage implements OnInit { private popoverController: PopoverController, private menu: MenuController, private alertService: AlertService, - private iab: InAppBrowser + private iab: InAppBrowser, + private animationController: AnimationController ) { // $$$ } @@ -236,12 +237,38 @@ export class ApproveEventPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -253,12 +280,38 @@ export class ApproveEventPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 74acd2072..7c533dc9a 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -4,13 +4,13 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { EventsService } from 'src/app/services/events.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { Event } from 'src/app/models/event.model'; -import { ModalController } from '@ionic/angular'; +import { AnimationController, ModalController } from '@ionic/angular'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchDocument } from "src/app/models/search-document"; import { EventAttachment } from 'src/app/models/attachment.model'; -import { BadRequestComponent } from '../../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../../popover/success-message/success-message.component'; +import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; +import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; @Component({ @@ -47,7 +47,9 @@ export class NewEventPage implements OnInit { constructor( private modalController: ModalController, private eventService: EventsService, - private attachmentsService: AttachmentsService + private attachmentsService: AttachmentsService, + private animationController: AnimationController, + ) {} ngOnInit() { @@ -315,12 +317,38 @@ export class NewEventPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -332,8 +360,34 @@ export class NewEventPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, diff --git a/src/app/shared/fingerprint/fingerprint.page.ts b/src/app/shared/fingerprint/fingerprint.page.ts index e1348100f..7bb9187ef 100644 --- a/src/app/shared/fingerprint/fingerprint.page.ts +++ b/src/app/shared/fingerprint/fingerprint.page.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController } from '@ionic/angular'; -import { BadRequestComponent } from '../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../popover/success-message/success-message.component'; +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 { FingerprintAIO } from '@ionic-native/fingerprint-aio'; @Component({ @@ -13,6 +13,7 @@ export class FingerprintPage implements OnInit { constructor( private modalController: ModalController, //private faio: FingerprintAIO + private animationController: AnimationController ) { } @@ -70,12 +71,38 @@ export class FingerprintPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -89,12 +116,38 @@ export class FingerprintPage implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 6a89b1bd2..edb29e322 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 @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { AlertController, ModalController, NavParams } from '@ionic/angular'; +import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular'; import { Attachment } from 'src/app/models/attachment.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { SearchDocument } from 'src/app/models/search-document'; @@ -9,8 +9,8 @@ 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 { Event, EventToApproveEdit } from '../../../models/event.model'; -import { BadRequestComponent } from '../../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../../popover/success-message/success-message.component'; +import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; +import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; @Component({ selector: 'app-edit-event', @@ -140,6 +140,7 @@ export class EditEventToApproveComponent implements OnInit { public alertController: AlertController, private attachmentsService: AttachmentsService, private processes:ProcessesService, + private animationController: AnimationController ) { this.serialNumber = this.navParams.get('serialNumber'); @@ -408,12 +409,38 @@ export class EditEventToApproveComponent implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -425,12 +452,38 @@ export class EditEventToApproveComponent implements OnInit { } 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/shared/pin/pin.page.ts b/src/app/shared/pin/pin.page.ts index 5aa3e5b3b..bb321155d 100644 --- a/src/app/shared/pin/pin.page.ts +++ b/src/app/shared/pin/pin.page.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController } from '@ionic/angular'; -import { BadRequestComponent } from '../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../popover/success-message/success-message.component'; +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' @Component({ selector: 'app-pin', @@ -11,7 +11,8 @@ import crypto from 'crypto-js' export class PinPage implements OnInit { code = [] - constructor( private modalController: ModalController,) { } + constructor( private modalController: ModalController, + private animationController: AnimationController) { } ngOnInit() { } @@ -55,12 +56,38 @@ export class PinPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -70,12 +97,38 @@ export class PinPage implements OnInit { } async badRequest(message?: string) { - let modal = await this.modalController.create({ - component: BadRequestComponent, + 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' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/shared/popover/bad-request/bad-request-routing.module.ts b/src/app/shared/popover/bad-request/bad-request-routing.module.ts new file mode 100644 index 000000000..6d7d64418 --- /dev/null +++ b/src/app/shared/popover/bad-request/bad-request-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { BadRequestPage } from './bad-request.page'; + +const routes: Routes = [ + { + path: '', + component: BadRequestPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class BadRequestPageRoutingModule {} diff --git a/src/app/shared/popover/bad-request/bad-request.component.html b/src/app/shared/popover/bad-request/bad-request.component.html deleted file mode 100644 index 3b9dd6dc9..000000000 --- a/src/app/shared/popover/bad-request/bad-request.component.html +++ /dev/null @@ -1,7 +0,0 @@ - -
-

- {{ message }} -

- -
diff --git a/src/app/shared/popover/bad-request/bad-request.module.ts b/src/app/shared/popover/bad-request/bad-request.module.ts new file mode 100644 index 000000000..acd919e5c --- /dev/null +++ b/src/app/shared/popover/bad-request/bad-request.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { BadRequestPageRoutingModule } from './bad-request-routing.module'; + +import { BadRequestPage } from './bad-request.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + BadRequestPageRoutingModule + ], + declarations: [BadRequestPage] +}) +export class BadRequestPageModule {} diff --git a/src/app/shared/popover/bad-request/bad-request.page.html b/src/app/shared/popover/bad-request/bad-request.page.html new file mode 100644 index 000000000..7ed6ca583 --- /dev/null +++ b/src/app/shared/popover/bad-request/bad-request.page.html @@ -0,0 +1,9 @@ + +
+

+ + {{ message }} +

+ + +
diff --git a/src/app/shared/popover/bad-request/bad-request.component.scss b/src/app/shared/popover/bad-request/bad-request.page.scss similarity index 88% rename from src/app/shared/popover/bad-request/bad-request.component.scss rename to src/app/shared/popover/bad-request/bad-request.page.scss index 4e33a9287..04d640390 100644 --- a/src/app/shared/popover/bad-request/bad-request.component.scss +++ b/src/app/shared/popover/bad-request/bad-request.page.scss @@ -11,6 +11,5 @@ } .message { - padding-top: 150px; - font-size: 16pt; + font-size: 12pt; } \ No newline at end of file diff --git a/src/app/shared/popover/bad-request/bad-request.component.spec.ts b/src/app/shared/popover/bad-request/bad-request.page.spec.ts similarity index 58% rename from src/app/shared/popover/bad-request/bad-request.component.spec.ts rename to src/app/shared/popover/bad-request/bad-request.page.spec.ts index 3e8f6b864..ff246f607 100644 --- a/src/app/shared/popover/bad-request/bad-request.component.spec.ts +++ b/src/app/shared/popover/bad-request/bad-request.page.spec.ts @@ -1,19 +1,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { BadRequestComponent } from './bad-request.component'; +import { BadRequestPage } from './bad-request.page'; -describe('BadRequestComponent', () => { - let component: BadRequestComponent; - let fixture: ComponentFixture; +describe('BadRequestPage', () => { + let component: BadRequestPage; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ BadRequestComponent ], + declarations: [ BadRequestPage ], imports: [IonicModule.forRoot()] }).compileComponents(); - fixture = TestBed.createComponent(BadRequestComponent); + fixture = TestBed.createComponent(BadRequestPage); component = fixture.componentInstance; fixture.detectChanges(); })); diff --git a/src/app/shared/popover/bad-request/bad-request.component.ts b/src/app/shared/popover/bad-request/bad-request.page.ts similarity index 65% rename from src/app/shared/popover/bad-request/bad-request.component.ts rename to src/app/shared/popover/bad-request/bad-request.page.ts index 833862f1f..d7aad59e2 100644 --- a/src/app/shared/popover/bad-request/bad-request.component.ts +++ b/src/app/shared/popover/bad-request/bad-request.page.ts @@ -3,10 +3,10 @@ import { NavParams } from '@ionic/angular'; @Component({ selector: 'app-bad-request', - templateUrl: './bad-request.component.html', - styleUrls: ['./bad-request.component.scss'], + templateUrl: './bad-request.page.html', + styleUrls: ['./bad-request.page.scss'], }) -export class BadRequestComponent implements OnInit { +export class BadRequestPage implements OnInit { message: string @@ -16,5 +16,4 @@ export class BadRequestComponent implements OnInit { } ngOnInit() {} - } 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 8eece8666..d140f491f 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -1,11 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, ModalController, PopoverController } from '@ionic/angular'; 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 { BadRequestComponent } from '../bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../success-message/success-message.component'; +import { BadRequestPage } from '../bad-request/bad-request.page'; +import { SuccessMessagePage } from '../success-message/success-message.page'; @Component({ selector: 'app-deploma-options', @@ -24,7 +24,8 @@ export class DeplomaOptionsPage implements OnInit { constructor(public popoverController: PopoverController, private modalController: ModalController, private activatedRoute: ActivatedRoute, - private processes: ProcessesService,) { + private processes: ProcessesService, + private animationController: AnimationController) { this.activatedRoute.queryParams.subscribe(params => { if(params["serialNumber"]) { this.serialnumber = params["serialNumber"]; @@ -124,7 +125,7 @@ export class DeplomaOptionsPage implements OnInit { modal.onDidDismiss(); } - async askSignature(note:string, documents:any){ + async askSignature(note:string, documents:any) { let body = { "serialNumber": this.serialnumber, "action": "Aprovar", @@ -146,12 +147,37 @@ export class DeplomaOptionsPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -164,11 +190,11 @@ export class DeplomaOptionsPage implements OnInit { async badRequest(message?: string) { const modal = await this.modalController.create({ - component: BadRequestComponent, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 3e7705c61..79877c012 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 { MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, 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' @@ -13,8 +13,8 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process. import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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 { 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'; @@ -41,7 +41,8 @@ export class DespachosOptionsPage implements OnInit { private modalController: ModalController, private alertService: AlertService, public popoverController: PopoverController, - private activatedRoute: ActivatedRoute) { } + private activatedRoute: ActivatedRoute, + private animationController: AnimationController) { } ngOnInit() { @@ -282,12 +283,38 @@ export class DespachosOptionsPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -300,11 +327,11 @@ export class DespachosOptionsPage implements OnInit { async badRequest(message?: string) { const modal = await this.modalController.create({ - component: BadRequestComponent, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 af1410d64..307d599c8 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 @@ -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 { MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, 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' @@ -13,8 +13,8 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process. import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page'; -import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +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 { 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'; @@ -42,7 +42,8 @@ export class DespachosPrOptionsPage implements OnInit { private modalController: ModalController, private alertService: AlertService, public popoverController: PopoverController, - private activatedRoute: ActivatedRoute) { } + private activatedRoute: ActivatedRoute, + private animationController: AnimationController) { } ngOnInit() { @@ -283,12 +284,38 @@ export class DespachosPrOptionsPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -301,11 +328,11 @@ export class DespachosPrOptionsPage implements OnInit { async badRequest(message?: string) { const modal = await this.modalController.create({ - component: BadRequestComponent, + component: BadRequestPage, componentProps: { - message: message || 'Processo não efetuado' , + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() 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 d45b7ea53..00c53da0b 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 @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { User } from 'src/app/models/user.model'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; @@ -11,8 +11,8 @@ 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 { BadRequestComponent } from '../bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../success-message/success-message.component'; +import { BadRequestPage } from '../bad-request/bad-request.page'; +import { SuccessMessagePage } from '../success-message/success-message.page'; @Component({ selector: 'app-opts-expediente-pr', @@ -42,6 +42,7 @@ export class OptsExpedientePrPage implements OnInit { private activatedRoute: ActivatedRoute, private userAuth: AuthService, private navParams: NavParams, + private animationController: AnimationController ) { this.task = this.navParams.get('task'); @@ -288,12 +289,38 @@ export class OptsExpedientePrPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -306,7 +333,7 @@ export class OptsExpedientePrPage implements OnInit { async badRequest() { const modal = await this.modalController.create({ - component: BadRequestComponent, + component: BadRequestPage, componentProps: { message: 'hello', }, 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 e343a340d..566639ada 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page'; import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; @@ -8,8 +8,8 @@ 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 { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ @@ -31,6 +31,7 @@ export class RequestOptionsPage implements OnInit { private navParams: NavParams, private processes: ProcessesService, private activatedRoute: ActivatedRoute, + private animationController: AnimationController ) { this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); @@ -286,12 +287,38 @@ export class RequestOptionsPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -302,13 +329,39 @@ export class RequestOptionsPage implements OnInit { } - async badRequest() { + async badRequest(message?) { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { - message: 'hello', + message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() diff --git a/src/app/shared/popover/success-message/success-message-routing.module.ts b/src/app/shared/popover/success-message/success-message-routing.module.ts new file mode 100644 index 000000000..6af204497 --- /dev/null +++ b/src/app/shared/popover/success-message/success-message-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { SuccessMessagePage } from './success-message.page'; + +const routes: Routes = [ + { + path: '', + component: SuccessMessagePage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class SuccessMessagePageRoutingModule {} diff --git a/src/app/shared/popover/success-message/success-message.component.html b/src/app/shared/popover/success-message/success-message.component.html deleted file mode 100644 index 3b9dd6dc9..000000000 --- a/src/app/shared/popover/success-message/success-message.component.html +++ /dev/null @@ -1,7 +0,0 @@ - -
-

- {{ message }} -

- -
diff --git a/src/app/shared/popover/success-message/success-message.module.ts b/src/app/shared/popover/success-message/success-message.module.ts new file mode 100644 index 000000000..94ad2bb1b --- /dev/null +++ b/src/app/shared/popover/success-message/success-message.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { SuccessMessagePageRoutingModule } from './success-message-routing.module'; + +import { SuccessMessagePage } from './success-message.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + SuccessMessagePageRoutingModule + ], + declarations: [SuccessMessagePage] +}) +export class SuccessMessagePageModule {} diff --git a/src/app/shared/popover/success-message/success-message.page.html b/src/app/shared/popover/success-message/success-message.page.html new file mode 100644 index 000000000..7f315c6ee --- /dev/null +++ b/src/app/shared/popover/success-message/success-message.page.html @@ -0,0 +1,8 @@ + +
+

+ + {{ message }} +

+ +
\ No newline at end of file diff --git a/src/app/shared/popover/success-message/success-message.component.scss b/src/app/shared/popover/success-message/success-message.page.scss similarity index 84% rename from src/app/shared/popover/success-message/success-message.component.scss rename to src/app/shared/popover/success-message/success-message.page.scss index 462f9709e..04d640390 100644 --- a/src/app/shared/popover/success-message/success-message.component.scss +++ b/src/app/shared/popover/success-message/success-message.page.scss @@ -3,7 +3,7 @@ align-items: center; display: flex; justify-content: center; - background-image: url("/assets/background/background-circle-check.svg"); + background-image: url("/assets/background/background-circle-negative.svg"); background-size: 686px 674px; background-position: center; background-position-y: 0px; @@ -11,6 +11,5 @@ } .message { - padding-top: 150px; - font-size: 16pt; + font-size: 12pt; } \ No newline at end of file diff --git a/src/app/shared/popover/success-message/success-message.component.spec.ts b/src/app/shared/popover/success-message/success-message.page.spec.ts similarity index 56% rename from src/app/shared/popover/success-message/success-message.component.spec.ts rename to src/app/shared/popover/success-message/success-message.page.spec.ts index a2c8875ec..006f24670 100644 --- a/src/app/shared/popover/success-message/success-message.component.spec.ts +++ b/src/app/shared/popover/success-message/success-message.page.spec.ts @@ -1,19 +1,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { SuccessMessageComponent } from './success-message.component'; +import { SuccessMessagePage } from './success-message.page'; -describe('SuccessMessageComponent', () => { - let component: SuccessMessageComponent; - let fixture: ComponentFixture; +describe('SuccessMessagePage', () => { + let component: SuccessMessagePage; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ SuccessMessageComponent ], + declarations: [ SuccessMessagePage ], imports: [IonicModule.forRoot()] }).compileComponents(); - fixture = TestBed.createComponent(SuccessMessageComponent); + fixture = TestBed.createComponent(SuccessMessagePage); component = fixture.componentInstance; fixture.detectChanges(); })); diff --git a/src/app/shared/popover/success-message/success-message.component.ts b/src/app/shared/popover/success-message/success-message.page.ts similarity index 64% rename from src/app/shared/popover/success-message/success-message.component.ts rename to src/app/shared/popover/success-message/success-message.page.ts index 61e702891..0572d1c5d 100644 --- a/src/app/shared/popover/success-message/success-message.component.ts +++ b/src/app/shared/popover/success-message/success-message.page.ts @@ -3,10 +3,10 @@ import { NavParams } from '@ionic/angular'; @Component({ selector: 'app-success-message', - templateUrl: './success-message.component.html', - styleUrls: ['./success-message.component.scss'], + templateUrl: './success-message.page.html', + styleUrls: ['./success-message.page.scss'], }) -export class SuccessMessageComponent implements OnInit { +export class SuccessMessagePage implements OnInit { message: string @@ -16,5 +16,4 @@ export class SuccessMessageComponent implements OnInit { } ngOnInit() {} - } 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 464a1b191..5edadbe90 100644 --- a/src/app/shared/publication/new-action/new-action.page.ts +++ b/src/app/shared/publication/new-action/new-action.page.ts @@ -1,9 +1,9 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; -import { ModalController } from '@ionic/angular'; +import { AnimationController, ModalController } from '@ionic/angular'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationsService } from 'src/app/services/publications.service'; -import { BadRequestComponent } from '../../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../../popover/success-message/success-message.component'; +import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; +import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; @Component({ selector: 'app-new-action', @@ -19,7 +19,8 @@ export class NewActionPage implements OnInit { constructor( private modalController: ModalController, - private publication: PublicationsService + private publication: PublicationsService, + private animationController: AnimationController ) { this.folder = new PublicationFolder(); } @@ -60,12 +61,38 @@ export class NewActionPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -77,8 +104,34 @@ export class NewActionPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, 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 7873077b1..c1cbb4fc3 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { AlertController, ModalController, NavParams } from '@ionic/angular'; +import { AlertController, AnimationController, ModalController, NavParams } from '@ionic/angular'; /* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; @@ -16,8 +16,8 @@ import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; import { PublicationFolder } from 'src/app/models/publicationfolder'; import { ViewPublicationsPage } from '../view-publications/view-publications.page'; import { LoadingService } from 'src/app/services/loading.service'; -import { BadRequestComponent } from '../../popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from '../../popover/success-message/success-message.component'; +import { BadRequestPage } from '../../popover/bad-request/bad-request.page'; +import { SuccessMessagePage} from '../../popover/success-message/success-message.page'; @Component({ selector: 'app-new-publication', @@ -57,6 +57,7 @@ export class NewPublicationPage implements OnInit { public photoService: PhotoService, private publications: PublicationsService, private camera: Camera, + private animationController: AnimationController ) { this.publicationTitle = 'Nova Publicação'; } @@ -276,12 +277,38 @@ export class NewPublicationPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -293,8 +320,34 @@ export class NewPublicationPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, 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 1bd07a6c5..5396004ca 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 @@ -1,11 +1,11 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import { ModalController, NavParams } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams } from '@ionic/angular'; 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 { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component'; -import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component'; +import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; +import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; @Component({ selector: 'app-publication-detail-shared', @@ -26,6 +26,7 @@ export class PublicationDetailPage implements OnInit { constructor( private modalController: ModalController, private publications:PublicationsService, + private animationController: AnimationController ) { /* this.folderId = this.navParams.get('folderIdId'); */ @@ -142,12 +143,38 @@ export class PublicationDetailPage implements OnInit { 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(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ - component: SuccessMessageComponent, + enterAnimation, + leaveAnimation, + component: SuccessMessagePage, componentProps: { message: message || 'Processo efetuado' , }, - cssClass: 'modal modal-desktop' + cssClass: 'notification-modal' }); modal.present() @@ -159,8 +186,34 @@ export class PublicationDetailPage implements OnInit { } async badRequest() { + 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({ - component: BadRequestComponent, + enterAnimation, + leaveAnimation, + component: BadRequestPage, componentProps: { message: 'Processo não realizado com sucesso', }, diff --git a/src/assets/images/nofitication-success.svg b/src/assets/images/nofitication-success.svg new file mode 100644 index 000000000..2a7c7d82c --- /dev/null +++ b/src/assets/images/nofitication-success.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/images/notification-error.svg b/src/assets/images/notification-error.svg new file mode 100644 index 000000000..8b00e3dd7 --- /dev/null +++ b/src/assets/images/notification-error.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/global.scss b/src/global.scss index efd39c49d..89eead7d3 100644 --- a/src/global.scss +++ b/src/global.scss @@ -376,6 +376,29 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent- } } + +.notification-modal { + ion-backdrop { + display: none; + } + .modal-wrapper { + 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; + } + + .ion-page { + box-shadow: 0 28px 48px rgba(0, 0, 0, 0.2) !important; + } +} + .hide-footer{ ion-footer{ display: none !important;