This commit is contained in:
tiago.kayaya
2021-06-15 17:44:20 +01:00
51 changed files with 295 additions and 1624 deletions
@@ -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) => {