mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { EditEventPageRoutingModule } from './edit-event-routing.module';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -6,10 +6,11 @@ import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
|
||||
@Component({
|
||||
@@ -47,6 +48,7 @@ export class EditEventPage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
this.postEvent = this.navParams.get('event');
|
||||
@@ -116,16 +118,16 @@ export class EditEventPage implements OnInit {
|
||||
});
|
||||
await alert.present(); */
|
||||
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
}, error => {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
});
|
||||
|
||||
this.isEventEdited = true;
|
||||
this.modalController.dismiss(this.isEventEdited);
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,7 +138,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
else{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
@@ -255,7 +257,7 @@ export class EditEventPage implements OnInit {
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
@@ -21,7 +22,8 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
private router:Router,
|
||||
private modalController: ModalController,
|
||||
private popoverController: PopoverController,
|
||||
private animationController: AnimationController,) {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,) {
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
this.instanceId = this.navParams.get('InstanceId');
|
||||
}
|
||||
@@ -45,9 +47,9 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,9 +63,9 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +109,7 @@ export class EventActionsPopoverPage implements OnInit {
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
@@ -6,10 +6,11 @@ import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchDocument } from 'src/app/models/search-document';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
||||
import { SearchPage } from '../../search/search.page';
|
||||
|
||||
@Component({
|
||||
@@ -41,6 +42,7 @@ export class NewEventPage implements OnInit {
|
||||
private eventService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
@@ -158,12 +160,12 @@ export class NewEventPage implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -184,7 +186,7 @@ export class NewEventPage implements OnInit {
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
@@ -239,7 +241,7 @@ export class NewEventPage implements OnInit {
|
||||
async openAttendees() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees,
|
||||
adding: this.adding,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { AttendeesPage } from './attendees.page';
|
||||
import { AttendeesPageModal } from './attendees.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AttendeesPage
|
||||
component: AttendeesPageModal
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeesPageRoutingModule } from './attendees-routing.module';
|
||||
|
||||
import { AttendeesPage } from './attendees.page';
|
||||
import { AttendeesPageModal } from './attendees.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -15,7 +15,7 @@ import { AttendeesPage } from './attendees.page';
|
||||
IonicModule,
|
||||
AttendeesPageRoutingModule
|
||||
],
|
||||
declarations: [AttendeesPage],
|
||||
exports: [AttendeesPage]
|
||||
declarations: [AttendeesPageModal],
|
||||
exports: [AttendeesPageModal]
|
||||
})
|
||||
export class AttendeesPageModule {}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ContactsService } from 'src/app/services/contacts.service';
|
||||
templateUrl: './attendees.page.html',
|
||||
styleUrls: ['./attendees.page.scss'],
|
||||
})
|
||||
export class AttendeesPage implements OnInit {
|
||||
export class AttendeesPageModal implements OnInit {
|
||||
|
||||
// Defined by the API
|
||||
contacts: EventPerson[];
|
||||
@@ -66,28 +66,16 @@ export class AttendeesPage implements OnInit {
|
||||
|
||||
filterSearchList(itm: EventPerson): boolean {
|
||||
|
||||
if(this.adding == "intervenient"){
|
||||
const result = this.taskParticipants.find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
return undefined == result;
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
|
||||
const result = this.taskParticipantsCc.find((contact, index)=>{
|
||||
|
||||
const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{
|
||||
|
||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
});
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
|
||||
return undefined == result;
|
||||
}
|
||||
})
|
||||
|
||||
return undefined == result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Event } from '../../../models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
@@ -87,7 +87,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||
import { AttendeesPage } from '../attendees/attendees.page';
|
||||
import { AttendeesPageModal } from '../attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-detail-modal',
|
||||
@@ -81,7 +81,7 @@ export class EventDetailModalPage implements OnInit {
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Event } from '../../../models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
@@ -87,7 +87,7 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
|
||||
@@ -21,6 +21,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho-pr',
|
||||
@@ -53,7 +54,8 @@ export class DespachoPrPage implements OnInit {
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private animationController: AnimationController) {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,) {
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
this.serialnumber = params["serialNumber"];
|
||||
@@ -188,9 +190,9 @@ export class DespachoPrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch(error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,10 +208,10 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage('Processo arquivado')
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest('Processo não arquivado')
|
||||
this.toastService.badRequest('Processo não arquivado')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -227,10 +229,10 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage('Processo criado')
|
||||
this.toastService.successMessage('Processo criado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest('Processo não criado')
|
||||
this.toastService.badRequest('Processo não criado')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -247,10 +249,10 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage('')
|
||||
this.toastService.successMessage('')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -268,10 +270,10 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -281,7 +283,7 @@ export class DespachoPrPage implements OnInit {
|
||||
console.log(res);
|
||||
this.close();
|
||||
|
||||
this.successMessage('Processo enviado para pendentes')
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -479,10 +481,11 @@ export class DespachoPrPage implements OnInit {
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho',
|
||||
@@ -54,6 +55,7 @@ export class DespachoPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
@@ -194,9 +196,9 @@ export class DespachoPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage('Processo criado')
|
||||
this.toastService.successMessage('Processo criado')
|
||||
} catch(error) {
|
||||
this.badRequest("Processo não criado")
|
||||
this.toastService.badRequest("Processo não criado")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,10 +214,10 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage('Processo descartado')
|
||||
this.toastService.successMessage('Processo descartado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest("Processo não descartado")
|
||||
this.toastService.badRequest("Processo não descartado")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -232,10 +234,10 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,11 +254,11 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.close();
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -265,10 +267,10 @@ export class DespachoPage implements OnInit {
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.close();
|
||||
this.successMessage('Processo enviado para despacho')
|
||||
this.toastService.successMessage('Processo enviado para despacho')
|
||||
},
|
||||
error => {
|
||||
this.badRequest("Processo não enviado para despacho")
|
||||
this.toastService.badRequest("Processo não enviado para despacho")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -459,7 +461,7 @@ export class DespachoPage implements OnInit {
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
+4
-47
@@ -11,6 +11,7 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma-assinar',
|
||||
@@ -38,6 +39,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
@@ -151,11 +153,11 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.successMessage(false, ()=>{
|
||||
this.toastService.successMessage(false, ()=>{
|
||||
this.goBack();
|
||||
})
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,52 +165,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-m
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma',
|
||||
@@ -38,7 +39,8 @@ export class DiplomaPage implements OnInit {
|
||||
private iab: InAppBrowser,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
@@ -154,12 +156,12 @@ export class DiplomaPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.successMessage(false, ()=>{
|
||||
this.toastService.successMessage(false, ()=>{
|
||||
this.close();
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,9 +178,9 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,9 +197,9 @@ export class DiplomaPage implements OnInit {
|
||||
}
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.successMessage('Processo concluído')
|
||||
this.toastService.successMessage('Processo concluído')
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -275,52 +277,7 @@ export class DiplomaPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
+4
-49
@@ -105,13 +105,13 @@ export class ApproveEventModalPage implements OnInit {
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
|
||||
this.successMessage('Evento aprovado', ()=>{
|
||||
this.toastService.successMessage('Evento aprovado', ()=>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest('Evento não aprovado')
|
||||
this.toastService.badRequest('Evento não aprovado')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -187,9 +187,9 @@ export class ApproveEventModalPage implements OnInit {
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
|
||||
@@ -220,52 +220,7 @@ export class ApproveEventModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -97,13 +97,13 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.toastService.successMessage('Evento aprovado', ()=>{
|
||||
this.goBack();
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
@@ -126,16 +126,16 @@ export class ApproveEventPage implements OnInit {
|
||||
async rejeitar(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
this.successMessage('Process');
|
||||
this.toastService.successMessage('Process');
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
await this.successMessage('Processo rejeitado');
|
||||
await this.toastService.successMessage('Processo rejeitado');
|
||||
await this.toastService.successMessage('Processo rejeitado', ()=>{
|
||||
this.goBack();
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -196,10 +196,10 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.successMessage();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest();
|
||||
this.toastService.badRequest();
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -241,52 +241,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
-1
@@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { BookMeetingModalPageRoutingModule } from './book-meeting-modal-routing.module';
|
||||
|
||||
import { BookMeetingModalPage } from './book-meeting-modal.page';
|
||||
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
|
||||
import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module';
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
|
||||
+12
-101
@@ -16,7 +16,8 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-book-meeting-modal',
|
||||
@@ -53,7 +54,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
private attachmentsService: AttachmentsService,
|
||||
private calendarService: EventsService,
|
||||
authService: AuthService,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.task = this.navParams.get('task');
|
||||
@@ -138,9 +140,9 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
this.distartExpedientModal();
|
||||
this.successMessage('Reunião criada')
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
} catch (error) {
|
||||
this.badRequest('Reunião não criada')
|
||||
this.toastService.badRequest('Reunião não criada')
|
||||
}
|
||||
|
||||
|
||||
@@ -157,12 +159,12 @@ export class BookMeetingModalPage implements OnInit {
|
||||
break;
|
||||
}
|
||||
|
||||
this.successMessage('Reunião criada', ()=>{
|
||||
this.toastService.successMessage('Reunião criada', ()=>{
|
||||
this.close();
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -176,13 +178,13 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
if(window.innerWidth <= 800){
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
taskParticipantsCc: this.taskParticipantsCc
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
@@ -212,13 +214,13 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
if(window.innerWidth <= 800) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
taskParticipantsCc: this.taskParticipantsCc
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
@@ -296,97 +298,6 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
this.goToGabinete()
|
||||
},3000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo não efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
goToGabinete() {
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
}
|
||||
|
||||
-1
@@ -7,7 +7,6 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { ExpedientTaskModalPageRoutingModule } from './expedient-task-modal-routing.module';
|
||||
|
||||
import { ExpedientTaskModalPage } from './expedient-task-modal.page';
|
||||
import { AttendeeModalPage } from 'src/app/shared/event/attendee-modal/attendee-modal.page';
|
||||
import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page';
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module';
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ import { User } from 'src/app/models/user.model';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedient-task-modal',
|
||||
@@ -368,7 +368,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
if(window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
adding: this.adding,
|
||||
taskParticipants: this.taskParticipants,
|
||||
|
||||
+10
-55
@@ -56,7 +56,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
) {
|
||||
|
||||
this.activateRoute.paramMap.subscribe(params => {
|
||||
@@ -120,14 +120,14 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.successMessage('Processo enviado para pendentes')
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
},
|
||||
(error)=>{
|
||||
this.badRequest('Processo não enviado para pendentes')
|
||||
this.toastService.badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -266,10 +266,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.successMessage('Processo descartado');
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest('Processo não descartado')
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -281,10 +281,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
if(res['data']== 'Yes'){
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.successMessage('Processo descartado');
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest('Processo não descartado')
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
this.goBack();
|
||||
}
|
||||
@@ -292,10 +292,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
console.log('Update');
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.successMessage();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,52 +361,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -21,6 +21,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-pr',
|
||||
@@ -56,6 +57,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private userAuth: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
|
||||
) {
|
||||
this.loggeduser = userAuth.ValidatedUser;
|
||||
@@ -102,11 +104,11 @@ export class ExpedientePrPage implements OnInit {
|
||||
sendExpedienteToPending(){
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.successMessage('Processo enviado para pendentes')
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
},
|
||||
(error)=>{
|
||||
this.badRequest('Processo não enviado para pendentes')
|
||||
this.toastService.badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -201,9 +203,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage('Processo aprovado')
|
||||
this.toastService.successMessage('Processo aprovado')
|
||||
} catch(error) {
|
||||
this.badRequest('Processo não aprovado')
|
||||
this.toastService.badRequest('Processo não aprovado')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,9 +223,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch(error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,9 +331,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise();
|
||||
this.successMessage('Processo descartado')
|
||||
this.toastService.successMessage('Processo descartado')
|
||||
} catch (error) {
|
||||
this.badRequest('Processo não descartado')
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
}
|
||||
|
||||
|
||||
@@ -345,10 +347,10 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
//await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
@@ -360,9 +362,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId);
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
@@ -440,52 +442,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -24,6 +24,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedido',
|
||||
@@ -56,7 +57,8 @@ export class PedidoPage implements OnInit {
|
||||
private alertService: AlertService,
|
||||
public popoverController: PopoverController,
|
||||
authService: AuthService,
|
||||
private animationController: AnimationController) {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params["serialNumber"]) {
|
||||
@@ -199,10 +201,10 @@ export class PedidoPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.successMessage()
|
||||
this.toastService.successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
@@ -221,10 +223,10 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.successMessage('Processo arquivado')
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest()
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
|
||||
|
||||
@@ -418,52 +420,7 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
|
||||
@@ -50,6 +50,7 @@ export class LoginPage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private modalController: ModalController,
|
||||
private animationController: AnimationController,
|
||||
|
||||
//private fcm: FCM
|
||||
) {
|
||||
|
||||
@@ -186,10 +187,10 @@ export class LoginPage implements OnInit {
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
if( encrypted == localStorage.getItem('PIN')) {
|
||||
//this.successMessage()
|
||||
//this.toastService.successMessage()
|
||||
this.router.navigate(['/home/events']);
|
||||
} else {
|
||||
this.badRequest('Pin incorreto')
|
||||
this.toastService.badRequest('Pin incorreto')
|
||||
this.code = []
|
||||
}
|
||||
|
||||
@@ -206,52 +207,7 @@ export class LoginPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
|
||||
@@ -19,6 +20,7 @@ export class NewActionPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private publication: PublicationsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
|
||||
) {
|
||||
this.folder = new PublicationFolder();
|
||||
@@ -45,10 +47,10 @@ export class NewActionPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
||||
this.successMessage("Ação presidencial criado")
|
||||
this.toastService.successMessage("Ação presidencial criado")
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest("Ação presidencial não criado")
|
||||
this.toastService.badRequest("Ação presidencial não criado")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,96 +58,8 @@ export class NewActionPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo não realizado com sucesso',
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ImageModalPage } from '../gallery/image-modal/image-modal.page';
|
||||
@@ -23,7 +24,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
private publications:PublicationsService,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
@@ -83,10 +85,10 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
|
||||
this.successMessage('Publicação eliminado')
|
||||
this.toastService.successMessage('Publicação eliminado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.badRequest('Publicação não eliminado')
|
||||
this.toastService.badRequest('Publicação não eliminado')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -122,95 +124,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo não realizado com sucesso',
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
}
|
||||
|
||||
+5
-91
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
|
||||
@@ -22,7 +23,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
private publications:PublicationsService,
|
||||
private animationController: AnimationController
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
) {
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
@@ -83,13 +85,13 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
|
||||
this.successMessage('Publicaçao eliminado')
|
||||
this.toastService.successMessage('Publicaçao eliminado')
|
||||
|
||||
this.close();
|
||||
//this.goBackToViewPublications.emit();
|
||||
|
||||
} catch (error) {
|
||||
this.badRequest('Publicaçao não eliminado')
|
||||
this.toastService.badRequest('Publicaçao não eliminado')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -124,96 +126,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: 'Processo não realizado com sucesso',
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
},7000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user