Merge branch 'RED-8765' into 'master'

RED-8765: fixed actions and edit fields for specific combinations.

See merge request redactmanager/red-ui!372
This commit is contained in:
Dan Percic 2024-04-02 14:38:53 +02:00
commit 035986ea4f
2 changed files with 3 additions and 4 deletions

View File

@ -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;

View File

@ -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);