RED-10531: enable assignToSelf on error files; display assignee.

This commit is contained in:
Nicoleta Panaghiu 2024-11-27 20:18:15 +02:00
parent d9e28e147a
commit fdcf25a3e3
4 changed files with 13 additions and 8 deletions

View File

@ -23,11 +23,13 @@
<div class="cell" *ngIf="!isDocumine">
<redaction-file-workload *ngIf="!file.excluded" [file]="file"></redaction-file-workload>
</div>
</ng-container>
<div class="user-column cell">
<iqser-initials-avatar [user]="file.assignee" [withName]="true"></iqser-initials-avatar>
</div>
<div class="user-column cell">
<iqser-initials-avatar [user]="file.assignee" [withName]="true"></iqser-initials-avatar>
</div>
<ng-container *ngIf="!file.isError">
<div class="cell">
<div class="small-label stats-subtitle">
<div>

View File

@ -5,7 +5,7 @@
}
.extend-cols {
grid-column-end: span 3;
grid-column-end: span 2;
align-items: flex-end;
}

View File

@ -85,7 +85,7 @@ export class FileActionsComponent {
this.isDossierOverview(),
);
readonly #showDelete = computed(() => this._permissionsService.canSoftDeleteFile(this.file(), this.dossier()));
readonly #showOCR = computed(() => this._permissionsService.canOcrFile(this.file(), this.dossier()));
readonly #showOCR = computed(() => this._permissionsService.canOcrFile(this.file(), this.dossier()) && !this.file().isError);
readonly #canReanalyse = computed(() => this._permissionsService.canReanalyseFile(this.file(), this.dossier()));
readonly #canEnableAutoAnalysis = computed(() => this._permissionsService.canEnableAutoAnalysis([this.file()], this.dossier()));
readonly #showUnderReview = computed(
@ -113,7 +113,11 @@ export class FileActionsComponent {
);
readonly #isDossierMember = computed(() => this._permissionsService.isDossierMember(this.dossier()));
readonly #showDownload = computed(
() => this._permissionsService.canDownloadRedactedFile() && !!this.file().lastProcessed && this.#isDossierMember(),
() =>
this._permissionsService.canDownloadRedactedFile() &&
!!this.file().lastProcessed &&
!this.file().isError &&
this.#isDossierMember(),
);
readonly #showReanalyseFilePreview = computed(
() => this.#showReanalyse() && this.isFilePreview() && !this.file().isApproved && this.#isDossierMember(),
@ -163,7 +167,6 @@ export class FileActionsComponent {
dossier: this.dossier(),
tooltipClass: 'small',
show: this.#showDownload(),
disabled: this.file().processingStatus === ProcessingFileStatuses.ERROR,
helpModeKey: this.#isDocumine ? 'download_document' : 'download',
},
{

View File

@ -469,7 +469,7 @@ export class PermissionsService {
}
#canAssignToSelf(file: File, dossier: Dossier): boolean {
const precondition = this.#fileIsOk(file, dossier) && !this.isFileAssignee(file);
const precondition = (this.#fileIsOk(file, dossier) || file.isError) && !this.isFileAssignee(file);
return precondition && (this.isApprover(dossier) || (this.isDossierMember(dossier) && (file.isNew || file.isUnderReview)));
}