RED-3489: Remove mandatory comments
* Change legal basis * Force annotation * Manual annotation * Recategorize image * Remove annotation * Resize annotation
This commit is contained in:
parent
8a1cfb6571
commit
f655771fb0
@ -31,7 +31,7 @@
|
||||
<input formControlName="classification" name="classification" type="text" />
|
||||
</div>
|
||||
|
||||
<div [class.required]="!isDocumentAdmin" class="iqser-input-group w-300">
|
||||
<div class="iqser-input-group w-300">
|
||||
<label translate="change-legal-basis-dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -19,13 +19,11 @@ export interface LegalBasisOption {
|
||||
templateUrl: './change-legal-basis-dialog.component.html',
|
||||
})
|
||||
export class ChangeLegalBasisDialogComponent extends BaseDialogComponent implements OnInit {
|
||||
isDocumentAdmin: boolean;
|
||||
legalOptions: LegalBasisOption[] = [];
|
||||
|
||||
constructor(
|
||||
private readonly _justificationsService: JustificationsService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
protected readonly _injector: Injector,
|
||||
protected readonly _dialogRef: MatDialogRef<ChangeLegalBasisDialogComponent>,
|
||||
@ -67,10 +65,9 @@ export class ChangeLegalBasisDialogComponent extends BaseDialogComponent impleme
|
||||
}
|
||||
|
||||
private _getForm(): FormGroup {
|
||||
this.isDocumentAdmin = this._permissionsService.isApprover(this._data.dossier);
|
||||
return this._formBuilder.group({
|
||||
reason: [null, Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
comment: [null],
|
||||
classification: [this.allRectangles ? this._data.annotations[0].value : null],
|
||||
section: [this._data.annotations[0].section],
|
||||
});
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<input [value]="form.get('reason').value?.legalBasis" disabled type="text" />
|
||||
</div>
|
||||
|
||||
<div [class.required]="!isDocumentAdmin" class="iqser-input-group w-300">
|
||||
<div class="iqser-input-group w-300">
|
||||
<label translate="manual-annotation.dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
@ -24,7 +24,6 @@ export interface LegalBasisOption {
|
||||
styleUrls: ['./force-annotation-dialog.component.scss'],
|
||||
})
|
||||
export class ForceAnnotationDialogComponent extends BaseDialogComponent implements OnInit {
|
||||
isDocumentAdmin: boolean;
|
||||
legalOptions: LegalBasisOption[] = [];
|
||||
|
||||
constructor(
|
||||
@ -35,7 +34,6 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _justificationsService: JustificationsService,
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
protected readonly _injector: Injector,
|
||||
protected readonly _dialogRef: MatDialogRef<ForceAnnotationDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
@ -75,11 +73,9 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen
|
||||
}
|
||||
|
||||
private _getForm(): FormGroup {
|
||||
this.isDocumentAdmin = this._permissionsService.isApprover(this._data.dossier);
|
||||
|
||||
return this._formBuilder.group({
|
||||
reason: this._data.hint ? ['Forced Hint'] : [null, Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
comment: [null],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
<input formControlName="classification" name="classification" type="text" />
|
||||
</div>
|
||||
|
||||
<div [class.required]="commentIsMandatory" class="iqser-input-group w-300">
|
||||
<div class="iqser-input-group w-300">
|
||||
<label translate="manual-annotation.dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -23,10 +23,9 @@ export interface LegalBasisOption {
|
||||
})
|
||||
export class ManualAnnotationDialogComponent extends BaseDialogComponent implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
isDocumentAdmin: boolean;
|
||||
isDictionaryRequest: boolean;
|
||||
isFalsePositiveRequest: boolean;
|
||||
isEditingSelectedText: boolean = false;
|
||||
isEditingSelectedText = false;
|
||||
|
||||
possibleDictionaries: Dictionary[] = [];
|
||||
legalOptions: LegalBasisOption[] = [];
|
||||
@ -37,7 +36,6 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _justificationsService: JustificationsService,
|
||||
private readonly _manualAnnotationService: ManualAnnotationService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _dictionaryService: DictionaryService,
|
||||
protected readonly _injector: Injector,
|
||||
@ -46,7 +44,6 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
this._dossier = this._dossiersService.find(this.data.dossierId);
|
||||
this.isDocumentAdmin = this._permissionsService.isApprover(this._dossier);
|
||||
|
||||
this.isFalsePositiveRequest = this.data.manualRedactionEntryWrapper.type === 'FALSE_POSITIVE';
|
||||
this.isDictionaryRequest = this.data.manualRedactionEntryWrapper.type === 'DICTIONARY' || this.isFalsePositiveRequest;
|
||||
@ -71,10 +68,6 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
return this.form.invalid || this.isEditingSelectedText;
|
||||
}
|
||||
|
||||
get commentIsMandatory() {
|
||||
return !this.isDocumentAdmin && !this.isDictionaryRequest;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
super.ngOnInit();
|
||||
this.possibleDictionaries = await this._dictionaryService.getDictionariesOptions(
|
||||
@ -115,7 +108,7 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
dictionary: this.isDictionaryRequest
|
||||
? [this.isFalsePositiveRequest ? 'false_positive' : null, Validators.required]
|
||||
: ['manual', Validators.required],
|
||||
comment: this.commentIsMandatory ? [null, Validators.required] : [null],
|
||||
comment: [null],
|
||||
classification: ['non-readable content'],
|
||||
});
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</mat-select>
|
||||
</div>
|
||||
|
||||
<div [class.required]="!isDocumentAdmin" class="iqser-input-group w-300">
|
||||
<div class="iqser-input-group w-300">
|
||||
<label translate="recategorize-image-dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -12,12 +12,10 @@ import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
templateUrl: './recategorize-image-dialog.component.html',
|
||||
})
|
||||
export class RecategorizeImageDialogComponent extends BaseDialogComponent implements OnInit {
|
||||
isDocumentAdmin: boolean;
|
||||
typeOptions: ImageCategory[] = ['signature', 'logo', 'formula', 'image'];
|
||||
translations = imageCategoriesTranslations;
|
||||
|
||||
constructor(
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
protected readonly _injector: Injector,
|
||||
protected readonly _dialogRef: MatDialogRef<RecategorizeImageDialogComponent>,
|
||||
@ -32,11 +30,10 @@ export class RecategorizeImageDialogComponent extends BaseDialogComponent implem
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
this.isDocumentAdmin = this._permissionsService.isApprover(this.data.dossier);
|
||||
|
||||
this.form = this._formBuilder.group({
|
||||
type: [this.data.annotations[0].type, Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
comment: [null],
|
||||
});
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div [class.required]="commentIsMandatory" class="iqser-input-group w-300">
|
||||
<div class="iqser-input-group w-300">
|
||||
<label translate="manual-annotation.dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -22,14 +22,13 @@ export class RemoveAnnotationsDialogComponent extends BaseDialogComponent {
|
||||
constructor(
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
readonly permissionsService: PermissionsService,
|
||||
protected readonly _injector: Injector,
|
||||
protected readonly _dialogRef: MatDialogRef<RemoveAnnotationsDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: RemoveAnnotationsDialogInput,
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
this.form = this._formBuilder.group({
|
||||
comment: this.commentIsMandatory ? [null, Validators.required] : [null],
|
||||
comment: [null],
|
||||
});
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
@ -42,10 +41,6 @@ export class RemoveAnnotationsDialogComponent extends BaseDialogComponent {
|
||||
return !this.valid;
|
||||
}
|
||||
|
||||
get commentIsMandatory() {
|
||||
return !this.permissionsService.isApprover(this.data.dossier) && !this.data.removeFromDictionary;
|
||||
}
|
||||
|
||||
printable(annotation: AnnotationWrapper) {
|
||||
if (annotation.isImage) {
|
||||
return this._translateService.instant('remove-annotations-dialog.image-type', {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="dialog-header heading-l" translate="resize-annotation-dialog.header"></div>
|
||||
|
||||
<div class="dialog-content">
|
||||
<div [class.required]="!isDocumentAdmin" class="iqser-input-group w-300">
|
||||
<div class="iqser-input-group w-300">
|
||||
<label translate="resize-annotation-dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -9,10 +9,7 @@ import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
templateUrl: './resize-annotation-dialog.component.html',
|
||||
})
|
||||
export class ResizeAnnotationDialogComponent extends BaseDialogComponent implements OnInit {
|
||||
isDocumentAdmin: boolean;
|
||||
|
||||
constructor(
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
protected readonly _injector: Injector,
|
||||
protected readonly _dialogRef: MatDialogRef<ResizeAnnotationDialogComponent>,
|
||||
@ -28,11 +25,7 @@ export class ResizeAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
|
||||
this.isDocumentAdmin = this._permissionsService.isApprover(this._data.dossier);
|
||||
|
||||
this.form = this._formBuilder.group({
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
});
|
||||
this.form = this._formBuilder.group({ comment: [null] });
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user