RED-3991: make drawing annotations faster
This commit is contained in:
parent
fdb3a0c6a0
commit
d26578e3e5
@ -28,7 +28,6 @@ import { PdfViewer } from '../../services/pdf-viewer.service';
|
||||
export class AnnotationsListComponent extends HasScrollbarDirective implements OnChanges {
|
||||
@Input() annotations: AnnotationWrapper[];
|
||||
@Input() annotationActionsTemplate: TemplateRef<unknown>;
|
||||
@Input() activeViewerPage: number;
|
||||
|
||||
@Output() readonly pagesPanelActive = new EventEmitter<boolean>();
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<div *ngIf="multiSelectService.active$ | async" class="multi-select">
|
||||
<div class="selected-wrapper">
|
||||
<iqser-round-checkbox
|
||||
(click)="pdf.selectAnnotations()"
|
||||
(click)="pdf.deselectAllAnnotations()"
|
||||
[indeterminate]="listingService.areSomeSelected$ | async"
|
||||
type="with-bg"
|
||||
></iqser-round-checkbox>
|
||||
@ -213,7 +213,6 @@
|
||||
|
||||
<redaction-annotations-list
|
||||
(pagesPanelActive)="pagesPanelActive = $event"
|
||||
[activeViewerPage]="activeViewerPage"
|
||||
[annotationActionsTemplate]="annotationActionsTemplate"
|
||||
[annotations]="(displayedAnnotations$ | async)?.get(activeViewerPage)"
|
||||
></redaction-annotations-list>
|
||||
|
||||
@ -134,7 +134,7 @@ export class FileWorkloadComponent {
|
||||
return this.multiSelectService.inactive$.pipe(
|
||||
tap(value => {
|
||||
if (value) {
|
||||
this.pdf.selectAnnotations();
|
||||
this.pdf.deselectAllAnnotations();
|
||||
}
|
||||
}),
|
||||
shareDistinctLast(),
|
||||
|
||||
@ -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[]),
|
||||
|
||||
@ -13,12 +13,13 @@ export class MultiSelectService {
|
||||
readonly enabled$: Observable<boolean>;
|
||||
readonly active$: Observable<boolean>;
|
||||
readonly inactive$: Observable<boolean>;
|
||||
|
||||
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)),
|
||||
);
|
||||
|
||||
@ -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[]) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user