force PR profile to add description before making a dispach

This commit is contained in:
tiago.kayaya
2021-10-14 12:43:54 +01:00
parent 01ca3d4739
commit 887c9c2186
3 changed files with 34 additions and 21 deletions
@@ -366,18 +366,23 @@ export class CreateProcessPage implements OnInit {
}
console.log('this.postData', this.postData, this.taskType);
try {
await this.despachoService.createDespacho(this.postData).toPromise();
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber}).toPromise();
if(this.postData.DispatchFolder.Message){
try {
await this.despachoService.createDespacho(this.postData).toPromise();
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber}).toPromise();
this.modalController.dismiss();
this.toastService.successMessage('Despacho criado');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
} finally {
loader.remove()
this.modalController.dismiss();
this.toastService.successMessage('Despacho criado');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
} finally {
//loader.remove();
}
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
case '1': // Pedido de Parecer
this.postData = {
@@ -5,7 +5,7 @@
<fa-icon icon="chevron-left" class="menu-icon"></fa-icon>
</div>
<div class="middle">
<div class="middle add-ellipsis">
{{file.title}}
</div>
@@ -130,7 +130,7 @@ export class ExpedientTaskModalPage implements OnInit {
SubjectTypes: this.selectedTypes,
NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber,
};
this.postData.DispatchFolder = this.dispatchFolder;
this.postData.UsersSelected = this.participants;
/* By Default TypeDeadline should be 'Normal' */
@@ -274,7 +274,7 @@ export class ExpedientTaskModalPage implements OnInit {
})
});
} else { // 8
docs.Attachments.push({
ApplicationId: 8,
@@ -459,17 +459,25 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
try {
if(this.postData.DispatchFolder.Message){
try {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
}
break;