From 819df0497c36e3d2f7537ffcf2234d4332082fff Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Fri, 30 Oct 2020 21:05:54 +0200 Subject: [PATCH] fixed content of self-drawn annotations --- .../screens/file/model/annotation.wrapper.ts | 18 ++++++++++++------ .../src/lib/model/redactionLogEntry.ts | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts b/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts index f9da8f02a..00be497e8 100644 --- a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts +++ b/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts @@ -27,7 +27,7 @@ export class AnnotationWrapper { this.firstTopLeftPoint = redactionLogEntry.positions[0]?.topLeft; this.pageNumber = redactionLogEntry.positions[0]?.page; this.id = redactionLogEntry.id; - this.content = redactionLogEntry.reason; + this.content = this.createAnnotationContent(redactionLogEntry); } get manualRedactionOwner() { @@ -42,9 +42,15 @@ export class AnnotationWrapper { return this.firstTopLeftPoint.y; } - // private String createAnnotationContent(Entity entity) { - // - // return "\nRule " + entity.getMatchedRule() + " matched\n\n" + entity.getRedactionReason() + "\n\nLegal basis:" + entity - // .getLegalBasis() + "\n\nIn section: \"" + entity.getHeadline() + "\""; - // } + private createAnnotationContent(entry: RedactionLogEntry) { + // return "\nRule " + entry.matchedRule + " matched\n\n" + entry.reason + "\n\nLegal basis:" + entry.legalBasis + "\n\nIn section: \"" + entry.section + "\""; + return ( + entry.reason + + '\n\nLegal basis:' + + entry.legalBasis + + '\n\nIn section: "' + + entry.section + + '"' + ); + } } diff --git a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts index 4c8328346..d32d11772 100644 --- a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts +++ b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts @@ -15,6 +15,7 @@ export interface RedactionLogEntry { color?: Array; hint?: boolean; id?: string; + legalBasis?: string; manual?: boolean; positions?: Array; reason?: string; @@ -25,7 +26,6 @@ export interface RedactionLogEntry { type?: string; value?: string; } - export namespace RedactionLogEntry { export type StatusEnum = 'REQUESTED' | 'APPROVED' | 'DECLINED'; export const StatusEnum = {