This commit is contained in:
tiago.kayaya
2021-06-08 16:58:21 +01:00
26 changed files with 86 additions and 84 deletions
@@ -177,7 +177,7 @@ export class CreateProcessPage implements OnInit {
try { try {
await this.processes.postDespatcho(this.postData).toPromise() await this.processes.postDespatcho(this.postData).toPromise()
this.successMessage() this.successMessage('')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest()
} }
@@ -578,7 +578,7 @@ export class CreateProcessPage implements OnInit {
leaveAnimation, leaveAnimation,
component: BadRequestPage, component: BadRequestPage,
componentProps: { componentProps: {
message: message || 'Processo efetuado' , message: message || 'Processo não efetuado' ,
}, },
cssClass: 'notification-modal' cssClass: 'notification-modal'
}); });
@@ -65,9 +65,9 @@ export class DarParecerPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
this.modalController.dismiss(); this.modalController.dismiss();
this.successMessage() this.successMessage('Pedido de Parecer solicitado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Pedido de Parecer não solicitado")
} }
+1 -1
View File
@@ -102,7 +102,7 @@ export class DelegarPage implements OnInit {
this.successMessage('Processo delegado') this.successMessage('Processo delegado')
}, },
(error)=>{ (error)=>{
this.badRequest() this.badRequest("Processo não delegado")
}); });
this.goBack(); this.goBack();
} }
@@ -51,7 +51,7 @@ export class EventActionsPopoverPage implements OnInit {
} }
} }
emendarTask(){ emendarTask() {
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" } let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body); console.log(body);
@@ -206,10 +206,10 @@ export class DespachoPrPage implements OnInit {
} }
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('Processo arquivado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não arquivado')
} }
} }
@@ -227,10 +227,10 @@ export class DespachoPrPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('Processo criado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não criado')
} }
} }
@@ -247,7 +247,7 @@ export class DespachoPrPage implements OnInit {
} }
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest()
@@ -280,6 +280,8 @@ export class DespachoPrPage implements OnInit {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res); console.log(res);
this.close(); this.close();
this.successMessage('Processo enviado para pendentes')
}); });
} }
@@ -183,9 +183,9 @@ export class DespachoPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.close(); this.close();
this.successMessage() this.successMessage('Processo criado')
} catch(error) { } catch(error) {
this.badRequest() this.badRequest("Processo não criado")
} }
} }
@@ -201,10 +201,10 @@ export class DespachoPage implements OnInit {
} }
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('Processo descartado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Processo não descartado")
} }
} }
@@ -235,10 +235,10 @@ export class DespachoPage implements OnInit {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res); console.log(res);
this.close(); this.close();
this.successMessage() this.successMessage('Processo enviado para despacho')
}, },
error => { error => {
this.badRequest() this.badRequest("Processo não enviado para despacho")
}); });
} }
@@ -191,7 +191,7 @@ export class DiplomaPage implements OnInit {
} }
try { try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
this.successMessage() this.successMessage('Processo concluído')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest()
} }
@@ -102,9 +102,9 @@ export class ApproveEventModalPage implements OnInit {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']); this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null); this.modalController.dismiss(null);
this.successMessage() this.successMessage('Evento aprovado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Evento não aprovado')
} }
@@ -127,9 +127,9 @@ export class ApproveEventModalPage implements OnInit {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']); this.router.navigate(['/home/gabinete-digital/event-list']);
this.successMessage() this.successMessage('Evento rejeitado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Evento não rejeitado')
} }
this.modalController.dismiss(null); this.modalController.dismiss(null);
@@ -122,7 +122,7 @@ export class ApproveEventPage implements OnInit {
try { try {
this.processes.PostTaskAction(body).toPromise(); this.processes.PostTaskAction(body).toPromise();
await this.successMessage(); await this.successMessage('Processo rejeitado');
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest()
@@ -139,7 +139,7 @@ export class BookMeetingModalPage implements OnInit {
this.distartExpedientModal(); this.distartExpedientModal();
this.successMessage('Reunião criada') this.successMessage('Reunião criada')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Reunião não criada')
} }
@@ -111,7 +111,7 @@ export class ExpedienteDetailPage implements OnInit {
this.goBack(); this.goBack();
}, },
(error)=>{ (error)=>{
this.badRequest() this.badRequest('Processo não enviado para pendentes')
}); });
} }
@@ -246,10 +246,10 @@ export class ExpedienteDetailPage implements OnInit {
try { try {
await this.processes.CompleteTask(otherbody).toPromise() await this.processes.CompleteTask(otherbody).toPromise()
this.successMessage(); this.successMessage('Processo descartado');
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não descartado')
} }
} }
@@ -261,10 +261,10 @@ export class ExpedienteDetailPage implements OnInit {
if(res['data']== 'Yes'){ if(res['data']== 'Yes'){
try { try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
this.successMessage(); this.successMessage('Processo descartado');
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não descartado')
} }
@@ -106,7 +106,7 @@ export class ExpedientePrPage implements OnInit {
this.goBack(); this.goBack();
}, },
(error)=>{ (error)=>{
this.badRequest() this.badRequest('Processo não enviado para pendentes')
}); });
} }
@@ -201,9 +201,9 @@ export class ExpedientePrPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.close(); this.close();
this.successMessage() this.successMessage('Processo aprovado')
} catch(error) { } catch(error) {
this.badRequest() this.badRequest('Processo não aprovado')
} }
} }
@@ -329,9 +329,9 @@ export class ExpedientePrPage implements OnInit {
try { try {
await this.processes.CompleteTask(otherbody).toPromise(); await this.processes.CompleteTask(otherbody).toPromise();
this.successMessage() this.successMessage('Processo descartado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não descartado')
} }
@@ -221,7 +221,7 @@ export class PedidoPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('Processo arquivado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest()
@@ -45,10 +45,10 @@ export class NewActionPage implements OnInit {
try { try {
await this.publication.CreatePublicationFolder(this.folder).toPromise() await this.publication.CreatePublicationFolder(this.folder).toPromise()
this.successMessage() this.successMessage("Ação presidencial criado")
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Ação presidencial não criado")
} }
} }
@@ -100,7 +100,7 @@ export class NewActionPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -130,9 +130,9 @@ export class NewActionPage implements OnInit {
leaveAnimation, leaveAnimation,
component: BadRequestPage, component: BadRequestPage,
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: message || 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()
@@ -83,10 +83,10 @@ export class PublicationDetailPage implements OnInit {
try { try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.successMessage() this.successMessage('Publicação eliminado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Publicação não eliminado')
} }
} }
@@ -166,7 +166,7 @@ export class PublicationDetailPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -196,9 +196,9 @@ export class PublicationDetailPage implements OnInit {
leaveAnimation, leaveAnimation,
component: BadRequestPage, component: BadRequestPage,
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: message || 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()
@@ -83,13 +83,13 @@ export class PublicationDetailPage implements OnInit {
try { try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.successMessage() this.successMessage('Publicaçao eliminado')
this.close(); this.close();
//this.goBackToViewPublications.emit(); //this.goBackToViewPublications.emit();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Publicaçao não eliminado')
} }
} }
@@ -168,7 +168,7 @@ export class PublicationDetailPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -200,7 +200,7 @@ export class PublicationDetailPage implements OnInit {
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()
@@ -125,9 +125,9 @@ export class ApproveEventPage implements OnInit {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']); this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null); this.modalController.dismiss(null);
this.successMessage() this.successMessage('Evento rejeitado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Evento não rejeitado')
} }
} }
@@ -206,11 +206,11 @@ export class NewEventPage implements OnInit {
this.afterSave(); this.afterSave();
} }
this.successMessage() this.successMessage('Evento criado')
}, },
error => { error => {
this.badRequest() this.badRequest('Evento não criado')
}); });
} }
else if(this.profile=='pr') { else if(this.profile=='pr') {
@@ -247,7 +247,7 @@ export class NewEventPage implements OnInit {
this.afterSave(); this.afterSave();
} }
this.successMessage() this.successMessage('Evento criado')
}); });
} }
} }
@@ -359,7 +359,7 @@ export class NewEventPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -389,9 +389,9 @@ export class NewEventPage implements OnInit {
leaveAnimation, leaveAnimation,
component: BadRequestPage, component: BadRequestPage,
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: message || 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()
@@ -253,9 +253,9 @@ export class EditEventToApproveComponent implements OnInit {
} }
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{ this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.successMessage() this.successMessage('Evento editado')
}, error =>{ }, error =>{
this.badRequest() this.badRequest('Evento não editado')
}) })
@@ -250,10 +250,10 @@ export class DespachosOptionsPage implements OnInit {
} }
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('Processo arquivado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não arquivado')
} }
} }
@@ -251,10 +251,10 @@ export class DespachosPrOptionsPage implements OnInit {
} }
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.successMessage() this.successMessage('Processo arquivado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não arquivado')
} }
} }
@@ -331,7 +331,7 @@ export class OptsExpedientePrPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: BadRequestPage, component: BadRequestPage,
componentProps: { componentProps: {
@@ -232,9 +232,9 @@ export class RequestOptionsPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.close(); this.close();
this.successMessage() this.successMessage('Processo arquivado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Processo não arquivado')
} }
@@ -47,9 +47,9 @@ export class NewActionPage implements OnInit {
try { try {
await this.publication.CreatePublicationFolder(this.folder).toPromise() await this.publication.CreatePublicationFolder(this.folder).toPromise()
this.close(); this.close();
this.successMessage() this.successMessage('Publicação criado')
} catch (error) { } catch (error) {
this.badRequest() this.badRequest('Publicação não criado')
} }
} }
@@ -103,7 +103,7 @@ export class NewActionPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -135,7 +135,7 @@ export class NewActionPage implements OnInit {
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()
@@ -159,11 +159,11 @@ export class NewPublicationPage implements OnInit {
console.log(this.publication); console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.successMessage() this.successMessage("Publicação criado")
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Publicação não criado")
} }
} }
@@ -183,11 +183,11 @@ export class NewPublicationPage implements OnInit {
try { try {
console.log(this.publication); console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.successMessage() this.successMessage("Publicação criado")
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Publicação não criado")
} }
} }
@@ -209,11 +209,11 @@ export class NewPublicationPage implements OnInit {
try { try {
console.log(this.publication); console.log(this.publication);
await this.publications.CreatePublication(this.folderId, this.publication).toPromise() await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
this.successMessage() this.successMessage("Publicação criado")
this.goBackToViewPublications.emit(); this.goBackToViewPublications.emit();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Publicação não criado")
} }
} }
@@ -319,7 +319,7 @@ export class NewPublicationPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -351,7 +351,7 @@ export class NewPublicationPage implements OnInit {
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()
@@ -80,7 +80,7 @@ export class PublicationDetailPage implements OnInit {
}); });
} }
close(){ close() {
this.modalController.dismiss(); this.modalController.dismiss();
} }
@@ -88,10 +88,10 @@ export class PublicationDetailPage implements OnInit {
try { try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
this.successMessage() this.successMessage("Publicação eliminado")
this.goBackToViewPublications.emit(); this.goBackToViewPublications.emit();
} catch (error) { } catch (error) {
this.badRequest() this.badRequest("Publicação não eliminado")
} }
} }
@@ -185,7 +185,7 @@ export class PublicationDetailPage implements OnInit {
} }
async badRequest() { async badRequest(message?) {
const enterAnimation = (baseEl: any) => { const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create() const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!) .addElement(baseEl.querySelector('ion-backdrop')!)
@@ -217,7 +217,7 @@ export class PublicationDetailPage implements OnInit {
componentProps: { componentProps: {
message: 'Processo não realizado com sucesso', message: 'Processo não realizado com sucesso',
}, },
cssClass: 'modal modal-desktop' cssClass: 'notification-modal'
}); });
modal.present() modal.present()