OCR processing indicator in file preview

This commit is contained in:
Adina Țeudan 2022-03-04 18:13:06 +02:00
parent a11e0835ae
commit e7a2322113
5 changed files with 13 additions and 4 deletions

View File

@ -33,6 +33,11 @@
<div class="right-content">
<div *ngIf="state.isReadonly$ | async" class="justify-center banner read-only d-flex">
<div *ngIf="file.isOcrProcessing" class="ocr-indicator">
OCR
<mat-progress-bar class="white ml-8 w-100" mode="indeterminate"></mat-progress-bar>
</div>
<div class="flex-center">
<mat-icon class="primary-white" svgIcon="red:read-only"></mat-icon>
<span class="read-only-text" translate="readonly"></span>

View File

@ -24,8 +24,10 @@
}
}
mat-progress-bar {
margin-left: 8px;
.ocr-indicator {
display: flex;
flex: 1;
align-items: center;
}
&.justify-center {

View File

@ -113,7 +113,7 @@ export class PermissionsService {
// TODO: Remove '?', after we make sure file is loaded before page
canPerformAnnotationActions(file: File): boolean {
return !file.excluded && (file?.isUnderReview || file?.isUnderApproval) && this.isFileAssignee(file);
return !file.isOcrProcessing && !file.excluded && (file?.isUnderReview || file?.isUnderApproval) && this.isFileAssignee(file);
}
canUndoApproval(file: File | File[]): boolean {

@ -1 +1 @@
Subproject commit 0157507f661ab216413ec0cf6f4a03128ecb5fce
Subproject commit 8d823ad6737857ce74e143350470bc705bad1eb5

View File

@ -49,6 +49,7 @@ export class File extends Entity<IFile> implements IFile {
readonly isNew: boolean;
readonly isError: boolean;
readonly isProcessing: boolean;
readonly isOcrProcessing: boolean;
readonly isInitialProcessing: boolean;
readonly isApproved: boolean;
readonly isUnprocessed: boolean;
@ -104,6 +105,7 @@ export class File extends Entity<IFile> implements IFile {
this.hintsOnly = this.hasHints && !this.hasRedactions;
this.hasNone = !this.hasRedactions && !this.hasHints && !this.hasSuggestions;
this.isProcessing = isProcessingStatuses.includes(this.processingStatus);
this.isOcrProcessing = this.processingStatus === ProcessingFileStatuses.OCR_PROCESSING;
this.isInitialProcessing = this.isProcessing && this.numberOfAnalyses === 0;
this.isApproved = this.workflowStatus === WorkflowFileStatuses.APPROVED;
this.isNew = this.workflowStatus === WorkflowFileStatuses.NEW;