diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index 60c1b2651..a225f4a8c 100644 --- a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -23,14 +23,34 @@
- + {{ dictionary.label }} + + + + + {{ dictionary.label }} + + + + + + {{ dictionary.label }} + + +
diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 942cc4609..643b12a66 100644 --- a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -16,10 +16,13 @@ import { ManualAnnotationResponse } from '../../screens/file/model/manual-annota styleUrls: ['./manual-annotation-dialog.component.scss'] }) export class ManualAnnotationDialogComponent implements OnInit { - dictionaryOptions: TypeValue[] = []; redactionForm: FormGroup; isDocumentAdmin: boolean; + isDictionaryRequest: boolean; + redactionDictionaries: TypeValue[] = []; + hintDictionaries: TypeValue[] = []; + constructor( private readonly _appStateService: AppStateService, private readonly _userService: UserService, @@ -34,11 +37,10 @@ export class ManualAnnotationDialogComponent implements OnInit { async ngOnInit() { this.isDocumentAdmin = this._appStateService.isActiveProjectOwnerAndManager; const commentField = this.isDocumentAdmin ? [null] : [null, Validators.required]; + + this.isDictionaryRequest = this.manualRedactionEntryWrapper.type === 'DICTIONARY'; this.redactionForm = this._formBuilder.group({ - reason: - this.manualRedactionEntryWrapper.type === 'DICTIONARY' - ? null - : [null, Validators.required], + reason: this.isDictionaryRequest ? null : [null, Validators.required], dictionary: [null, Validators.required], comment: commentField }); @@ -46,11 +48,11 @@ export class ManualAnnotationDialogComponent implements OnInit { for (const key of Object.keys(this._appStateService.dictionaryData)) { const dictionaryData = this._appStateService.dictionaryData[key]; if (!dictionaryData.virtual) { - if (this.manualRedactionEntryWrapper.type === 'DICTIONARY') { - this.dictionaryOptions.push(dictionaryData); + if (dictionaryData.hint) { + this.hintDictionaries.push(dictionaryData); } - if (!dictionaryData.hint && this.manualRedactionEntryWrapper.type === 'REDACTION') { - this.dictionaryOptions.push(dictionaryData); + if (!dictionaryData.hint) { + this.redactionDictionaries.push(dictionaryData); } } } @@ -59,7 +61,7 @@ export class ManualAnnotationDialogComponent implements OnInit { handleAddRedaction() { this._enhanceManualRedaction(this.manualRedactionEntryWrapper.manualRedactionEntry); - if (this.manualRedactionEntryWrapper.type === 'DICTIONARY') { + if (this.isDictionaryRequest) { this._manualAnnotationService .makeDictionaryEntry(this.manualRedactionEntryWrapper.manualRedactionEntry) .subscribe( @@ -99,7 +101,7 @@ export class ManualAnnotationDialogComponent implements OnInit { addRedactionRequest.reason = this.redactionForm.get('reason').value; // todo fix this in backend if (!addRedactionRequest.reason) { - addRedactionRequest.reason = 'ADD_TO_DICTIONARY_REQUEST'; + addRedactionRequest.reason = '-'; } const commentValue = this.redactionForm.get('comment').value; addRedactionRequest.comment = commentValue ? { text: commentValue } : null; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 1240b6fc9..25280d048 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -332,5 +332,9 @@ "number-of-analyses": "Number of analyses", "custom": "Custom" }, - "readonly-pill": "Readonly" + "readonly-pill": "Readonly", + "group": { + "redactions": "Redaction Dictionaries", + "hints": "Hint Dictionaries" + } }