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