RED-10515: fixed multi select for hidden annotations.
This commit is contained in:
parent
4dbfba1c7b
commit
182a11ce5b
@ -1,9 +1,8 @@
|
|||||||
import { ActivatedRouteSnapshot, NavigationExtras, Router, RouterLink } from '@angular/router';
|
import { ActivatedRouteSnapshot, NavigationExtras, Router } from '@angular/router';
|
||||||
import { ChangeDetectorRef, Component, effect, NgZone, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
import { ChangeDetectorRef, Component, effect, NgZone, OnDestroy, OnInit, TemplateRef, untracked, ViewChild } from '@angular/core';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { ComponentCanDeactivate } from '@guards/can-deactivate.guard';
|
import { ComponentCanDeactivate } from '@guards/can-deactivate.guard';
|
||||||
import {
|
import {
|
||||||
CircleButtonComponent,
|
|
||||||
CircleButtonTypes,
|
CircleButtonTypes,
|
||||||
ConfirmOption,
|
ConfirmOption,
|
||||||
ConfirmOptions,
|
ConfirmOptions,
|
||||||
@ -12,7 +11,6 @@ import {
|
|||||||
ErrorService,
|
ErrorService,
|
||||||
getConfig,
|
getConfig,
|
||||||
IConfirmationDialogData,
|
IConfirmationDialogData,
|
||||||
IqserAllowDirective,
|
|
||||||
IqserDialog,
|
IqserDialog,
|
||||||
LoadingService,
|
LoadingService,
|
||||||
Toaster,
|
Toaster,
|
||||||
@ -60,12 +58,7 @@ import { ViewModeService } from './services/view-mode.service';
|
|||||||
import { RedactTextData } from './utils/dialog-types';
|
import { RedactTextData } from './utils/dialog-types';
|
||||||
import { MultiSelectService } from './services/multi-select.service';
|
import { MultiSelectService } from './services/multi-select.service';
|
||||||
import { NgIf } from '@angular/common';
|
import { NgIf } from '@angular/common';
|
||||||
import { ViewSwitchComponent } from './components/view-switch/view-switch.component';
|
|
||||||
import { ProcessingIndicatorComponent } from '@shared/components/processing-indicator/processing-indicator.component';
|
|
||||||
import { UserManagementComponent } from './components/user-management/user-management.component';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { InitialsAvatarComponent } from '@common-ui/users';
|
|
||||||
import { FileActionsComponent } from '../shared-dossiers/components/file-actions/file-actions.component';
|
|
||||||
import { FilePreviewRightContainerComponent } from './components/right-container/file-preview-right-container.component';
|
import { FilePreviewRightContainerComponent } from './components/right-container/file-preview-right-container.component';
|
||||||
import { TypeFilterComponent } from '@shared/components/type-filter/type-filter.component';
|
import { TypeFilterComponent } from '@shared/components/type-filter/type-filter.component';
|
||||||
import { FileHeaderComponent } from './components/file-header/file-header.component';
|
import { FileHeaderComponent } from './components/file-header/file-header.component';
|
||||||
@ -80,16 +73,8 @@ import { ANNOTATION_ACTION_ICONS, ANNOTATION_ACTIONS } from './utils/constants';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
NgIf,
|
NgIf,
|
||||||
ViewSwitchComponent,
|
|
||||||
ProcessingIndicatorComponent,
|
|
||||||
UserManagementComponent,
|
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
InitialsAvatarComponent,
|
|
||||||
CircleButtonComponent,
|
|
||||||
IqserAllowDirective,
|
|
||||||
FileActionsComponent,
|
|
||||||
DisableStopPropagationDirective,
|
DisableStopPropagationDirective,
|
||||||
RouterLink,
|
|
||||||
FilePreviewRightContainerComponent,
|
FilePreviewRightContainerComponent,
|
||||||
TypeFilterComponent,
|
TypeFilterComponent,
|
||||||
FileHeaderComponent,
|
FileHeaderComponent,
|
||||||
@ -101,13 +86,13 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
readonly roles = Roles;
|
readonly roles = Roles;
|
||||||
readonly fileId = this.state.fileId;
|
readonly fileId = this.state.fileId;
|
||||||
readonly dossierId = this.state.dossierId;
|
readonly dossierId = this.state.dossierId;
|
||||||
|
protected readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||||
@ViewChild('annotationFilterTemplate', {
|
@ViewChild('annotationFilterTemplate', {
|
||||||
read: TemplateRef,
|
read: TemplateRef,
|
||||||
static: false,
|
static: false,
|
||||||
})
|
})
|
||||||
private readonly _filterTemplate: TemplateRef<unknown>;
|
private readonly _filterTemplate: TemplateRef<unknown>;
|
||||||
#loadAllAnnotationsEnabled = false;
|
#loadAllAnnotationsEnabled = false;
|
||||||
protected readonly isDocumine = getConfig().IS_DOCUMINE;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly pdf: PdfViewer,
|
readonly pdf: PdfViewer,
|
||||||
@ -180,6 +165,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
|
|
||||||
effect(() => {
|
effect(() => {
|
||||||
this._viewModeService.viewMode();
|
this._viewModeService.viewMode();
|
||||||
|
this.pdf.currentPage();
|
||||||
this.updateViewMode().then();
|
this.updateViewMode().then();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -251,7 +237,8 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
|
|
||||||
switch (this._viewModeService.viewMode()) {
|
switch (this._viewModeService.viewMode()) {
|
||||||
case ViewModes.STANDARD: {
|
case ViewModes.STANDARD: {
|
||||||
const wrappers = this._fileDataService.annotations();
|
const wrappers = untracked(this._fileDataService.annotations);
|
||||||
|
const multiSelectActive = untracked(this._multiSelectService.active);
|
||||||
const ocrAnnotationIds = wrappers.filter(a => a.isOCR).map(a => a.id);
|
const ocrAnnotationIds = wrappers.filter(a => a.isOCR).map(a => a.id);
|
||||||
const standardEntries = annotations
|
const standardEntries = annotations
|
||||||
.filter(a => !bool(a.getCustomData('changeLogRemoved')) && !this._annotationManager.isHidden(a.Id))
|
.filter(a => !bool(a.getCustomData('changeLogRemoved')) && !this._annotationManager.isHidden(a.Id))
|
||||||
@ -265,7 +252,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
this._readableRedactionsService.setAnnotationsColor(standardEntries, 'annotationColor');
|
this._readableRedactionsService.setAnnotationsColor(standardEntries, 'annotationColor');
|
||||||
this._readableRedactionsService.setAnnotationsOpacity(standardEntries, true);
|
this._readableRedactionsService.setAnnotationsOpacity(standardEntries, true);
|
||||||
this._annotationManager.show(standardEntries);
|
this._annotationManager.show(standardEntries);
|
||||||
this._annotationManager.hide(nonStandardEntries);
|
this._annotationManager.hide(nonStandardEntries, multiSelectActive);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ViewModes.DELTA: {
|
case ViewModes.DELTA: {
|
||||||
|
|||||||
@ -106,7 +106,11 @@ export class REDAnnotationManager {
|
|||||||
this.deselect(this.selected.map(annotation => annotation.Id));
|
this.deselect(this.selected.map(annotation => annotation.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
hide(annotations: Annotation[]): void {
|
hide(annotations: Annotation[], multiSelectActive = false): void {
|
||||||
|
if (multiSelectActive) {
|
||||||
|
annotations.forEach(a => (a['Opacity'] = 0));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.#manager.hideAnnotations(annotations);
|
this.#manager.hideAnnotations(annotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user