diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html index d202d612c..52a506da2 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.html @@ -146,7 +146,7 @@ id="annotations-list" tabindex="1" > - + annotations.get(page)), + map(([annotations]) => annotations.get(this.currentAnnotationsPage)), ); effect(() => { @@ -455,19 +456,24 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On this.displayedAnnotations.set(this._annotationProcessingService.filterAndGroupAnnotations(annotations, primary, secondary)); const pagesThatDisplayAnnotations = [...this.displayedAnnotations().keys()]; this.enabledFilters = this.filterService.enabledFlatFilters; - if (this.enabledFilters.some(f => f.id === 'pages-without-annotations')) { - if (this.enabledFilters.length === 1 && !onlyPageWithAnnotations) { - const pages = allPages.filter(page => !pagesThatDisplayAnnotations.includes(page)); - this.#setDisplayedPages(pages); - } else { - this.#setDisplayedPages([]); - } - this.displayedAnnotations().clear(); - } else if (this.enabledFilters.length || onlyPageWithAnnotations || componentReferenceIds) { - this.#setDisplayedPages(pagesThatDisplayAnnotations); - } else { + if (this.isDocumine && this.#isIqserDevMode) { this.#setDisplayedPages(allPages); + } else { + if (this.enabledFilters.some(f => f.id === 'pages-without-annotations')) { + if (this.enabledFilters.length === 1 && !onlyPageWithAnnotations) { + const pages = allPages.filter(page => !pagesThatDisplayAnnotations.includes(page)); + this.#setDisplayedPages(pages); + } else { + this.#setDisplayedPages([]); + } + this.displayedAnnotations().clear(); + } else if (this.enabledFilters.length || onlyPageWithAnnotations || componentReferenceIds) { + this.#setDisplayedPages(pagesThatDisplayAnnotations); + } else { + this.#setDisplayedPages(allPages); + } } + this.displayedPages.sort((a, b) => a - b); return this.displayedAnnotations(); @@ -590,6 +596,10 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On ); } + get currentAnnotationsPage() { + return this.isDocumine && this.#isIqserDevMode ? ALL_ANNOTATIONS_PAGE : this.pdf.currentPage(); + } + @HostListener('click', ['$event']) clickInsideWorkloadView($event: MouseEvent) { $event?.stopPropagation(); diff --git a/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.html b/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.html index c7515da50..048a0334c 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/pages/pages.component.html @@ -1,7 +1,7 @@
; + readonly pages = input.required>(); readonly viewedPages$ = inject(ViewedPagesMapService).get$(this.#state.fileId); ngAfterViewInit() { diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts index e453fb37d..85b96449f 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts @@ -19,6 +19,7 @@ import { } from '../utils/sort-by-page-rotation.utils'; import { FileDataService } from './file-data.service'; import { FilePreviewStateService } from './file-preview-state.service'; +import { ALL_ANNOTATIONS_PAGE } from '../utils/constants'; @Injectable() export class AnnotationProcessingService { @@ -167,7 +168,7 @@ export class AnnotationProcessingService { continue; } - const pageNumber = annotation.pageNumber; + const pageNumber = this.#devMode && this.#isDocumine ? ALL_ANNOTATIONS_PAGE : annotation.pageNumber; if (!obj.has(pageNumber)) { obj.set(pageNumber, []); diff --git a/apps/red-ui/src/app/modules/file-preview/utils/constants.ts b/apps/red-ui/src/app/modules/file-preview/utils/constants.ts index 3e4315665..02d1e9e5e 100644 --- a/apps/red-ui/src/app/modules/file-preview/utils/constants.ts +++ b/apps/red-ui/src/app/modules/file-preview/utils/constants.ts @@ -73,3 +73,5 @@ export const ANNOTATION_ACTIONS = [ 'Hide', 'Ausblenden', ] as const; + +export const ALL_ANNOTATIONS_PAGE = 0;