add notification message

This commit is contained in:
Peter Maquiran
2023-02-02 12:01:18 +01:00
parent 0036ce6ab2
commit ecd19c46bb
41 changed files with 721 additions and 131 deletions
@@ -352,8 +352,12 @@ export class EditEventPage implements OnInit {
this.toastService._successMessage();
}, error => {
if(error.status != 0)
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
});
} else {
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
@@ -376,8 +380,12 @@ export class EditEventPage implements OnInit {
this.toastService._successMessage();
}, error => {
if(error.status != 0)
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
});
}
@@ -446,7 +446,12 @@ export class NewEventPage implements OnInit {
this.modalController.dismiss(data);
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -274,7 +274,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -299,7 +304,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('Processo arquivado')
} catch (error) {
this.toastService._badRequest('Processo não arquivado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não arquivado')
}
}
finally {
loader.remove()
@@ -321,7 +331,12 @@ export class DespachoPrPage implements OnInit {
this.toastService._successMessage('Processo criado')
} catch (error) {
this.toastService._badRequest('Processo não criado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não criado')
}
}
finally {
loader.remove()
@@ -346,7 +361,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('')
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -371,7 +391,12 @@ export class DespachoPrPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -390,9 +415,14 @@ export class DespachoPrPage implements OnInit {
this.toastService._successMessage('Processo enviado para pendentes')
this.goBack()
loader.remove()
}, () => {
}, (error) => {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
}
@@ -279,7 +279,12 @@ export class DespachoPage implements OnInit {
this.toastService._successMessage('Processo criado')
this.close();
} catch (error) {
this.toastService._badRequest("Processo não criado")
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest("Processo não criado")
}
}
finally {
loader.remove()
@@ -295,7 +300,12 @@ export class DespachoPage implements OnInit {
this.toastService._successMessage('Processo descartado')
this.close();
} catch (error) {
this.toastService._badRequest("Processo não descartado")
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest("Processo não descartado")
}
}
finally {
loader.remove()
@@ -322,7 +332,12 @@ export class DespachoPage implements OnInit {
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -348,7 +363,12 @@ export class DespachoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -110,7 +110,12 @@ export class DiplomaAssinarPage implements OnInit {
}, (error)=>{
try {
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
this.goBack()
} catch (e) {
window.history.back();
@@ -176,7 +181,12 @@ export class DiplomaAssinarPage implements OnInit {
this.goBack();
})
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -252,7 +252,12 @@ export class DiplomasGerarPage implements OnInit {
this.toastService._successMessage();
this.goBack()
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -314,7 +319,12 @@ export class DiplomasGerarPage implements OnInit {
this.goBack();
})
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -162,7 +162,12 @@ export class DiplomaPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -286,7 +291,12 @@ export class DiplomaPage implements OnInit {
})
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -309,7 +319,12 @@ export class DiplomaPage implements OnInit {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -335,7 +350,12 @@ export class DiplomaPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.toastService._successMessage('Processo concluído')
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -107,7 +107,12 @@ export class ApproveEventModalPage implements OnInit {
})
} catch (error) {
this.toastService._badRequest('Evento não aprovado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Evento não aprovado')
}
}
finally {
loader.remove()
@@ -134,7 +139,12 @@ export class ApproveEventModalPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/event-list']);
})
} catch (error) {
this.toastService._badRequest('Evento não rejeitado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Evento não rejeitado')
}
}
finally {
loader.remove()
@@ -198,7 +208,12 @@ export class ApproveEventModalPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/event-list']);
this.toastService._successMessage()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
this.router.navigate(['/home/gabinete-digital/event-list']);
}
finally {
@@ -218,7 +218,12 @@ export class ApproveEventPage implements OnInit {
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -264,7 +269,12 @@ export class ApproveEventPage implements OnInit {
this.toastService._successMessage('Pedido enviado');
this.goBack();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -285,7 +295,12 @@ export class ApproveEventPage implements OnInit {
await this.toastService._successMessage('Processo rejeitado');
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()
@@ -365,7 +380,12 @@ export class ApproveEventPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -318,7 +318,12 @@ export class BookMeetingModalPage implements OnInit {
this.toastService._successMessage('Reunião criada');
} catch (error) {
this.toastService._badRequest('Reunião não criada')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Reunião não criada')
}
}
finally {
loader.remove()
@@ -338,7 +343,12 @@ export class BookMeetingModalPage implements OnInit {
this.toastService._successMessage('Reunião criada');
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -320,7 +320,12 @@ export class ExpedientTaskModalPage implements OnInit {
this.modalController.dismiss(action_despacho);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -354,7 +359,12 @@ export class ExpedientTaskModalPage implements OnInit {
this.modalController.dismiss(action_parecer);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -385,7 +395,12 @@ export class ExpedientTaskModalPage implements OnInit {
this.toastService._successMessage('Processo efetuado');
this.modalController.dismiss(action_deferimento);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -423,8 +438,12 @@ export class ExpedientTaskModalPage implements OnInit {
await this.toastService._successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
//loader.remove()
}
@@ -461,8 +480,12 @@ export class ExpedientTaskModalPage implements OnInit {
await this.toastService._successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
await this.toastService._badRequest('Processo não efetuado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
await this.toastService._badRequest('Processo não efetuado')
}
} finally {
loader.remove()
}
@@ -242,7 +242,12 @@ export class ExpedienteDetailPage implements OnInit {
this.close();
this.toastService._successMessage('Processo aprovado')
} catch (error) {
this.toastService._badRequest('Processo não aprovado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não aprovado')
}
} finally {
loader.remove()
}
@@ -267,7 +272,12 @@ export class ExpedienteDetailPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -334,7 +344,12 @@ export class ExpedienteDetailPage implements OnInit {
},
(error) => {
loader.remove()
this.toastService._badRequest('Processo não enviado para pendentes')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não enviado para pendentes')
}
});
}
@@ -391,7 +406,12 @@ export class ExpedienteDetailPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -482,8 +502,13 @@ export class ExpedienteDetailPage implements OnInit {
loader.remove()
await this.attachmentsService.AddAttachment(body).toPromise()
this.toastService._successMessage()
} catch(e) {
} catch(error) {
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
});
}
@@ -519,7 +544,12 @@ export class ExpedienteDetailPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -553,7 +583,12 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -572,7 +607,12 @@ export class ExpedienteDetailPage implements OnInit {
//this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -586,7 +626,12 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -143,7 +143,12 @@ export class ExpedientePrPage implements OnInit {
},
(error)=>{
loader.remove()
this.toastService._badRequest('Processo não enviado para pendentes')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não enviado para pendentes')
}
});
}
@@ -309,7 +314,12 @@ export class ExpedientePrPage implements OnInit {
this.close();
this.toastService._successMessage('Processo aprovado')
} catch(error) {
this.toastService._badRequest('Processo não aprovado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não aprovado')
}
} finally {
loader.remove()
}
@@ -334,7 +344,12 @@ export class ExpedientePrPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch(error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -455,7 +470,12 @@ export class ExpedientePrPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -492,7 +512,12 @@ export class ExpedientePrPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -183,7 +183,12 @@ export class PedidoPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -374,7 +379,12 @@ export class PedidoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -394,7 +404,12 @@ export class PedidoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -419,7 +434,12 @@ export class PedidoPage implements OnInit {
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -431,9 +451,14 @@ export class PedidoPage implements OnInit {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res => {
this.goBack();
loader.remove()
}, () => {
}, (error) => {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
}
@@ -119,7 +119,12 @@ export class EditActionPage implements OnInit {
this.updateDesktopComponent.emit();
this.toastService._successMessage('Acção presidencial atualizada')
} catch (error) {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
}
} finally {
loader.remove()
}
@@ -255,8 +255,13 @@ export class PublicationsPage implements OnInit {
try {
await this.publications.DeletePresidentialAction(id).toPromise();
this.toastService._successMessage()
} catch (e) {
this.toastService._badRequest()
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
finally {
loader.remove()