From c0474203128e372649ccd7ad68b1cd8f2e2f84f6 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Wed, 10 Nov 2021 10:33:44 +0200 Subject: [PATCH] UI fix for error file --- libs/red-domain/src/lib/files/file.model.ts | 4 ++-- libs/red-domain/src/lib/files/file.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/red-domain/src/lib/files/file.model.ts b/libs/red-domain/src/lib/files/file.model.ts index 897c8f64c..c7c2f02ab 100644 --- a/libs/red-domain/src/lib/files/file.model.ts +++ b/libs/red-domain/src/lib/files/file.model.ts @@ -37,7 +37,7 @@ export class File implements IFile, IListable { readonly lastUpdated?: string; readonly lastUploaded?: string; readonly legalBasisVersion?: number; - readonly numberOfAnalyses?: number; + readonly numberOfAnalyses: number; readonly numberOfPages?: number; readonly rulesVersion?: number; readonly status: FileStatus; @@ -110,7 +110,7 @@ export class File implements IFile, IListable { this.isUnderReview = this.status === FileStatuses.UNDER_REVIEW; this.isUnderApproval = this.status === FileStatuses.UNDER_APPROVAL; this.canBeApproved = !this.analysisRequired && !this.hasSuggestions; - this.canBeOpened = !this.isError && !this.isPending; + this.canBeOpened = !this.isError && !this.isPending && this.numberOfAnalyses > 0; this.isWorkable = !this.isProcessing && this.canBeOpened; this.canBeOCRed = !this.excluded && !this.lastOCRTime && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(this.status); diff --git a/libs/red-domain/src/lib/files/file.ts b/libs/red-domain/src/lib/files/file.ts index 6b35bbea9..f3ddd649b 100644 --- a/libs/red-domain/src/lib/files/file.ts +++ b/libs/red-domain/src/lib/files/file.ts @@ -117,7 +117,7 @@ export interface IFile { /** * The number of times the file has been analyzed. */ - readonly numberOfAnalyses?: number; + readonly numberOfAnalyses: number; /** * The number of pages of the file. */