diff --git a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts index c407b4cbe..ea61f36ff 100644 --- a/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts +++ b/apps/red-ui/src/app/models/file/redaction-log-entry.wrapper.ts @@ -28,7 +28,6 @@ export interface RedactionLogEntryWrapper { actionPendingReanalysis?: boolean; hidden?: boolean; - legalBasisChangeValue?: string; userId?: string; comments?: Comment[]; diff --git a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts index 698f66f9b..b0f25ef89 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/file-workload/file-workload.component.ts @@ -74,18 +74,6 @@ export class FileWorkloadComponent { private _multiSelectActive = false; - get isProcessing(): boolean { - return this.fileData?.fileStatus?.isProcessing; - } - - get activeAnnotationsLength(): number | undefined { - return this.displayedAnnotations[this.activeViewerPage]?.annotations?.length; - } - - get isReadOnly(): boolean { - return !this._permissionsService.canPerformAnnotationActions(); - } - get multiSelectActive(): boolean { return this._multiSelectActive; } @@ -324,64 +312,56 @@ export class FileWorkloadComponent { !this._firstSelectedAnnotation || this.activeViewerPage !== this._firstSelectedAnnotation.pageNumber ) { - const pageIdx = this.displayedPages.indexOf(this.activeViewerPage); - if (pageIdx !== -1) { + if (this.displayedPages.indexOf(this.activeViewerPage) !== -1) { // Displayed page has annotations - this.selectAnnotations.emit([ + return this.selectAnnotations.emit([ this.displayedAnnotations[this.activeViewerPage].annotations[0] ]); - } else { - // Displayed page doesn't have annotations - if ($event.key === 'ArrowDown') { - const nextPage = this._nextPageWithAnnotations(); - this.shouldDeselectAnnotationsOnPageChange = false; - this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); - this.selectAnnotations.emit([ - this.displayedAnnotations[nextPage].annotations[0] - ]); - } else { - const prevPage = this._prevPageWithAnnotations(); - this.shouldDeselectAnnotationsOnPageChange = false; - this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); - const prevPageAnnotations = this.displayedAnnotations[prevPage].annotations; - this.selectAnnotations.emit([ - prevPageAnnotations[prevPageAnnotations.length - 1] - ]); - } } - } else { - const page = this._firstSelectedAnnotation.pageNumber; - const pageIdx = this.displayedPages.indexOf(page); - const annotationsOnPage = this.displayedAnnotations[page].annotations; - const idx = annotationsOnPage.findIndex(a => a.id === this._firstSelectedAnnotation.id); - + // Displayed page doesn't have annotations if ($event.key === 'ArrowDown') { - if (idx + 1 !== annotationsOnPage.length) { - // If not last item in page - this.selectAnnotations.emit([annotationsOnPage[idx + 1]]); - } else if (pageIdx + 1 < this.displayedPages.length) { - // If not last page - const nextPageAnnotations = - this.displayedAnnotations[this.displayedPages[pageIdx + 1]].annotations; - this.shouldDeselectAnnotationsOnPageChange = false; - this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); - this.selectAnnotations.emit([nextPageAnnotations[0]]); - } - } else { - if (idx !== 0) { - // If not first item in page - this.selectAnnotations.emit([annotationsOnPage[idx - 1]]); - } else if (pageIdx) { - // If not first page - const prevPageAnnotations = - this.displayedAnnotations[this.displayedPages[pageIdx - 1]].annotations; - this.shouldDeselectAnnotationsOnPageChange = false; - this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); - this.selectAnnotations.emit([ - prevPageAnnotations[prevPageAnnotations.length - 1] - ]); - } + const nextPage = this._nextPageWithAnnotations(); + this.shouldDeselectAnnotationsOnPageChange = false; + this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); + this.selectAnnotations.emit([this.displayedAnnotations[nextPage].annotations[0]]); + return; } + + const prevPage = this._prevPageWithAnnotations(); + this.shouldDeselectAnnotationsOnPageChange = false; + this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); + const prevPageAnnotations = this.displayedAnnotations[prevPage].annotations; + this.selectAnnotations.emit([prevPageAnnotations[prevPageAnnotations.length - 1]]); + return; + } + + const page = this._firstSelectedAnnotation.pageNumber; + const pageIdx = this.displayedPages.indexOf(page); + const annotationsOnPage = this.displayedAnnotations[page].annotations; + const idx = annotationsOnPage.findIndex(a => a.id === this._firstSelectedAnnotation.id); + + if ($event.key === 'ArrowDown') { + if (idx + 1 !== annotationsOnPage.length) { + // If not last item in page + this.selectAnnotations.emit([annotationsOnPage[idx + 1]]); + } else if (pageIdx + 1 < this.displayedPages.length) { + // If not last page + const nextPageAnnotations = + this.displayedAnnotations[this.displayedPages[pageIdx + 1]].annotations; + this.shouldDeselectAnnotationsOnPageChange = false; + this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); + this.selectAnnotations.emit([nextPageAnnotations[0]]); + } + } else if (idx !== 0) { + // If not first item in page + this.selectAnnotations.emit([annotationsOnPage[idx - 1]]); + } else if (pageIdx) { + // If not first page + const prevPageAnnotations = + this.displayedAnnotations[this.displayedPages[pageIdx - 1]].annotations; + this.shouldDeselectAnnotationsOnPageChange = false; + this.shouldDeselectAnnotationsOnPageChangeChange.emit(false); + this.selectAnnotations.emit([prevPageAnnotations[prevPageAnnotations.length - 1]]); } } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index 8fbf61595..34c5726d3 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -460,7 +460,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach, } async annotationsChangedByReviewAction(annotation: AnnotationWrapper) { - console.log(annotation); await this._cleanupAndRedrawManualAnnotationsForEntirePage(annotation.pageNumber); }