Progress Indicator for file reanalysis
This commit is contained in:
parent
13be7d76c4
commit
5634bb5984
@ -114,6 +114,7 @@ import { ScrollingModule } from '@angular/cdk/scrolling';
|
|||||||
import { RemoveAnnotationsDialogComponent } from './dialogs/remove-annotations-dialog/remove-annotations-dialog.component';
|
import { RemoveAnnotationsDialogComponent } from './dialogs/remove-annotations-dialog/remove-annotations-dialog.component';
|
||||||
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
||||||
import { ComboChartComponent, ComboSeriesVerticalComponent } from './screens/admin/license-information-screen/combo-chart';
|
import { ComboChartComponent, ComboSeriesVerticalComponent } from './screens/admin/license-information-screen/combo-chart';
|
||||||
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||||
|
|
||||||
export function HttpLoaderFactory(httpClient: HttpClient) {
|
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||||||
return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json');
|
return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json');
|
||||||
@ -406,7 +407,8 @@ const matImports = [
|
|||||||
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
||||||
ColorPickerModule,
|
ColorPickerModule,
|
||||||
AceEditorModule,
|
AceEditorModule,
|
||||||
ScrollingModule
|
ScrollingModule,
|
||||||
|
MatProgressBarModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -280,7 +280,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<redaction-full-page-loading-indicator [displayed]="!viewReady" [message]="loadingMessage"></redaction-full-page-loading-indicator>
|
<redaction-full-page-loading-indicator [displayed]="!viewReady" [showIndicator]="false">
|
||||||
|
<h1 class="heading-l loading" *ngIf="loadingMessage">{{ loadingMessage | translate }}</h1>
|
||||||
|
<div class="analysis-progress">
|
||||||
|
<mat-progress-bar
|
||||||
|
[mode]="analysisProgress < 100 ? 'determinate' : 'indeterminate'"
|
||||||
|
[value]="analysisProgress"
|
||||||
|
*ngIf="analysisInterval"
|
||||||
|
></mat-progress-bar>
|
||||||
|
</div>
|
||||||
|
</redaction-full-page-loading-indicator>
|
||||||
|
|
||||||
<ng-template #annotationFilterTemplate let-filter="filter">
|
<ng-template #annotationFilterTemplate let-filter="filter">
|
||||||
<redaction-type-filter *ngIf="filter.topLevelFilter" [filter]="filter"></redaction-type-filter>
|
<redaction-type-filter *ngIf="filter.topLevelFilter" [filter]="filter"></redaction-type-filter>
|
||||||
|
|||||||
@ -173,3 +173,9 @@ redaction-dictionary-annotation-icon {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.analysis-progress {
|
||||||
|
padding: 12px 20px;
|
||||||
|
max-width: 400px;
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|||||||
@ -104,6 +104,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
|||||||
get displayData() {
|
get displayData() {
|
||||||
return this.fileData?.fileData;
|
return this.fileData?.fileData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private projectId: string;
|
private projectId: string;
|
||||||
private _instance: WebViewerInstance;
|
private _instance: WebViewerInstance;
|
||||||
private _dialogRef: MatDialogRef<any>;
|
private _dialogRef: MatDialogRef<any>;
|
||||||
@ -114,6 +115,10 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
|||||||
public reviewerForm: FormGroup;
|
public reviewerForm: FormGroup;
|
||||||
public shouldDeselectAnnotationsOnPageChange = true;
|
public shouldDeselectAnnotationsOnPageChange = true;
|
||||||
|
|
||||||
|
public analysisProgressInSeconds: number = 0;
|
||||||
|
public analysisProgress: number;
|
||||||
|
public analysisInterval: number;
|
||||||
|
|
||||||
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
|
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
|
||||||
@ViewChild('annotationsElement') private _annotationsElement: ElementRef;
|
@ViewChild('annotationsElement') private _annotationsElement: ElementRef;
|
||||||
@ViewChild('quickNavigation') private _quickNavigationElement: ElementRef;
|
@ViewChild('quickNavigation') private _quickNavigationElement: ElementRef;
|
||||||
@ -201,6 +206,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
|||||||
this._loadFileData(true).subscribe(() => {
|
this._loadFileData(true).subscribe(() => {
|
||||||
this.viewReady = true;
|
this.viewReady = true;
|
||||||
this.loadingMessage = null;
|
this.loadingMessage = null;
|
||||||
|
this._stopAnalysisTimer();
|
||||||
this._updateCanPerformActions();
|
this._updateCanPerformActions();
|
||||||
this._cleanupAndRedrawManualAnnotations();
|
this._cleanupAndRedrawManualAnnotations();
|
||||||
});
|
});
|
||||||
@ -620,6 +626,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
case 'reanalyse':
|
case 'reanalyse':
|
||||||
this.viewReady = false;
|
this.viewReady = false;
|
||||||
|
this._startAnalysisTimer();
|
||||||
this.loadingMessage = 'file-preview.reanalyse-file';
|
this.loadingMessage = 'file-preview.reanalyse-file';
|
||||||
await this._loadFileData().toPromise();
|
await this._loadFileData().toPromise();
|
||||||
this._updateCanPerformActions();
|
this._updateCanPerformActions();
|
||||||
@ -630,6 +637,31 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _startAnalysisTimer() {
|
||||||
|
this._stopAnalysisTimer();
|
||||||
|
|
||||||
|
if (this.appStateService.activeFile.analysisDuration > 0) {
|
||||||
|
this.analysisProgress = 0;
|
||||||
|
this.analysisProgressInSeconds = 0;
|
||||||
|
|
||||||
|
this.analysisInterval = setInterval(() => {
|
||||||
|
this.analysisProgressInSeconds += 1;
|
||||||
|
this.analysisProgress = (this.analysisProgressInSeconds * 100) / (this.appStateService.activeFile.analysisDuration / 1000);
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
this.analysisInterval = 0;
|
||||||
|
this.analysisProgress = 0;
|
||||||
|
this.analysisProgressInSeconds = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _stopAnalysisTimer() {
|
||||||
|
if (this.analysisInterval) {
|
||||||
|
clearInterval(this.analysisInterval);
|
||||||
|
this.analysisInterval = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async assignToMe() {
|
public async assignToMe() {
|
||||||
await this._fileActionService.assignToMe(this.fileData.fileStatus, async () => {
|
await this._fileActionService.assignToMe(this.fileData.fileStatus, async () => {
|
||||||
await this.appStateService.reloadActiveFile();
|
await this.appStateService.reloadActiveFile();
|
||||||
@ -681,6 +713,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
|||||||
this.viewMode = $event.value;
|
this.viewMode = $event.value;
|
||||||
this.updateViewMode();
|
this.updateViewMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadOriginalFile() {
|
downloadOriginalFile() {
|
||||||
this._fileManagementControllerService
|
this._fileManagementControllerService
|
||||||
.downloadOriginalFile(this.projectId, this.fileId, true, this.fileData.fileStatus.lastUploaded, 'response')
|
.downloadOriginalFile(this.projectId, this.fileId, true, this.fileData.fileStatus.lastUploaded, 'response')
|
||||||
|
|||||||
@ -4,6 +4,10 @@ import { StatusSorter } from '../../../common/sorters/status-sorter';
|
|||||||
export class FileStatusWrapper {
|
export class FileStatusWrapper {
|
||||||
constructor(public fileStatus: FileStatus, public reviewerName: string) {}
|
constructor(public fileStatus: FileStatus, public reviewerName: string) {}
|
||||||
|
|
||||||
|
get analysisDuration() {
|
||||||
|
return this.fileStatus.analysisDuration;
|
||||||
|
}
|
||||||
|
|
||||||
get lastProcessed() {
|
get lastProcessed() {
|
||||||
return this.fileStatus.lastProcessed;
|
return this.fileStatus.lastProcessed;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<section class="full-page-load-section" *ngIf="displayed"></section>
|
<section class="full-page-load-section" *ngIf="displayed"></section>
|
||||||
<section class="full-page-load-spinner" *ngIf="displayed">
|
<section class="full-page-load-spinner" *ngIf="displayed">
|
||||||
<mat-spinner diameter="40"></mat-spinner>
|
<mat-spinner diameter="40" *ngIf="showIndicator"></mat-spinner>
|
||||||
<h1 class="heading-l" *ngIf="message">{{ message | translate }}</h1>
|
<ng-content></ng-content>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@ -7,5 +7,5 @@ import { Component, Input } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class FullPageLoadingIndicatorComponent {
|
export class FullPageLoadingIndicatorComponent {
|
||||||
@Input() displayed = false;
|
@Input() displayed = false;
|
||||||
@Input() message: string;
|
@Input() showIndicator: boolean = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -287,7 +287,7 @@
|
|||||||
"show-redacted-view": "Show Redacted Preview",
|
"show-redacted-view": "Show Redacted Preview",
|
||||||
"cannot-show-redacted-view": "Redactions out of sync. Redacted Preview only available after reanalysis",
|
"cannot-show-redacted-view": "Redactions out of sync. Redacted Preview only available after reanalysis",
|
||||||
"reanalyse-notification": "This document was not processed with the latest rule/dictionary set. Analyze now to get updated annotations.",
|
"reanalyse-notification": "This document was not processed with the latest rule/dictionary set. Analyze now to get updated annotations.",
|
||||||
"reanalyse-file": "File reanalysis in progress... ",
|
"reanalyse-file": "File reanalysis in progress",
|
||||||
"view-toggle": "Redacted View",
|
"view-toggle": "Redacted View",
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"quick-navigation": "Quick Navigation",
|
"quick-navigation": "Quick Navigation",
|
||||||
|
|||||||
@ -14,6 +14,10 @@
|
|||||||
* Object containing information on a specific file.
|
* Object containing information on a specific file.
|
||||||
*/
|
*/
|
||||||
export interface FileStatus {
|
export interface FileStatus {
|
||||||
|
/**
|
||||||
|
* Time of last analysis
|
||||||
|
*/
|
||||||
|
analysisDuration?: number;
|
||||||
/**
|
/**
|
||||||
* Date and time when the file was added to the system.
|
* Date and time when the file was added to the system.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user