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 355c31935..509b98f4d 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -303,20 +303,24 @@ export class AnnotationWrapper implements IListable, Record { } } + private static _getLastRelevantManualChange(manualChanges: IManualChange[]) { + return manualChanges[manualChanges.length - 1]; + } + private static _setSuperType(annotationWrapper: AnnotationWrapper, redactionLogEntryWrapper: RedactionLogEntry) { if (redactionLogEntryWrapper.manualChanges?.length) { - const lastManualChange = redactionLogEntryWrapper.manualChanges[redactionLogEntryWrapper.manualChanges.length - 1]; + const lastRelevantManualChange = this._getLastRelevantManualChange(redactionLogEntryWrapper.manualChanges); - annotationWrapper.pending = !lastManualChange.processed; + annotationWrapper.pending = !lastRelevantManualChange.processed; annotationWrapper.superType = AnnotationWrapper._selectSuperType( redactionLogEntryWrapper, - lastManualChange, + lastRelevantManualChange, annotationWrapper.hintDictionary, ); - if (lastManualChange.annotationStatus === LogEntryStatus.REQUESTED) { - annotationWrapper.recategorizationType = lastManualChange.propertyChanges.type; + if (lastRelevantManualChange.annotationStatus === LogEntryStatus.REQUESTED) { + annotationWrapper.recategorizationType = lastRelevantManualChange.propertyChanges.type; } } else { if (redactionLogEntryWrapper.recommendation) { @@ -418,7 +422,7 @@ export class AnnotationWrapper implements IListable, Record { case LogEntryStatus.APPROVED: return SuperTypes.Redaction; case LogEntryStatus.DECLINED: - return SuperTypes.Skipped; + return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped; case LogEntryStatus.REQUESTED: return SuperTypes.SuggestionForceRedaction; } @@ -444,7 +448,7 @@ export class AnnotationWrapper implements IListable, Record { } else if (redactionLogEntry.hint) { return SuperTypes.Hint; } else { - return SuperTypes.Skipped; + return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped; } } case LogEntryStatus.REQUESTED: @@ -471,7 +475,7 @@ export class AnnotationWrapper implements IListable, Record { } else if (redactionLogEntry.hint) { return SuperTypes.Hint; } else { - return SuperTypes.Skipped; + return isHintDictionary ? SuperTypes.IgnoredHint : SuperTypes.Skipped; } case LogEntryStatus.REQUESTED: return SuperTypes.SuggestionResize; diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index e69136f35..faa35213f 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -396,7 +396,7 @@ export class AnnotationActionsService { annotationWrapper.resizing = true; const viewerAnnotation = this._pdf.annotationManager.getAnnotationById(annotationWrapper.id); - if (annotationWrapper.rectangle || annotationWrapper.imported) { + if (annotationWrapper.rectangle || annotationWrapper.imported || annotationWrapper.isImage) { this._pdf.deleteAnnotations([annotationWrapper.id]); const rectangleAnnotation = this.#generateRectangle(annotationWrapper); this._pdf.annotationManager.addAnnotation(rectangleAnnotation, { imported: true });