RED-10072: AI description field and toggle for entities
This commit is contained in:
parent
686f390b1a
commit
46202a0b64
@ -78,6 +78,24 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="isIqserDevMode && form.get('aiCreationEnabled')" class="iqser-input-group">
|
||||||
|
<mat-slide-toggle color="primary" formControlName="aiCreationEnabled">
|
||||||
|
{{ 'add-edit-entity.form.ai-creation-enabled' | translate }}
|
||||||
|
</mat-slide-toggle>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="isIqserDevMode && form.get('aiCreationEnabled')?.value && form.get('aiDescription')" class="iqser-input-group w-400">
|
||||||
|
<label translate="add-edit-entity.form.ai-description"></label>
|
||||||
|
<textarea
|
||||||
|
[placeholder]="'add-edit-entity.form.ai-description-placeholder' | translate"
|
||||||
|
formControlName="aiDescription"
|
||||||
|
iqserHasScrollbar
|
||||||
|
name="aiDescription"
|
||||||
|
rows="4"
|
||||||
|
type="text"
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div *ngIf="form.get('hasDictionary')" class="iqser-input-group">
|
<div *ngIf="form.get('hasDictionary')" class="iqser-input-group">
|
||||||
<mat-slide-toggle color="primary" formControlName="hasDictionary">
|
<mat-slide-toggle color="primary" formControlName="hasDictionary">
|
||||||
{{ 'add-edit-entity.form.has-dictionary' | translate }}
|
{{ 'add-edit-entity.form.has-dictionary' | translate }}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { MatSelect } from '@angular/material/select';
|
|||||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { RoundCheckboxComponent } from '@common-ui/inputs/round-checkbox/round-checkbox.component';
|
import { RoundCheckboxComponent } from '@common-ui/inputs/round-checkbox/round-checkbox.component';
|
||||||
import { BaseFormComponent, getConfig, HasScrollbarDirective, LoadingService, Toaster } from '@iqser/common-ui';
|
import { BaseFormComponent, getConfig, isIqserDevMode, HasScrollbarDirective, LoadingService, Toaster } from '@iqser/common-ui';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { Dictionary, IDictionary } from '@red/domain';
|
import { Dictionary, IDictionary } from '@red/domain';
|
||||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||||
@ -18,6 +18,7 @@ import { toSnakeCase } from '@utils/functions';
|
|||||||
import { ColorPickerModule } from 'ngx-color-picker';
|
import { ColorPickerModule } from 'ngx-color-picker';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map, startWith } from 'rxjs/operators';
|
import { map, startWith } from 'rxjs/operators';
|
||||||
|
import { log } from '@common-ui/utils';
|
||||||
|
|
||||||
const REDACTION_FIELDS = ['defaultReason'];
|
const REDACTION_FIELDS = ['defaultReason'];
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
|
|||||||
|
|
||||||
colors: Color[];
|
colors: Color[];
|
||||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||||
|
readonly isIqserDevMode = isIqserDevMode();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _dictionariesMapService: DictionariesMapService,
|
private readonly _dictionariesMapService: DictionariesMapService,
|
||||||
@ -158,6 +160,8 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
|
|||||||
skippedHexColor: [this.entity?.skippedHexColor, [Validators.required, Validators.minLength(7)]],
|
skippedHexColor: [this.entity?.skippedHexColor, [Validators.required, Validators.minLength(7)]],
|
||||||
type: [this.entity?.type],
|
type: [this.entity?.type],
|
||||||
description: [this.entity?.description],
|
description: [this.entity?.description],
|
||||||
|
aiCreationEnabled: [this.entity?.aiCreationEnabled],
|
||||||
|
aiDescription: [this.entity?.aiDescription],
|
||||||
rank: [{ value: this.entity?.rank, disabled: this.#isSystemManaged }, Validators.required],
|
rank: [{ value: this.entity?.rank, disabled: this.#isSystemManaged }, Validators.required],
|
||||||
hint: [{ value: !!this.entity?.hint, disabled: this.#isSystemManaged }],
|
hint: [{ value: !!this.entity?.hint, disabled: this.#isSystemManaged }],
|
||||||
hasDictionary: [
|
hasDictionary: [
|
||||||
@ -250,6 +254,8 @@ export class AddEditEntityComponent extends BaseFormComponent implements OnInit
|
|||||||
dossierTemplateId: this.dossierTemplateId,
|
dossierTemplateId: this.dossierTemplateId,
|
||||||
type: this.form.get('type').value,
|
type: this.form.get('type').value,
|
||||||
description: this.form.get('description').value,
|
description: this.form.get('description').value,
|
||||||
|
aiCreationEnabled: this.form.get('aiCreationEnabled').value,
|
||||||
|
aiDescription: this.form.get('aiDescription').value,
|
||||||
hint: this.#isHint,
|
hint: this.#isHint,
|
||||||
rank: this.form.get('rank').value,
|
rank: this.form.get('rank').value,
|
||||||
caseInsensitive: !this.form.get('caseSensitive').value,
|
caseInsensitive: !this.form.get('caseSensitive').value,
|
||||||
|
|||||||
@ -112,9 +112,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"add-edit-dossier-attribute": {
|
"add-edit-dossier-attribute": {
|
||||||
"error": {
|
|
||||||
"generic": "Speichern des Attributs fehlgeschlagen."
|
|
||||||
},
|
|
||||||
"form": {
|
"form": {
|
||||||
"label": "Name des Attributs",
|
"label": "Name des Attributs",
|
||||||
"label-placeholder": "Namen eingeben",
|
"label-placeholder": "Namen eingeben",
|
||||||
@ -138,6 +135,9 @@
|
|||||||
},
|
},
|
||||||
"add-edit-entity": {
|
"add-edit-entity": {
|
||||||
"form": {
|
"form": {
|
||||||
|
"ai-creation-enabled": "AI Erzeugung aktivieren",
|
||||||
|
"ai-description": "AI Beschreibung",
|
||||||
|
"ai-description-placeholder": "AI Beschreibung eingeben",
|
||||||
"case-sensitive": "Groß-/Kleinschreibung beachten",
|
"case-sensitive": "Groß-/Kleinschreibung beachten",
|
||||||
"color": "Farbe {type, select, redaction{Schwärzung} hint{Hinweis} recommendation{Empfehlung} skipped{Ingorierte Schwärzung} ignored{Ignorierter Hinweis} other{}}",
|
"color": "Farbe {type, select, redaction{Schwärzung} hint{Hinweis} recommendation{Empfehlung} skipped{Ingorierte Schwärzung} ignored{Ignorierter Hinweis} other{}}",
|
||||||
"color-placeholder": "#",
|
"color-placeholder": "#",
|
||||||
|
|||||||
@ -112,9 +112,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"add-edit-dossier-attribute": {
|
"add-edit-dossier-attribute": {
|
||||||
"error": {
|
|
||||||
"generic": "Failed to save attribute."
|
|
||||||
},
|
|
||||||
"form": {
|
"form": {
|
||||||
"label": "Attribute name",
|
"label": "Attribute name",
|
||||||
"label-placeholder": "Enter name",
|
"label-placeholder": "Enter name",
|
||||||
@ -138,6 +135,9 @@
|
|||||||
},
|
},
|
||||||
"add-edit-entity": {
|
"add-edit-entity": {
|
||||||
"form": {
|
"form": {
|
||||||
|
"ai-creation-enabled": "Enable AI creation",
|
||||||
|
"ai-description": "AI Description",
|
||||||
|
"ai-description-placeholder": "Enter AI description",
|
||||||
"case-sensitive": "Case-sensitive",
|
"case-sensitive": "Case-sensitive",
|
||||||
"color": "{type, select, redaction{Redaction} hint{Hint} recommendation{Recommendation} skipped{Skipped redaction} ignored{Ignored hint} other{}} color",
|
"color": "{type, select, redaction{Redaction} hint{Hint} recommendation{Recommendation} skipped{Skipped redaction} ignored{Ignored hint} other{}} color",
|
||||||
"color-placeholder": "#",
|
"color-placeholder": "#",
|
||||||
|
|||||||
@ -112,9 +112,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"add-edit-dossier-attribute": {
|
"add-edit-dossier-attribute": {
|
||||||
"error": {
|
|
||||||
"generic": "Speichern des Attributs fehlgeschlagen."
|
|
||||||
},
|
|
||||||
"form": {
|
"form": {
|
||||||
"label": "Name des Attributs",
|
"label": "Name des Attributs",
|
||||||
"label-placeholder": "Namen eingeben",
|
"label-placeholder": "Namen eingeben",
|
||||||
@ -138,6 +135,9 @@
|
|||||||
},
|
},
|
||||||
"add-edit-entity": {
|
"add-edit-entity": {
|
||||||
"form": {
|
"form": {
|
||||||
|
"ai-creation-enabled": "AI Erzeugung aktivieren",
|
||||||
|
"ai-description": "AI Beschreibung",
|
||||||
|
"ai-description-placeholder": "AI Beschreibung eingeben",
|
||||||
"case-sensitive": "Groß-/Kleinschreibung beachten",
|
"case-sensitive": "Groß-/Kleinschreibung beachten",
|
||||||
"color": "Farbe {type, select, redaction{Annotation} hint{Hinweis} recommendation{Empfehlung} skipped{Übersprungene Annotation} ignored{Ignorierter Hinweis} other{}}",
|
"color": "Farbe {type, select, redaction{Annotation} hint{Hinweis} recommendation{Empfehlung} skipped{Übersprungene Annotation} ignored{Ignorierter Hinweis} other{}}",
|
||||||
"color-placeholder": "#",
|
"color-placeholder": "#",
|
||||||
|
|||||||
@ -112,9 +112,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"add-edit-dossier-attribute": {
|
"add-edit-dossier-attribute": {
|
||||||
"error": {
|
|
||||||
"generic": "Failed to save attribute!"
|
|
||||||
},
|
|
||||||
"form": {
|
"form": {
|
||||||
"label": "Attribute name",
|
"label": "Attribute name",
|
||||||
"label-placeholder": "Enter name",
|
"label-placeholder": "Enter name",
|
||||||
@ -138,6 +135,9 @@
|
|||||||
},
|
},
|
||||||
"add-edit-entity": {
|
"add-edit-entity": {
|
||||||
"form": {
|
"form": {
|
||||||
|
"ai-creation-enabled": "Enable AI creation",
|
||||||
|
"ai-description": "AI Description",
|
||||||
|
"ai-description-placeholder": "Enter AI description",
|
||||||
"case-sensitive": "Case-sensitive",
|
"case-sensitive": "Case-sensitive",
|
||||||
"color": "{type, select, redaction{Annotation} hint{Hint} recommendation{Recommendation} skipped{Skipped annotation} ignored{Ignored hint} other{}} Color",
|
"color": "{type, select, redaction{Annotation} hint{Hint} recommendation{Recommendation} skipped{Skipped annotation} ignored{Ignored hint} other{}} Color",
|
||||||
"color-placeholder": "#",
|
"color-placeholder": "#",
|
||||||
|
|||||||
@ -7,6 +7,8 @@ export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
|||||||
readonly addToDictionaryAction: boolean;
|
readonly addToDictionaryAction: boolean;
|
||||||
readonly caseInsensitive: boolean;
|
readonly caseInsensitive: boolean;
|
||||||
readonly description: string;
|
readonly description: string;
|
||||||
|
readonly aiCreationEnabled: boolean;
|
||||||
|
readonly aiDescription: string;
|
||||||
readonly dossierTemplateId?: string;
|
readonly dossierTemplateId?: string;
|
||||||
readonly hexColor?: string;
|
readonly hexColor?: string;
|
||||||
readonly recommendationHexColor?: string;
|
readonly recommendationHexColor?: string;
|
||||||
@ -33,6 +35,8 @@ export class Dictionary extends Entity<IDictionary> implements IDictionary {
|
|||||||
this.addToDictionaryAction = !!entity.addToDictionaryAction;
|
this.addToDictionaryAction = !!entity.addToDictionaryAction;
|
||||||
this.caseInsensitive = !!entity.caseInsensitive;
|
this.caseInsensitive = !!entity.caseInsensitive;
|
||||||
this.description = entity.description ?? '';
|
this.description = entity.description ?? '';
|
||||||
|
this.aiCreationEnabled = !!entity.aiCreationEnabled;
|
||||||
|
this.aiDescription = entity.aiDescription ?? '';
|
||||||
this.dossierTemplateId = entity.dossierTemplateId;
|
this.dossierTemplateId = entity.dossierTemplateId;
|
||||||
this.entries = entity.entries ?? [];
|
this.entries = entity.entries ?? [];
|
||||||
this.falsePositiveEntries = entity.falsePositiveEntries ?? [];
|
this.falsePositiveEntries = entity.falsePositiveEntries ?? [];
|
||||||
|
|||||||
@ -16,6 +16,14 @@ export interface IDictionary {
|
|||||||
* The description of the dictionary type
|
* The description of the dictionary type
|
||||||
*/
|
*/
|
||||||
readonly description?: string;
|
readonly description?: string;
|
||||||
|
/**
|
||||||
|
* True if the entries in this type should also be created via AI, default is false.
|
||||||
|
*/
|
||||||
|
readonly aiCreationEnabled?: boolean;
|
||||||
|
/**
|
||||||
|
* The AI description of the dictionary type
|
||||||
|
*/
|
||||||
|
readonly aiDescription?: string;
|
||||||
/**
|
/**
|
||||||
* The DossierTemplate Id for this type
|
* The DossierTemplate Id for this type
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user