diff --git a/frontend/src/app/corpus-definitions/form/field-form/field-form.component.html b/frontend/src/app/corpus-definitions/form/field-form/field-form.component.html index b3d556246..d64518966 100644 --- a/frontend/src/app/corpus-definitions/form/field-form/field-form.component.html +++ b/frontend/src/app/corpus-definitions/form/field-form/field-form.component.html @@ -22,7 +22,7 @@

Fields

-

{{help}}

+

{{help}}

@@ -54,7 +54,7 @@

Fields

-
+
diff --git a/frontend/src/app/corpus-definitions/form/field-form/field-form.component.ts b/frontend/src/app/corpus-definitions/form/field-form/field-form.component.ts index a453a72bb..3bb29250e 100644 --- a/frontend/src/app/corpus-definitions/form/field-form/field-form.component.ts +++ b/frontend/src/app/corpus-definitions/form/field-form/field-form.component.ts @@ -26,14 +26,16 @@ export class FieldFormComponent { { label: 'text (content)', value: 'text_content', - tooltip: + helpText: 'Main document text. Can consist of multiple paragraphs. Can be used to search.', + hasLanguage: true, }, { label: 'text (metadata)', value: 'text_metadata', - tooltip: + helpText: 'Metadata text. Limited to a single paragraph. Can be used to filter and/or search.', + hasLanguage: true, }, { label: 'number (integer)', value: 'integer' }, { label: 'number (decimal)', value: 'float' }, @@ -41,7 +43,7 @@ export class FieldFormComponent { { label: 'boolean', value: 'boolean', - tooltip: 'True/false field. Can be used to filter.', + helpText: 'True/false field. Can be used to filter.', }, ]; @@ -78,11 +80,10 @@ export class FieldFormComponent { return fg; } - helpText(field: FormGroup): string | undefined { + getFieldProperty(field: FormGroup, prop: string) { const fieldType = field.get('type').value; - return _.find(this.fieldTypeOptions, { - value: fieldType, - }).tooltip; + const option = _.find(this.fieldTypeOptions, { value: fieldType }); + return option[prop]; } ngOnChanges(changes: SimpleChanges): void {