From 971a00bd55ec20ab85f2c8c2dacded64088cd053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Sat, 7 Nov 2020 18:08:02 +0200 Subject: [PATCH] Reanalyse tooltip --- .../file-preview-screen.component.html | 14 ++- .../file-preview-screen.component.ts | 86 ++++++------------- .../project-listing-screen.component.html | 10 +-- .../project-details.component.html | 2 +- .../project-overview-screen.component.html | 43 +++++----- .../upload-status-overlay.component.html | 8 +- apps/red-ui/src/assets/i18n/en.json | 2 +- apps/red-ui/src/assets/styles/red-button.scss | 6 +- .../src/assets/styles/red-tooltips.scss | 34 +++++--- 9 files changed, 100 insertions(+), 105 deletions(-) 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 48afed6cd..d6f91925f 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 @@ -50,7 +50,7 @@ : 'report.unavailable-single' ) | translate " - [matTooltipPosition]="'above'" + matTooltipPosition="above" > @@ -83,7 +91,7 @@ : 'project-overview.under-approval' ) | translate " - [matTooltipPosition]="'above'" + matTooltipPosition="above" > @@ -98,7 +106,7 @@ : 'project-overview.under-review' ) | translate " - [matTooltipPosition]="'above'" + matTooltipPosition="above" color="accent" mat-icon-button > 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 d6f9cd197..bcb6dde60 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 @@ -8,11 +8,7 @@ import { ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { - ReanalysisControllerService, - ViewedPages, - ViewedPagesControllerService -} from '@redaction/red-ui-http'; +import { ReanalysisControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '../../../state/app-state.service'; import { WebViewerInstance } from '@pdftron/webviewer'; import { PdfViewerComponent } from '../pdf-viewer/pdf-viewer.component'; @@ -34,9 +30,10 @@ 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 { NotificationService } from '../../../notification/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { FileStatusWrapper } from '../model/file-status.wrapper'; +import { MatTooltip } from '@angular/material/tooltip'; const KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; @@ -46,6 +43,30 @@ const KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; styleUrls: ['./file-preview-screen.component.scss'] }) export class FilePreviewScreenComponent implements OnInit { + private projectId: string; + private _activeViewer: 'ANNOTATED' | 'REDACTED' = 'ANNOTATED'; + private instance: WebViewerInstance; + private _dialogRef: MatDialogRef; + + @ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent; + @ViewChild('annotationsElement') private _annotationsElement: ElementRef; + @ViewChild('quickNavigation') private _quickNavigationElement: ElementRef; + @ViewChild('reanalyseTooltip') private _reanalyseTooltip: MatTooltip; + + public fileData: FileDataModel; + public fileId: string; + public annotations: AnnotationWrapper[] = []; + public displayedAnnotations: { [key: number]: { annotations: AnnotationWrapper[] } } = {}; + public selectedAnnotation: AnnotationWrapper; + public pagesPanelActive = true; + public viewReady = false; + public filters: FilterModel[]; + + private _activeMenuAnnotation: AnnotationWrapper; + loadingMessage: string; + + canPerformAnnotationActions: boolean; + constructor( public readonly appStateService: AppStateService, public readonly userService: UserService, @@ -61,7 +82,6 @@ export class FilePreviewScreenComponent implements OnInit { private readonly _manualAnnotationService: ManualAnnotationService, private readonly _fileDownloadService: FileDownloadService, private readonly _reanalysisControllerService: ReanalysisControllerService, - private ngZone: NgZone ) { this._activatedRoute.params.subscribe((params) => { @@ -95,29 +115,6 @@ export class FilePreviewScreenComponent implements OnInit { return this.instance?.docViewer?.getCurrentPage(); } - private projectId: string; - private _activeViewer: 'ANNOTATED' | 'REDACTED' = 'ANNOTATED'; - private instance: WebViewerInstance; - private _dialogRef: MatDialogRef; - - @ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent; - @ViewChild('annotationsElement') private _annotationsElement: ElementRef; - @ViewChild('quickNavigation') private _quickNavigationElement: ElementRef; - - public fileData: FileDataModel; - public fileId: string; - public annotations: AnnotationWrapper[] = []; - public displayedAnnotations: { [key: number]: { annotations: AnnotationWrapper[] } } = {}; - public selectedAnnotation: AnnotationWrapper; - public pagesPanelActive = true; - public viewReady = false; - public filters: FilterModel[]; - - private _activeMenuAnnotation: AnnotationWrapper; - loadingMessage: string; - - canPerformAnnotationActions: boolean; - get canNotSwitchToRedactedView() { return ( this.appStateService.fileNotUpToDateWithDictionary() || @@ -488,7 +485,7 @@ export class FilePreviewScreenComponent implements OnInit { viewerReady($event: WebViewerInstance) { this.instance = $event; this.viewReady = true; - this._displayNewRuleToast(); + this._reanalyseTooltip.show(); this._cleanupAndRedrawManualAnnotations(); } @@ -561,31 +558,4 @@ export class FilePreviewScreenComponent implements OnInit { $event.stopPropagation(); this._fileActionService.undoApproveOrUnderApproval().subscribe(() => {}); } - - 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 a1faf643e..3cac4f300 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 @@ -166,7 +166,7 @@ diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html index 1dadeee90..3402ba452 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html +++ b/apps/red-ui/src/app/screens/project-overview-screen/project-details/project-details.component.html @@ -17,7 +17,7 @@ ) | translate " *ngIf="appStateService.isActiveProjectOwnerAndManager" - [matTooltipPosition]="'above'" + matTooltipPosition="above" >