diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index 82e59f754..4cf536232 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -114,7 +114,7 @@ export function HttpLoaderFactory(httpClient: HttpClient) { NeedsWorkBadgeComponent, ProjectOverviewEmptyComponent, ProjectListingEmptyComponent, - AnnotationActionsComponent + AnnotationActionsComponent, ProjectListingEmptyComponent, ProjectListingDetailsComponent ], diff --git a/apps/red-ui/src/app/dialogs/dialog.service.ts b/apps/red-ui/src/app/dialogs/dialog.service.ts index 4fcb1aed4..182759fda 100644 --- a/apps/red-ui/src/app/dialogs/dialog.service.ts +++ b/apps/red-ui/src/app/dialogs/dialog.service.ts @@ -110,7 +110,7 @@ export class DialogService { ref.afterClosed().subscribe((result) => { if (result) { this._manualAnnotationService - .acceptSuggestion(annotation.id) + .approveRequest(annotation.id) .subscribe((acceptResult) => { if (callback) { callback(acceptResult); @@ -136,7 +136,7 @@ export class DialogService { ref.afterClosed().subscribe((result) => { if (result) { - this._manualAnnotationService.rejectSuggestion(annotation).subscribe(() => { + this._manualAnnotationService.declineOrRemoveRequest(annotation).subscribe(() => { rejectCallback(); }); } diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 643b12a66..d1b57c1c4 100644 --- a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -60,34 +60,18 @@ export class ManualAnnotationDialogComponent implements OnInit { handleAddRedaction() { this._enhanceManualRedaction(this.manualRedactionEntryWrapper.manualRedactionEntry); - - if (this.isDictionaryRequest) { - this._manualAnnotationService - .makeDictionaryEntry(this.manualRedactionEntryWrapper.manualRedactionEntry) - .subscribe( - (response) => { - this.dialogRef.close( - new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response) - ); - }, - () => { - this.dialogRef.close(); - } - ); - } else { - this._manualAnnotationService - .makeRedaction(this.manualRedactionEntryWrapper.manualRedactionEntry) - .subscribe( - (response) => { - this.dialogRef.close( - new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response) - ); - }, - () => { - this.dialogRef.close(); - } - ); - } + this._manualAnnotationService + .addAnnotation(this.manualRedactionEntryWrapper.manualRedactionEntry) + .subscribe( + (response) => { + this.dialogRef.close( + new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response) + ); + }, + () => { + this.dialogRef.close(); + } + ); } get title() { diff --git a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html index 278d669a3..f27c78cf4 100644 --- a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html @@ -1,12 +1,8 @@ -
+
@@ -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.scss b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss index ec2d62c70..50d6755fc 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss @@ -19,6 +19,7 @@ redaction-pdf-viewer { .filename { display: flex; justify-content: center; + align-items: center; } .right-fixed-container { 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" >
-
-
- {{ fileStatus.filename }} +
+
+
+ {{ fileStatus.filename }} +
+
-
@@ -239,7 +242,7 @@ fileStatus.isError " [matTooltip]="'project-overview.delete.action' | translate" - [matTooltipPosition]="'above'" + matTooltipPosition="above" color="accent" mat-icon-button > @@ -257,7 +260,7 @@ appStateService.isActiveProjectOwnerAndManager && !isError(fileStatus) " - [matTooltipPosition]="'above'" + matTooltipPosition="above" >