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 bf18953e0..1f44cd234 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 @@ -285,7 +285,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni this._filterService.addFilterGroup({ slug: 'secondaryFilters', filterTemplate: this._filterTemplate, - filters: processFilters(secondaryFilters, AnnotationProcessingService.secondaryAnnotationFilters), + filters: processFilters(secondaryFilters, AnnotationProcessingService.secondaryAnnotationFilters(this.fileData?.viewedPages)), }); console.log(`[REDACTION] Process time: ${new Date().getTime() - processStartTime} ms`); console.log( 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 9eaddc99d..a38db9a5e 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 @@ -4,10 +4,11 @@ import { SuperTypeSorter } from '@utils/sorters/super-type-sorter'; import { Filter, handleCheckedValue, IFilter, INestedFilter, NestedFilter } from '@iqser/common-ui'; import { annotationTypesTranslations } from '../../../translations/annotation-types-translations'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { IViewedPage } from '@red/domain'; @Injectable() export class AnnotationProcessingService { - static get secondaryAnnotationFilters(): INestedFilter[] { + static secondaryAnnotationFilters(viewedPages: IViewedPage[]): INestedFilter[] { return [ { id: 'with-comments', @@ -25,6 +26,14 @@ export class AnnotationProcessingService { topLevelFilter: true, checker: (annotation: AnnotationWrapper) => annotation?.legalBasisChangeValue?.length > 0, }, + { + id: 'unseen-pages', + icon: 'iqser:pages', + label: _('filter-menu.unseen-pages'), + checked: false, + topLevelFilter: true, + checker: (annotation: AnnotationWrapper) => !viewedPages.map(page => page.page).includes(annotation.pageNumber), + }, ].map(item => new NestedFilter(item)); } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index ffe70bc4d..574d1d823 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -876,8 +876,10 @@ "display-name": { "cancel": "Cancel", "edit": "Edit Display Name", + "error": "Failed to update dictionary display name.", "placeholder": "Enter Display Name", - "save": "Save Display Name" + "save": "Save Display Name", + "success": "Successfully updated dictionary display name." }, "entries": "{length} {length, plural, one{entry} other{entries}}" }, @@ -1105,6 +1107,7 @@ "filter-options": "Filter options", "filter-types": "Filter", "label": "Filter", + "unseen-pages": "Only annotations on unseen pages", "with-comments": "Only annotations with comments", "with-reason-changes": "Only redactions with reason changes" },