diff --git a/apps/red-ui/src/app/models/file/list-item.ts b/apps/red-ui/src/app/models/file/list-item.ts index 7bf4a2dea..71ba19148 100644 --- a/apps/red-ui/src/app/models/file/list-item.ts +++ b/apps/red-ui/src/app/models/file/list-item.ts @@ -1,4 +1,5 @@ export interface ListItem { item: T; isSelected: boolean; + multiSelectActive: boolean; } diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.html index c30416ead..c5dbee02b 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.html @@ -1,5 +1,5 @@
- +
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 182504471..183a6dd71 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 @@ -46,6 +46,7 @@ export class AnnotationDetailsComponent implements OnChanges { engines: Engine[]; changesTooltip: string; + noSelection: boolean; constructor(private readonly _translateService: TranslateService, private readonly _listingService: AnnotationsListingService) {} @@ -64,6 +65,7 @@ export class AnnotationDetailsComponent implements OnChanges { ngOnChanges() { this.engines = this.#extractEngines(this.annotation.item).filter(engine => engine.show); this.changesTooltip = this.getChangesTooltip(); + this.noSelection = !this.annotation.isSelected || !this.annotation.multiSelectActive; } #extractEngines(annotation: AnnotationWrapper): Engine[] { 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 4a0192977..994434dd0 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 @@ -20,7 +20,7 @@ {{ annotation.item.comments.length }} -
+
- [this._filterAnnotations(annotations, primary, secondary), multiSelectInactive] as [ - Map, - boolean, - ], + [this._filterAnnotations(annotations, primary, secondary), multiSelectInactive] as const, ), - map(([annotations, multiSelectInactive]) => { - const listItemsMap = new Map[]>(); - if (!annotations) { - return listItemsMap; - } - [...annotations.keys()].forEach(key => { - const newValue = annotations.get(key).map(annotation => ({ - item: annotation, - isSelected: this.listingService.isSelected(annotation) && !multiSelectInactive, - })); - listItemsMap.set(key, newValue); - }); - return listItemsMap; - }), + this._mapListItemsFromAnnotationWrapperArray(), ); } @@ -484,4 +468,24 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy FileWorkloadComponent._scrollToFirstElement(elements); } } + + private _mapListItemsFromAnnotationWrapperArray() { + return pipe( + map(([annotations, multiSelectActive]) => { + const listItemsMap = new Map[]>(); + if (!annotations) { + return listItemsMap; + } + [...annotations.keys()].forEach(key => { + const newValue = annotations.get(key).map(annotation => ({ + item: annotation, + isSelected: this.listingService.isSelected(annotation), + multiSelectActive, + })); + listItemsMap.set(key, newValue); + }); + return listItemsMap; + }), + ); + } }