{{ annotation.superTypeLabel | translate }}
diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.scss b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.scss
index 36304a969..76eb01385 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.scss
+++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-wrapper/annotation-wrapper.component.scss
@@ -58,14 +58,17 @@
}
}
- &:hover,
- &.help-mode {
+ &:hover {
background-color: var(--iqser-annotation-hover);
::ng-deep .annotation-actions {
display: flex;
}
}
+
+ &.active {
+ background-color: var(--iqser-annotation-hover);
+ }
}
.hide-comments {
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 a6827d447..7535542c1 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
@@ -1,4 +1,4 @@
-import { ChangeDetectorRef, Component, computed, ElementRef, EventEmitter, Input, Output } from '@angular/core';
+import { Component, computed, ElementRef, EventEmitter, Input, Output } from '@angular/core';
import { getConfig, HasScrollbarDirective } from '@iqser/common-ui';
import { FilterService } from '@iqser/common-ui/lib/filtering';
import { IqserEventTarget } from '@iqser/common-ui/lib/utils';
@@ -36,7 +36,6 @@ export class AnnotationsListComponent extends HasScrollbarDirective {
constructor(
protected readonly _elementRef: ElementRef,
- protected readonly _changeDetector: ChangeDetectorRef,
private readonly _multiSelectService: MultiSelectService,
private readonly _filterService: FilterService,
private readonly _userPreferenceService: UserPreferenceService,
@@ -45,7 +44,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective {
private readonly _listingService: AnnotationsListingService,
readonly annotationReferencesService: AnnotationReferencesService,
) {
- super(_elementRef, _changeDetector);
+ super(_elementRef);
}
annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): void {
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html
index 92216e66a..39d8bf3d4 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html
+++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.html
@@ -12,6 +12,8 @@
@if (hasUpdatedValues) {
@@ -26,17 +28,19 @@
-
+
@@ -56,6 +60,7 @@
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss
index 3ee2c0515..0246ffeb3 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss
+++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.scss
@@ -29,6 +29,11 @@
iqser-circle-button {
visibility: hidden;
+
+ &.help-mode {
+ visibility: visible;
+ z-index: 600;
+ }
}
.changes-dot {
diff --git a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts
index 51bf95b54..5617d84e0 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts
+++ b/apps/red-ui/src/app/modules/file-preview/components/editable-structured-component-value/editable-structured-component-value.component.ts
@@ -1,13 +1,13 @@
import { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
-import { KeyValuePipe, NgClass, NgForOf, NgIf } from '@angular/common';
+import { AsyncPipe, KeyValuePipe, NgClass, NgForOf, NgIf } from '@angular/common';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatIcon } from '@angular/material/icon';
-import { FilterService } from '@common-ui/filtering';
-import { CircleButtonComponent, IconButtonComponent, IconButtonTypes, IqserDialog } from '@iqser/common-ui';
+import { CircleButtonComponent, HelpModeService, IconButtonComponent, IconButtonTypes, IqserDialog } from '@iqser/common-ui';
import { TranslateModule } from '@ngx-translate/core';
import { IComponentLogEntry, IComponentValue } from '@red/domain';
import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value-dialog/revert-value-dialog.component';
+import { FilePreviewStateService } from '../../services/file-preview-state.service';
@Component({
selector: 'redaction-editable-structured-component-value [entry] [canEdit]',
@@ -27,6 +27,7 @@ import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value
NgForOf,
CdkDragHandle,
FormsModule,
+ AsyncPipe,
],
})
export class EditableStructuredComponentValueComponent implements OnInit {
@@ -43,8 +44,9 @@ export class EditableStructuredComponentValueComponent implements OnInit {
selected = false;
constructor(
- private readonly _filtersService: FilterService,
+ readonly helpModeService: HelpModeService,
private readonly _iqserDialog: IqserDialog,
+ private readonly _state: FilePreviewStateService,
) {}
get disabled() {
@@ -91,7 +93,7 @@ export class EditableStructuredComponentValueComponent implements OnInit {
}
this.deselectLast.emit();
this.selected = true;
- this.#setWorkloadFilters();
+ this._state.componentReferenceIds = this.#getUniqueReferencesIds(this.entry.componentValues);
}
}
@@ -106,7 +108,7 @@ export class EditableStructuredComponentValueComponent implements OnInit {
$event?.stopImmediatePropagation();
this.selected = false;
this.editing = false;
- this._filtersService.deactivateFilters({ primaryFiltersSlug: 'primaryFilters' });
+ this._state.componentReferenceIds = null;
}
removeValue(index: number) {
@@ -150,41 +152,14 @@ export class EditableStructuredComponentValueComponent implements OnInit {
return value.replace(/\n/g, '
');
}
- #setWorkloadFilters() {
- this._filtersService.deactivateFilters({ primaryFiltersSlug: 'primaryFilters' });
- const uniqueLabels = this.#getUniqueReferencesLabels(this.entry.componentValues);
- let setFilterCount = 0;
- for (const label of uniqueLabels) {
- const setFilter = this.#setFilter(label);
- if (setFilter) {
- setFilterCount++;
- }
- }
- if (!setFilterCount) {
- this.#setFilter('no-annotations-filter');
- }
- }
-
- #setFilter(label: string) {
- const filterGroup = this._filtersService.getGroup('primaryFilters');
- for (const filter of filterGroup.filters) {
- const nestedFilter = filter.children.find(f => f.label.toLowerCase() === label);
- if (nestedFilter) {
- this._filtersService.filterCheckboxClicked({ nestedFilter, filterGroup, primaryFiltersSlug: 'primaryFilters' });
- return true;
- }
- }
- }
-
- #getUniqueReferencesLabels(values: IComponentValue[]) {
- const labels: Set
= new Set();
+ #getUniqueReferencesIds(values: IComponentValue[]) {
+ const ids: Set = new Set();
for (const value of values) {
for (const reference of value.entityReferences) {
- const label = reference.type?.replace(/_/g, ' ')?.toLowerCase();
- labels.add(label);
+ ids.add(reference.id);
}
}
- return labels;
+ return Array.from(ids);
}
#updateTextAreaHeight() {
diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html
index f7606feb3..cf93a1f1c 100644
--- a/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html
+++ b/apps/red-ui/src/app/modules/file-preview/components/file-header/file-header.component.html
@@ -33,6 +33,7 @@
[file]="file"
[helpModeKeyPrefix]="'editor'"
[minWidth]="width"
+ [singleEntityAction]="true"
iqserDisableStopPropagation
type="file-preview"
>
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 9e6fac31b..32b509d90 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
@@ -44,34 +44,9 @@
-
-
-
-
- {{ listingService.selectedLength$ | async }} selected
-
-
-
-
-
-
+ @if (!isDocumine) {
+
+ }
+ @if (isDocumine) {
+
+ }
+
.
-
- {{ 'file-preview.tabs.annotations.no-annotations' | translate }}
-
-
-
0 &&
- displayedPages.length === 0 &&
- !filterService.noAnnotationsFilterChecked
- "
- >{{ 'file-preview.tabs.annotations.wrong-filters' | translate }}
-
- {{ 'file-preview.tabs.annotations.the-filters' | translate }}
-
+ @if ((fileDataService.allLength$ | async) > 0 && displayedPages.length === 0) {
+ @if (this.enabledFilters?.length) {
+ {{ 'file-preview.tabs.annotations.wrong-filters' | translate }}
+
+ {{ 'file-preview.tabs.annotations.the-filters' | translate }}
+ } @else if (state.componentReferenceIds?.length === 0) {
+ {{ 'file-preview.tabs.annotations.no-annotations' | translate }}
+ }
+ }