reason for recommendation and remove from dictionary for hints
This commit is contained in:
parent
8412e9f9b8
commit
9f6fa4b545
@ -32,7 +32,7 @@ export class AnnotationPermissions {
|
||||
|
||||
permissions.canRemoveOrSuggestToRemoveOnlyHere = annotation.isRedacted;
|
||||
permissions.canRemoveOrSuggestToRemoveFromDictionary =
|
||||
annotation.isModifyDictionary && (annotation.isRedacted || annotation.isSkipped);
|
||||
annotation.isModifyDictionary && (annotation.isRedacted || annotation.isSkipped || annotation.isHint);
|
||||
|
||||
permissions.canAcceptSuggestion = isApprover && (annotation.isSuggestion || annotation.isDeclinedSuggestion);
|
||||
permissions.canRejectSuggestion = isApprover && annotation.isSuggestion;
|
||||
|
||||
@ -76,14 +76,8 @@ export class FileDataModel {
|
||||
}
|
||||
});
|
||||
|
||||
const reasonAnnotationIds = [];
|
||||
const reasonAnnotationIds: { [key: string]: RedactionLogEntryWrapper[] } = {};
|
||||
this.redactionLog.redactionLogEntry?.forEach(redactionLogEntry => {
|
||||
if (redactionLogEntry.manual && (redactionLogEntry.status === 'APPROVED' || redactionLogEntry.status === 'REQUESTED')) {
|
||||
// for dictionary entries -> I.E accepted recommendations or false positives,
|
||||
// check reason
|
||||
reasonAnnotationIds.push(redactionLogEntry.reason);
|
||||
}
|
||||
|
||||
const existingChangeLogEntry = this.redactionChangeLog?.redactionLogEntry?.find(rle => rle.id === redactionLogEntry.id);
|
||||
|
||||
// copy the redactionLog Entry
|
||||
@ -102,15 +96,30 @@ export class FileDataModel {
|
||||
} else {
|
||||
result.push(redactionLogEntryWrapper);
|
||||
}
|
||||
|
||||
if (redactionLogEntry.manual && (redactionLogEntry.status === 'APPROVED' || redactionLogEntry.status === 'REQUESTED')) {
|
||||
// for dictionary entries -> I.E accepted recommendations or false positives,
|
||||
// check reason
|
||||
if (!reasonAnnotationIds[redactionLogEntry.reason]) {
|
||||
reasonAnnotationIds[redactionLogEntry.reason] = [redactionLogEntryWrapper];
|
||||
} else {
|
||||
reasonAnnotationIds[redactionLogEntry.reason].push(redactionLogEntryWrapper);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
result = result.filter(r => reasonAnnotationIds.indexOf(r.id) < 0);
|
||||
const reasonKeys = Object.keys(reasonAnnotationIds);
|
||||
result = result.filter(r => {
|
||||
const matched = reasonKeys.indexOf(r.id) >= 0;
|
||||
if (matched) {
|
||||
reasonAnnotationIds[r.id].forEach(value => {
|
||||
value.reason = null;
|
||||
});
|
||||
}
|
||||
return !matched;
|
||||
});
|
||||
|
||||
result.forEach(redactionLogEntry => {
|
||||
if (redactionLogEntry.id === '96a9fad412ac0ccc340c9ee53f97986b') {
|
||||
redactionLogEntry.dictionaryEntry = true;
|
||||
}
|
||||
|
||||
redactionLogEntry.legalBasisMapping = this.redactionLog.legalBasis;
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user