From 9678a62e8169d2d558701d34c7f1f9898bbc7d12 Mon Sep 17 00:00:00 2001
From: "hamza.hramchi" <hamza.hramchi@xelians.fr>
Date: Thu, 25 Mar 2021 15:37:06 +0100
Subject: [PATCH] FEAT #16510 TIME 0:10 display the certified document badge if
 document validated or electronic signature + correct message in workflow

---
 lang/en.json                                     |  6 ++++--
 lang/fr.json                                     |  4 +++-
 src/frontend/app/document/document.component.ts  |  2 +-
 .../visa-workflow/visa-workflow.component.html   | 16 +++++++++++++---
 .../visa-workflow/visa-workflow.component.scss   | 15 +++++++++++++--
 5 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/lang/en.json b/lang/en.json
index a2044fd238..cd798544ba 100755
--- a/lang/en.json
+++ b/lang/en.json
@@ -466,7 +466,9 @@
         "notificationNewAccountId": "<br/> <br/> <b> Your username: </b>",
         "notificationNewAccountFooter": "<br/> <br/> This message is sent automatically following an action by the administrator. <br/> Please do not answer it. <br/> <br/> For any questions, please contact the technical administrator of the solution.",
         "documentIdSearch": "Document ID",
-        "refuseActionDocInMailGroup": "Do you want to refuse the other documents?",
-        "notificationDeletedUserBody": "Hello, <br/> <br/> A visa workflow you initiated was interrupted because a user was deleted. <br/> <br/> Click on the link below to view it: <br / >"
+        "refuseActionDocInMailGroup": "Do you want to refuse the other documents from a direct mail?",
+        "notificationDeletedUserBody": "Hello, <br/> <br/> A visa workflow you initiated was interrupted because a user was deleted. <br/> <br/> Click on the link below to view it: <br / >",
+        "stopProcessInfo": "Interrupted on",
+        "refProcessInfo": "Refused on"
     }
 }
\ No newline at end of file
diff --git a/lang/fr.json b/lang/fr.json
index 20e38b37a5..e0a46fa275 100755
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -463,6 +463,8 @@
 		"noItem": "Aucun élément",
 		"modelCreated": "Modèle créé",
 		"undefined": "Non défini",
-		"refuseActionDocInMailGroup": "Voulez-vous refuser les autres documents issus d'un publipostage ?"
+		"refuseActionDocInMailGroup": "Voulez-vous refuser les autres documents issus d'un publipostage ?",
+		"stopProcessInfo": "Interrompu le",
+		"refProcessInfo": "Refusé le"
 	}
 }
diff --git a/src/frontend/app/document/document.component.ts b/src/frontend/app/document/document.component.ts
index ac4ee94619..cfb2e6c98b 100755
--- a/src/frontend/app/document/document.component.ts
+++ b/src/frontend/app/document/document.component.ts
@@ -328,7 +328,7 @@ export class DocumentComponent implements OnInit {
 
                             const realUserWorkflow = this.mainDocument.workflow.filter((line: { current: boolean; }) => line.current === true);
 
-                            this.mainDocument.isCertified = this.mainDocument.workflow.filter((line: any) => line.mode === 'sign' && line.signatureMode !== 'stamp' && line.processDate !== null).length > 0;
+                            this.mainDocument.isCertified = this.mainDocument.workflow.filter((line: any) => line.status !== 'REF' && line.status !== 'STOP' && line.mode === 'sign' && line.signatureMode !== 'stamp' && line.processDate !== null).length > 0;
 
                             if (realUserWorkflow.length === 0 || this.mainDocument.readOnly) {
                                 this.actionsList = [
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 3c7b3f66aa..7865a96ae5 100644
--- a/src/frontend/app/document/visa-workflow/visa-workflow.component.html
+++ b/src/frontend/app/document/visa-workflow/visa-workflow.component.html
@@ -61,9 +61,19 @@
                         </ion-select-option>
                     </ion-select>
                 </p>
-                <p *ngIf="diffusion.processDate !== null" [title]="diffusion.processDate" class="processDate">
-                    {{'lang.'+diffusion.mode+'ProcessInfo' | translate}}
-                    {{diffusion.processDate}}
+                <p *ngIf="diffusion.processDate !== null" [title]="diffusion.processDate">
+                    <ion-note *ngIf="diffusion.status === 'VAL'" class="valProcess">
+                        {{'lang.'+diffusion.mode+'ProcessInfo' | translate}}
+                        {{diffusion.processDate}}
+                    </ion-note>
+                    <ion-note *ngIf="diffusion.status === 'REF'" class="refProcess">
+                        {{'lang.refProcessInfo' | translate}}
+                        {{diffusion.processDate}}
+                    </ion-note>
+                    <ion-note *ngIf="diffusion.status === 'STOP'" class="stopProcess">
+                        {{'lang.stopProcessInfo' | translate}}
+                        {{diffusion.processDate}}
+                    </ion-note>
                 </p>
             </ion-label>
             <ion-icon *ngIf="!editMode && diffusion.current" color="success" slot="end" name="caret-back-outline">
diff --git a/src/frontend/app/document/visa-workflow/visa-workflow.component.scss b/src/frontend/app/document/visa-workflow/visa-workflow.component.scss
index df70b86fbf..20b4531c56 100644
--- a/src/frontend/app/document/visa-workflow/visa-workflow.component.scss
+++ b/src/frontend/app/document/visa-workflow/visa-workflow.component.scss
@@ -42,7 +42,7 @@ ion-select {
     display: none !important;
 }
 
-.processDate {
+.valProcess {
     display: flex;
     justify-content: flex-start;
     font-size: 12px;
@@ -50,4 +50,15 @@ ion-select {
     color : var(--ion-color-success);
     padding-top: 10px;
     padding-bottom: 10px;
-}
\ No newline at end of file
+}
+
+.refProcess, .stopProcess {
+    display: flex;
+    justify-content: flex-start;
+    font-size: 12px;
+    text-align: right;
+    color : var(--ion-color-danger);
+    padding-top: 10px;
+    padding-bottom: 10px;
+}
+
-- 
GitLab