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), 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",