Commit dd3a8da3 authored by Pearu Sarv's avatar Pearu Sarv
Browse files

TEIS-2500 Disable infected justification download

parent 852c287d
......@@ -17,11 +17,15 @@
</teis-flex>
</ng-template>
<teis-flex *ngFor="let file of violation.files | sort: fileSort" class="py-2 border-bottom" position="spaceBetween">
<a href-void (click)="downloadFile(file)">
<a href-void (click)="downloadFile(file)" *ngIf="file.scanStatus === scanStatus.CLEAN">
<i *ngIf="!file.downloadInProgress" class="icon-download ml-1"></i>
<span *ngIf="file.downloadInProgress" class="progress-simple progress-file-upload mr-3"> </span>
{{ file.fileName }}
</a>
<span *ngIf="file.scanStatus !== scanStatus.CLEAN">
<tehik-file-scan-status-icon [fileScanStatus]="file.scanStatus"></tehik-file-scan-status-icon>
{{ file.fileName }}
</span>
<teis-icon-button
*permission="{ id: file.id, type: filePermissionType, permission: deleteFilePermission }"
role="button"
......
......@@ -3,7 +3,7 @@ import { FormControl } from '@angular/forms';
import { SortInstance, SortType } from '@ska-angular/common';
import { ClientType } from '@teis/services/authentication/authentication.models';
import { AuthenticationService } from '@teis/services/authentication/authentication.service';
import { DownloadProgress, FileReferenceWithPermissionsDto } from '@teis/services/file/file.model';
import { DownloadProgress, FileReferenceWithPermissionsDto, ScanStatus } from '@teis/services/file/file.model';
import { PermissionDataObjectType } from '@teis/services/permissions/permissions.model';
import { PermissionsService } from '@teis/services/permissions/permissions.service';
import { ConfirmationOptions } from '@teis/widgets/teis-modal/confirmation/confirmation.component';
......@@ -32,6 +32,7 @@ export class DriversViolationJustificationComponent implements OnChanges {
readonly permissionType = PermissionDataObjectType.DRIVERS_VIOLATION;
readonly filePermissionType = PermissionDataObjectType.DRIVERS_VIOLATION_FILE;
fileSort = new SortInstance('fileName', SortType.ASC);
scanStatus = ScanStatus;
violationId$: BehaviorSubject<string> = new BehaviorSubject(null);
hasEditPermission$: Observable<boolean> = this.violationId$.pipe(switchMap((id: string) => this.permission.hasPermissionForObject(this.permissionType, id, this.editPermission)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment