diff --git a/README.md b/README.md index 27e42e3ee..abe0df64e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ To re-generate http rune swagger YOu need swagger-codegen installed `brew install swagger-codegen` ``` -BASE=https://timo-redaction-dev-2.iqser.cloud/ +BASE=https://redapi-staging.iqser.cloud/ URL="$BASE"v2/api-docs?group=redaction-gateway-v1 mkdir -p /tmp/swagger swagger-codegen generate -i "$URL" -l typescript-angular -o /tmp/swagger diff --git a/apps/red-ui/src/app/models/file/file-status.wrapper.ts b/apps/red-ui/src/app/models/file/file-status.wrapper.ts index 698fd58fe..cd15941d4 100644 --- a/apps/red-ui/src/app/models/file/file-status.wrapper.ts +++ b/apps/red-ui/src/app/models/file/file-status.wrapper.ts @@ -89,7 +89,7 @@ export class FileStatusWrapper { } get status() { - return this.fileStatus.status === 'REPROCESS' ? 'PROCESSING' : this.fileStatus.status; + return this.fileStatus.status === 'REPROCESS' || this.fileStatus.status === 'OCR_PROCESSING' ? 'PROCESSING' : this.fileStatus.status; } get numberOfPages() { @@ -105,7 +105,7 @@ export class FileStatusWrapper { } get isProcessing() { - return [FileStatus.StatusEnum.REPROCESS, FileStatus.StatusEnum.PROCESSING].includes(this.status); + return [FileStatus.StatusEnum.REPROCESS, FileStatus.StatusEnum.OCR_PROCESSING, FileStatus.StatusEnum.PROCESSING].includes(this.status); } get statusSort() { diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 164c8c62a..538f480ac 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -49,6 +49,7 @@ export class IconsModule { 'needs-work', 'new-tab', 'notification', + 'ocr', 'page', 'pages', 'plus', diff --git a/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.html b/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.html index 61856eb3a..c6a2cc3e7 100644 --- a/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.html +++ b/apps/red-ui/src/app/modules/projects/components/bulk-actions/project-overview-bulk-actions.component.html @@ -44,6 +44,8 @@ + + acc && this._permissionsService.canReanalyseFile(file), true); } + public get canOcr() { + return this.selectedFiles.reduce((acc, file) => acc && this._permissionsService.canOcrFile(file), true); + } + public get fileStatuses() { return this.selectedFiles.map((file) => file.fileStatus.status); } @@ -85,6 +89,10 @@ export class ProjectOverviewBulkActionsComponent { this._performBulkAction(this._reanalysisControllerService.reanalyzeFilesForProject(fileIds, this._appStateService.activeProject.projectId)); } + ocr() { + this._performBulkAction(this._fileActionService.ocrFile(this.selectedFiles)); + } + // Under review public get canSetToUnderReview() { return this.selectedFiles.reduce((acc, file) => acc && this._permissionsService.canSetUnderReview(file), true); diff --git a/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.html b/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.html index 72b362611..319c28c56 100644 --- a/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.html +++ b/apps/red-ui/src/app/modules/projects/components/file-actions/file-actions.component.html @@ -103,6 +103,16 @@ > + + + { + this.reloadProjects('ocr-file'); + }); + } + setFileUnderReview($event: MouseEvent, fileStatus: FileStatusWrapper, ignoreDialogChanges = false) { $event.stopPropagation(); // this._fileActionService.setFileUnderReview(fileStatus).subscribe(() => { diff --git a/apps/red-ui/src/app/modules/projects/services/file-action.service.ts b/apps/red-ui/src/app/modules/projects/services/file-action.service.ts index 21007df1c..12d818e77 100644 --- a/apps/red-ui/src/app/modules/projects/services/file-action.service.ts +++ b/apps/red-ui/src/app/modules/projects/services/file-action.service.ts @@ -102,4 +102,14 @@ export class FileActionService { this._appStateService.activeProjectId ); } + + ocrFile(fileStatus: FileStatusWrapper | FileStatusWrapper[]) { + if (!isArray(fileStatus)) { + fileStatus = [fileStatus]; + } + return this._reanalysisControllerService.ocrFiles( + fileStatus.map((f) => f.fileId), + this._appStateService.activeProjectId + ); + } } diff --git a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html index 8dcc3efc8..9ae2ab412 100644 --- a/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html +++ b/apps/red-ui/src/app/modules/shared/components/buttons/circle-button/circle-button.component.html @@ -1,6 +1,6 @@