RED-8167: fixed rectangle redaction label in edit dialog.

This commit is contained in:
Nicoleta Panaghiu 2024-01-30 16:33:35 +02:00
parent 7bf07bf690
commit d9c30cd23a
5 changed files with 17 additions and 4 deletions

View File

@ -8,8 +8,8 @@
<div class="dialog-content redaction" [class.fixed-height]="isRedacted && isImage">
<div *ngIf="!isImage">
<label [translate]="isImported ? 'edit-redaction.dialog.content.imported' : 'edit-redaction.dialog.content.redacted-text'"></label>
<div *ngIf="!!redactedTexts.length" class="iqser-input-group">
<label [translate]="editRedactionLabelsTranslations[label]"></label>
<div *ngIf="!!redactedTexts.length && !allRectangles" class="iqser-input-group">
<cdk-virtual-scroll-viewport
[itemSize]="16"
[ngStyle]="{ height: redactedTexts.length <= 5 ? 16 * redactedTexts.length + 'px' : 80 + 'px' }"

View File

@ -9,6 +9,7 @@ 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';
interface TypeSelectOptions {
type: string;
@ -102,6 +103,10 @@ export class EditRedactionDialogComponent
return this.annotations.length > 1;
}
get label() {
return this.allRectangles ? 'customRectangle' : this.isImported ? 'imported' : 'redactedText';
}
async ngOnInit() {
this.#setTypes();
const data = await firstValueFrom(this._justificationsService.loadAll(this.#dossier.dossierTemplateId));

View File

@ -31,3 +31,9 @@ export const editRedactionTranslations: Record<'onlyHere' | 'inDossier', DialogO
extraOptionLabel: _('edit-redaction.dialog.content.options.in-dossier.extraOptionLabel'),
},
} as const;
export const editRedactionLabelsTranslations = {
redactedText: _('edit-redaction.dialog.content.redacted-text'),
customRectangle: _('edit-redaction.dialog.content.custom-rectangle'),
imported: _('edit-redaction.dialog.content.imported'),
};

View File

@ -1198,6 +1198,7 @@
"comment": "Comment",
"comment-placeholder": "Add remarks or mentions...",
"imported": "Imported Redaction",
"custom-rectangle": "Custom Rectangle",
"legal-basis": "Legal basis",
"options": {
"in-dossier": {
@ -2467,4 +2468,4 @@
}
},
"yesterday": "Gestern"
}
}

View File

@ -1212,6 +1212,7 @@
"reason": "Reason",
"redacted-text": "Annotated text",
"imported": "Imported Redaction",
"custom-rectangle": "Custom Rectangle",
"section": "Paragraph / location",
"type": "Type",
"unchanged": "Unchanged"
@ -2467,4 +2468,4 @@
}
},
"yesterday": "Yesterday"
}
}