Merge branch 'master' into VM/DM-337
This commit is contained in:
commit
fab49ae183
@ -75,7 +75,7 @@ export class AnnotationActionsComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeOrSuggestRemoveRedaction() {
|
removeOrSuggestRemoveRedaction() {
|
||||||
this.annotationActionsService.removeOrSuggestRemoveRedaction(this.annotations[0], this.annotationPermissions);
|
this.annotationActionsService.removeRedaction(this.annotations[0], this.annotationPermissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptRecommendation() {
|
acceptRecommendation() {
|
||||||
|
|||||||
@ -0,0 +1,65 @@
|
|||||||
|
<section class="dialog">
|
||||||
|
<form (submit)="save()" [formGroup]="form">
|
||||||
|
<div [translate]="'add-hint.dialog.title'" class="dialog-header heading-l"></div>
|
||||||
|
|
||||||
|
<div class="dialog-content">
|
||||||
|
<div class="iqser-input-group w-450">
|
||||||
|
<label [translate]="'add-hint.dialog.content.selected-text'"></label>
|
||||||
|
{{ form.get('selectedText').value }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<iqser-details-radio
|
||||||
|
[options]="options"
|
||||||
|
(extraOptionChanged)="extraOptionChanged($event)"
|
||||||
|
formControlName="option"
|
||||||
|
></iqser-details-radio>
|
||||||
|
|
||||||
|
<ng-container *deny="roles.getRss">
|
||||||
|
<div class="iqser-input-group required w-450">
|
||||||
|
<label [translate]="'add-hint.dialog.content.type'"></label>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select formControlName="dictionary" [placeholder]="'add-hint.dialog.content.type-placeholder' | translate">
|
||||||
|
<mat-select-trigger>{{ displayedDictionaryLabel }}</mat-select-trigger>
|
||||||
|
<mat-option
|
||||||
|
*ngFor="let dictionary of dictionaries"
|
||||||
|
[matTooltip]="dictionary.description"
|
||||||
|
[value]="dictionary.type"
|
||||||
|
(click)="typeChanged()"
|
||||||
|
matTooltipPosition="after"
|
||||||
|
>
|
||||||
|
<span> {{ dictionary.label }} </span>
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<div *ngIf="!dictionaryRequest" class="iqser-input-group w-450">
|
||||||
|
<label [translate]="'add-hint.dialog.content.comment'"></label>
|
||||||
|
<textarea
|
||||||
|
formControlName="comment"
|
||||||
|
iqserHasScrollbar
|
||||||
|
name="comment"
|
||||||
|
rows="4"
|
||||||
|
type="text"
|
||||||
|
[placeholder]="'add-hint.dialog.content.comment-placeholder' | translate"
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dialog-actions">
|
||||||
|
<iqser-icon-button
|
||||||
|
[label]="'add-hint.dialog.actions.save' | translate"
|
||||||
|
[submit]="true"
|
||||||
|
[type]="iconButtonTypes.primary"
|
||||||
|
[disabled]="disabled"
|
||||||
|
>
|
||||||
|
</iqser-icon-button>
|
||||||
|
|
||||||
|
<div class="all-caps-label cancel" mat-dialog-close [translate]="'add-hint.dialog.actions.cancel'"></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<iqser-circle-button (action)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>
|
||||||
|
</section>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
label {
|
||||||
|
font-weight: bold;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
iqser-details-radio {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { DetailsRadioOption, IconButtonTypes, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
|
import { Dictionary, Dossier, IAddRedactionRequest, SuperTypes } from '@red/domain';
|
||||||
|
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
|
import { Roles } from '@users/roles';
|
||||||
|
import { JustificationsService } from '@services/entity-services/justifications.service';
|
||||||
|
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||||
|
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||||
|
import { tap } from 'rxjs/operators';
|
||||||
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
import { IqserDialogComponent } from '@common-ui/dialog/iqser-dialog-component.directive';
|
||||||
|
import { RedactOrHintData, RedactOrHintResult } from '../../utils/dialog-types';
|
||||||
|
import { getRedactOrHintOptions, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-options';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: './add-hint-dialog.component.html',
|
||||||
|
styleUrls: ['./add-hint-dialog.component.scss'],
|
||||||
|
})
|
||||||
|
export class AddHintDialogComponent
|
||||||
|
extends IqserDialogComponent<AddHintDialogComponent, RedactOrHintData, RedactOrHintResult>
|
||||||
|
implements OnInit
|
||||||
|
{
|
||||||
|
readonly roles = Roles;
|
||||||
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
|
readonly options: DetailsRadioOption<RedactOrHintOption>[];
|
||||||
|
dictionaryRequest = false;
|
||||||
|
dictionaries: Dictionary[] = [];
|
||||||
|
form!: UntypedFormGroup;
|
||||||
|
|
||||||
|
#manualRedactionTypeExists = true;
|
||||||
|
#applyToAllDossiers: boolean;
|
||||||
|
|
||||||
|
readonly #dossier: Dossier;
|
||||||
|
readonly #isRss = this._iqserPermissionsService.has(Roles.getRss);
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private readonly _justificationsService: JustificationsService,
|
||||||
|
private readonly _activeDossiersService: ActiveDossiersService,
|
||||||
|
private readonly _dictionaryService: DictionaryService,
|
||||||
|
private readonly _iqserPermissionsService: IqserPermissionsService,
|
||||||
|
private readonly _formBuilder: FormBuilder,
|
||||||
|
) {
|
||||||
|
super();
|
||||||
|
this.#dossier = _activeDossiersService.find(this.data.dossierId);
|
||||||
|
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||||
|
this.#manualRedactionTypeExists = this._dictionaryService.hasManualType(this.#dossier.dossierTemplateId);
|
||||||
|
this.options = getRedactOrHintOptions(this.#dossier, this.#isRss, true, this.#applyToAllDossiers, this.data.isApprover);
|
||||||
|
|
||||||
|
this.form = this.#getForm();
|
||||||
|
|
||||||
|
this.form
|
||||||
|
.get('option')
|
||||||
|
.valueChanges.pipe(
|
||||||
|
tap((option: DetailsRadioOption<RedactOrHintOption>) => {
|
||||||
|
this.dictionaryRequest = option.value === RedactOrHintOptions.IN_DOSSIER;
|
||||||
|
this.#setDictionaries();
|
||||||
|
this.#resetValues();
|
||||||
|
}),
|
||||||
|
takeUntilDestroyed(),
|
||||||
|
)
|
||||||
|
.subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
get displayedDictionaryLabel() {
|
||||||
|
const dictType = this.form.get('dictionary').value;
|
||||||
|
if (dictType) {
|
||||||
|
return this.dictionaries.find(d => d.type === dictType)?.label ?? null;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
get disabled() {
|
||||||
|
if (this.dictionaryRequest || this.#isRss) {
|
||||||
|
return !this.form.get('dictionary').value;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async ngOnInit(): Promise<void> {
|
||||||
|
this.#setDictionaries();
|
||||||
|
this.#resetValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
extraOptionChanged(option: DetailsRadioOption<RedactOrHintOption>): void {
|
||||||
|
this.#applyToAllDossiers = option.extraOption.checked;
|
||||||
|
|
||||||
|
this.#setDictionaries();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typeChanged() {
|
||||||
|
if (!this.#applyToAllDossiers) {
|
||||||
|
const selectedDictionaryType = this.form.get('dictionary').value;
|
||||||
|
const selectedDictionary = this.dictionaries.find(d => d.type === selectedDictionaryType);
|
||||||
|
this.options[1].extraOption.disabled = selectedDictionary.dossierDictionaryOnly;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
save(): void {
|
||||||
|
this.#enhanceManualRedaction(this.data.manualRedactionEntryWrapper.manualRedactionEntry);
|
||||||
|
const redaction = this.data.manualRedactionEntryWrapper.manualRedactionEntry;
|
||||||
|
this.dialogRef.close({
|
||||||
|
redaction,
|
||||||
|
dictionary: this.dictionaries.find(d => d.type === this.form.get('dictionary').value),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#setDictionaries() {
|
||||||
|
this.dictionaries = this._dictionaryService.getAddHintDictionaries(
|
||||||
|
this.#dossier.dossierTemplateId,
|
||||||
|
!this.#applyToAllDossiers,
|
||||||
|
this.dictionaryRequest,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#getForm(): UntypedFormGroup {
|
||||||
|
return this._formBuilder.group({
|
||||||
|
selectedText: this.data?.manualRedactionEntryWrapper?.manualRedactionEntry?.value,
|
||||||
|
reason: [null],
|
||||||
|
comment: [null],
|
||||||
|
dictionary: [this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null],
|
||||||
|
classification: ['non-readable content'],
|
||||||
|
section: [null],
|
||||||
|
option: [this.options[0]],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) {
|
||||||
|
addRedactionRequest.reason = 'Dictionary Request';
|
||||||
|
addRedactionRequest.type = this.form.get('dictionary').value;
|
||||||
|
addRedactionRequest.section = this.form.get('section').value;
|
||||||
|
addRedactionRequest.value = this.form.get('selectedText').value;
|
||||||
|
|
||||||
|
const selectedType = this.dictionaries.find(d => d.type === addRedactionRequest.type);
|
||||||
|
if (selectedType) {
|
||||||
|
addRedactionRequest.addToDictionary = selectedType.hasDictionary;
|
||||||
|
} else {
|
||||||
|
addRedactionRequest.addToDictionary = this.dictionaryRequest && addRedactionRequest.type !== 'dossier_redaction';
|
||||||
|
}
|
||||||
|
|
||||||
|
const commentValue = this.form.get('comment').value;
|
||||||
|
addRedactionRequest.comment = commentValue ? { text: commentValue } : null;
|
||||||
|
addRedactionRequest.addToAllDossiers = this.data.isApprover && this.dictionaryRequest && this.#applyToAllDossiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resetValues() {
|
||||||
|
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||||
|
if (!this.#isRss) {
|
||||||
|
this.options[1].extraOption.checked = this.#applyToAllDossiers;
|
||||||
|
}
|
||||||
|
if (this.dictionaryRequest) {
|
||||||
|
this.form.get('dictionary').setValue(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.form.get('dictionary').setValue(this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<section class="dialog">
|
<section class="dialog">
|
||||||
<form (submit)="save()" [formGroup]="form">
|
<form (submit)="save()" [formGroup]="form">
|
||||||
<div [translate]="!hint ? 'redact-text.dialog.title' : 'redact-text.dialog.hint-title'" class="dialog-header heading-l"></div>
|
<div [translate]="'redact-text.dialog.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">
|
||||||
@ -14,7 +14,7 @@
|
|||||||
formControlName="option"
|
formControlName="option"
|
||||||
></iqser-details-radio>
|
></iqser-details-radio>
|
||||||
|
|
||||||
<ng-container *deny="roles.getRss; if: !dictionaryRequest && type !== 'HINT'">
|
<ng-container *deny="roles.getRss; if: !dictionaryRequest">
|
||||||
<div class="iqser-input-group required w-450">
|
<div class="iqser-input-group required w-450">
|
||||||
<label [translate]="'redact-text.dialog.content.reason'"></label>
|
<label [translate]="'redact-text.dialog.content.reason'"></label>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *deny="roles.getRss; if: dictionaryRequest || type === 'HINT'">
|
<ng-container *deny="roles.getRss; if: dictionaryRequest">
|
||||||
<div class="iqser-input-group required w-450">
|
<div class="iqser-input-group required w-450">
|
||||||
<label [translate]="'redact-text.dialog.content.type'"></label>
|
<label [translate]="'redact-text.dialog.content.type'"></label>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { DetailsRadioOption, IconButtonTypes, IqserPermissionsService } from '@iqser/common-ui';
|
import { DetailsRadioOption, IconButtonTypes, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
import { Dictionary, Dossier, File, IAddRedactionRequest, IManualRedactionEntry, SuperTypes } from '@red/domain';
|
import { Dictionary, Dossier, IAddRedactionRequest, SuperTypes } from '@red/domain';
|
||||||
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
@ -8,44 +8,23 @@ import { JustificationsService } from '@services/entity-services/justifications.
|
|||||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||||
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
||||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||||
|
|
||||||
import { ManualRedactionEntryType, ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
|
||||||
import { redactTextTranslations } from '@translations/redact-text-translations';
|
|
||||||
import { RedactTextOption, RedactTextOptions } from './redact-text-options';
|
|
||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { IqserDialogComponent } from '@iqser/common-ui';
|
import { IqserDialogComponent } from '@common-ui/dialog/iqser-dialog-component.directive';
|
||||||
|
import { getRedactOrHintOptions, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-options';
|
||||||
const PIN_ICON = 'red:push-pin';
|
import { RedactOrHintData, RedactOrHintResult } from '../../utils/dialog-types';
|
||||||
const FOLDER_ICON = 'red:folder';
|
|
||||||
|
|
||||||
export interface RedactTextData {
|
|
||||||
manualRedactionEntryWrapper: ManualRedactionEntryWrapper;
|
|
||||||
dossierId: string;
|
|
||||||
file: File;
|
|
||||||
applyToAllDossiers: boolean;
|
|
||||||
isApprover: boolean;
|
|
||||||
hint: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DialogResult {
|
|
||||||
redaction: IManualRedactionEntry;
|
|
||||||
dictionary: Dictionary;
|
|
||||||
applyToAllDossiers: boolean | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './redact-text-dialog.component.html',
|
templateUrl: './redact-text-dialog.component.html',
|
||||||
styleUrls: ['./redact-text-dialog.component.scss'],
|
styleUrls: ['./redact-text-dialog.component.scss'],
|
||||||
})
|
})
|
||||||
export class RedactTextDialogComponent
|
export class RedactTextDialogComponent
|
||||||
extends IqserDialogComponent<RedactTextDialogComponent, RedactTextData, DialogResult>
|
extends IqserDialogComponent<RedactTextDialogComponent, RedactOrHintData, RedactOrHintResult>
|
||||||
implements OnInit
|
implements OnInit
|
||||||
{
|
{
|
||||||
readonly roles = Roles;
|
readonly roles = Roles;
|
||||||
readonly iconButtonTypes = IconButtonTypes;
|
readonly iconButtonTypes = IconButtonTypes;
|
||||||
readonly options: DetailsRadioOption<RedactTextOption>[];
|
readonly options: DetailsRadioOption<RedactOrHintOption>[];
|
||||||
readonly type: ManualRedactionEntryType;
|
|
||||||
dictionaryRequest = false;
|
dictionaryRequest = false;
|
||||||
legalOptions: LegalBasisOption[] = [];
|
legalOptions: LegalBasisOption[] = [];
|
||||||
dictionaries: Dictionary[] = [];
|
dictionaries: Dictionary[] = [];
|
||||||
@ -54,10 +33,8 @@ export class RedactTextDialogComponent
|
|||||||
#manualRedactionTypeExists = true;
|
#manualRedactionTypeExists = true;
|
||||||
#applyToAllDossiers: boolean;
|
#applyToAllDossiers: boolean;
|
||||||
|
|
||||||
readonly #translations = redactTextTranslations;
|
|
||||||
readonly #dossier: Dossier;
|
readonly #dossier: Dossier;
|
||||||
readonly #isRss = this._iqserPermissionsService.has(Roles.getRss);
|
readonly #isRss = this._iqserPermissionsService.has(Roles.getRss);
|
||||||
readonly hint: boolean;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _justificationsService: JustificationsService,
|
private readonly _justificationsService: JustificationsService,
|
||||||
@ -68,19 +45,17 @@ 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.hint = this.data.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 = getRedactOrHintOptions(this.#dossier, this.#isRss, false, this.#applyToAllDossiers, this.data.isApprover);
|
||||||
|
|
||||||
this.form = this.#getForm();
|
this.form = this.#getForm();
|
||||||
|
|
||||||
this.form
|
this.form
|
||||||
.get('option')
|
.get('option')
|
||||||
.valueChanges.pipe(
|
.valueChanges.pipe(
|
||||||
tap((option: DetailsRadioOption<RedactTextOption>) => {
|
tap((option: DetailsRadioOption<RedactOrHintOption>) => {
|
||||||
this.dictionaryRequest = option.value === RedactTextOptions.IN_DOSSIER;
|
this.dictionaryRequest = option.value === RedactOrHintOptions.IN_DOSSIER;
|
||||||
this.#setDictionaries();
|
this.#setDictionaries();
|
||||||
this.#resetValues();
|
this.#resetValues();
|
||||||
}),
|
}),
|
||||||
@ -98,7 +73,7 @@ export class RedactTextDialogComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
get disabled() {
|
get disabled() {
|
||||||
if (this.dictionaryRequest || this.hint || this.#isRss) {
|
if (this.dictionaryRequest || this.#isRss) {
|
||||||
return !this.form.get('dictionary').value;
|
return !this.form.get('dictionary').value;
|
||||||
}
|
}
|
||||||
return !this.form.get('reason').value;
|
return !this.form.get('reason').value;
|
||||||
@ -115,11 +90,10 @@ export class RedactTextDialogComponent
|
|||||||
this.legalOptions.sort((a, b) => a.label.localeCompare(b.label));
|
this.legalOptions.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
|
|
||||||
this.#selectReason();
|
this.#selectReason();
|
||||||
this.#formatSelectedTextValue();
|
|
||||||
this.#resetValues();
|
this.#resetValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
extraOptionChanged(option: DetailsRadioOption<RedactTextOption>): void {
|
extraOptionChanged(option: DetailsRadioOption<RedactOrHintOption>): void {
|
||||||
this.#applyToAllDossiers = option.extraOption.checked;
|
this.#applyToAllDossiers = option.extraOption.checked;
|
||||||
|
|
||||||
this.#setDictionaries();
|
this.#setDictionaries();
|
||||||
@ -150,9 +124,8 @@ export class RedactTextDialogComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#setDictionaries() {
|
#setDictionaries() {
|
||||||
this.dictionaries = this._dictionaryService.getPossibleDictionaries(
|
this.dictionaries = this._dictionaryService.getRedactTextDictionaries(
|
||||||
this.#dossier.dossierTemplateId,
|
this.#dossier.dossierTemplateId,
|
||||||
this.hint,
|
|
||||||
!this.#applyToAllDossiers,
|
!this.#applyToAllDossiers,
|
||||||
this.dictionaryRequest,
|
this.dictionaryRequest,
|
||||||
);
|
);
|
||||||
@ -164,21 +137,11 @@ export class RedactTextDialogComponent
|
|||||||
reason: [null],
|
reason: [null],
|
||||||
comment: [null],
|
comment: [null],
|
||||||
dictionary: [this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null],
|
dictionary: [this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null],
|
||||||
classification: ['non-readable content'],
|
|
||||||
section: [null],
|
section: [null],
|
||||||
option: [this.options[0]],
|
option: [this.options[0]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#formatSelectedTextValue(): void {
|
|
||||||
this.data.manualRedactionEntryWrapper.manualRedactionEntry.value =
|
|
||||||
this.data.manualRedactionEntryWrapper.manualRedactionEntry.value.replace(
|
|
||||||
// eslint-disable-next-line no-control-regex,max-len
|
|
||||||
/([^\s\d-]{2,})[-\u00AD]\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi,
|
|
||||||
'$1',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#selectReason() {
|
#selectReason() {
|
||||||
if (this.legalOptions.length === 1) {
|
if (this.legalOptions.length === 1) {
|
||||||
this.form.get('reason').setValue(this.legalOptions[0]);
|
this.form.get('reason').setValue(this.legalOptions[0]);
|
||||||
@ -186,8 +149,11 @@ export class RedactTextDialogComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) {
|
#enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) {
|
||||||
const legalOption: LegalBasisOption = this.form.get('reason').value;
|
|
||||||
addRedactionRequest.type = this.form.get('dictionary').value;
|
addRedactionRequest.type = this.form.get('dictionary').value;
|
||||||
|
addRedactionRequest.section = this.form.get('section').value;
|
||||||
|
addRedactionRequest.value = this.form.get('selectedText').value;
|
||||||
|
|
||||||
|
const legalOption: LegalBasisOption = this.form.get('reason').value;
|
||||||
if (legalOption) {
|
if (legalOption) {
|
||||||
addRedactionRequest.reason = legalOption.description;
|
addRedactionRequest.reason = legalOption.description;
|
||||||
addRedactionRequest.legalBasis = legalOption.legalBasis;
|
addRedactionRequest.legalBasis = legalOption.legalBasis;
|
||||||
@ -206,45 +172,15 @@ export class RedactTextDialogComponent
|
|||||||
}
|
}
|
||||||
const commentValue = this.form.get('comment').value;
|
const commentValue = this.form.get('comment').value;
|
||||||
addRedactionRequest.comment = commentValue ? { text: commentValue } : null;
|
addRedactionRequest.comment = commentValue ? { text: commentValue } : null;
|
||||||
addRedactionRequest.section = this.form.get('section').value;
|
|
||||||
addRedactionRequest.value = addRedactionRequest.rectangle
|
|
||||||
? this.form.get('classification').value
|
|
||||||
: this.form.get('selectedText').value;
|
|
||||||
addRedactionRequest.addToAllDossiers = this.data.isApprover && this.dictionaryRequest && this.#applyToAllDossiers;
|
addRedactionRequest.addToAllDossiers = this.data.isApprover && this.dictionaryRequest && this.#applyToAllDossiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
#options() {
|
|
||||||
const options: DetailsRadioOption<RedactTextOption>[] = [
|
|
||||||
{
|
|
||||||
label: this.#translations[this.type].onlyHere.label,
|
|
||||||
description: this.#translations[this.type].onlyHere.description,
|
|
||||||
icon: PIN_ICON,
|
|
||||||
value: RedactTextOptions.ONLY_HERE,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
if (!this.#isRss) {
|
|
||||||
options.push({
|
|
||||||
label: this.#translations[this.type].inDossier.label,
|
|
||||||
description: this.#translations[this.type].inDossier.description,
|
|
||||||
descriptionParams: { dossierName: this.#dossier.dossierName },
|
|
||||||
icon: FOLDER_ICON,
|
|
||||||
value: RedactTextOptions.IN_DOSSIER,
|
|
||||||
extraOption: {
|
|
||||||
label: this.#translations[this.type].inDossier.extraOptionLabel,
|
|
||||||
checked: this.data.applyToAllDossiers ?? true,
|
|
||||||
hidden: !this.data.isApprover,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
#resetValues() {
|
#resetValues() {
|
||||||
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||||
if (!this.#isRss) {
|
if (!this.#isRss) {
|
||||||
this.options[1].extraOption.checked = this.#applyToAllDossiers;
|
this.options[1].extraOption.checked = this.#applyToAllDossiers;
|
||||||
}
|
}
|
||||||
if (this.dictionaryRequest || this.hint) {
|
if (this.dictionaryRequest) {
|
||||||
this.form.get('reason').setValue(null);
|
this.form.get('reason').setValue(null);
|
||||||
this.form.get('dictionary').setValue(null);
|
this.form.get('dictionary').setValue(null);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
export const RedactTextOptions = {
|
|
||||||
ONLY_HERE: 'ONLY_HERE',
|
|
||||||
IN_DOSSIER: 'IN_DOSSIER',
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export type RedactTextOption = keyof typeof RedactTextOptions;
|
|
||||||
@ -1,42 +1,15 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { DetailsRadioOption, IconButtonTypes } from '@iqser/common-ui';
|
import { DetailsRadioOption, IconButtonTypes } from '@iqser/common-ui';
|
||||||
import { RemoveRedactionOption, RemoveRedactionOptions } from './remove-redaction-options';
|
|
||||||
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
import { removeRedactionTranslations } from '@translations/remove-redaction-translations';
|
import { IqserDialogComponent } from '@common-ui/dialog/iqser-dialog-component.directive';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
|
||||||
import { Dossier } from '@red/domain';
|
|
||||||
import { IqserDialogComponent } from '@iqser/common-ui';
|
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
import { RemoveRedactionData, RemoveRedactionResult } from '../../utils/dialog-types';
|
||||||
const PIN_ICON = 'red:push-pin';
|
import { getRemoveRedactionOptions, RemoveRedactionOption } from '../../utils/dialog-options';
|
||||||
const FOLDER_ICON = 'red:folder';
|
|
||||||
const REMOVE_FROM_DICT_ICON = 'red:remove-from-dict';
|
|
||||||
|
|
||||||
export interface RemoveRedactionPermissions {
|
|
||||||
canRemoveOnlyHere: boolean;
|
|
||||||
canRemoveFromDictionary: boolean;
|
|
||||||
canMarkAsFalsePositive: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RemoveRedactionData {
|
|
||||||
redaction: AnnotationWrapper;
|
|
||||||
dossier: Dossier;
|
|
||||||
falsePositiveContext: string;
|
|
||||||
permissions: RemoveRedactionPermissions;
|
|
||||||
applyToAllDossiers: boolean;
|
|
||||||
isApprover: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RemoveRedactionResult {
|
|
||||||
comment: string;
|
|
||||||
option: DetailsRadioOption<RemoveRedactionOption>;
|
|
||||||
applyToAllDossiers: boolean | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './remove-redaction-dialog.html',
|
templateUrl: './remove-redaction-dialog.component.html',
|
||||||
styleUrls: ['./remove-redaction-dialog.component.scss'],
|
styleUrls: ['./remove-redaction-dialog.component.scss'],
|
||||||
})
|
})
|
||||||
export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
||||||
@ -50,17 +23,12 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
|||||||
form!: UntypedFormGroup;
|
form!: UntypedFormGroup;
|
||||||
hint: boolean;
|
hint: boolean;
|
||||||
|
|
||||||
readonly #redaction: AnnotationWrapper;
|
|
||||||
readonly #permissions: RemoveRedactionPermissions;
|
|
||||||
readonly #translations = removeRedactionTranslations;
|
|
||||||
#applyToAllDossiers: boolean;
|
#applyToAllDossiers: boolean;
|
||||||
|
|
||||||
constructor(private readonly _formBuilder: FormBuilder, private readonly _permissionsService: PermissionsService) {
|
constructor(private readonly _formBuilder: FormBuilder, private readonly _permissionsService: PermissionsService) {
|
||||||
super();
|
super();
|
||||||
this.#redaction = this.data.redaction;
|
this.hint = this.data.redaction.hint;
|
||||||
this.hint = this.#redaction.hint;
|
this.options = getRemoveRedactionOptions(this.data);
|
||||||
this.#permissions = this.data.permissions;
|
|
||||||
this.options = this.#options();
|
|
||||||
this.form = this.#getForm();
|
this.form = this.#getForm();
|
||||||
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true;
|
||||||
|
|
||||||
@ -89,46 +57,4 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
|||||||
option: [this.options[0]],
|
option: [this.options[0]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#options() {
|
|
||||||
const options: DetailsRadioOption<RemoveRedactionOption>[] = [];
|
|
||||||
if (this.#permissions.canRemoveOnlyHere) {
|
|
||||||
options.push({
|
|
||||||
label: this.#translations.ONLY_HERE.label,
|
|
||||||
description: this.#translations.ONLY_HERE.description,
|
|
||||||
descriptionParams: { type: this.hint ? 'hint' : 'redact', value: this.#redaction.value },
|
|
||||||
icon: PIN_ICON,
|
|
||||||
value: RemoveRedactionOptions.ONLY_HERE,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (this.#permissions.canRemoveFromDictionary) {
|
|
||||||
options.push({
|
|
||||||
label: this.#translations.IN_DOSSIER.label,
|
|
||||||
description: this.#translations.IN_DOSSIER.description,
|
|
||||||
descriptionParams: { type: this.hint ? 'hint' : 'redact', value: this.#redaction.value },
|
|
||||||
icon: FOLDER_ICON,
|
|
||||||
value: RemoveRedactionOptions.IN_DOSSIER,
|
|
||||||
extraOption: {
|
|
||||||
label: this.#translations.IN_DOSSIER.extraOptionLabel,
|
|
||||||
checked: this.data.applyToAllDossiers ?? true,
|
|
||||||
hidden: !this.data.isApprover,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (this.#permissions.canMarkAsFalsePositive) {
|
|
||||||
options.push({
|
|
||||||
label: this.#translations.FALSE_POSITIVE.label,
|
|
||||||
description: this.#translations.FALSE_POSITIVE.description,
|
|
||||||
descriptionParams: { value: this.#redaction.value, type: this.#redaction.type, context: this.data.falsePositiveContext },
|
|
||||||
icon: REMOVE_FROM_DICT_ICON,
|
|
||||||
value: RemoveRedactionOptions.FALSE_POSITIVE,
|
|
||||||
extraOption: {
|
|
||||||
label: this.#translations.FALSE_POSITIVE.extraOptionLabel,
|
|
||||||
checked: this.data.applyToAllDossiers ?? true,
|
|
||||||
hidden: !this.data.isApprover,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
export const RemoveRedactionOptions = {
|
|
||||||
ONLY_HERE: 'ONLY_HERE',
|
|
||||||
IN_DOSSIER: 'IN_DOSSIER',
|
|
||||||
FALSE_POSITIVE: 'FALSE_POSITIVE',
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export type RemoveRedactionOption = keyof typeof RemoveRedactionOptions;
|
|
||||||
@ -67,12 +67,13 @@ import { ConfigService } from '@services/config.service';
|
|||||||
import { ReadableRedactionsService } from '../pdf-viewer/services/readable-redactions.service';
|
import { ReadableRedactionsService } from '../pdf-viewer/services/readable-redactions.service';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { SuggestionsService } from './services/suggestions.service';
|
import { SuggestionsService } from './services/suggestions.service';
|
||||||
import { RedactTextData, RedactTextDialogComponent } from './dialogs/redact-text-dialog/redact-text-dialog.component';
|
import { RedactTextDialogComponent } from './dialogs/redact-text-dialog/redact-text-dialog.component';
|
||||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||||
import { copyLocalStorageFiltersValues, FilterService, NestedFilter, processFilters } from '@iqser/common-ui/lib/filtering';
|
import { copyLocalStorageFiltersValues, FilterService, NestedFilter, processFilters } from '@iqser/common-ui/lib/filtering';
|
||||||
import { AutoUnsubscribe, Bind, bool, Debounce, List, OnAttach, OnDetach } from '@iqser/common-ui/lib/utils';
|
import { AutoUnsubscribe, Bind, bool, Debounce, List, OnAttach, OnDetach } from '@iqser/common-ui/lib/utils';
|
||||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
||||||
import { AddAnnotationDialogComponent } from './dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component';
|
import { AddHintDialogComponent } from './dialogs/add-hint-dialog/add-hint-dialog.component';
|
||||||
|
import { RedactOrHintData } from './utils/dialog-types';
|
||||||
|
|
||||||
const textActions = [TextPopups.REDACT_TEXT, TextPopups.ADD_HINT, TextPopups.ADD_FALSE_POSITIVE];
|
const textActions = [TextPopups.REDACT_TEXT, TextPopups.ADD_HINT, TextPopups.ADD_FALSE_POSITIVE];
|
||||||
|
|
||||||
@ -371,10 +372,10 @@ export class FilePreviewScreenComponent
|
|||||||
const file = this.state.file();
|
const file = this.state.file();
|
||||||
const hint = manualRedactionEntryWrapper.type === ManualRedactionEntryTypes.HINT;
|
const hint = manualRedactionEntryWrapper.type === ManualRedactionEntryTypes.HINT;
|
||||||
|
|
||||||
const data = this.#getRedactTextDialogData(manualRedactionEntryWrapper, file, hint);
|
const data = this.#getRedactTextDialogData(manualRedactionEntryWrapper, file);
|
||||||
const ref = this.#isDocumine
|
const ref = hint
|
||||||
? this._iqserDialog.openDefault(AddAnnotationDialogComponent, { data })
|
? this._iqserDialog.openDefault(AddHintDialogComponent, { data: data as RedactOrHintData })
|
||||||
: this._iqserDialog.openDefault(RedactTextDialogComponent, { data: data as RedactTextData });
|
: this._iqserDialog.openDefault(RedactTextDialogComponent, { data: data as RedactOrHintData });
|
||||||
|
|
||||||
const result = await ref.result();
|
const result = await ref.result();
|
||||||
if (!result) {
|
if (!result) {
|
||||||
@ -393,28 +394,6 @@ export class FilePreviewScreenComponent
|
|||||||
return firstValueFrom(addAndReload$.pipe(catchError(() => of(undefined))));
|
return firstValueFrom(addAndReload$.pipe(catchError(() => of(undefined))));
|
||||||
}
|
}
|
||||||
|
|
||||||
#getRedactTextDialogData(manualRedactionEntryWrapper: ManualRedactionEntryWrapper, file: File, hint: boolean) {
|
|
||||||
const dossierTemplate = this._dossierTemplatesService.find(this.state.dossierTemplateId);
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
manualRedactionEntryWrapper,
|
|
||||||
dossierId: this.dossierId,
|
|
||||||
file,
|
|
||||||
};
|
|
||||||
if (this.#isDocumine) {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isApprover = this.permissionsService.isApprover(this.state.dossier());
|
|
||||||
const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault;
|
|
||||||
return {
|
|
||||||
...data,
|
|
||||||
applyToAllDossiers: isApprover ? applyDictionaryUpdatesToAllDossiersByDefault : false,
|
|
||||||
isApprover,
|
|
||||||
hint,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleFullScreen() {
|
toggleFullScreen() {
|
||||||
this.fullScreen = !this.fullScreen;
|
this.fullScreen = !this.fullScreen;
|
||||||
if (this.fullScreen) {
|
if (this.fullScreen) {
|
||||||
@ -870,4 +849,25 @@ export class FilePreviewScreenComponent
|
|||||||
this.openRSSView();
|
this.openRSSView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#getRedactTextDialogData(manualRedactionEntryWrapper: ManualRedactionEntryWrapper, file: File) {
|
||||||
|
const dossierTemplate = this._dossierTemplatesService.find(this.state.dossierTemplateId);
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
manualRedactionEntryWrapper,
|
||||||
|
dossierId: this.dossierId,
|
||||||
|
file,
|
||||||
|
};
|
||||||
|
if (this.#isDocumine) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isApprover = this.permissionsService.isApprover(this.state.dossier());
|
||||||
|
const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault;
|
||||||
|
return {
|
||||||
|
...data,
|
||||||
|
applyToAllDossiers: isApprover ? applyDictionaryUpdatesToAllDossiersByDefault : false,
|
||||||
|
isApprover,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,6 +66,7 @@ import { IqserUsersModule } from '@iqser/common-ui/lib/users';
|
|||||||
import { IqserFiltersModule } from '@iqser/common-ui/lib/filtering';
|
import { IqserFiltersModule } from '@iqser/common-ui/lib/filtering';
|
||||||
import { StatusBarComponent } from '@iqser/common-ui/lib/shared';
|
import { StatusBarComponent } from '@iqser/common-ui/lib/shared';
|
||||||
import { TenantPipe } from '@iqser/common-ui/lib/tenants';
|
import { TenantPipe } from '@iqser/common-ui/lib/tenants';
|
||||||
|
import { AddHintDialogComponent } from './dialogs/add-hint-dialog/add-hint-dialog.component';
|
||||||
import { AddAnnotationDialogComponent } from './dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component';
|
import { AddAnnotationDialogComponent } from './dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component';
|
||||||
import { RemoveAnnotationDialogComponent } from './dialogs/docu-mine/remove-annotation-dialog/remove-annotation-dialog.component';
|
import { RemoveAnnotationDialogComponent } from './dialogs/docu-mine/remove-annotation-dialog/remove-annotation-dialog.component';
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ const dialogs = [
|
|||||||
ImportRedactionsDialogComponent,
|
ImportRedactionsDialogComponent,
|
||||||
RssDialogComponent,
|
RssDialogComponent,
|
||||||
RedactTextDialogComponent,
|
RedactTextDialogComponent,
|
||||||
|
AddHintDialogComponent,
|
||||||
RemoveRedactionDialogComponent,
|
RemoveRedactionDialogComponent,
|
||||||
AddAnnotationDialogComponent,
|
AddAnnotationDialogComponent,
|
||||||
RemoveAnnotationDialogComponent,
|
RemoveAnnotationDialogComponent,
|
||||||
|
|||||||
@ -29,16 +29,13 @@ import { PdfViewer } from '../../pdf-viewer/services/pdf-viewer.service';
|
|||||||
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service';
|
||||||
import { SkippedService } from './skipped.service';
|
import { SkippedService } from './skipped.service';
|
||||||
import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service';
|
import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service';
|
||||||
import {
|
import { RemoveRedactionDialogComponent } from '../dialogs/remove-redaction-dialog/remove-redaction-dialog.component';
|
||||||
RemoveRedactionDialogComponent,
|
import { IqserDialog } from '@common-ui/dialog/iqser-dialog.service';
|
||||||
RemoveRedactionPermissions,
|
|
||||||
RemoveRedactionResult,
|
|
||||||
} from '../dialogs/remove-redaction-dialog/remove-redaction-dialog.component';
|
|
||||||
import { RemoveRedactionOptions } from '../dialogs/remove-redaction-dialog/remove-redaction-options';
|
|
||||||
import { IqserDialog } from '../../../../../../../libs/common-ui/src/lib/dialog/iqser-dialog.service';
|
|
||||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||||
import { isJustOne, List } from '@iqser/common-ui/lib/utils';
|
import { isJustOne, List } from '@iqser/common-ui/lib/utils';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
|
import { RemoveRedactionPermissions, RemoveRedactionResult } from '../utils/dialog-types';
|
||||||
|
import { RemoveRedactionOptions } from '../utils/dialog-options';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AnnotationActionsService {
|
export class AnnotationActionsService {
|
||||||
@ -121,7 +118,7 @@ export class AnnotationActionsService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeOrSuggestRemoveRedaction(redaction: AnnotationWrapper, permissions) {
|
async removeRedaction(redaction: AnnotationWrapper, permissions) {
|
||||||
const removePermissions: RemoveRedactionPermissions = {
|
const removePermissions: RemoveRedactionPermissions = {
|
||||||
canRemoveOnlyHere: permissions.canRemoveOnlyHere,
|
canRemoveOnlyHere: permissions.canRemoveOnlyHere,
|
||||||
canRemoveFromDictionary: permissions.canRemoveFromDictionary,
|
canRemoveFromDictionary: permissions.canRemoveFromDictionary,
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export class PdfAnnotationActionsService {
|
|||||||
|
|
||||||
if (permissions.canRemoveRedaction) {
|
if (permissions.canRemoveRedaction) {
|
||||||
const removeRedactionButton = this.#getButton('trash', _('annotation-actions.remove-annotation.remove-redaction'), () =>
|
const removeRedactionButton = this.#getButton('trash', _('annotation-actions.remove-annotation.remove-redaction'), () =>
|
||||||
this.#annotationActionsService.removeOrSuggestRemoveRedaction(annotations[0], permissions),
|
this.#annotationActionsService.removeRedaction(annotations[0], permissions),
|
||||||
);
|
);
|
||||||
availableActions.push(removeRedactionButton);
|
availableActions.push(removeRedactionButton);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -267,11 +267,20 @@ export class PdfProxyService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.value = text;
|
entry.value = this.#formatSelectedText(text);
|
||||||
entry.rectangle = !text;
|
entry.rectangle = !text;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#formatSelectedText(text: string): string {
|
||||||
|
text = text.replace(
|
||||||
|
// eslint-disable-next-line no-control-regex,max-len
|
||||||
|
/([^\s\d-]{2,})[-\u00AD]\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi,
|
||||||
|
'$1',
|
||||||
|
);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
#deactivateMultiSelect() {
|
#deactivateMultiSelect() {
|
||||||
this._logger.info('[PDF] Deactivating multi-select');
|
this._logger.info('[PDF] Deactivating multi-select');
|
||||||
this._multiSelectService.deactivate();
|
this._multiSelectService.deactivate();
|
||||||
|
|||||||
103
apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts
Normal file
103
apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
import { DetailsRadioOption } from '@iqser/common-ui';
|
||||||
|
import { addHintTranslations } from '@translations/add-hint-translations';
|
||||||
|
import { redactTextTranslations } from '@translations/redact-text-translations';
|
||||||
|
import { Dossier } from '@red/domain';
|
||||||
|
import { removeRedactionTranslations } from '@translations/remove-redaction-translations';
|
||||||
|
import { RemoveRedactionData } from './dialog-types';
|
||||||
|
|
||||||
|
const PIN_ICON = 'red:push-pin';
|
||||||
|
const FOLDER_ICON = 'red:folder';
|
||||||
|
const REMOVE_FROM_DICT_ICON = 'red:remove-from-dict';
|
||||||
|
|
||||||
|
export const RedactOrHintOptions = {
|
||||||
|
ONLY_HERE: 'ONLY_HERE',
|
||||||
|
IN_DOSSIER: 'IN_DOSSIER',
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type RedactOrHintOption = keyof typeof RedactOrHintOptions;
|
||||||
|
|
||||||
|
export const RemoveRedactionOptions = {
|
||||||
|
ONLY_HERE: 'ONLY_HERE',
|
||||||
|
IN_DOSSIER: 'IN_DOSSIER',
|
||||||
|
FALSE_POSITIVE: 'FALSE_POSITIVE',
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type RemoveRedactionOption = keyof typeof RemoveRedactionOptions;
|
||||||
|
|
||||||
|
export const getRedactOrHintOptions = (
|
||||||
|
dossier: Dossier,
|
||||||
|
isRss: boolean,
|
||||||
|
hint: boolean,
|
||||||
|
applyToAllDossiers: boolean,
|
||||||
|
isApprover: boolean,
|
||||||
|
): DetailsRadioOption<RedactOrHintOption>[] => {
|
||||||
|
const translations = hint ? addHintTranslations : redactTextTranslations;
|
||||||
|
const options: DetailsRadioOption<RedactOrHintOption>[] = [
|
||||||
|
{
|
||||||
|
label: translations.onlyHere.label,
|
||||||
|
description: translations.onlyHere.description,
|
||||||
|
icon: PIN_ICON,
|
||||||
|
value: RedactOrHintOptions.ONLY_HERE,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
if (!isRss) {
|
||||||
|
options.push({
|
||||||
|
label: translations.inDossier.label,
|
||||||
|
description: translations.inDossier.description,
|
||||||
|
descriptionParams: { dossierName: dossier.dossierName },
|
||||||
|
icon: FOLDER_ICON,
|
||||||
|
value: RedactOrHintOptions.IN_DOSSIER,
|
||||||
|
extraOption: {
|
||||||
|
label: translations.inDossier.extraOptionLabel,
|
||||||
|
checked: applyToAllDossiers,
|
||||||
|
hidden: !isApprover,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getRemoveRedactionOptions = (data: RemoveRedactionData): DetailsRadioOption<RemoveRedactionOption>[] => {
|
||||||
|
const translations = removeRedactionTranslations;
|
||||||
|
const { permissions, redaction, applyToAllDossiers, isApprover, falsePositiveContext } = data;
|
||||||
|
|
||||||
|
const options: DetailsRadioOption<RemoveRedactionOption>[] = [];
|
||||||
|
if (permissions.canRemoveOnlyHere) {
|
||||||
|
options.push({
|
||||||
|
label: translations.ONLY_HERE.label,
|
||||||
|
description: translations.ONLY_HERE.description,
|
||||||
|
descriptionParams: { type: redaction.hint ? 'hint' : 'redact', value: redaction.value },
|
||||||
|
icon: PIN_ICON,
|
||||||
|
value: RemoveRedactionOptions.ONLY_HERE,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (permissions.canRemoveFromDictionary) {
|
||||||
|
options.push({
|
||||||
|
label: translations.IN_DOSSIER.label,
|
||||||
|
description: translations.IN_DOSSIER.description,
|
||||||
|
descriptionParams: { type: redaction.hint ? 'hint' : 'redact', value: redaction.value },
|
||||||
|
icon: FOLDER_ICON,
|
||||||
|
value: RemoveRedactionOptions.IN_DOSSIER,
|
||||||
|
extraOption: {
|
||||||
|
label: translations.IN_DOSSIER.extraOptionLabel,
|
||||||
|
checked: applyToAllDossiers ?? true,
|
||||||
|
hidden: !isApprover,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (permissions.canMarkAsFalsePositive) {
|
||||||
|
options.push({
|
||||||
|
label: translations.FALSE_POSITIVE.label,
|
||||||
|
description: translations.FALSE_POSITIVE.description,
|
||||||
|
descriptionParams: { value: redaction.value, type: redaction.type, context: falsePositiveContext },
|
||||||
|
icon: REMOVE_FROM_DICT_ICON,
|
||||||
|
value: RemoveRedactionOptions.FALSE_POSITIVE,
|
||||||
|
extraOption: {
|
||||||
|
label: translations.FALSE_POSITIVE.extraOptionLabel,
|
||||||
|
checked: applyToAllDossiers ?? true,
|
||||||
|
hidden: !isApprover,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
};
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper';
|
||||||
|
import { Dictionary, Dossier, File, IManualRedactionEntry } from '@red/domain';
|
||||||
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
|
import { DetailsRadioOption } from '@iqser/common-ui';
|
||||||
|
import { RemoveRedactionOption } from './dialog-options';
|
||||||
|
|
||||||
|
export interface RedactOrHintData {
|
||||||
|
manualRedactionEntryWrapper: ManualRedactionEntryWrapper;
|
||||||
|
dossierId: string;
|
||||||
|
file: File;
|
||||||
|
applyToAllDossiers: boolean;
|
||||||
|
isApprover: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RedactOrHintResult {
|
||||||
|
redaction: IManualRedactionEntry;
|
||||||
|
dictionary: Dictionary;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RemoveRedactionPermissions {
|
||||||
|
canRemoveOnlyHere: boolean;
|
||||||
|
canRemoveFromDictionary: boolean;
|
||||||
|
canMarkAsFalsePositive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RemoveRedactionData {
|
||||||
|
redaction: AnnotationWrapper;
|
||||||
|
dossier: Dossier;
|
||||||
|
falsePositiveContext: string;
|
||||||
|
permissions: RemoveRedactionPermissions;
|
||||||
|
applyToAllDossiers: boolean;
|
||||||
|
isApprover: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RemoveRedactionResult {
|
||||||
|
comment: string;
|
||||||
|
option: DetailsRadioOption<RemoveRedactionOption>;
|
||||||
|
applyToAllDossiers: boolean | null;
|
||||||
|
}
|
||||||
@ -147,6 +147,42 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRedactTextDictionaries(dossierTemplateId: string, dossierDictionaryOnly: boolean, dictionaryRequest: boolean): Dictionary[] {
|
||||||
|
const dictionaries: Dictionary[] = [];
|
||||||
|
|
||||||
|
this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => {
|
||||||
|
if (
|
||||||
|
(!d.virtual && !d.hint && !d.systemManaged && d.hasDictionary && d.addToDictionaryAction) ||
|
||||||
|
(dossierDictionaryOnly && d.dossierDictionaryOnly)
|
||||||
|
) {
|
||||||
|
dictionaries.push(d);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return dictionaries.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
|
}
|
||||||
|
|
||||||
|
getAddHintDictionaries(dossierTemplateId: string, dossierDictionaryOnly: boolean, dictionaryRequest: boolean): Dictionary[] {
|
||||||
|
const dictionaries: Dictionary[] = [];
|
||||||
|
|
||||||
|
this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => {
|
||||||
|
if (
|
||||||
|
(d.hint && d.hasDictionary && d.addToDictionaryAction && d.type) ||
|
||||||
|
(dictionaryRequest && dossierDictionaryOnly && d.dossierDictionaryOnly)
|
||||||
|
) {
|
||||||
|
if (!dictionaryRequest) {
|
||||||
|
if (!IMAGE_TYPES.includes(d.type)) {
|
||||||
|
dictionaries.push(d);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dictionaries.push(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return dictionaries.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
|
}
|
||||||
|
|
||||||
getPossibleDictionaries(
|
getPossibleDictionaries(
|
||||||
dossierTemplateId: string,
|
dossierTemplateId: string,
|
||||||
hintTypes: boolean,
|
hintTypes: boolean,
|
||||||
|
|||||||
14
apps/red-ui/src/app/translations/add-hint-translations.ts
Normal file
14
apps/red-ui/src/app/translations/add-hint-translations.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
|
import { RedactOrHintOption } from '@translations/redact-text-translations';
|
||||||
|
|
||||||
|
export const addHintTranslations: Record<'onlyHere' | 'inDossier', RedactOrHintOption> = {
|
||||||
|
onlyHere: {
|
||||||
|
label: _('add-hint.dialog.content.options.only-here.label'),
|
||||||
|
description: _('add-hint.dialog.content.options.only-here.description'),
|
||||||
|
},
|
||||||
|
inDossier: {
|
||||||
|
label: _('add-hint.dialog.content.options.in-dossier.label'),
|
||||||
|
description: _('add-hint.dialog.content.options.in-dossier.description'),
|
||||||
|
extraOptionLabel: _('add-hint.dialog.content.options.in-dossier.extraOptionLabel'),
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
@ -1,32 +1,19 @@
|
|||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
|
|
||||||
interface Option {
|
export interface RedactOrHintOption {
|
||||||
label: string;
|
label: string;
|
||||||
description: string;
|
description: string;
|
||||||
extraOptionLabel?: string;
|
extraOptionLabel?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const redactTextTranslations: Record<'REDACT' | 'HINT', Record<'onlyHere' | 'inDossier', Option>> = {
|
export const redactTextTranslations: Record<'onlyHere' | 'inDossier', RedactOrHintOption> = {
|
||||||
REDACT: {
|
onlyHere: {
|
||||||
onlyHere: {
|
label: _('redact-text.dialog.content.options.only-here.label'),
|
||||||
label: _('redact-text.dialog.content.options.redact.only-here.label'),
|
description: _('redact-text.dialog.content.options.only-here.description'),
|
||||||
description: _('redact-text.dialog.content.options.redact.only-here.description'),
|
|
||||||
},
|
|
||||||
inDossier: {
|
|
||||||
label: _('redact-text.dialog.content.options.redact.in-dossier.label'),
|
|
||||||
description: _('redact-text.dialog.content.options.redact.in-dossier.description'),
|
|
||||||
extraOptionLabel: _('redact-text.dialog.content.options.redact.in-dossier.extraOptionLabel'),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
HINT: {
|
inDossier: {
|
||||||
onlyHere: {
|
label: _('redact-text.dialog.content.options.in-dossier.label'),
|
||||||
label: _('redact-text.dialog.content.options.hint.only-here.label'),
|
description: _('redact-text.dialog.content.options.in-dossier.description'),
|
||||||
description: _('redact-text.dialog.content.options.hint.only-here.description'),
|
extraOptionLabel: _('redact-text.dialog.content.options.in-dossier.extraOptionLabel'),
|
||||||
},
|
|
||||||
inDossier: {
|
|
||||||
label: _('redact-text.dialog.content.options.hint.in-dossier.label'),
|
|
||||||
description: _('redact-text.dialog.content.options.hint.in-dossier.description'),
|
|
||||||
extraOptionLabel: _('redact-text.dialog.content.options.hint.in-dossier.extraOptionLabel'),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { RemoveRedactionOption } from '../modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-options';
|
import { RemoveRedactionOption } from '../modules/file-preview/utils/dialog-options';
|
||||||
|
|
||||||
interface Option {
|
interface Option {
|
||||||
label: string;
|
label: string;
|
||||||
@ -15,11 +15,11 @@ export const removeRedactionTranslations: { [key in RemoveRedactionOption]: Opti
|
|||||||
IN_DOSSIER: {
|
IN_DOSSIER: {
|
||||||
label: _('remove-redaction.dialog.content.options.in-dossier.label'),
|
label: _('remove-redaction.dialog.content.options.in-dossier.label'),
|
||||||
description: _('remove-redaction.dialog.content.options.in-dossier.description'),
|
description: _('remove-redaction.dialog.content.options.in-dossier.description'),
|
||||||
extraOptionLabel: _('remove-redaction.dialog.content.options.redact.in-dossier.extraOptionLabel'),
|
extraOptionLabel: _('remove-redaction.dialog.content.options.in-dossier.extraOptionLabel'),
|
||||||
},
|
},
|
||||||
FALSE_POSITIVE: {
|
FALSE_POSITIVE: {
|
||||||
label: _('remove-redaction.dialog.content.options.false-positive.label'),
|
label: _('remove-redaction.dialog.content.options.false-positive.label'),
|
||||||
description: _('remove-redaction.dialog.content.options.false-positive.description'),
|
description: _('remove-redaction.dialog.content.options.false-positive.description'),
|
||||||
extraOptionLabel: _('remove-redaction.dialog.content.options.redact.false-positive.extraOptionLabel'),
|
extraOptionLabel: _('remove-redaction.dialog.content.options.false-positive.extraOptionLabel'),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -197,6 +197,33 @@
|
|||||||
"save": "Wörterbuch speichern",
|
"save": "Wörterbuch speichern",
|
||||||
"title": "Wörterbuch erstellen"
|
"title": "Wörterbuch erstellen"
|
||||||
},
|
},
|
||||||
|
"add-hint": {
|
||||||
|
"dialog": {
|
||||||
|
"actions": {
|
||||||
|
"cancel": "",
|
||||||
|
"save": ""
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"comment": "",
|
||||||
|
"comment-placeholder": "",
|
||||||
|
"options": {
|
||||||
|
"in-dossier": {
|
||||||
|
"description": "",
|
||||||
|
"extraOptionLabel": "",
|
||||||
|
"label": ""
|
||||||
|
},
|
||||||
|
"only-here": {
|
||||||
|
"description": "",
|
||||||
|
"label": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"selected-text": "",
|
||||||
|
"type": "",
|
||||||
|
"type-placeholder": ""
|
||||||
|
},
|
||||||
|
"title": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"admin-side-nav": {
|
"admin-side-nav": {
|
||||||
"audit": "",
|
"audit": "",
|
||||||
"configurations": "",
|
"configurations": "",
|
||||||
@ -1932,27 +1959,14 @@
|
|||||||
"comment-placeholder": "",
|
"comment-placeholder": "",
|
||||||
"legal-basis": "",
|
"legal-basis": "",
|
||||||
"options": {
|
"options": {
|
||||||
"hint": {
|
"in-dossier": {
|
||||||
"in-dossier": {
|
"description": "",
|
||||||
"description": "",
|
"extraOptionLabel": "",
|
||||||
"extraOptionLabel": "",
|
"label": ""
|
||||||
"label": ""
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "",
|
|
||||||
"label": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"redact": {
|
"only-here": {
|
||||||
"in-dossier": {
|
"description": "",
|
||||||
"description": "",
|
"label": ""
|
||||||
"extraOptionLabel": "",
|
|
||||||
"label": ""
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "",
|
|
||||||
"label": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"reason": "",
|
"reason": "",
|
||||||
@ -1961,7 +1975,6 @@
|
|||||||
"type": "",
|
"type": "",
|
||||||
"type-placeholder": ""
|
"type-placeholder": ""
|
||||||
},
|
},
|
||||||
"hint-title": "",
|
|
||||||
"title": ""
|
"title": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2006,23 +2019,17 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"false-positive": {
|
"false-positive": {
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"extraOptionLabel": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
},
|
||||||
"in-dossier": {
|
"in-dossier": {
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"extraOptionLabel": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
},
|
||||||
"only-here": {
|
"only-here": {
|
||||||
"description": "",
|
"description": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
|
||||||
"redact": {
|
|
||||||
"false-positive": {
|
|
||||||
"extraOptionLabel": ""
|
|
||||||
},
|
|
||||||
"in-dossier": {
|
|
||||||
"extraOptionLabel": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -197,6 +197,33 @@
|
|||||||
"save": "Save Entity",
|
"save": "Save Entity",
|
||||||
"title": "Create Entity"
|
"title": "Create Entity"
|
||||||
},
|
},
|
||||||
|
"add-hint": {
|
||||||
|
"dialog": {
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"save": "Save"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"comment": "Comment",
|
||||||
|
"comment-placeholder": "Add remarks or mentions ...",
|
||||||
|
"options": {
|
||||||
|
"in-dossier": {
|
||||||
|
"description": "Add hint in every document in {dossierName}.",
|
||||||
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
|
"label": "Add hint in dossier"
|
||||||
|
},
|
||||||
|
"only-here": {
|
||||||
|
"description": "Add hint only at this position in this document.",
|
||||||
|
"label": "Add hint only here"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"selected-text": "Selected text:",
|
||||||
|
"type": "Type",
|
||||||
|
"type-placeholder": "Select type ..."
|
||||||
|
},
|
||||||
|
"title": "Add hint"
|
||||||
|
}
|
||||||
|
},
|
||||||
"admin-side-nav": {
|
"admin-side-nav": {
|
||||||
"audit": "Audit",
|
"audit": "Audit",
|
||||||
"configurations": "Configurations",
|
"configurations": "Configurations",
|
||||||
@ -1932,27 +1959,14 @@
|
|||||||
"comment-placeholder": "Add remarks or mentions ...",
|
"comment-placeholder": "Add remarks or mentions ...",
|
||||||
"legal-basis": "Legal Basis",
|
"legal-basis": "Legal Basis",
|
||||||
"options": {
|
"options": {
|
||||||
"hint": {
|
"in-dossier": {
|
||||||
"in-dossier": {
|
"description": "Add redaction in every document in {dossierName}.",
|
||||||
"description": "Add hint in every document in {dossierName}.",
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
"extraOptionLabel": "Apply to all dossiers",
|
"label": "Redact in dossier"
|
||||||
"label": "Add hint in dossier"
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "Add hint only at this position in this document.",
|
|
||||||
"label": "Add hint only here"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"redact": {
|
"only-here": {
|
||||||
"in-dossier": {
|
"description": "Add redaction only at this position in this document.",
|
||||||
"description": "Add redaction in every document in {dossierName}.",
|
"label": "Redact only here"
|
||||||
"extraOptionLabel": "Apply to all dossiers",
|
|
||||||
"label": "Redact in dossier"
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "Add redaction only at this position in this document.",
|
|
||||||
"label": "Redact only here"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"reason": "Reason",
|
"reason": "Reason",
|
||||||
@ -1961,7 +1975,6 @@
|
|||||||
"type": "Type",
|
"type": "Type",
|
||||||
"type-placeholder": "Select type ..."
|
"type-placeholder": "Select type ..."
|
||||||
},
|
},
|
||||||
"hint-title": "Add Hint",
|
|
||||||
"title": "Redact text"
|
"title": "Redact text"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2006,23 +2019,17 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"false-positive": {
|
"false-positive": {
|
||||||
"description": "\"{value}\" is not a {type} in this context: \"{context}\".",
|
"description": "\"{value}\" is not a {type} in this context: \"{context}\".",
|
||||||
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
"label": "False positive"
|
"label": "False positive"
|
||||||
},
|
},
|
||||||
"in-dossier": {
|
"in-dossier": {
|
||||||
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
||||||
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
"label": "Remove from dossier"
|
"label": "Remove from dossier"
|
||||||
},
|
},
|
||||||
"only-here": {
|
"only-here": {
|
||||||
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
||||||
"label": "Remove here"
|
"label": "Remove here"
|
||||||
},
|
|
||||||
"redact": {
|
|
||||||
"false-positive": {
|
|
||||||
"extraOptionLabel": "Apply to all dossiers"
|
|
||||||
},
|
|
||||||
"in-dossier": {
|
|
||||||
"extraOptionLabel": "Apply to all dossiers"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -197,6 +197,33 @@
|
|||||||
"save": "Wörterbuch speichern",
|
"save": "Wörterbuch speichern",
|
||||||
"title": "Wörterbuch erstellen"
|
"title": "Wörterbuch erstellen"
|
||||||
},
|
},
|
||||||
|
"add-hint": {
|
||||||
|
"dialog": {
|
||||||
|
"actions": {
|
||||||
|
"cancel": "",
|
||||||
|
"save": ""
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"comment": "",
|
||||||
|
"comment-placeholder": "",
|
||||||
|
"options": {
|
||||||
|
"in-dossier": {
|
||||||
|
"description": "",
|
||||||
|
"extraOptionLabel": "",
|
||||||
|
"label": ""
|
||||||
|
},
|
||||||
|
"only-here": {
|
||||||
|
"description": "",
|
||||||
|
"label": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"selected-text": "",
|
||||||
|
"type": "",
|
||||||
|
"type-placeholder": ""
|
||||||
|
},
|
||||||
|
"title": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"admin-side-nav": {
|
"admin-side-nav": {
|
||||||
"audit": "",
|
"audit": "",
|
||||||
"configurations": "",
|
"configurations": "",
|
||||||
@ -1932,27 +1959,14 @@
|
|||||||
"comment-placeholder": "",
|
"comment-placeholder": "",
|
||||||
"legal-basis": "",
|
"legal-basis": "",
|
||||||
"options": {
|
"options": {
|
||||||
"hint": {
|
"in-dossier": {
|
||||||
"in-dossier": {
|
"description": "",
|
||||||
"description": "",
|
"extraOptionLabel": "",
|
||||||
"extraOptionLabel": "",
|
"label": ""
|
||||||
"label": ""
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "",
|
|
||||||
"label": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"redact": {
|
"only-here": {
|
||||||
"in-dossier": {
|
"description": "",
|
||||||
"description": "",
|
"label": ""
|
||||||
"extraOptionLabel": "",
|
|
||||||
"label": ""
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "",
|
|
||||||
"label": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"reason": "",
|
"reason": "",
|
||||||
@ -1961,7 +1975,6 @@
|
|||||||
"type": "",
|
"type": "",
|
||||||
"type-placeholder": ""
|
"type-placeholder": ""
|
||||||
},
|
},
|
||||||
"hint-title": "",
|
|
||||||
"title": ""
|
"title": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2006,23 +2019,17 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"false-positive": {
|
"false-positive": {
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"extraOptionLabel": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
},
|
||||||
"in-dossier": {
|
"in-dossier": {
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"extraOptionLabel": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
},
|
||||||
"only-here": {
|
"only-here": {
|
||||||
"description": "",
|
"description": "",
|
||||||
"label": ""
|
"label": ""
|
||||||
},
|
|
||||||
"redact": {
|
|
||||||
"false-positive": {
|
|
||||||
"extraOptionLabel": ""
|
|
||||||
},
|
|
||||||
"in-dossier": {
|
|
||||||
"extraOptionLabel": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -197,6 +197,33 @@
|
|||||||
"save": "Save Entity",
|
"save": "Save Entity",
|
||||||
"title": "Create Entity"
|
"title": "Create Entity"
|
||||||
},
|
},
|
||||||
|
"add-hint": {
|
||||||
|
"dialog": {
|
||||||
|
"actions": {
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"save": "Save"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"comment": "Comment",
|
||||||
|
"comment-placeholder": "Add remarks or mentions ...",
|
||||||
|
"options": {
|
||||||
|
"in-dossier": {
|
||||||
|
"description": "Add hint in every document in {dossierName}.",
|
||||||
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
|
"label": "Add hint in dossier"
|
||||||
|
},
|
||||||
|
"only-here": {
|
||||||
|
"description": "Add hint only at this position in this document.",
|
||||||
|
"label": "Add hint only here"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"selected-text": "Selected text:",
|
||||||
|
"type": "Type",
|
||||||
|
"type-placeholder": "Select type ..."
|
||||||
|
},
|
||||||
|
"title": "Add hint"
|
||||||
|
}
|
||||||
|
},
|
||||||
"admin-side-nav": {
|
"admin-side-nav": {
|
||||||
"audit": "Audit",
|
"audit": "Audit",
|
||||||
"configurations": "Configurations",
|
"configurations": "Configurations",
|
||||||
@ -1932,27 +1959,14 @@
|
|||||||
"comment-placeholder": "Add remarks or mentions ...",
|
"comment-placeholder": "Add remarks or mentions ...",
|
||||||
"legal-basis": "Legal Basis",
|
"legal-basis": "Legal Basis",
|
||||||
"options": {
|
"options": {
|
||||||
"hint": {
|
"in-dossier": {
|
||||||
"in-dossier": {
|
"description": "Add redaction in every document in {dossierName}.",
|
||||||
"description": "Add hint in every document in {dossierName}.",
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
"extraOptionLabel": "Apply to all dossiers",
|
"label": "Redact in dossier"
|
||||||
"label": "Add hint in dossier"
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "Add hint only at this position in this document.",
|
|
||||||
"label": "Add hint only here"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"redact": {
|
"only-here": {
|
||||||
"in-dossier": {
|
"description": "Add redaction only at this position in this document.",
|
||||||
"description": "Add redaction in every document in {dossierName}.",
|
"label": "Redact only here"
|
||||||
"extraOptionLabel": "Apply to all dossiers",
|
|
||||||
"label": "Redact in dossier"
|
|
||||||
},
|
|
||||||
"only-here": {
|
|
||||||
"description": "Add redaction only at this position in this document.",
|
|
||||||
"label": "Redact only here"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"reason": "Reason",
|
"reason": "Reason",
|
||||||
@ -1961,7 +1975,6 @@
|
|||||||
"type": "Type",
|
"type": "Type",
|
||||||
"type-placeholder": "Select type ..."
|
"type-placeholder": "Select type ..."
|
||||||
},
|
},
|
||||||
"hint-title": "Add Hint",
|
|
||||||
"title": "Redact text"
|
"title": "Redact text"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2006,23 +2019,17 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"false-positive": {
|
"false-positive": {
|
||||||
"description": "\"{value}\" is not a {type} in this context: \"{context}\".",
|
"description": "\"{value}\" is not a {type} in this context: \"{context}\".",
|
||||||
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
"label": "False positive"
|
"label": "False positive"
|
||||||
},
|
},
|
||||||
"in-dossier": {
|
"in-dossier": {
|
||||||
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
||||||
|
"extraOptionLabel": "Apply to all dossiers",
|
||||||
"label": "Remove from dossier"
|
"label": "Remove from dossier"
|
||||||
},
|
},
|
||||||
"only-here": {
|
"only-here": {
|
||||||
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
||||||
"label": "Remove here"
|
"label": "Remove here"
|
||||||
},
|
|
||||||
"redact": {
|
|
||||||
"false-positive": {
|
|
||||||
"extraOptionLabel": "Apply to all dossiers"
|
|
||||||
},
|
|
||||||
"in-dossier": {
|
|
||||||
"extraOptionLabel": "Apply to all dossiers"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user