RED-8884: improved force redaction dialog.
This commit is contained in:
parent
6fbf7a36f1
commit
a1c5e43f8e
@ -4,6 +4,7 @@
|
|||||||
<div *ngIf="isHintDialog" class="dialog-header heading-l" [translate]="'manual-annotation.dialog.header.force-hint'"></div>
|
<div *ngIf="isHintDialog" class="dialog-header heading-l" [translate]="'manual-annotation.dialog.header.force-hint'"></div>
|
||||||
|
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
|
<redaction-selected-annotations-table [columns]="tableColumns" [data]="tableData"></redaction-selected-annotations-table>
|
||||||
<div *ngIf="!isHintDialog && !isDocumine" class="iqser-input-group required w-400">
|
<div *ngIf="!isHintDialog && !isDocumine" class="iqser-input-group required w-400">
|
||||||
<label [translate]="'manual-annotation.dialog.content.reason'"></label>
|
<label [translate]="'manual-annotation.dialog.content.reason'"></label>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
.full-width {
|
.full-width {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dialog-content {
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { Dossier, ILegalBasisChangeRequest } from '@red/domain';
|
|||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
|
import { ValueColumn } from '../../components/selected-annotations-table/selected-annotations-table.component';
|
||||||
|
|
||||||
export interface LegalBasisOption {
|
export interface LegalBasisOption {
|
||||||
label?: string;
|
label?: string;
|
||||||
@ -23,8 +24,24 @@ const DOCUMINE_LEGAL_BASIS = 'n-a.';
|
|||||||
})
|
})
|
||||||
export class ForceAnnotationDialogComponent extends BaseDialogComponent implements OnInit {
|
export class ForceAnnotationDialogComponent extends BaseDialogComponent implements OnInit {
|
||||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||||
protected readonly roles = Roles;
|
|
||||||
|
readonly tableColumns = [
|
||||||
|
{
|
||||||
|
label: 'Value',
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Type',
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
readonly tableData: ValueColumn[][] = this._data.annotations.map(redaction => [
|
||||||
|
{ label: redaction.value, show: true, bold: true },
|
||||||
|
{ label: redaction.typeLabel, show: true },
|
||||||
|
]);
|
||||||
|
|
||||||
legalOptions: LegalBasisOption[] = [];
|
legalOptions: LegalBasisOption[] = [];
|
||||||
|
protected readonly roles = Roles;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _justificationsService: JustificationsService,
|
private readonly _justificationsService: JustificationsService,
|
||||||
@ -33,7 +50,7 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen
|
|||||||
private readonly _data: { readonly dossier: Dossier; readonly hint: boolean; annotations: AnnotationWrapper[] },
|
private readonly _data: { readonly dossier: Dossier; readonly hint: boolean; annotations: AnnotationWrapper[] },
|
||||||
) {
|
) {
|
||||||
super(_dialogRef);
|
super(_dialogRef);
|
||||||
this.form = this._getForm();
|
this.form = this.#getForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isHintDialog() {
|
get isHintDialog() {
|
||||||
@ -66,17 +83,17 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this._dialogRef.close(this._createForceRedactionRequest());
|
this._dialogRef.close(this.#createForceRedactionRequest());
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getForm(): UntypedFormGroup {
|
#getForm(): UntypedFormGroup {
|
||||||
return this._formBuilder.group({
|
return this._formBuilder.group({
|
||||||
reason: this._data.hint ? ['Forced Hint'] : [null, !this.isDocumine ? Validators.required : null],
|
reason: this._data.hint ? ['Forced Hint'] : [null, !this.isDocumine ? Validators.required : null],
|
||||||
comment: [null],
|
comment: [null],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _createForceRedactionRequest(): ILegalBasisChangeRequest {
|
#createForceRedactionRequest(): ILegalBasisChangeRequest {
|
||||||
const request: ILegalBasisChangeRequest = {};
|
const request: ILegalBasisChangeRequest = {};
|
||||||
|
|
||||||
request.legalBasis = !this.isDocumine ? this.form.get('reason').value.legalBasis : DOCUMINE_LEGAL_BASIS;
|
request.legalBasis = !this.isDocumine ? this.form.get('reason').value.legalBasis : DOCUMINE_LEGAL_BASIS;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user