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 ce6756679..531d15776 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 @@ -185,26 +185,19 @@ >. - - {{ 'file-preview.tabs.annotations.no-annotations' | translate }} - - - {{ 'file-preview.tabs.annotations.wrong-filters' | translate }} - - {{ 'file-preview.tabs.annotations.the-filters' | translate }} - + @if ((fileDataService.allLength$ | async) > 0 && displayedPages.length === 0) { + @if (this.enabledFilters?.length) { + {{ 'file-preview.tabs.annotations.wrong-filters' | translate }} + + {{ 'file-preview.tabs.annotations.the-filters' | translate }} + } @else if (state.componentReferenceIds?.length === 0) { + {{ 'file-preview.tabs.annotations.no-annotations' | translate }} + } + }
diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts index 0f0c47c83..3bc1ba7b9 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts @@ -90,9 +90,10 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On protected readonly currentPageIsExcluded = computed(() => this.state.file().excludedPages.includes(this.pdf.currentPage())); protected readonly translations = workloadTranslations; protected readonly isDocumine = getConfig().IS_DOCUMINE; - displayedAnnotations = new Map(); - displayedPages: number[] = []; - pagesPanelActive = true; + protected displayedAnnotations = new Map(); + protected displayedPages: number[] = []; + protected pagesPanelActive = true; + protected enabledFilters = []; constructor( readonly filterService: FilterService, @@ -425,15 +426,15 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On this.displayedAnnotations = this._annotationProcessingService.filterAndGroupAnnotations(annotations, primary, secondary); const pagesThatDisplayAnnotations = [...this.displayedAnnotations.keys()]; - const enabledFilters = this.filterService.enabledFlatFilters; - if (enabledFilters.some(f => f.id === 'pages-without-annotations')) { - if (enabledFilters.length === 1 && !onlyPageWithAnnotations) { + this.enabledFilters = this.filterService.enabledFlatFilters; + if (this.enabledFilters.some(f => f.id === 'pages-without-annotations')) { + if (this.enabledFilters.length === 1 && !onlyPageWithAnnotations) { this.displayedPages = this.#allPages.filter(page => !pagesThatDisplayAnnotations.includes(page)); } else { this.displayedPages = []; } this.displayedAnnotations.clear(); - } else if (enabledFilters.length || onlyPageWithAnnotations || componentReferenceIds) { + } else if (this.enabledFilters.length || onlyPageWithAnnotations || componentReferenceIds) { this.displayedPages = pagesThatDisplayAnnotations; } else { this.displayedPages = this.#allPages; 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 253b63f4c..e453fb37d 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 @@ -141,10 +141,6 @@ export class AnnotationProcessingService { } } - if (this.#isDocumine) { - this.#createNoAnnotationsFilter(filterMap, filters); - } - return filters.sort((a, b) => SuperTypeSorter[a.id] - SuperTypeSorter[b.id]); } @@ -272,19 +268,4 @@ export class AnnotationProcessingService { return first.pageNumber < second.pageNumber ? -1 : 1; }); } - - #createNoAnnotationsFilter(filterMap: Map, filters: INestedFilter[]) { - const childFilter: IFilter = { - id: 'no-annotations-filter', - label: 'no-annotations-filter', - checked: false, - matches: 1, - skipTranslation: true, - hidden: true, - }; - - const newChildFilter = new Filter(childFilter); - filterMap.set('no-annotations-filter', newChildFilter); - filters[0]?.children.push(newChildFilter); - } } diff --git a/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.html b/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.html index 221d497fe..006a7bc77 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.html +++ b/apps/red-ui/src/app/modules/pdf-viewer/components/paginator/paginator.component.html @@ -1,4 +1,8 @@ -