From e8e8687ee9b2ae72a41f5fa6c794c1cb682b76d8 Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Fri, 7 Jan 2022 22:25:58 +0200 Subject: [PATCH] dialog open on button click and annotation input --- .../annotation-references-dialog.component.ts | 19 +++++----- .../file-workload.component.html | 1 - .../file-workload/file-workload.component.ts | 1 - .../file-preview-screen.component.html | 6 ++++ .../file-preview-screen.component.ts | 35 +++++++++++++++++++ 5 files changed, 49 insertions(+), 13 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-references-dialog/annotation-references-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-references-dialog/annotation-references-dialog.component.ts index a52d2d34c..ea3dcc01f 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-references-dialog/annotation-references-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotation-references-dialog/annotation-references-dialog.component.ts @@ -1,20 +1,17 @@ -import { Component } from '@angular/core'; -import { BaseDialogComponent } from '@iqser/common-ui'; +import { Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { AnnotationWrapper } from '@models/file/annotation.wrapper'; @Component({ selector: 'redaction-annotation-references-dialog', templateUrl: './annotation-references-dialog.component.html', styleUrls: ['./annotation-references-dialog.component.scss'], }) -export class AnnotationReferencesDialogComponent extends BaseDialogComponent { +export class AnnotationReferencesDialogComponent implements OnInit { // eslint-disable-next-line @typescript-eslint/no-useless-constructor - constructor() { - super(); + @Input() annotation: AnnotationWrapper; + constructor() {} + + ngOnInit(): void { + console.log(this.annotation); } - - changed: boolean; - disabled: boolean; - valid: boolean; - - save(): void {} } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html index 375e46f74..71c41366d 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html @@ -50,7 +50,6 @@ (); @Output() readonly selectPage = new EventEmitter(); @Output() readonly annotationsChanged = new EventEmitter(); - @Output() readonly seeReferences = new EventEmitter(); displayedPages: number[] = []; pagesPanelActive = true; readonly displayedAnnotations$: Observable>; diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html index b90dd8d93..1b5ce036a 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html @@ -118,11 +118,17 @@ + + diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 93db957e2..ee38046dd 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -88,6 +88,8 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni ready = false; private _instance: WebViewerInstance; private _lastPage: string; + private _seeReferences = false; + private _reloadFileOnReanalysis = false; @ViewChild('fileWorkloadComponent') private readonly _workloadComponent: FileWorkloadComponent; @ViewChild('annotationFilterTemplate', { read: TemplateRef, @@ -152,6 +154,39 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni return this._stateService.fileData; } + private _setActiveViewerPage() { + const currentPage = this._instance?.Core.documentViewer?.getCurrentPage(); + if (!currentPage) { + this.activeViewerPage = 1; + } else { + this.activeViewerPage = this.viewModeService.isCompare + ? currentPage % 2 === 0 + ? currentPage / 2 + : (currentPage + 1) / 2 + : currentPage; + } + } + + set seeReferences(e) { + this._seeReferences = e; + } + + get seeReferences(): boolean { + return this._seeReferences; + } + + private get _viewDocumentInfo$() { + return this.documentInfoService.shown$.pipe( + tap(value => { + if (value) { + this.multiSelectService.deactivate(); + this.excludedPagesService.hide(); + } + }), + shareDistinctLast(), + ); + } + private get _canPerformAnnotationActions$() { return combineLatest([ this._stateService.fileData$.pipe(switchMap(fileData => fileData.file$)),