diff --git a/apps/red-ui/src/app/common/service/permissions.service.ts b/apps/red-ui/src/app/common/service/permissions.service.ts index 32acfe5c9..e75007ba8 100644 --- a/apps/red-ui/src/app/common/service/permissions.service.ts +++ b/apps/red-ui/src/app/common/service/permissions.service.ts @@ -205,6 +205,7 @@ export class PermissionsService { } return ( this.isProjectMember() && + !fileStatus.isProcessing && !fileStatus.isError && !fileStatus.isApprovedOrUnderApproval && (this.isManagerAndOwner() || !this.isFileReviewer(fileStatus)) diff --git a/apps/red-ui/src/app/components/comments/comments.component.html b/apps/red-ui/src/app/components/comments/comments.component.html index e1faa0d7b..196a22d4f 100644 --- a/apps/red-ui/src/app/components/comments/comments.component.html +++ b/apps/red-ui/src/app/components/comments/comments.component.html @@ -25,7 +25,7 @@ }) }} -
+
diff --git a/apps/red-ui/src/app/components/comments/comments.component.ts b/apps/red-ui/src/app/components/comments/comments.component.ts index 52d51edbc..f58485d92 100644 --- a/apps/red-ui/src/app/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/components/comments/comments.component.ts @@ -6,6 +6,7 @@ import { AnnotationWrapper } from '../../screens/file/model/annotation.wrapper'; import { UserService } from '../../user/user.service'; import { AppStateService } from '../../state/app-state.service'; import { TranslateService } from '@ngx-translate/core'; + @Component({ selector: 'redaction-comments', templateUrl: './comments.component.html', @@ -30,6 +31,10 @@ export class CommentsComponent { }); } + get canAddComment() { + return !this.annotation.isChangeLogRemoved; + } + public toggleExpandComments($event: MouseEvent): void { $event.stopPropagation(); if (!this.annotation.comments.length) { diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html index b5503b64c..3730193dd 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html @@ -243,6 +243,7 @@ attr.annotation-id="{{ annotation.id }}" attr.annotation-page="{{ activeViewerPage }}" class="annotation" + [class.removed]="annotation.isChangeLogRemoved" >
diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss index 33418d888..2fcb67d1a 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.scss @@ -99,6 +99,11 @@ flex-direction: column; border-left: 4px solid transparent; + &.removed { + text-decoration: line-through; + color: $grey-7; + } + .details { display: flex; position: relative; diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts index 378dd8114..4650057ca 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts @@ -11,7 +11,7 @@ import { ManualRedactionEntryWrapper } from '../model/manual-redaction-entry.wra import { AnnotationWrapper } from '../model/annotation.wrapper'; import { ManualAnnotationService } from '../service/manual-annotation.service'; import { ManualAnnotationResponse } from '../model/manual-annotation-response'; -import { FileDataModel } from '../model/file-data.model'; +import { AnnotationData, FileDataModel } from '../model/file-data.model'; import { FileActionService } from '../service/file-action.service'; import { AnnotationDrawService } from '../service/annotation-draw.service'; import { AnnotationProcessingService } from '../service/annotation-processing.service'; @@ -57,7 +57,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { fileData: FileDataModel; fileId: string; - annotations: AnnotationWrapper[] = []; + annotationData: AnnotationData; + displayedAnnotations: { [key: number]: { annotations: AnnotationWrapper[] } } = {}; selectedAnnotation: AnnotationWrapper; pagesPanelActive = true; @@ -101,6 +102,10 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { }); } + get annotations() { + return this.annotationData ? this.annotationData.visibleAnnotations : []; + } + updateViewMode() { const allAnnotations = this._instance.annotManager.getAnnotationsList(); @@ -228,7 +233,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { const existingAnnotations = this.annotations.map((a) => this.activeViewer.annotManager.getAnnotationById(a.id)); this.activeViewer.annotManager.deleteAnnotations(existingAnnotations, true, true); } - this.annotations = this.fileData.getAnnotations( + this.annotationData = this.fileData.getAnnotations( this.appStateService.dictionaryData[this.appStateService.activeProject.ruleSetId], this.permissionsService.currentUser, this.viewMode, @@ -528,7 +533,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { this._fileDownloadService.loadActiveFileManualAnnotations().subscribe((manualRedactions) => { this.fileData.manualRedactions = manualRedactions; this._rebuildFilters(); - this._annotationDrawService.drawAnnotations(this._instance, this.annotations); + this._annotationDrawService.drawAnnotations(this._instance, this.annotationData.allAnnotations); }); } 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 556ce6af9..4a3d055ff 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 @@ -14,6 +14,11 @@ import { AnnotationWrapper } from './annotation.wrapper'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { ViewMode } from './view-mode'; +export class AnnotationData { + visibleAnnotations: AnnotationWrapper[]; + allAnnotations: AnnotationWrapper[]; +} + export class FileDataModel { constructor( public fileStatus: FileStatusWrapper, @@ -28,28 +33,19 @@ export class FileDataModel { return this.redactionLog.redactionLogEntry; } - getAnnotations( - dictionaryData: { [p: string]: TypeValue }, - currentUser: UserWrapper, - viewMode: ViewMode, - areDevFeaturesEnabled: boolean - ): AnnotationWrapper[] { + getAnnotations(dictionaryData: { [p: string]: TypeValue }, currentUser: UserWrapper, viewMode: ViewMode, areDevFeaturesEnabled: boolean): AnnotationData { const entries: RedactionLogEntryWrapper[] = this._convertData(dictionaryData); + let allAnnotations = entries.map((entry) => AnnotationWrapper.fromData(entry)); - let annotations = entries.map((entry) => AnnotationWrapper.fromData(entry)); + if (!areDevFeaturesEnabled) { + allAnnotations = allAnnotations.filter((annotation) => { + return !annotation.isIgnored && !annotation.isFalsePositive; + }); + } - // filter based on dev-mode - annotations = annotations.filter((annotation) => { + let visibleAnnotations = allAnnotations.filter((annotation) => { if (viewMode === 'STANDARD') { - if (annotation.isChangeLogRemoved) { - return false; - } else { - if (!areDevFeaturesEnabled) { - return !annotation.isIgnored && !annotation.isFalsePositive; - } else { - return true; - } - } + return !annotation.isChangeLogRemoved; } else if (viewMode === 'DELTA') { return annotation.isChangeLogEntry; } else { @@ -57,13 +53,20 @@ export class FileDataModel { } }); - return annotations; + return { + visibleAnnotations: visibleAnnotations, + allAnnotations: allAnnotations + }; } private _convertData(dictionaryData: { [p: string]: TypeValue }): RedactionLogEntryWrapper[] { let result: RedactionLogEntryWrapper[] = []; this.redactionChangeLog?.redactionLogEntry?.forEach((changeLogEntry) => { + if (changeLogEntry.id === '48a8c973d0ef86bda58bf9722b931fc2') { + console.log(changeLogEntry); + // const existingChangeLogEntry = this.redactionChangeLog.redactionLogEntry.find((rle) => rle.id === redactionLogEntry.id); + } if (changeLogEntry.changeType === 'REMOVED') { const redactionLogEntryWrapper: RedactionLogEntryWrapper = { actionPendingReanalysis: false };