Display processing status

This commit is contained in:
Adina Țeudan 2021-11-15 23:46:09 +02:00
parent 71cd722bfa
commit b50fd15f7f
15 changed files with 692 additions and 205 deletions

View File

@ -4,6 +4,11 @@
<span>{{ 'dossier-overview.dossier-details.stats.documents' | translate: { count: stats.numberOfFiles } }}</span>
</div>
<div>
<mat-icon svgIcon="red:reanalyse"></mat-icon>
<span>{{ 'dossier-overview.dossier-details.stats.processing-documents' | translate: { count: stats.numberOfProcessingFiles } }}</span>
</div>
<div>
<mat-icon svgIcon="red:user"></mat-icon>
<span>{{ 'dossier-overview.dossier-details.stats.people' | translate: { count: dossier.memberIds.length } }}</span>

View File

@ -49,16 +49,22 @@
<div [class.extend-cols]="file.isError" class="status-container cell">
<div *ngIf="file.isError" class="small-label error" translate="dossier-overview.file-listing.file-entry.file-error"></div>
<div *ngIf="file.isPending" class="small-label" translate="dossier-overview.file-listing.file-entry.file-pending"></div>
<iqser-status-bar
*ngIf="file.isWorkable"
[configs]="[
<div *ngIf="file.isProcessing || file.canBeOpened" class="status-wrapper">
<div *ngIf="file.isProcessing" [matTooltip]="'file-status.processing' | translate" class="spinning" matTooltipPosition="above">
<mat-icon svgIcon="red:reanalyse"></mat-icon>
</div>
<iqser-status-bar
*ngIf="!file.isError && !file.isPending"
[configs]="[
{
color: file.workflowStatus,
length: 1
}
]"
></iqser-status-bar>
></iqser-status-bar>
</div>
<redaction-file-actions
(actionPerformed)="calculateData.emit($event)"
*ngIf="!file.isProcessing"

View File

@ -22,5 +22,20 @@
&.status-container {
align-items: flex-end;
.status-wrapper {
display: flex;
align-items: center;
> *:not(:last-child) {
margin-right: 16px;
}
.spinning > mat-icon {
height: 10px;
width: 10px;
opacity: 0.5;
}
}
}
}

View File

@ -1,5 +1,9 @@
<div *ngIf="isDossierOverviewList" class="action-buttons">
<ng-container *ngTemplateOutlet="actions"></ng-container>
<div *ngIf="showStatusBar && file.isProcessing" [matTooltip]="'file-status.processing' | translate" class="spinning"
matTooltipPosition="above">
<mat-icon svgIcon="red:reanalyse"></mat-icon>
</div>
<iqser-status-bar *ngIf="showStatusBar" [configs]="statusBarConfig"></iqser-status-bar>
</div>

View File

@ -31,9 +31,16 @@ mat-slide-toggle {
height: 34px;
width: 34px;
line-height: 33px;
}
mat-slide-toggle {
margin-left: 8px;
margin-right: 5px;
}
.spinning {
margin: 0 12px 0 11px;
> mat-icon {
height: 10px;
width: 10px;
opacity: 0.5;
}
}

View File

@ -251,7 +251,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnInit, OnD
this.showOCR = this.file.canBeOCRed;
this.canReanalyse = this.permissionsService.canReanalyseFile(this.file, dossier);
this.showStatusBar = this.file.isWorkable && this.isDossierOverviewList;
this.showStatusBar = !this.file.isError && !this.file.isPending && this.isDossierOverviewList;
this.showAssignToSelf = this.permissionsService.canAssignToSelf(this.file) && this.isDossierOverview;
this.showAssign =

View File

@ -12,7 +12,6 @@ export class IconsModule {
constructor(private readonly _iconRegistry: MatIconRegistry, private readonly _sanitizer: DomSanitizer) {
const icons = [
'ai',
'analyse',
'approved',
'arrow-up',
'assign',
@ -49,6 +48,7 @@ export class IconsModule {
'put-back',
'read-only',
'ready-for-approval',
'reanalyse',
'reason',
'remove-from-dict',
'report',

File diff suppressed because it is too large Load Diff

View File

@ -690,7 +690,8 @@
"deleted": "{count} deleted files",
"documents": "{count} {count, plural, one{document} other{documents}}",
"due-date": "Due {date}",
"people": "{count} {count, plural, one{user} other{users}}"
"people": "{count} {count, plural, one{user} other{users}}",
"processing-documents": "{count} processing {count, plural, one{document} other{documents}}"
}
},
"download-file": "Download",
@ -1084,7 +1085,7 @@
"indexing": "Processing",
"ocr-processing": "OCR Processing",
"processed": "Processed",
"processing": "Processing",
"processing": "Processing...",
"reprocess": "Processing",
"unassigned": "Unassigned",
"under-approval": "Under Approval",

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="100px" version="1.1" viewBox="0 0 100 100" width="100px"
xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd" id="analyse" stroke="none" stroke-width="1">
<path
d="M16.5,89 L16.5,100 L0,100 L0,89 L16.5,89 Z M44.5,89 L44.5,100 L28,100 L28,89 L44.5,89 Z M72,89 L72,100 L55.5,100 L55.5,89 L72,89 Z M100,89 L100,100 L83.5,100 L83.5,89 L100,89 Z M16.5,66.5 L16.5,77.5 L0,77.5 L0,66.5 L16.5,66.5 Z M44.5,66.5 L44.5,77.5 L28,77.5 L28,66.5 L44.5,66.5 Z M72,66.5 L72,77.5 L55.5,77.5 L55.5,66.5 L72,66.5 Z M100,66.5 L100,77.5 L83.5,77.5 L83.5,66.5 L100,66.5 Z M16.5,44.5 L16.5,55.5 L0,55.5 L0,44.5 L16.5,44.5 Z M44.5,44.5 L44.5,55.5 L28,55.5 L28,44.5 L44.5,44.5 Z M100,44.5 L100,55.5 L83.5,55.5 L83.5,44.5 L100,44.5 Z M44.5,22 L44.5,33 L28,33 L28,22 L44.5,22 Z M100,22 L100,33 L83.5,33 L83.5,22 L100,22 Z M44.5,0 L44.5,11 L28,11 L28,0 L44.5,0 Z"
fill="currentColor" fill-rule="nonzero" id="Combined-Shape"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="10px" version="1.1" viewBox="0 0 10 10" width="10px" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd" id="Processing" stroke="none" stroke-width="1">
<g id="01.Processing" transform="translate(-1024.000000, -214.000000)">
<rect height="705" width="1440" x="0" y="0"></rect>
<polygon id="Rectangle" points="0 194 1086 194 1086 244 0 244"></polygon>
<g fill="currentColor" fill-rule="nonzero" id="status" transform="translate(1024.000000, 214.000000)">
<g id="refresh">
<path
d="M1.25,6.35 C1.8,7.95 3.3,9 5,9 C6.2,9 7.35,8.45 8.1,7.5 L8.1,7.5 L6.5,7.5 L6.5,6.5 L9.5,6.5 L9.5,9.5 L8.5,9.5 L8.5,8.55 C7.6,9.45 6.35,10 5,10 C2.9,10 1,8.65 0.3,6.7 L0.3,6.7 Z M5,0 C7.1,0 9,1.35 9.7,3.3 L9.7,3.3 L8.75,3.65 C8.2,2.05 6.7,1 5,1 C3.8,1 2.65,1.55 1.9,2.5 L1.9,2.5 L3.5,2.5 L3.5,3.5 L0.5,3.5 L0.5,0.5 L1.5,0.5 L1.5,1.45 C2.45,0.55 3.7,0 5,0 Z"
id="Combined-Shape"></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,25 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg">
<title>status</title>
<g id="Styleguide" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Styleguide-Actions" transform="translate(-979.000000, -630.000000)" fill="currentColor">
<svg height="14px" version="1.1" viewBox="0 0 14 14" width="14px" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd" id="Styleguide" stroke="none" stroke-width="1">
<g fill="currentColor" id="Styleguide-Actions" transform="translate(-979.000000, -630.000000)">
<g id="reference" transform="translate(969.000000, 620.000000)">
<g id="status" transform="translate(10.000000, 10.000000)">
<path
d="M1.4,9.8 L1.4,12.6 L4.2,12.6 L4.2,14 L0,14 L0,9.8 L1.4,9.8 Z M14,9.8 L14,14 L9.8,14 L9.8,12.6 L12.6,12.6 L12.6,9.8 L14,9.8 Z M4.2,0 L4.2,1.4 L1.4,1.4 L1.4,4.2 L0,4.2 L0,0 L4.2,0 Z M14,0 L14,4.2 L12.6,4.2 L12.6,1.4 L9.8,1.4 L9.8,0 L14,0 Z"
id="OCR" fill-rule="nonzero"></path>
<path d="M4.2,0 L0,0 L0,4.2 L4.2,4.2 L4.2,0 Z M2.8,1.4 L2.8,2.8 L1.4,2.8 L1.4,1.4 L2.8,1.4 Z" id="Path"
fill-rule="nonzero"></path>
<path d="M4.2,9.8 L0,9.8 L0,14 L4.2,14 L4.2,9.8 Z M2.8,11.2 L2.8,12.6 L1.4,12.6 L1.4,11.2 L2.8,11.2 Z" id="Path"
fill-rule="nonzero"></path>
<path d="M14,0 L9.8,0 L9.8,4.2 L14,4.2 L14,0 Z M12.6,1.4 L12.6,2.8 L11.2,2.8 L11.2,1.4 L12.6,1.4 Z" id="Path"
fill-rule="nonzero"></path>
<path d="M14,9.8 L9.8,9.8 L9.8,14 L14,14 L14,9.8 Z M12.6,11.2 L12.6,12.6 L11.2,12.6 L11.2,11.2 L12.6,11.2 Z" id="Path"
fill-rule="nonzero"></path>
<rect id="Rectangle" x="4.2" y="1.4" width="5.6" height="1.4"></rect>
<rect id="Rectangle" x="4.2" y="11.2" width="5.6" height="1.4"></rect>
<rect id="Rectangle" x="11.2" y="4.2" width="1.4" height="5.6"></rect>
<rect id="Rectangle" x="1.4" y="4.2" width="1.4" height="5.6"></rect>
fill-rule="nonzero" id="OCR"></path>
<path d="M4.2,0 L0,0 L0,4.2 L4.2,4.2 L4.2,0 Z M2.8,1.4 L2.8,2.8 L1.4,2.8 L1.4,1.4 L2.8,1.4 Z" fill-rule="nonzero"
id="Path"></path>
<path d="M4.2,9.8 L0,9.8 L0,14 L4.2,14 L4.2,9.8 Z M2.8,11.2 L2.8,12.6 L1.4,12.6 L1.4,11.2 L2.8,11.2 Z" fill-rule="nonzero"
id="Path"></path>
<path d="M14,0 L9.8,0 L9.8,4.2 L14,4.2 L14,0 Z M12.6,1.4 L12.6,2.8 L11.2,2.8 L11.2,1.4 L12.6,1.4 Z" fill-rule="nonzero"
id="Path"></path>
<path d="M14,9.8 L9.8,9.8 L9.8,14 L14,14 L14,9.8 Z M12.6,11.2 L12.6,12.6 L11.2,12.6 L11.2,11.2 L12.6,11.2 Z" fill-rule="nonzero"
id="Path"></path>
<rect height="1.4" id="Rectangle" width="5.6" x="4.2" y="1.4"></rect>
<rect height="1.4" id="Rectangle" width="5.6" x="4.2" y="11.2"></rect>
<rect height="5.6" id="Rectangle" width="1.4" x="11.2" y="4.2"></rect>
<rect height="5.6" id="Rectangle" width="1.4" x="1.4" y="4.2"></rect>
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,5 +1,6 @@
import { IDossierStats } from './dossier-stats';
import { FileCountPerProcessingStatus, FileCountPerWorkflowStatus } from './types';
import { isProcessingStatuses, ProcessingFileStatus } from '../files';
export class DossierStats implements IDossierStats {
readonly dossierId: string;
@ -12,6 +13,7 @@ export class DossierStats implements IDossierStats {
readonly hasUpdatesFilePresent: boolean;
readonly numberOfPages: number;
readonly numberOfFiles: number;
readonly numberOfProcessingFiles: number;
readonly hasFiles: boolean;
@ -26,6 +28,9 @@ export class DossierStats implements IDossierStats {
this.hasUpdatesFilePresent = stats.hasUpdatesFilePresent;
this.numberOfPages = stats.numberOfPages;
this.numberOfFiles = stats.numberOfFiles;
this.numberOfProcessingFiles = Object.entries<number>(this.fileCountPerProcessingStatus)
.filter(([key, _]) => isProcessingStatuses.includes(key as ProcessingFileStatus))
.reduce((count, [_, value]) => count + value, 0);
this.hasFiles = this.numberOfFiles > 0;
}

View File

@ -1,17 +1,9 @@
import { Entity, List } from '@iqser/common-ui';
import { Entity } from '@iqser/common-ui';
import { StatusSorter } from '../shared';
import { ProcessingFileStatus, ProcessingFileStatuses, WorkflowFileStatus, WorkflowFileStatuses } from './types';
import { isProcessingStatuses, ProcessingFileStatus, ProcessingFileStatuses, WorkflowFileStatus, WorkflowFileStatuses } from './types';
import { IFile } from './file';
import { FileAttributes, IFileAttributesConfig } from '../file-attributes';
const processingStatuses: List<ProcessingFileStatus> = [
ProcessingFileStatuses.REPROCESS,
ProcessingFileStatuses.FULLREPROCESS,
ProcessingFileStatuses.OCR_PROCESSING,
ProcessingFileStatuses.INDEXING,
ProcessingFileStatuses.PROCESSING,
] as const;
export class File extends Entity<IFile> implements IFile {
readonly added?: string;
readonly allManualRedactionsApplied: boolean;
@ -61,7 +53,6 @@ export class File extends Entity<IFile> implements IFile {
readonly isUnderApproval: boolean;
readonly canBeApproved: boolean;
readonly canBeOpened: boolean;
readonly isWorkable: boolean;
readonly canBeOCRed: boolean;
constructor(file: IFile, readonly reviewerName: string, fileAttributesConfig?: IFileAttributesConfig) {
@ -107,14 +98,13 @@ export class File extends Entity<IFile> implements IFile {
this.hintsOnly = this.hasHints && !this.hasRedactions;
this.hasNone = !this.hasRedactions && !this.hasHints && !this.hasSuggestions;
this.isPending = this.processingStatus === ProcessingFileStatuses.UNPROCESSED;
this.isProcessing = processingStatuses.includes(this.processingStatus);
this.isProcessing = isProcessingStatuses.includes(this.processingStatus);
this.isApproved = this.workflowStatus === WorkflowFileStatuses.APPROVED;
this.isUnassigned = this.workflowStatus === WorkflowFileStatuses.UNASSIGNED;
this.isUnderReview = this.workflowStatus === WorkflowFileStatuses.UNDER_REVIEW;
this.isUnderApproval = this.workflowStatus === WorkflowFileStatuses.UNDER_APPROVAL;
this.canBeApproved = !this.analysisRequired && !this.hasSuggestions;
this.canBeOpened = !this.isError && !this.isPending && this.numberOfAnalyses > 0;
this.isWorkable = !this.isProcessing && this.canBeOpened;
this.canBeOCRed = !this.excluded && !this.lastOCRTime && (this.isUnassigned || this.isUnderReview || this.isUnderApproval);
if (fileAttributesConfig) {

View File

@ -1,3 +1,5 @@
import { List } from '@iqser/common-ui';
export const WorkflowFileStatuses = {
APPROVED: 'APPROVED',
UNASSIGNED: 'UNASSIGNED',
@ -20,3 +22,11 @@ export const ProcessingFileStatuses = {
} as const;
export type ProcessingFileStatus = keyof typeof ProcessingFileStatuses;
export const isProcessingStatuses: List<ProcessingFileStatus> = [
ProcessingFileStatuses.REPROCESS,
ProcessingFileStatuses.FULLREPROCESS,
ProcessingFileStatuses.OCR_PROCESSING,
ProcessingFileStatuses.INDEXING,
ProcessingFileStatuses.PROCESSING,
] as const;