From 3408655c8223aafdc5fa63c28c2c01339c4f4186 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 15 Jul 2022 15:26:38 +0300 Subject: [PATCH] RED-3687 - undone changes for file preview component --- .../components/comments/comments.component.ts | 13 +- .../file-preview-screen.component.html | 20 +-- .../file-preview-screen.component.ts | 119 +++++++++--------- .../services/manual-redaction.service.ts | 2 +- .../red-ui/src/app/utils/context.component.ts | 44 ++----- 5 files changed, 91 insertions(+), 107 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts b/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts index f0eab09e1..c8d9027b7 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts @@ -11,13 +11,18 @@ import { FilePreviewStateService } from '../../services/file-preview-state.servi import { ManualRedactionService } from '../../services/manual-redaction.service'; import { ContextComponent } from '@utils/context.component'; +interface CommentsTemplate { + dossier: Dossier; + file: File; +} + @Component({ selector: 'redaction-comments', templateUrl: './comments.component.html', styleUrls: ['./comments.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class CommentsComponent extends ContextComponent implements OnInit { +export class CommentsComponent extends ContextComponent implements OnInit { @Input() annotation: AnnotationWrapper; readonly trackBy = trackByFactory(); readonly file$: Observable; @@ -47,7 +52,11 @@ export class CommentsComponent extends ContextComponent implements OnInit { }), ); - super._initContext([{ file: this.file$ }, { dossier: this.dossier$ }, this.hiddenComments$]); + super._initContext({ + file: this.file$, + dossier: this.dossier$, + hiddenComments: this.hiddenComments$, + }); } async addComment(value: string): Promise { diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html index 31f5076ab..19f0302e7 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.html @@ -1,22 +1,22 @@ - -
+ +