diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 232a238d8..ebed53aca 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -39,6 +39,7 @@ export class AnnotationWrapper { positions: Rectangle[]; recommendationType: string; legalBasis: string; + legalBasisChangeValue?: string; image?: boolean; force?: boolean; @@ -234,6 +235,7 @@ export class AnnotationWrapper { annotationWrapper.dictionaryOperation = redactionLogEntry.dictionaryEntry; annotationWrapper.userId = redactionLogEntry.userId; annotationWrapper.image = redactionLogEntry.image; + annotationWrapper.legalBasisChangeValue = redactionLogEntry.legalBasisChangeValue; annotationWrapper.comments = redactionLogEntry.comments || []; annotationWrapper.legalBasis = redactionLogEntry.legalBasis; AnnotationWrapper._createContent(annotationWrapper, redactionLogEntry); 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 9b72900e1..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 @@ -312,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); } diff --git a/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts b/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts index cd7650636..d189d56fc 100644 --- a/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/annotation-processing.service.ts @@ -16,6 +16,16 @@ export class AnnotationProcessingService { topLevelFilter: true, filters: [], checker: (annotation: AnnotationWrapper) => annotation?.comments?.length > 0 + }, + { + key: 'with-reason-changes', + icon: 'red:reason', + label: 'filter-menu.with-reason-changes', + checked: false, + topLevelFilter: true, + filters: [], + checker: (annotation: AnnotationWrapper) => + annotation?.legalBasisChangeValue?.length > 0 } ]; } diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 0fed86bb4..0fdd3947e 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -66,6 +66,7 @@ export class IconsModule { 'radio-selected', 'read-only', 'ready-for-approval', + 'reason', 'refresh', 'remove-from-dict', 'report', diff --git a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html index 924a1d038..330c9184c 100644 --- a/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html +++ b/apps/red-ui/src/app/modules/shared/components/filters/popup-filter/popup-filter.component.html @@ -37,13 +37,11 @@