From abfed73b6311c75c7349ead7a2ea3c2125626b62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ABl=20QUAISSARD?= <mael.quaissard@smile.fr>
Date: Tue, 4 Aug 2020 18:23:25 +0200
Subject: [PATCH] 18982 - securistation - disable download for the warning
 operations

Co-authored-by: benemart <benedicte.martinez@cea.fr>
---
 .../securisation-preview.component.html       | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.html b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.html
index 1b0598d5..f7cdbb84 100644
--- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.html
+++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.html
@@ -5,14 +5,18 @@
         <div class="title">
             <h2>{{securisation?.id}}</h2>
         </div>
-      <mat-form-field class="vitamui-mat-select">
-        <mat-select placeholder="Selectionnez un contrat d'accès" panelclass="vitamui-mat-select" (selectionChange)="updateAccessContractId($event)">
-          <mat-option *ngFor='let accessContract of accessContracts'
-                      [value]="accessContract.identifier">{{accessContract.name}}
-          </mat-option>
-        </mat-select>
-      </mat-form-field>
-        <button mat-button class="btn btn-primary button-maring" (click)="downloadReport()" [disabled]="!accessContractId">Télécharger le rapport</button>
+
+        <ng-container *ngIf="securisation.events[securisation.events.length - 1].outcome !== 'WARNING'">
+            <mat-form-field class="vitamui-mat-select">
+                <mat-select placeholder="Selectionnez un contrat d'accès" panelclass="vitamui-mat-select" (selectionChange)="updateAccessContractId($event)">
+                    <mat-option *ngFor='let accessContract of accessContracts'
+                                [value]="accessContract.identifier">{{accessContract.name}}
+                    </mat-option>
+                </mat-select>
+            </mat-form-field>
+            <button mat-button class="btn btn-primary button-maring" (click)="downloadReport()" 
+                    [disabled]="!accessContractId">Télécharger le rapport</button>
+        </ng-container>
     </div>
     <div class="vitamui-sidepanel-body">
         <mat-tab-group class="preview-tab-group">
-- 
GitLab