Skip to content
Snippets Groups Projects
Commit c7f141bc authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

Merge branch 'fix/23944/develop' into 'develop'

[23944] Mauvais message d'erreur quand je clique sur le positionnement de signature alors que le circuit est vide

See merge request maarch/MaarchParapheur!211
parents fc8db54b 216dc22e
No related branches found
No related tags found
No related merge requests found
...@@ -380,32 +380,33 @@ export class IndexationComponent implements OnInit { ...@@ -380,32 +380,33 @@ export class IndexationComponent implements OnInit {
} }
async signPos(index: number) { async signPos(index: number) {
const allUsers: any[] = this.appVisaWorkflow.getCurrentWorkflow(); if (this.appVisaWorkflow.getCurrentWorkflow().length > 0) {
const usersWithNoteRole: any[] = this.appVisaWorkflow.getCurrentWorkflow().filter((user: any) => user.role === 'note'); const allUsers: any[] = this.appVisaWorkflow.getCurrentWorkflow();
const usersWithNoteRole: any[] = this.appVisaWorkflow.getCurrentWorkflow().filter((user: any) => user.role === 'note');
if ((allUsers.length === 1 && this.appVisaWorkflow.getCurrentWorkflow()[0].role === 'note') || (allUsers.length === usersWithNoteRole.length)) { if ((allUsers.length === 1 && this.appVisaWorkflow.getCurrentWorkflow()[0].role === 'note') || (allUsers.length === usersWithNoteRole.length)) {
this.notificationService.error('lang.cannotSetSignature'); this.notificationService.error('lang.cannotSetSignature');
} else if (this.appVisaWorkflow.getCurrentWorkflow().length > 0) { } else {
this.appVisaWorkflow.getCurrentWorkflow().forEach((user: any, indexUser: number) => { this.appVisaWorkflow.getCurrentWorkflow().forEach((user: any, indexUser: number) => {
if (user.signaturePositions === undefined) { if (user.signaturePositions === undefined) {
this.appVisaWorkflow.visaWorkflow[indexUser].signaturePositions = []; this.appVisaWorkflow.visaWorkflow[indexUser].signaturePositions = [];
} }
}); });
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: SignaturePositionComponent, component: SignaturePositionComponent,
cssClass: 'custom-alert-fullscreen', cssClass: 'custom-alert-fullscreen',
componentProps: { componentProps: {
workflow: this.appVisaWorkflow.getCurrentWorkflow(), workflow: this.appVisaWorkflow.getCurrentWorkflow(),
resource: this.filesToUpload[index], resource: this.filesToUpload[index],
pdfContent: 'data:application/pdf;base64,' + this.filesToUpload[index].content, pdfContent: 'data:application/pdf;base64,' + this.filesToUpload[index].content,
docIndex: this.filesToUpload.indexOf(this.filesToUpload[index]) docIndex: this.filesToUpload.indexOf(this.filesToUpload[index])
}
});
await modal.present();
const { data } = await modal.onWillDismiss();
if (data !== undefined) {
this.filesToUpload[index].signPos = data;
this.appVisaWorkflow.setPositionsWorkfow(this.filesToUpload, index, data);
} }
});
await modal.present();
const { data } = await modal.onWillDismiss();
if (data !== undefined) {
this.filesToUpload[index].signPos = data;
this.appVisaWorkflow.setPositionsWorkfow(this.filesToUpload, index, data);
} }
} else { } else {
this.notificationService.error('lang.mustSetWorkflowBeforeSignPositions'); this.notificationService.error('lang.mustSetWorkflowBeforeSignPositions');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment