diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 481eeca19..140c98eee 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -6,8 +6,8 @@ import { AnnotationIconType, DefaultColors, Dictionary, + Earmark, FalsePositiveSuperTypes, - Highlight, IComment, IManualChange, IPoint, @@ -124,7 +124,7 @@ export class AnnotationWrapper implements IListable, Record { } get filterKey() { - if (this.isHighlight) { + if (this.isEarmark) { return this.color; } @@ -147,7 +147,7 @@ export class AnnotationWrapper implements IListable, Record { return this.superType === SuperTypes.Hint; } - get isHighlight() { + get isEarmark() { return this.superType === SuperTypes.TextHighlight; } @@ -256,17 +256,17 @@ export class AnnotationWrapper implements IListable, Record { ); } - static fromHighlight(highlight: Highlight) { + static fromEarmark(earmark: Earmark) { const annotationWrapper = new AnnotationWrapper(); - annotationWrapper.annotationId = highlight.id; - annotationWrapper.pageNumber = highlight.positions[0].page; + annotationWrapper.annotationId = earmark.id; + annotationWrapper.pageNumber = earmark.positions[0].page; annotationWrapper.superType = SuperTypes.TextHighlight; annotationWrapper.typeValue = SuperTypes.TextHighlight; annotationWrapper.value = 'Imported'; - annotationWrapper.color = highlight.hexColor; - annotationWrapper.positions = highlight.positions; - annotationWrapper.firstTopLeftPoint = highlight.positions[0]?.topLeft; + annotationWrapper.color = earmark.hexColor; + annotationWrapper.positions = earmark.positions; + annotationWrapper.firstTopLeftPoint = earmark.positions[0]?.topLeft; annotationWrapper.typeLabel = annotationTypesTranslations[annotationWrapper.superType]; return annotationWrapper; diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html index 349b8a93f..031a08ed9 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html @@ -1,7 +1,7 @@
@@ -24,10 +24,10 @@
: {{ annotation.shortContent }}
-
+
: {{ annotation.color }}
-
+
: {{ annotation.width }}x{{ annotation.height }} px
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 222de79b1..bebcc261f 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 @@ -8,7 +8,7 @@ matTooltipPosition="above" > -
+
(); - readonly highlightGroups$ = new BehaviorSubject([]); + readonly earmarkGroups$ = new BehaviorSubject([]); constructor( protected readonly _elementRef: ElementRef, @@ -49,8 +49,8 @@ export class AnnotationsListComponent extends HasScrollbarDirective implements O } ngOnChanges(): void { - if (this._viewModeService.isTextHighlights) { - this._updateHighlightGroups(); + if (this._viewModeService.isEarmarks) { + this._updateEarmarksGroups(); } setTimeout(() => { @@ -88,27 +88,27 @@ export class AnnotationsListComponent extends HasScrollbarDirective implements O } } - showHighlightGroup(idx: number): TextHighlightsGroup { - return this._viewModeService.isTextHighlights && this.highlightGroups$.value.find(h => h.startIdx === idx); + showHighlightGroup(idx: number): EarmarkGroup { + return this._viewModeService.isEarmarks && this.earmarkGroups$.value.find(h => h.startIdx === idx); } - private _updateHighlightGroups(): void { + private _updateEarmarksGroups(): void { if (!this.annotations?.length) { return; } - const highlightGroups: TextHighlightsGroup[] = []; - let lastGroup: TextHighlightsGroup; + const earmarksGroups: EarmarkGroup[] = []; + let lastGroup: EarmarkGroup; for (let idx = 0; idx < this.annotations.length; ++idx) { if (idx === 0 || this.annotations[idx].color !== this.annotations[idx - 1].color) { if (lastGroup) { - highlightGroups.push(lastGroup); + earmarksGroups.push(lastGroup); } lastGroup = { startIdx: idx, length: 1, color: this.annotations[idx].color }; } else { lastGroup.length += 1; } } - highlightGroups.push(lastGroup); - this.highlightGroups$.next(highlightGroups); + earmarksGroups.push(lastGroup); + this.earmarkGroups$.next(earmarksGroups); } } 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 65e00eb9a..2fadc2be8 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 @@ -116,7 +116,7 @@
; readonly showExcludedPages$: Observable; readonly title$: Observable; - readonly isHighlights$: Observable; + readonly isEarmarks$: Observable; @ViewChild('annotationsElement') private readonly _annotationsElement: ElementRef; @ViewChild('quickNavigation') private readonly _quickNavigationElement: ElementRef; @@ -105,7 +105,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy this.displayedAnnotations$ = this._displayedAnnotations$; this.multiSelectInactive$ = this._multiSelectInactive$; this.showExcludedPages$ = this._showExcludedPages$; - this.isHighlights$ = this._isHighlights$; + this.isEarmarks$ = this._isHighlights$; this.title$ = this._title$; } @@ -129,7 +129,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy } private get _title$(): Observable { - return this.isHighlights$.pipe( + return this.isEarmarks$.pipe( map(isHighlights => (isHighlights ? _('file-preview.tabs.highlights.label') : _('file-preview.tabs.annotations.label'))), ); } @@ -137,7 +137,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy private get _isHighlights$(): Observable { return this.viewModeService.viewMode$.pipe( tap(() => this._scrollViews()), - map(() => this.viewModeService.isTextHighlights), + map(() => this.viewModeService.isEarmarks), ); } diff --git a/apps/red-ui/src/app/modules/file-preview/components/highlights-separator/highlights-separator.component.ts b/apps/red-ui/src/app/modules/file-preview/components/highlights-separator/highlights-separator.component.ts index eb3522420..de455d668 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/highlights-separator/highlights-separator.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/highlights-separator/highlights-separator.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { CircleButtonTypes } from '@iqser/common-ui'; -import { TextHighlightOperation, TextHighlightsGroup } from '@red/domain'; +import { EarmarkGroup, EarmarkOperation } from '@red/domain'; import { FilePreviewStateService } from '../../services/file-preview-state.service'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { FilePreviewDialogService } from '../../services/file-preview-dialog.service'; @@ -14,7 +14,7 @@ import { MultiSelectService } from '../../services/multi-select.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class HighlightsSeparatorComponent { - @Input() highlightGroup: TextHighlightsGroup; + @Input() highlightGroup: EarmarkGroup; @Input() annotation: AnnotationWrapper; readonly circleButtonTypes = CircleButtonTypes; @@ -28,17 +28,17 @@ export class HighlightsSeparatorComponent { private readonly _multiSelectService: MultiSelectService, ) {} - convertHighlights(highlightGroup: TextHighlightsGroup): void { - const data = this._getActionData(highlightGroup, TextHighlightOperation.CONVERT); + convertHighlights(highlightGroup: EarmarkGroup): void { + const data = this._getActionData(highlightGroup, EarmarkOperation.CONVERT); this._dialogService.openDialog('highlightAction', null, data); } - removeHighlights(highlightGroup: TextHighlightsGroup): void { - const data = this._getActionData(highlightGroup, TextHighlightOperation.REMOVE); + removeHighlights(highlightGroup: EarmarkGroup): void { + const data = this._getActionData(highlightGroup, EarmarkOperation.REMOVE); this._dialogService.openDialog('highlightAction', null, data); } - private _getActionData(highlightGroup: TextHighlightsGroup, operation: TextHighlightOperation) { + private _getActionData(highlightGroup: EarmarkGroup, operation: EarmarkOperation) { const highlights = this._fileDataService.all.filter(a => a.color === highlightGroup.color); return { dossierId: this._state.dossierId, diff --git a/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.html b/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.html index 120ec09dc..6a6140249 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/view-switch/view-switch.component.html @@ -34,7 +34,7 @@