RED-6774 - fixed redact text issues
This commit is contained in:
parent
0d109b0066
commit
f20f7d3801
@ -1,6 +1,6 @@
|
||||
<section class="dialog">
|
||||
<form (submit)="save()" [formGroup]="form">
|
||||
<div [translate]="'redact-text.dialog.title'" class="dialog-header heading-l"></div>
|
||||
<div [translate]="!hint ? 'redact-text.dialog.title' : 'redact-text.dialog.hint-title'" class="dialog-header heading-l"></div>
|
||||
|
||||
<div class="dialog-content">
|
||||
<div class="iqser-input-group w-450">
|
||||
@ -39,6 +39,18 @@
|
||||
<label [translate]="'redact-text.dialog.content.legal-basis'"></label>
|
||||
<input [value]="form.get('reason').value?.legalBasis" disabled type="text" />
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'redact-text.dialog.content.comment'"></label>
|
||||
<textarea
|
||||
formControlName="comment"
|
||||
iqserHasScrollbar
|
||||
name="comment"
|
||||
rows="4"
|
||||
type="text"
|
||||
[placeholder]="'redact-text.dialog.content.comment-placeholder' | translate"
|
||||
></textarea>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *deny="roles.getRss; if: dictionaryRequest || type === 'HINT'">
|
||||
@ -60,18 +72,6 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'redact-text.dialog.content.comment'"></label>
|
||||
<textarea
|
||||
formControlName="comment"
|
||||
iqserHasScrollbar
|
||||
name="comment"
|
||||
rows="4"
|
||||
type="text"
|
||||
[placeholder]="'redact-text.dialog.content.comment-placeholder' | translate"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
|
||||
@ -58,7 +58,7 @@ export class RedactTextDialogComponent
|
||||
|
||||
readonly #translations = redactTextTranslations;
|
||||
readonly #dossier: Dossier;
|
||||
readonly #hint: boolean;
|
||||
readonly hint: boolean;
|
||||
|
||||
constructor(
|
||||
private readonly _justificationsService: JustificationsService,
|
||||
@ -70,7 +70,7 @@ export class RedactTextDialogComponent
|
||||
super();
|
||||
this.#dossier = _activeDossiersService.find(this.data.dossierId);
|
||||
this.type = this.data.manualRedactionEntryWrapper.type;
|
||||
this.#hint = this.type === ManualRedactionEntryTypes.HINT;
|
||||
this.hint = this.type === ManualRedactionEntryTypes.HINT;
|
||||
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||
this.#manualRedactionTypeExists = this._dictionaryService.hasManualType(this.#dossier.dossierTemplateId);
|
||||
this.options = this.#options();
|
||||
@ -98,14 +98,18 @@ export class RedactTextDialogComponent
|
||||
}
|
||||
|
||||
get disabled() {
|
||||
if (this.dictionaryRequest || this.#hint) {
|
||||
if (this.dictionaryRequest || this.hint) {
|
||||
return !this.form.get('dictionary').value;
|
||||
}
|
||||
return !this.form.get('reason').value;
|
||||
}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
this.dictionaries = this._dictionaryService.getPossibleDictionaries(this.#dossier.dossierTemplateId, this.#hint);
|
||||
this.dictionaries = this._dictionaryService.getPossibleDictionaries(
|
||||
this.#dossier.dossierTemplateId,
|
||||
this.hint,
|
||||
!this.#applyToAllDossiers,
|
||||
);
|
||||
|
||||
const data = await firstValueFrom(this._justificationsService.getForDossierTemplate(this.#dossier.dossierTemplateId));
|
||||
this.legalOptions = data.map(lbm => ({
|
||||
@ -121,6 +125,19 @@ export class RedactTextDialogComponent
|
||||
|
||||
extraOptionChanged(option: DetailsRadioOption<RedactTextOption>): void {
|
||||
this.#applyToAllDossiers = option.extraOption.checked;
|
||||
|
||||
this.dictionaries = this._dictionaryService.getPossibleDictionaries(
|
||||
this.#dossier.dossierTemplateId,
|
||||
this.hint,
|
||||
!this.#applyToAllDossiers,
|
||||
);
|
||||
if (this.#applyToAllDossiers && this.form.get('dictionary').value) {
|
||||
const selectedDictionaryLabel = this.form.get('dictionary').value;
|
||||
const selectedDictionary = this.dictionaries.find(d => d.type === selectedDictionaryLabel);
|
||||
if (!selectedDictionary) {
|
||||
this.form.get('dictionary').setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
save(): void {
|
||||
@ -185,6 +202,9 @@ export class RedactTextDialogComponent
|
||||
addRedactionRequest.value = addRedactionRequest.rectangle
|
||||
? this.form.get('classification').value
|
||||
: this.form.get('selectedText').value;
|
||||
if (this.dictionaryRequest) {
|
||||
addRedactionRequest.addToAllDossiers = this.#applyToAllDossiers;
|
||||
}
|
||||
}
|
||||
|
||||
#options() {
|
||||
|
||||
@ -146,12 +146,15 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
return !!this._dictionariesMapService.get(dossierTemplateId).find(e => e.type === SuperTypes.ManualRedaction && !e.virtual);
|
||||
}
|
||||
|
||||
getPossibleDictionaries(dossierTemplateId: string, hintTypes: boolean): Dictionary[] {
|
||||
getPossibleDictionaries(dossierTemplateId: string, hintTypes: boolean, dossierDictionaryOnly = false): Dictionary[] {
|
||||
const possibleDictionaries: Dictionary[] = [];
|
||||
|
||||
this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => {
|
||||
if (!hintTypes) {
|
||||
if (!d.virtual && !d.hint && !d.systemManaged) {
|
||||
if (
|
||||
(!d.virtual && !d.hint && !d.systemManaged && d.hasDictionary && d.addToDictionaryAction) ||
|
||||
(dossierDictionaryOnly && d.dossierDictionaryOnly)
|
||||
) {
|
||||
possibleDictionaries.push(d);
|
||||
}
|
||||
} else if (d.hint) {
|
||||
|
||||
@ -1647,8 +1647,6 @@
|
||||
"license-info-screen": {
|
||||
"backend-version": "Backend-Version der Anwendung",
|
||||
"chart": {
|
||||
"cumulative": "Seiten insgesamt",
|
||||
"legend": "",
|
||||
"pages-per-month": "Seiten pro Monat",
|
||||
"total-pages": "Gesamtzahl der Seiten"
|
||||
},
|
||||
@ -1943,6 +1941,7 @@
|
||||
"type": "",
|
||||
"type-placeholder": ""
|
||||
},
|
||||
"hint-title": "",
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
|
||||
@ -1647,8 +1647,6 @@
|
||||
"license-info-screen": {
|
||||
"backend-version": "Backend Application Version",
|
||||
"chart": {
|
||||
"cumulative": "Cumulative Pages",
|
||||
"legend": "Legend",
|
||||
"pages-per-month": "Pages per Month",
|
||||
"total-pages": "Total Pages"
|
||||
},
|
||||
@ -1943,6 +1941,7 @@
|
||||
"type": "Type",
|
||||
"type-placeholder": "Select type ..."
|
||||
},
|
||||
"hint-title": "Add Hint",
|
||||
"title": "Redact text"
|
||||
}
|
||||
},
|
||||
|
||||
@ -1647,8 +1647,6 @@
|
||||
"license-info-screen": {
|
||||
"backend-version": "Backend-Version der Anwendung",
|
||||
"chart": {
|
||||
"cumulative": "Seiten insgesamt",
|
||||
"legend": "",
|
||||
"pages-per-month": "Seiten pro Monat",
|
||||
"total-pages": "Gesamtzahl der Seiten"
|
||||
},
|
||||
@ -1943,6 +1941,7 @@
|
||||
"type": "",
|
||||
"type-placeholder": ""
|
||||
},
|
||||
"hint-title": "",
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
|
||||
@ -1647,8 +1647,6 @@
|
||||
"license-info-screen": {
|
||||
"backend-version": "Backend Application Version",
|
||||
"chart": {
|
||||
"cumulative": "Cumulative Pages",
|
||||
"legend": "Legend",
|
||||
"pages-per-month": "Pages per Month",
|
||||
"total-pages": "Total Pages"
|
||||
},
|
||||
@ -1943,6 +1941,7 @@
|
||||
"type": "Type",
|
||||
"type-placeholder": "Select type ..."
|
||||
},
|
||||
"hint-title": "Add Hint",
|
||||
"title": "Redact text"
|
||||
}
|
||||
},
|
||||
|
||||
@ -18,6 +18,7 @@ export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
||||
readonly type: string;
|
||||
readonly hasDictionary?: boolean;
|
||||
readonly systemManaged?: boolean;
|
||||
readonly dossierDictionaryOnly?: boolean;
|
||||
|
||||
entries: List;
|
||||
falsePositiveEntries: List;
|
||||
@ -42,6 +43,7 @@ export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
||||
this.type = entity.type;
|
||||
this.hasDictionary = entity.hasDictionary;
|
||||
this.systemManaged = entity.systemManaged;
|
||||
this.dossierDictionaryOnly = entity.dossierDictionaryOnly;
|
||||
}
|
||||
|
||||
get id(): string {
|
||||
|
||||
@ -58,4 +58,6 @@ export interface IDictionary {
|
||||
readonly hasDictionary?: boolean;
|
||||
|
||||
readonly systemManaged?: boolean;
|
||||
|
||||
readonly dossierDictionaryOnly?: boolean;
|
||||
}
|
||||
|
||||
@ -14,4 +14,5 @@ export interface IAddRedactionRequest {
|
||||
value?: string;
|
||||
section?: string;
|
||||
rectangle?: boolean;
|
||||
addToAllDossiers?: boolean;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user