diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html
index f95bc6c4a..60fdc9626 100644
--- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html
+++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html
@@ -7,7 +7,12 @@
diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts
index 4778f5077..9eb8482db 100644
--- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts
+++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts
@@ -30,6 +30,8 @@ import { AnnotationDrawService } from '../service/annotation-draw.service';
import { AnnotationProcessingService } from '../service/annotation-processing.service';
import { FilterModel } from '../../../common/filter/model/filter.model';
import { tap } from 'rxjs/operators';
+import { NotificationService, NotificationType } from '../../../notification/notification.service';
+import { TranslateService } from '@ngx-translate/core';
const KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
@@ -46,6 +48,8 @@ export class FilePreviewScreenComponent implements OnInit {
private readonly _activatedRoute: ActivatedRoute,
private readonly _dialogService: DialogService,
private readonly _router: Router,
+ private readonly _notificationService: NotificationService,
+ private readonly _translateService: TranslateService,
private readonly _annotationProcessingService: AnnotationProcessingService,
private readonly _annotationDrawService: AnnotationDrawService,
private readonly _fileActionService: FileActionService,
@@ -107,7 +111,9 @@ export class FilePreviewScreenComponent implements OnInit {
loadingMessage: string;
public ngOnInit(): void {
- this._loadFileData().subscribe(() => {});
+ this._loadFileData().subscribe(() => {
+ this._displayNewRuleToast();
+ });
this.appStateService.fileStatusChanged.subscribe((fileStatus: FileStatus) => {
if (fileStatus.fileId === this.fileId) {
this._loadFileData().subscribe(() => {
@@ -155,8 +161,8 @@ export class FilePreviewScreenComponent implements OnInit {
);
}
- public reanalyseFile($event: MouseEvent) {
- $event.stopPropagation();
+ public reanalyseFile($event?: MouseEvent) {
+ $event?.stopPropagation();
this.viewReady = false;
this.loadingMessage = 'file-preview.reanalyse-file';
this._reanalysisControllerService
@@ -510,4 +516,31 @@ export class FilePreviewScreenComponent implements OnInit {
this._fileActionService.setApproved(this.appStateService.activeFile);
}
}
+
+ private _displayNewRuleToast() {
+ if (this.appStateService.fileNotUpToDateWithDictionary()) {
+ this._notificationService.showToastNotification(
+ `${this._translateService.instant('project-overview.new-rule.toast.message-file')}`,
+ null,
+ NotificationType.WARNING,
+ {
+ disableTimeOut: true,
+ positionClass: 'toast-top-left',
+ actions: [
+ {
+ title: this._translateService.instant(
+ 'project-overview.new-rule.toast.actions.reanalyse-file'
+ ),
+ action: () => this.reanalyseFile()
+ },
+ {
+ title: this._translateService.instant(
+ 'project-overview.new-rule.toast.actions.later'
+ )
+ }
+ ]
+ }
+ );
+ }
+ }
}
diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html
index 33f17af4a..1ed79bfc0 100644
--- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html
+++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html
@@ -215,7 +215,7 @@
@@ -240,7 +240,7 @@
diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
index 2082cbf10..31fe90b49 100644
--- a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
+++ b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
@@ -171,7 +171,7 @@
{{ fileStatus.filename }}