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 faa35213f..5d33b65f1 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 @@ -501,19 +501,26 @@ export class AnnotationActionsService { } private _getFalsePositiveText(annotation: AnnotationWrapper) { - if (annotation.canBeMarkedAsFalsePositive) { - let text: string; - if (annotation.hasTextAfter) { - text = getFirstRelevantTextPart(annotation.textAfter, 'FORWARD'); - return text ? (annotation.value + text).trim() : annotation.value; - } - if (annotation.hasTextAfter) { - text = getFirstRelevantTextPart(annotation.textBefore, 'BACKWARD'); - return text ? (text + annotation.value).trim() : annotation.value; - } else { - return annotation.value; - } + if (!annotation.canBeMarkedAsFalsePositive) { + return; } + + if (annotation.isRecommendation) { + return annotation.value; + } + + let text: string; + if (annotation.hasTextAfter) { + text = getFirstRelevantTextPart(annotation.textAfter, 'FORWARD'); + return text ? (annotation.value + text).trim() : annotation.value; + } + + if (annotation.hasTextBefore) { + text = getFirstRelevantTextPart(annotation.textBefore, 'BACKWARD'); + return text ? (text + annotation.value).trim() : annotation.value; + } + + return annotation.value; } private _convertPath(path: string): string {