From 1749cb20c45fa9440b6e0e6c81b45c3f5e439ae2 Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Sun, 30 Jan 2022 10:52:07 +0200 Subject: [PATCH 1/2] updated text --- apps/red-ui/src/assets/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 06c421b0a..dd08da1a3 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1117,7 +1117,7 @@ "fullscreen": "Full Screen (F)", "last-reviewer": "Last Reviewed by:", "no-data": { - "title": "There are no annotations on this page." + "title": "There have been no changes to this page." }, "quick-nav": { "jump-first": "Jump to first page", From b94884a09dc437bcf6b4210d3dba2f385a2f2ab7 Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Sun, 30 Jan 2022 11:08:07 +0200 Subject: [PATCH 2/2] fixed .find of undefined manualRedaction --- .../src/app/models/file/annotation.wrapper.ts | 18 ++++++++++-------- .../src/app/models/file/file-data.model.ts | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 607c8e3c9..34643f918 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -67,6 +67,7 @@ export class AnnotationWrapper { hasBeenForcedHint: boolean; hasBeenForcedRedaction: boolean; hasBeenRemovedByManualOverride: boolean; + redactionLogEntry: any; get isChangeLogRemoved() { return this.changeLogType === 'REMOVED'; @@ -232,7 +233,7 @@ export class AnnotationWrapper { get legalBasis() { return this.legalBasisChangeValue || this.legalBasisValue; } - redactionLogEntry: any; + static fromData(redactionLogEntry?: RedactionLogEntry) { const annotationWrapper = new AnnotationWrapper(); @@ -257,22 +258,22 @@ export class AnnotationWrapper { annotationWrapper.section = redactionLogEntry.section; annotationWrapper.reference = redactionLogEntry.reference || []; annotationWrapper.rectangle = redactionLogEntry.rectangle; - annotationWrapper.hasBeenResized = !!redactionLogEntry.manualChanges.find( + annotationWrapper.hasBeenResized = !!redactionLogEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionType.RESIZE && c.annotationStatus === LogEntryStatus.APPROVED, ); - annotationWrapper.hasBeenRecategorized = !!redactionLogEntry.manualChanges.find( + annotationWrapper.hasBeenRecategorized = !!redactionLogEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionType.RECATEGORIZE && c.annotationStatus === LogEntryStatus.APPROVED, ); - annotationWrapper.hasLegalBasisChanged = !!redactionLogEntry.manualChanges.find( + annotationWrapper.hasLegalBasisChanged = !!redactionLogEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionType.LEGAL_BASIS_CHANGE && c.annotationStatus === LogEntryStatus.APPROVED, ); - annotationWrapper.hasBeenForcedHint = !!redactionLogEntry.manualChanges.find( + annotationWrapper.hasBeenForcedHint = !!redactionLogEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionType.FORCE_HINT && c.annotationStatus === LogEntryStatus.APPROVED, ); - annotationWrapper.hasBeenForcedRedaction = !!redactionLogEntry.manualChanges.find( + annotationWrapper.hasBeenForcedRedaction = !!redactionLogEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionType.FORCE_REDACT && c.annotationStatus === LogEntryStatus.APPROVED, ); - annotationWrapper.hasBeenRemovedByManualOverride = !!redactionLogEntry.manualChanges.find( + annotationWrapper.hasBeenRemovedByManualOverride = !!redactionLogEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionType.REMOVE_LOCALLY && c.annotationStatus === LogEntryStatus.APPROVED, ); @@ -297,7 +298,7 @@ export class AnnotationWrapper { return; } - if (redactionLogEntryWrapper.manualChanges.length) { + if (redactionLogEntryWrapper.manualChanges?.length) { const lastManualChange = redactionLogEntryWrapper.manualChanges[redactionLogEntryWrapper.manualChanges.length - 1]; annotationWrapper.pending = !lastManualChange.processed; @@ -375,6 +376,7 @@ export class AnnotationWrapper { case LogEntryStatus.REQUESTED: return 'suggestion-add'; } + break; case ManualRedactionType.ADD_TO_DICTIONARY: switch (lastManualChange.annotationStatus) { case LogEntryStatus.APPROVED: diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 2ffe2bb08..6f508752a 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -105,7 +105,7 @@ export class FileDataModel { ); if ( - redactionLogEntry.manualChanges.find( + redactionLogEntry.manualChanges?.find( mc => mc.manualRedactionType === ManualRedactionType.ADD_TO_DICTIONARY && (mc.annotationStatus === LogEntryStatus.APPROVED || mc.annotationStatus === LogEntryStatus.REQUESTED),