mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
merge
This commit is contained in:
@@ -292,7 +292,12 @@ export class CreateProcessPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
this.toastService._successMessage('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error?.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
|
||||
} finally {
|
||||
loader.remove()
|
||||
@@ -324,7 +329,12 @@ export class CreateProcessPage implements OnInit {
|
||||
this.toastService._successMessage('Pedido de Parecer enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error?.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -349,7 +359,12 @@ export class CreateProcessPage implements OnInit {
|
||||
this.toastService._successMessage('Pedido de Deferimento criado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error?.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -377,7 +392,12 @@ export class CreateProcessPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
this.toastService._successMessage('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error?.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
} finally {
|
||||
loader.remove();
|
||||
}
|
||||
@@ -413,7 +433,12 @@ export class CreateProcessPage implements OnInit {
|
||||
this.toastService._successMessage('Pedido de Parecer criado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -438,7 +463,12 @@ export class CreateProcessPage implements OnInit {
|
||||
this.toastService._successMessage('Pedido de Deferimento criado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -493,7 +523,12 @@ export class CreateProcessPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService._successMessage(message);
|
||||
} catch (error) {
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -68,7 +68,11 @@ export class DarParecerPage implements OnInit {
|
||||
this.modalController.dismiss('sucess');
|
||||
this.toastService._successMessage('Parecer enviado');
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Parecer não solicitado");
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest("Parecer não solicitado");
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -107,7 +107,11 @@ export class DelegarPage implements OnInit {
|
||||
this.close();
|
||||
},
|
||||
(error)=>{
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest("Processo não delegado")
|
||||
}
|
||||
},
|
||||
()=>{
|
||||
loader.remove()
|
||||
|
||||
@@ -277,7 +277,12 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
this.modalController.dismiss()
|
||||
}, (error) => {
|
||||
laoder.remove()
|
||||
this.toastService._badRequest('Não foi possível marcar a reunião');
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Não foi possível marcar a reunião');
|
||||
}
|
||||
}, ()=>{
|
||||
laoder.remove()
|
||||
});
|
||||
|
||||
@@ -151,7 +151,12 @@ export class ForwardPage implements OnInit {
|
||||
this.goBack();
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService._badRequest("Processo não delegado")
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest("Processo não delegado")
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,9 +446,10 @@ export class NewEventPage implements OnInit {
|
||||
this.modalController.dismiss(data);
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
} finally {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
+12
-2
@@ -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()
|
||||
|
||||
+12
-2
@@ -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()
|
||||
|
||||
+17
-2
@@ -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()
|
||||
}
|
||||
|
||||
+12
-2
@@ -319,7 +319,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()
|
||||
@@ -339,7 +344,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()
|
||||
}
|
||||
|
||||
+15
-11
@@ -320,9 +320,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.modalController.dismiss(action_despacho);
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
} finally {
|
||||
@@ -358,9 +359,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.modalController.dismiss(action_parecer);
|
||||
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
} finally {
|
||||
@@ -393,9 +395,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.toastService._successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_deferimento);
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
} finally {
|
||||
@@ -435,10 +438,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
await this.toastService._successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
} finally {
|
||||
@@ -477,9 +480,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
await this.toastService._successMessage('Pedido enviado');
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
}
|
||||
} finally {
|
||||
|
||||
+54
-9
@@ -244,7 +244,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()
|
||||
}
|
||||
@@ -269,7 +274,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()
|
||||
}
|
||||
@@ -336,7 +346,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')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -393,7 +408,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')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -484,8 +504,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()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -521,7 +546,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()
|
||||
}
|
||||
@@ -555,7 +585,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()
|
||||
}
|
||||
@@ -574,7 +609,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()
|
||||
}
|
||||
@@ -588,7 +628,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()
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ServerConnectionService } from './server-connection.service';
|
||||
|
||||
describe('ServerConnectionService', () => {
|
||||
let service: ServerConnectionService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ServerConnectionService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ServerConnectionService {
|
||||
|
||||
constructor(private http: HttpClient,) { }
|
||||
|
||||
async BaseAPI(): Promise<boolean> {
|
||||
try {
|
||||
await this.http.get(environment.apiURL)
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,12 @@ export class ApproveEventPage implements OnInit {
|
||||
this.toastService._successMessage('Evento enviado para revisão');
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -415,7 +415,12 @@ export class EditEventToApprovePage implements OnInit {
|
||||
this.toastService._successMessage();
|
||||
this.goToApproveEventList();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest();
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest();
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="middle">
|
||||
<ion-label class="title">Novo Evento</ion-label>
|
||||
<ion-label class="title">Novo Evento"</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<ion-progress-bar class="calendar-progress-bar" type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
@@ -25,6 +25,7 @@ import { FormGroup, Validators } from '@angular/forms';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
|
||||
import { ServerConnectionService } from 'src/app/services/server-connection.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -129,6 +130,7 @@ export class NewEventPage implements OnInit {
|
||||
private dateAdapter: DateAdapter<any>,
|
||||
public ThemeService: ThemeService,
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private ServerConnectionService: ServerConnectionService
|
||||
// private translate: TranslateService
|
||||
) {
|
||||
this.dateAdapter.setLocale('pt');
|
||||
@@ -529,9 +531,15 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
},
|
||||
error => {
|
||||
console.log(error, 'error')
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -585,10 +593,19 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.toastService._successMessage('Evento criado')
|
||||
},()=>{
|
||||
},(error) => {
|
||||
|
||||
//const connectionToServer = this.ServerConnectionService.BaseAPI()
|
||||
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
}
|
||||
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -641,10 +658,15 @@ export class NewEventPage implements OnInit {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
}
|
||||
this.toastService._successMessage('Evento criado')
|
||||
},()=>{
|
||||
},(error)=>{
|
||||
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -312,7 +312,12 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
||||
this.toastService._successMessage('Evento editado');
|
||||
}, error =>{
|
||||
this.toastService._badRequest('Evento não editado');
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Evento não editado');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -322,14 +327,24 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
||||
this.toastService._successMessage();
|
||||
}, error =>{
|
||||
this.toastService._badRequest();
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest();
|
||||
}
|
||||
});
|
||||
} else if(document['action'] == 'delete') {
|
||||
delete document.action
|
||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
||||
this.toastService._successMessage()
|
||||
}, error =>{
|
||||
this.toastService._badRequest()
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,12 @@ export class DeplomaOptionsPage 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()
|
||||
}
|
||||
@@ -154,7 +159,12 @@ export class DeplomaOptionsPage 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()
|
||||
}
|
||||
@@ -180,7 +190,11 @@ export class DeplomaOptionsPage 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()
|
||||
}
|
||||
@@ -205,7 +219,12 @@ export class DeplomaOptionsPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService._successMessage('Processo concluído')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
@@ -78,9 +78,14 @@ export class DespachosOptionsPage implements OnInit {
|
||||
loader.remove()
|
||||
|
||||
this.close();
|
||||
},()=>{
|
||||
},(error)=>{
|
||||
loader.remove()
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -173,7 +178,12 @@ export class DespachosOptionsPage 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()
|
||||
}
|
||||
@@ -254,7 +264,12 @@ export class DespachosOptionsPage implements OnInit {
|
||||
this.toastService._successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} 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()
|
||||
}
|
||||
@@ -281,7 +296,12 @@ export class DespachosOptionsPage 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()
|
||||
}
|
||||
@@ -308,7 +328,12 @@ export class DespachosOptionsPage 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()
|
||||
}
|
||||
|
||||
@@ -104,10 +104,14 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
this.toastService._successMessage()
|
||||
this.popoverController.dismiss('close')
|
||||
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')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -206,7 +210,12 @@ export class DespachosPrOptionsPage 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()
|
||||
}
|
||||
@@ -290,7 +299,12 @@ export class DespachosPrOptionsPage 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()
|
||||
|
||||
@@ -92,7 +92,12 @@ export class DiplomasGerarOptionsPage 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()
|
||||
}
|
||||
|
||||
@@ -142,7 +142,12 @@ export class OptsExpedientePrPage 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()
|
||||
}
|
||||
@@ -180,7 +185,12 @@ export class OptsExpedientePrPage 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()
|
||||
}
|
||||
@@ -199,7 +209,12 @@ export class OptsExpedientePrPage 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()
|
||||
}
|
||||
@@ -214,7 +229,12 @@ export class OptsExpedientePrPage 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()
|
||||
}
|
||||
@@ -242,7 +262,12 @@ export class OptsExpedientePrPage 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()
|
||||
}
|
||||
@@ -255,9 +280,13 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
loader.remove()
|
||||
this.close();
|
||||
},()=>{
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}, (error) => {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
loader.remove()
|
||||
});
|
||||
}
|
||||
@@ -295,7 +324,11 @@ export class OptsExpedientePrPage 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()
|
||||
}
|
||||
|
||||
@@ -170,8 +170,13 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
|
||||
this.toastService._successMessage()
|
||||
},()=> {
|
||||
this.toastService._badRequest()
|
||||
}, (error) => {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
},()=> {
|
||||
loader.remove()
|
||||
});
|
||||
@@ -248,7 +253,12 @@ export class OptsExpedientePage 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()
|
||||
}
|
||||
@@ -258,9 +268,13 @@ export class OptsExpedientePage implements OnInit {
|
||||
this.close();
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
this.goBack();
|
||||
},()=>{
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
},(error)=>{
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -284,7 +298,12 @@ export class OptsExpedientePage 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()
|
||||
}
|
||||
@@ -340,7 +359,12 @@ export class OptsExpedientePage 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()
|
||||
}
|
||||
@@ -375,7 +399,12 @@ export class OptsExpedientePage 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()
|
||||
}
|
||||
@@ -395,7 +424,12 @@ export class OptsExpedientePage implements OnInit {
|
||||
this.toastService._successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -409,8 +443,12 @@ export class OptsExpedientePage implements OnInit {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService._successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -191,7 +191,12 @@ export class RequestOptionsPage 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()
|
||||
@@ -260,7 +265,12 @@ export class RequestOptionsPage implements OnInit {
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -111,7 +111,11 @@ export class EditActionPage implements OnInit {
|
||||
this.getActions.emit()
|
||||
|
||||
} 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()
|
||||
}
|
||||
|
||||
@@ -133,7 +133,12 @@ export class NewActionPage implements OnInit {
|
||||
|
||||
this.getActions.emit()
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -159,7 +159,11 @@ export class NewPublicationPage 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()
|
||||
}
|
||||
@@ -188,7 +192,11 @@ export class NewPublicationPage 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()
|
||||
}
|
||||
@@ -216,7 +224,11 @@ export class NewPublicationPage 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()
|
||||
}
|
||||
@@ -247,7 +259,11 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
this.goBackToViewPublications.emit();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest()
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
+5
-1
@@ -90,7 +90,11 @@ export class PublicationDetailPage implements OnInit {
|
||||
this.toastService._successMessage("Publicação eliminado")
|
||||
this.goBackToViewPublications.emit();
|
||||
} catch (error) {
|
||||
this.toastService._badRequest("Publicação não eliminado")
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
this.toastService._badRequest("Publicação não eliminado")
|
||||
}
|
||||
} finally {
|
||||
laoder.remove()
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
getpublication = [];
|
||||
error: any;
|
||||
|
||||
@Input() folderId: string;
|
||||
@Input() folderId: any;
|
||||
@Output() addNewPublication = new EventEmitter<any>();
|
||||
@Output() editPublication = new EventEmitter<any>();
|
||||
@Output() openPublicationDetails= new EventEmitter<any>();
|
||||
@@ -221,8 +221,13 @@ export class ViewPublicationsPage implements OnInit {
|
||||
try {
|
||||
await this.publications.DeletePresidentialAction(folderId).toPromise();
|
||||
this.toastService._successMessage()
|
||||
} catch (e) {
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('sem conexão ao servidor')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
Reference in New Issue
Block a user