some more cleanup
This commit is contained in:
parent
4d51e8475d
commit
64e8ce5242
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, TemplateRef } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { IqserEventTarget } from '@iqser/common-ui';
|
||||
|
||||
@ -8,7 +8,7 @@ import { IqserEventTarget } from '@iqser/common-ui';
|
||||
styleUrls: ['./annotations-list.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class AnnotationsListComponent implements OnChanges {
|
||||
export class AnnotationsListComponent {
|
||||
@Input() annotations: AnnotationWrapper[];
|
||||
@Input() selectedAnnotations: AnnotationWrapper[];
|
||||
@Input() annotationActionsTemplate: TemplateRef<unknown>;
|
||||
@ -45,8 +45,4 @@ export class AnnotationsListComponent implements OnChanges {
|
||||
isSelected(annotationId: string): boolean {
|
||||
return !!this.selectedAnnotations?.find(a => a?.annotationId === annotationId);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: any): void {
|
||||
console.log('changeeees', changes);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import { FileDataModel } from '@models/file/file-data.model';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { WebViewerInstance } from '@pdftron/webviewer';
|
||||
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
|
||||
const COMMAND_KEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Escape'];
|
||||
const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
||||
@ -43,21 +43,22 @@ export class FileWorkloadComponent {
|
||||
@Output() readonly actionPerformed = new EventEmitter<string>();
|
||||
displayedPages: number[] = [];
|
||||
pagesPanelActive = true;
|
||||
readonly displayedAnnotations$ = this._displayedAnnotations$;
|
||||
private _annotations$ = new BehaviorSubject<AnnotationWrapper[]>([]);
|
||||
@ViewChild('annotationsElement') private readonly _annotationsElement: ElementRef;
|
||||
@ViewChild('quickNavigation') private readonly _quickNavigationElement: ElementRef;
|
||||
private _annotations$ = new BehaviorSubject<AnnotationWrapper[]>([]);
|
||||
readonly displayedAnnotations$: Observable<Map<number, AnnotationWrapper[]>>;
|
||||
|
||||
constructor(
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||
private readonly _filterService: FilterService,
|
||||
private readonly _annotationProcessingService: AnnotationProcessingService
|
||||
) {}
|
||||
) {
|
||||
this.displayedAnnotations$ = this._displayedAnnotations$;
|
||||
}
|
||||
|
||||
@Input()
|
||||
set annotations(value: AnnotationWrapper[]) {
|
||||
console.log(value);
|
||||
this._annotations$.next(value);
|
||||
}
|
||||
|
||||
@ -96,8 +97,8 @@ export class FileWorkloadComponent {
|
||||
private get _displayedAnnotations$(): Observable<Map<number, AnnotationWrapper[]>> {
|
||||
const primary$ = this._filterService.getFilterModels$('primaryFilters');
|
||||
const secondary$ = this._filterService.getFilterModels$('secondaryFilters');
|
||||
console.log('============', primary$, secondary$);
|
||||
return combineLatest([this._annotations$, primary$, secondary$]).pipe(
|
||||
|
||||
return combineLatest([this._annotations$.asObservable(), primary$, secondary$]).pipe(
|
||||
map(([annotations, primary, secondary]) => this._filterAnnotations(annotations, primary, secondary))
|
||||
);
|
||||
}
|
||||
@ -113,10 +114,6 @@ export class FileWorkloadComponent {
|
||||
}
|
||||
}
|
||||
|
||||
logAnnotation(annotation: AnnotationWrapper) {
|
||||
console.log(annotation);
|
||||
}
|
||||
|
||||
pageHasSelection(page: number) {
|
||||
return this.multiSelectActive && !!this.selectedAnnotations?.find(a => a.pageNumber === page);
|
||||
}
|
||||
@ -233,7 +230,6 @@ export class FileWorkloadComponent {
|
||||
primary: INestedFilter[],
|
||||
secondary: INestedFilter[] = []
|
||||
): Map<number, AnnotationWrapper[]> {
|
||||
console.log(this.displayedAnnotations, this.displayedPages, this.annotations);
|
||||
if (!primary) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user