This commit is contained in:
Dan Percic 2024-08-10 14:21:27 +02:00
parent e41ac70dfe
commit c4c549fe1b

View File

@ -1,4 +1,5 @@
import { ChangeDetectorRef, Component, computed, ElementRef, EventEmitter, Input, Output } from '@angular/core'; import { NgForOf, NgIf } from '@angular/common';
import { Component, computed, ElementRef, EventEmitter, Input, Output } from '@angular/core';
import { getConfig, HasScrollbarDirective } from '@iqser/common-ui'; import { getConfig, HasScrollbarDirective } from '@iqser/common-ui';
import { FilterService } from '@iqser/common-ui/lib/filtering'; import { FilterService } from '@iqser/common-ui/lib/filtering';
import { IqserEventTarget } from '@iqser/common-ui/lib/utils'; import { IqserEventTarget } from '@iqser/common-ui/lib/utils';
@ -11,10 +12,9 @@ import { AnnotationReferencesService } from '../../services/annotation-reference
import { AnnotationsListingService } from '../../services/annotations-listing.service'; import { AnnotationsListingService } from '../../services/annotations-listing.service';
import { MultiSelectService } from '../../services/multi-select.service'; import { MultiSelectService } from '../../services/multi-select.service';
import { ViewModeService } from '../../services/view-mode.service'; import { ViewModeService } from '../../services/view-mode.service';
import { NgForOf, NgIf } from '@angular/common';
import { HighlightsSeparatorComponent } from '../highlights-separator/highlights-separator.component';
import { AnnotationWrapperComponent } from '../annotation-wrapper/annotation-wrapper.component';
import { AnnotationReferencesListComponent } from '../annotation-references-list/annotation-references-list.component'; import { AnnotationReferencesListComponent } from '../annotation-references-list/annotation-references-list.component';
import { AnnotationWrapperComponent } from '../annotation-wrapper/annotation-wrapper.component';
import { HighlightsSeparatorComponent } from '../highlights-separator/highlights-separator.component';
@Component({ @Component({
selector: 'redaction-annotations-list', selector: 'redaction-annotations-list',
@ -24,8 +24,6 @@ import { AnnotationReferencesListComponent } from '../annotation-references-list
imports: [NgForOf, NgIf, HighlightsSeparatorComponent, AnnotationWrapperComponent, AnnotationReferencesListComponent], imports: [NgForOf, NgIf, HighlightsSeparatorComponent, AnnotationWrapperComponent, AnnotationReferencesListComponent],
}) })
export class AnnotationsListComponent extends HasScrollbarDirective { export class AnnotationsListComponent extends HasScrollbarDirective {
@Input({ required: true }) annotations: ListItem<AnnotationWrapper>[];
@Output() readonly pagesPanelActive = new EventEmitter<boolean>();
readonly #earmarkGroups = computed(() => { readonly #earmarkGroups = computed(() => {
if (this._viewModeService.isEarmarks()) { if (this._viewModeService.isEarmarks()) {
return this.#getEarmarksGroups(); return this.#getEarmarksGroups();
@ -33,10 +31,11 @@ export class AnnotationsListComponent extends HasScrollbarDirective {
return [] as EarmarkGroup[]; return [] as EarmarkGroup[];
}); });
protected readonly isDocumine = getConfig().IS_DOCUMINE; protected readonly isDocumine = getConfig().IS_DOCUMINE;
@Input({ required: true }) annotations: ListItem<AnnotationWrapper>[];
@Output() readonly pagesPanelActive = new EventEmitter<boolean>();
constructor( constructor(
protected readonly _elementRef: ElementRef, protected readonly _elementRef: ElementRef,
protected readonly _changeDetector: ChangeDetectorRef,
private readonly _multiSelectService: MultiSelectService, private readonly _multiSelectService: MultiSelectService,
private readonly _filterService: FilterService, private readonly _filterService: FilterService,
private readonly _userPreferenceService: UserPreferenceService, private readonly _userPreferenceService: UserPreferenceService,
@ -45,7 +44,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective {
private readonly _listingService: AnnotationsListingService, private readonly _listingService: AnnotationsListingService,
readonly annotationReferencesService: AnnotationReferencesService, readonly annotationReferencesService: AnnotationReferencesService,
) { ) {
super(_elementRef, _changeDetector); super(_elementRef);
} }
annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void { annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void {