From 7e1e8fc19bf3a469dd03049caffc3fc0c504dfe4 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Fri, 4 Jun 2021 11:35:44 +0200
Subject: [PATCH] FIX #17109 TIME 0:40 fix processInfo if otp

---
 .../visa-workflow/visa-workflow.component.html       |  2 +-
 .../visa-workflow/visa-workflow.component.ts         | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/frontend/app/document/visa-workflow/visa-workflow.component.html b/src/frontend/app/document/visa-workflow/visa-workflow.component.html
index bf25501bfe..23e527f9ae 100644
--- a/src/frontend/app/document/visa-workflow/visa-workflow.component.html
+++ b/src/frontend/app/document/visa-workflow/visa-workflow.component.html
@@ -92,7 +92,7 @@
                 </p>
                 <p *ngIf="diffusion.processDate !== null" [title]="diffusion.processDate">
                     <ion-note *ngIf="diffusion.status === 'VAL'" class="valProcess">
-                        {{'lang.'+diffusion.mode+'ProcessInfo' | translate}}
+                        {{'lang.' + getProcessInfo(diffusion.mode) + 'ProcessInfo' | translate}}
                         {{diffusion.processDate}}
                     </ion-note>
                     <ion-note *ngIf="diffusion.status === 'REF'" class="refProcess">
diff --git a/src/frontend/app/document/visa-workflow/visa-workflow.component.ts b/src/frontend/app/document/visa-workflow/visa-workflow.component.ts
index 2d45365d5c..f14c4cae0c 100644
--- a/src/frontend/app/document/visa-workflow/visa-workflow.component.ts
+++ b/src/frontend/app/document/visa-workflow/visa-workflow.component.ts
@@ -373,4 +373,16 @@ export class VisaWorkflowComponent implements OnInit {
             this.openOtpModal(item, position, item.userId);
         }
     }
+
+    getProcessInfo(mode: string) {
+        const isOtpSign = /otp_sign_/g;
+        const isOtpvisa = /otp_visa_/g;
+        if (mode.match(isOtpSign) !== null) {
+            return 'sign';
+        } else if (mode.match(isOtpvisa) !== null) {
+            return 'visa';
+        } else {
+            return mode;
+        }
+    }
 }
-- 
GitLab