Merge branch 'RED-9937' into 'master'

RED-9937: made preview tab available & trigger reanalysis when required.

See merge request redactmanager/red-ui!561
This commit is contained in:
Dan Percic 2024-09-04 12:39:59 +02:00
commit eae53022ee
2 changed files with 8 additions and 5 deletions

View File

@ -27,7 +27,7 @@ export class ViewSwitchComponent {
});
protected readonly canSwitchToRedactedView = computed(() => {
const file = this._state.file();
return !file.analysisRequired && !file.excluded && !file.isError;
return !file.excluded && !file.isError;
});
protected readonly canSwitchToEarmarksView = computed(() => {
const file = this._state.file();

View File

@ -152,6 +152,13 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
this._fileDataService.loadAnnotations(file).then();
});
effect(() => {
const file = this.state.file();
if (file.analysisRequired && !file.excludedFromAutomaticAnalysis) {
this._reanalysisService.reanalyzeFilesForDossier([file], file.dossierId, { force: true }).then();
}
});
effect(
() => {
if (this._documentViewer.loaded()) {
@ -350,10 +357,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
this.userPreferenceService.saveLastOpenedFileForDossier(this.dossierId, this.fileId).then();
this.#subscribeToFileUpdates();
if (file?.analysisRequired && !file.excludedFromAutomaticAnalysis) {
await this._reanalysisService.reanalyzeFilesForDossier([file], this.dossierId, { force: true });
}
this.pdfProxyService.configureElements();
this.#restoreOldFilters();
this.pdf.instance.UI.hotkeys.on('esc', this.handleEscInsideViewer);