RED-3958: return annotation value for false recommendations

This commit is contained in:
Dan Percic 2022-05-04 14:59:09 +03:00
parent 281d03de25
commit e484927f61

View File

@ -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 {