hide declined suggestions, fix false positive
This commit is contained in:
parent
5c75ec2e04
commit
d5485882e4
@ -186,10 +186,10 @@ export class AnnotationActionsService {
|
||||
let text;
|
||||
if (annotation.hasTextAfter) {
|
||||
text = getFirstRelevantTextPart(annotation.textAfter, 'FORWARD');
|
||||
return annotation.value + text;
|
||||
return (annotation.value + text).trim();
|
||||
} else {
|
||||
text = getFirstRelevantTextPart(annotation.textBefore, 'BACKWARD');
|
||||
return text + annotation.value;
|
||||
return (text + annotation.value).trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,13 +41,15 @@ export class FileDataModel {
|
||||
|
||||
this.redactionLog.redactionLogEntry.forEach((redactionLogEntry) => {
|
||||
// false positive entries from the redaction-log need to be skipped
|
||||
if (redactionLogEntry.type !== 'false_positive') {
|
||||
// copy the redactionLog Entry
|
||||
const redactionLogEntryWrapper: RedactionLogEntryWrapper = { actionPendingReanalysis: false };
|
||||
Object.assign(redactionLogEntryWrapper, redactionLogEntry);
|
||||
redactionLogEntryWrapper.comments = this.manualRedactions.comments[redactionLogEntryWrapper.id];
|
||||
result.push(redactionLogEntryWrapper);
|
||||
if (redactionLogEntry.type === 'false_positive') {
|
||||
return;
|
||||
}
|
||||
|
||||
// copy the redactionLog Entry
|
||||
const redactionLogEntryWrapper: RedactionLogEntryWrapper = { actionPendingReanalysis: false };
|
||||
Object.assign(redactionLogEntryWrapper, redactionLogEntry);
|
||||
redactionLogEntryWrapper.comments = this.manualRedactions.comments[redactionLogEntryWrapper.id];
|
||||
result.push(redactionLogEntryWrapper);
|
||||
});
|
||||
|
||||
this.manualRedactions.entriesToAdd.forEach((manual) => {
|
||||
@ -62,6 +64,11 @@ export class FileDataModel {
|
||||
|
||||
// an entry for this request already exists in the redactionLog
|
||||
if (!!relevantRedactionLogEntry) {
|
||||
if (relevantRedactionLogEntry.status === 'DECLINED') {
|
||||
relevantRedactionLogEntry.hidden = true;
|
||||
return;
|
||||
}
|
||||
|
||||
relevantRedactionLogEntry.userId = manual.user;
|
||||
relevantRedactionLogEntry.dictionaryEntry = manual.addToDictionary;
|
||||
|
||||
|
||||
@ -53,12 +53,14 @@ export function getFirstRelevantTextPart(text, direction: 'FORWARD' | 'BACKWARD'
|
||||
if (breakChars.indexOf(char) >= 0) {
|
||||
spaceCount += 1;
|
||||
}
|
||||
if (spaceCount >= 2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
accumulator += char;
|
||||
|
||||
return false;
|
||||
if (spaceCount >= 2) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
if (direction === 'FORWARD') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user