RED-5701 - Disable OCR button for files that are not yet initially analyzed

This commit is contained in:
Valentin Mihai 2022-12-08 15:44:21 +02:00
parent 32f0d76c0b
commit 16ee20ed48
2 changed files with 6 additions and 2 deletions

View File

@ -249,7 +249,7 @@ export class ViewerHeaderService {
header.getItems().splice(10, header.getItems().length - 14, ...enabledItems);
});
this._pdf.instance.UI.updateElement('selectToolButton', {
this._pdf.instance?.UI.updateElement('selectToolButton', {
img: this._convertPath('/assets/icons/general/pdftron-cursor.svg'),
});
}

View File

@ -146,7 +146,11 @@ export class File extends Entity<IFile> implements IFile {
this.isUnderApproval = this.workflowStatus === WorkflowFileStatuses.UNDER_APPROVAL;
this.canBeApproved = !this.hasSuggestions && !this.isProcessing && !this.isError;
this.canBeOpened = !this.isError && !this.isUnprocessed && this.numberOfAnalyses > 0;
this.canBeOCRed = !this.excluded && !this.lastOCRTime && (this.isNew || this.isUnderReview || this.isUnderApproval);
this.canBeOCRed =
!this.excluded &&
!this.lastOCRTime &&
this.numberOfAnalyses !== 0 &&
(this.isNew || this.isUnderReview || this.isUnderApproval);
this.fileAttributes =
file.fileAttributes && file.fileAttributes.attributeIdToValue ? file.fileAttributes : { attributeIdToValue: {} };