diff --git a/apps/red-ui/src/app/common/service/annotation-actions.service.ts b/apps/red-ui/src/app/common/service/annotation-actions.service.ts index 0dd0dd77b..cb5572ed8 100644 --- a/apps/red-ui/src/app/common/service/annotation-actions.service.ts +++ b/apps/red-ui/src/app/common/service/annotation-actions.service.ts @@ -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(); } } } diff --git a/apps/red-ui/src/app/screens/file/model/file-data.model.ts b/apps/red-ui/src/app/screens/file/model/file-data.model.ts index 6e547b6af..83085cfc0 100644 --- a/apps/red-ui/src/app/screens/file/model/file-data.model.ts +++ b/apps/red-ui/src/app/screens/file/model/file-data.model.ts @@ -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; diff --git a/apps/red-ui/src/app/utils/functions.ts b/apps/red-ui/src/app/utils/functions.ts index 56404da33..60a8cb091 100644 --- a/apps/red-ui/src/app/utils/functions.ts +++ b/apps/red-ui/src/app/utils/functions.ts @@ -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') {