added reload single active file
This commit is contained in:
parent
0e35fb25ef
commit
57826e891d
@ -164,8 +164,9 @@ export class FilePreviewScreenComponent implements OnInit {
|
|||||||
|
|
||||||
openManualRedactionDialog($event: ManualRedactionEntryWrapper) {
|
openManualRedactionDialog($event: ManualRedactionEntryWrapper) {
|
||||||
this.ngZone.run(() => {
|
this.ngZone.run(() => {
|
||||||
this._dialogRef = this._dialogService.openManualRedactionDialog($event, (response: ManualAnnotationResponse) => {
|
this._dialogRef = this._dialogService.openManualRedactionDialog($event, async (response: ManualAnnotationResponse) => {
|
||||||
if (response?.annotationId) {
|
if (response?.annotationId) {
|
||||||
|
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||||
this._cleanupAndRedrawManualAnnotations(response.annotationId);
|
this._cleanupAndRedrawManualAnnotations(response.annotationId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -381,11 +382,12 @@ export class FilePreviewScreenComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
annotationsChangedByReviewAction(annotation: AnnotationWrapper) {
|
async annotationsChangedByReviewAction(annotation: AnnotationWrapper) {
|
||||||
const viewerAnnotation = this.activeViewer.annotManager.getAnnotationById(annotation.id);
|
const viewerAnnotation = this.activeViewer.annotManager.getAnnotationById(annotation.id);
|
||||||
if (viewerAnnotation) {
|
if (viewerAnnotation) {
|
||||||
this.activeViewer.annotManager.deleteAnnotation(viewerAnnotation, true, true);
|
this.activeViewer.annotManager.deleteAnnotation(viewerAnnotation, true, true);
|
||||||
}
|
}
|
||||||
|
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||||
this._cleanupAndRedrawManualAnnotations(annotation.id);
|
this._cleanupAndRedrawManualAnnotations(annotation.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -186,6 +186,21 @@ export class AppStateService {
|
|||||||
return found ? found.files : [];
|
return found ? found.files : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async reloadActiveFile() {
|
||||||
|
const oldProcessedDate = this.activeFile.lastProcessed;
|
||||||
|
const activeFile = await this._statusControllerService.getFileStatus(this.activeProjectId, this.activeFileId).toPromise();
|
||||||
|
|
||||||
|
const activeFileWrapper = new FileStatusWrapper(activeFile, this._userService.getNameForId(activeFile.currentReviewer));
|
||||||
|
this.activeProject.files = this.activeProject.files.map((file) => (file.fileId === activeFileWrapper.fileId ? activeFileWrapper : file));
|
||||||
|
|
||||||
|
this._computeStats();
|
||||||
|
if (activeFileWrapper.lastProcessed !== oldProcessedDate) {
|
||||||
|
this.fileReanalysed.emit(activeFileWrapper);
|
||||||
|
}
|
||||||
|
this.fileChanged.emit(activeFileWrapper);
|
||||||
|
return activeFileWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
async getFiles(project?: ProjectWrapper) {
|
async getFiles(project?: ProjectWrapper) {
|
||||||
if (!project) {
|
if (!project) {
|
||||||
project = this.activeProject;
|
project = this.activeProject;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user