From 3871b7bd4f77cb51e3dfbf2d59d7c06b9acb223d Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Thu, 28 Mar 2024 12:00:39 +0200 Subject: [PATCH] RED-8765: fixed actions and edit fields for specific combinations. --- .../src/app/models/file/annotation-permissions.utils.ts | 3 ++- .../edit-redaction-dialog/edit-redaction-dialog.component.ts | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts b/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts index 168cd371b..ec313b6de 100644 --- a/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts +++ b/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts @@ -56,6 +56,7 @@ export const canResizeAnnotation = ( export const canEditAnnotation = (annotation: AnnotationWrapper) => (annotation.isRedacted || annotation.isSkipped) && !annotation.isImage; -export const canEditHint = (annotation: AnnotationWrapper) => (annotation.isHint && !annotation.isRuleBased) || annotation.isIgnoredHint; +export const canEditHint = (annotation: AnnotationWrapper) => + ((annotation.isHint && !annotation.isRuleBased) || annotation.isIgnoredHint) && !annotation.isImage; export const canEditImage = (annotation: AnnotationWrapper) => annotation.isImage; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts index bfa171555..7c3b94304 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts @@ -9,7 +9,6 @@ import { firstValueFrom } from 'rxjs'; import { getEditRedactionOptions, RedactOrHintOption } from '../../utils/dialog-options'; import { EditRedactionData, EditRedactResult } from '../../utils/dialog-types'; import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component'; -import { editRedactionLabelsTranslations } from '@translations/redact-text-translations'; import { Roles } from '@users/roles'; import { DialogHelpModeKeys } from '../../utils/constants'; @@ -31,11 +30,10 @@ export class EditRedactionDialogComponent readonly #applyToAllDossiers = this.data.applyToAllDossiers; readonly annotations = this.data.annotations; readonly iconButtonTypes = IconButtonTypes; - readonly editRedactionLabelsTranslations = editRedactionLabelsTranslations; readonly isModifyDictionary = this.annotations.every(annotation => annotation.isModifyDictionary); readonly isImage = this.annotations.reduce((acc, next) => acc && next.isImage, true); readonly redactedTexts = !this.isImage ? this.annotations.map(annotation => annotation.value).filter(value => !!value) : null; - readonly isManualRedaction = this.annotations.every(annotation => annotation.type === SuperTypes.ManualRedaction); + readonly isManualRedaction = this.annotations.some(annotation => annotation.type === SuperTypes.ManualRedaction); readonly isHint = this.annotations.every(annotation => annotation.HINT || annotation.IMAGE_HINT); readonly isRedacted = this.annotations.every(annotation => annotation.isRedacted); readonly isImported: boolean = this.annotations.every(annotation => annotation.imported);