From b1d38ba9629f995265efbc790b1429b5fd97c3de Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Wed, 30 Jun 2021 19:05:16 +0300 Subject: [PATCH] show original redaction when suggestion is declined --- apps/red-ui/src/app/models/file/file-data.model.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 8aeb14511..c207e6656 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -146,7 +146,10 @@ export class FileDataModel { // a redaction-log entry is marked as a reason for another entry - hide it if (markedAsReasonRedactionLogEntry) { - if (!(this._hasAlreadyBeenProcessed(manual) && manual.status === 'APPROVED')) { + if ( + !this._hasBeenProcessed(manual) || + !['APPROVED', 'DECLINED'].includes(manual.status) + ) { markedAsReasonRedactionLogEntry.hidden = true; } } @@ -169,7 +172,7 @@ export class FileDataModel { } else { // dictionary modifying requests that have been processed already updated // the dictionary and should not be drawn - if (manual.addToDictionary && this._hasAlreadyBeenProcessed(manual)) { + if (manual.addToDictionary && this._hasBeenProcessed(manual)) { return; } @@ -219,7 +222,7 @@ export class FileDataModel { relevantRedactionLogEntry.status = idToRemove.status; } - if (this._hasAlreadyBeenProcessed(idToRemove)) { + if (this._hasBeenProcessed(idToRemove)) { if (idToRemove.status === 'DECLINED') { relevantRedactionLogEntry.status = null; } @@ -242,7 +245,7 @@ export class FileDataModel { relevantRedactionLogEntry.status = legalBasisChange.status; } - if (this._hasAlreadyBeenProcessed(legalBasisChange)) { + if (this._hasBeenProcessed(legalBasisChange)) { if (legalBasisChange.status === 'DECLINED') { relevantRedactionLogEntry.status = null; } @@ -295,7 +298,7 @@ export class FileDataModel { return result; } - private _hasAlreadyBeenProcessed(entry: ManualRedactionEntry | IdRemoval): boolean { + private _hasBeenProcessed(entry: ManualRedactionEntry | IdRemoval): boolean { return !entry.processedDate ? false : new Date(entry.processedDate).getTime() <