From 2a8e048a53deb13d7f19766719eacd2918747185 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 4 Nov 2022 17:34:11 +0200 Subject: [PATCH] RED-5460 - filtered 'changeLogRemoved' redactions in preview mode --- .../components/file-workload/file-workload.component.ts | 8 ++++++-- .../modules/file-preview/file-preview-screen.component.ts | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts index 9cbfc954c..317dfb29a 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts @@ -15,6 +15,7 @@ import { MatDialogRef, MatDialogState } from '@angular/material/dialog'; import scrollIntoView from 'scroll-into-view-if-needed'; import { AutoUnsubscribe, + bool, CircleButtonTypes, Debounce, FilterService, @@ -383,8 +384,11 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy return; } - if (this._viewModeService.isRedacted && !this._userPreferencesService.getShowSuggestionsInPreview()) { - annotations = annotations.filter(a => !a.isSuggestion); + if (this._viewModeService.isRedacted) { + annotations = annotations.filter(a => !bool(a.isChangeLogRemoved)); + if (!this._userPreferencesService.getShowSuggestionsInPreview()) { + annotations = annotations.filter(a => !a.isSuggestion); + } } this.displayedAnnotations = this._annotationProcessingService.filterAndGroupAnnotations(annotations, primary, secondary); diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index e2695e16d..1964f966f 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -239,7 +239,9 @@ export class FilePreviewScreenComponent break; } case ViewModes.REDACTED: { - const nonRedactionEntries = annotations.filter(a => !bool(a.getCustomData('redaction'))); + const nonRedactionEntries = annotations.filter( + a => !bool(a.getCustomData('redaction')) || bool(a.getCustomData('changeLogRemoved')), + ); if (this._readableRedactionsService.active) { this._setAnnotationsOpacity(redactions, true); this._setAnnotationsColor(redactions, 'annotationColor');