diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts index b620bfca7..e67ddac59 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotations-list/annotations-list.component.ts @@ -28,7 +28,6 @@ import { PdfViewer } from '../../services/pdf-viewer.service'; export class AnnotationsListComponent extends HasScrollbarDirective implements OnChanges { @Input() annotations: AnnotationWrapper[]; @Input() annotationActionsTemplate: TemplateRef; - @Input() activeViewerPage: number; @Output() readonly pagesPanelActive = new EventEmitter(); 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 2ba09b6b5..c9f517c59 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 @@ -48,7 +48,7 @@
@@ -213,7 +213,6 @@ 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 be00a494a..9c6909607 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 @@ -134,7 +134,7 @@ export class FileWorkloadComponent { return this.multiSelectService.inactive$.pipe( tap(value => { if (value) { - this.pdf.selectAnnotations(); + this.pdf.deselectAllAnnotations(); } }), shareDistinctLast(), diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 0ea7210c4..a0e3efe9a 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -31,7 +31,7 @@ import { download, handleFilterDelta } from '../../utils'; import { FileWorkloadComponent } from './components/file-workload/file-workload.component'; import { FilesService } from '@services/entity-services/files.service'; import { FileManagementService } from '@services/entity-services/file-management.service'; -import { catchError, debounceTime, map, startWith, switchMap, tap } from 'rxjs/operators'; +import { catchError, map, startWith, switchMap, tap } from 'rxjs/operators'; import { FilesMapService } from '@services/entity-services/files-map.service'; import { ExcludedPagesService } from './services/excluded-pages.service'; import { ViewModeService } from './services/view-mode.service'; @@ -362,7 +362,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni ); let start; return combineLatest([currentPageAnnotations$, documentLoaded$]).pipe( - debounceTime(300), tap(() => (start = new Date().getTime())), map(([annotations]) => annotations), startWith([] as AnnotationWrapper[]), diff --git a/apps/red-ui/src/app/modules/file-preview/services/multi-select.service.ts b/apps/red-ui/src/app/modules/file-preview/services/multi-select.service.ts index f918f5b59..0cc9f0dfd 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/multi-select.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/multi-select.service.ts @@ -13,12 +13,13 @@ export class MultiSelectService { readonly enabled$: Observable; readonly active$: Observable; readonly inactive$: Observable; + readonly #active$ = new BehaviorSubject(false); readonly #enabled$ = new BehaviorSubject(true); - constructor(private readonly _viewModeService: ViewModeService, private readonly _state: FilePreviewStateService) { + constructor(viewModeService: ViewModeService, state: FilePreviewStateService) { [this.active$, this.inactive$] = boolFactory(this.#active$.asObservable()); - this.enabled$ = combineLatest([this._viewModeService.viewMode$, _state.isWritable$]).pipe( + this.enabled$ = combineLatest([viewModeService.viewMode$, state.isWritable$]).pipe( map(([viewMode, isWritable]) => isWritable && ENABLED_MULTISELECT.includes(viewMode)), tap(enabled => this.#enabled$.next(enabled)), ); diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-viewer.service.ts index 2f841c6e4..c9e6d7470 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-viewer.service.ts @@ -227,7 +227,7 @@ export class PdfViewer { this.navigateToPage(pageNumber); // wait for page to be loaded and to draw annotations - setTimeout(() => this.#jumpAndSelectAnnotations(filteredAnnotationsIds), 500); + setTimeout(() => this.#jumpAndSelectAnnotations(filteredAnnotationsIds), 300); } #jumpAndSelectAnnotations(annotationIds: readonly string[]) {