From b2dbb6b9f3850e3ca582288ed7e838d408022734 Mon Sep 17 00:00:00 2001 From: "hamza.hramchi" <hamza.hramchi@xelians.fr> Date: Fri, 22 Jan 2021 10:25:18 +0100 Subject: [PATCH] FIX #15550 TIME 0:20 fix fix duplicate signature for last user in workflow --- src/frontend/app/signatures/signatures.component.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/app/signatures/signatures.component.ts b/src/frontend/app/signatures/signatures.component.ts index eb0793e55e..790b798b8f 100755 --- a/src/frontend/app/signatures/signatures.component.ts +++ b/src/frontend/app/signatures/signatures.component.ts @@ -121,12 +121,16 @@ export class SignaturesComponent implements OnInit { this.notificationService.success('lang.signatureInDocAdded'); this.modalController.dismiss('success'); } else { - if (signPosCurrentPage.length > 0) { + let signaturePos = this.currentWorflow.signaturePositions.filter((item: any) => item.sequence === this.posCurrentUser); + if (signPosCurrentPage.length > 0 && signPosOtherPage.length === 0) { signature.positionX = signPosCurrentPage[0].positionX; signature.positionY = signPosCurrentPage[0].positionY; this.storeSignature(signature, this.signaturesService.currentPage); - } - let signaturePos = this.currentWorflow.signaturePositions.filter((item: any) => item.sequence === this.posCurrentUser); + } else if (signPosCurrentPage.length > 0 && signPosOtherPage.length > 0) { + signature.positionX = signaturePos[0].positionX; + signature.positionY = signaturePos[0].positionY; + this.storeSignature(signature, signaturePos[0].page); + } if (signaturePos.length > 0) { signaturePos.forEach((element: { positionX: any; positionY: any; page: number; }) => { signature.positionX = element.positionX; @@ -159,6 +163,8 @@ export class SignaturesComponent implements OnInit { } else { this.modalController.dismiss({ redirectPage: this.currentWorflow.signaturePositions[0].page }); } + } else if(signPosCurrentPage.length > 0 && signPosOtherPage.length > 0) { + this.modalController.dismiss({ redirectPage: signaturePos[0].page }); } else { this.modalController.dismiss('success'); } -- GitLab