-
-
+}
diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts
index 2c647bd76..a092c15b3 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts
+++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts
@@ -1,4 +1,4 @@
-import { Component, inject, Input, OnChanges } from '@angular/core';
+import { Component, computed, inject, input, signal } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { KeysOf } from '@iqser/common-ui/lib/utils';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
@@ -33,30 +33,27 @@ const changesProperties: KeysOf
[] = [
];
@Component({
- selector: 'redaction-annotation-details [annotation]',
+ selector: 'redaction-annotation-details',
templateUrl: './annotation-details.component.html',
styleUrls: ['./annotation-details.component.scss'],
standalone: true,
imports: [NgIf, MatTooltip, MatIcon, CdkOverlayOrigin, NgForOf, CdkConnectedOverlay, TranslateModule],
})
-export class AnnotationDetailsComponent implements OnChanges {
- @Input() annotation: ListItem;
- isPopoverOpen = false;
- engines: Engine[];
- changesTooltip: string;
- noSelection: boolean;
+export class AnnotationDetailsComponent {
+ readonly annotation = input.required>();
+ protected readonly _isPopoverOpen = signal(false);
+ protected readonly _engines = computed(() => this.#extractEngines(this.annotation().item).filter(engine => engine.show));
private readonly _translateService = inject(TranslateService);
- private readonly _multiSelectService = inject(MultiSelectService);
+ protected readonly _changesTooltip = computed(() => {
+ const annotation = this.annotation().item;
+ const changes = changesProperties.filter(key => annotation[key]);
- getChangesTooltip(): string | undefined {
- const changes = changesProperties.filter(key => this.annotation.item[key]);
-
- if (!changes.length && !this.annotation.item.engines?.includes(LogEntryEngines.MANUAL)) {
+ if (!changes.length && !annotation.engines?.includes(LogEntryEngines.MANUAL)) {
return;
}
const details = [];
- if (this.annotation.item.engines?.includes(LogEntryEngines.MANUAL)) {
+ if (annotation.engines?.includes(LogEntryEngines.MANUAL)) {
details.push(this._translateService.instant(_('annotation-changes.added-locally')));
}
@@ -66,13 +63,9 @@ export class AnnotationDetailsComponent implements OnChanges {
const header = this._translateService.instant(_('annotation-changes.header'));
return [header, ...details.map(change => `• ${change}`)].join('\n');
- }
-
- ngOnChanges() {
- this.engines = this.#extractEngines(this.annotation.item).filter(engine => engine.show);
- this.changesTooltip = this.getChangesTooltip();
- this.noSelection = !this.annotation.isSelected || this._multiSelectService.inactive();
- }
+ });
+ private readonly _multiSelectService = inject(MultiSelectService);
+ protected readonly _noSelection = computed(() => !this.annotation().isSelected || this._multiSelectService.inactive());
#extractEngines(annotation: AnnotationWrapper): Engine[] {
return [
diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html
index e3eeb5b22..8c22e3273 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html
+++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.html
@@ -1,6 +1,6 @@
-
+
-
-
+ @defer (on hover(annotationDiv)) {
+
+
+
+ }
}
}
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 c30366d23..a6364564f 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
@@ -11,7 +11,7 @@ import { AnnotationReferencesService } from '../../services/annotation-reference
import { AnnotationsListingService } from '../../services/annotations-listing.service';
import { MultiSelectService } from '../../services/multi-select.service';
import { ViewModeService } from '../../services/view-mode.service';
-import { NgForOf, NgIf } from '@angular/common';
+import { JsonPipe, 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';
@@ -21,7 +21,7 @@ import { AnnotationReferencesListComponent } from '../annotation-references-list
templateUrl: './annotations-list.component.html',
styleUrls: ['./annotations-list.component.scss'],
standalone: true,
- imports: [NgForOf, NgIf, HighlightsSeparatorComponent, AnnotationWrapperComponent, AnnotationReferencesListComponent],
+ imports: [NgForOf, NgIf, HighlightsSeparatorComponent, AnnotationWrapperComponent, AnnotationReferencesListComponent, JsonPipe],
})
export class AnnotationsListComponent extends HasScrollbarDirective {
readonly annotations = input.required[]>();
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 32b509d90..47d3dc13b 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
@@ -32,11 +32,11 @@
-@if (displayedAnnotations$ | async; as annotations) {
+@if (filteredAnnotations$ | async; as annotations) {
@@ -112,7 +112,7 @@
>
@@ -200,7 +200,7 @@
}
@@ -224,7 +224,7 @@
-
+
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 6ccf8e4c7..f65803d1d 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
@@ -9,6 +9,7 @@ import {
OnDestroy,
OnInit,
TemplateRef,
+ untracked,
viewChild,
} from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
@@ -89,23 +90,30 @@ const ALL_HOTKEY_ARRAY = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
],
})
export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, OnDestroy {
- private readonly _annotationsElement = viewChild('annotationsElement');
- private readonly _quickNavigationElement = viewChild('quickNavigation');
readonly multiSelectTemplate = viewChild>('multiSelect');
- readonly #isIqserDevMode = this._userPreferenceService.isIqserDevMode;
+ readonly annotationsList$: Observable[]>;
+ readonly allPages = computed(() => Array.from({ length: this.state.file()?.numberOfPages }, (_x, i) => i + 1));
protected readonly iconButtonTypes = IconButtonTypes;
protected readonly circleButtonTypes = CircleButtonTypes;
- protected readonly displayedAnnotations$: Observable