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) {
|
||||
this.ngZone.run(() => {
|
||||
this._dialogRef = this._dialogService.openManualRedactionDialog($event, (response: ManualAnnotationResponse) => {
|
||||
this._dialogRef = this._dialogService.openManualRedactionDialog($event, async (response: ManualAnnotationResponse) => {
|
||||
if (response?.annotationId) {
|
||||
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||
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);
|
||||
if (viewerAnnotation) {
|
||||
this.activeViewer.annotManager.deleteAnnotation(viewerAnnotation, true, true);
|
||||
}
|
||||
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
|
||||
this._cleanupAndRedrawManualAnnotations(annotation.id);
|
||||
}
|
||||
|
||||
|
||||
@ -186,6 +186,21 @@ export class AppStateService {
|
||||
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) {
|
||||
if (!project) {
|
||||
project = this.activeProject;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user