Use missing textarea field for config inputtype 'text'.

This commit is contained in:
Emanuel Schütze 2019-01-28 20:56:49 +01:00
parent 793066935e
commit f3b96d4386
2 changed files with 15 additions and 3 deletions

View File

@ -51,11 +51,19 @@
<div class="config-form-group" *ngIf="isExcludedType(configItem.inputType)">
<div *ngIf="configItem.inputType === 'boolean'">
<mat-checkbox formControlName="value"> {{ configItem.label | translate }} </mat-checkbox>
<mat-checkbox formControlName="value">{{ configItem.label | translate }}</mat-checkbox>
<div class="hint" *ngIf="configItem.helpText && !error">{{ configItem.helpText | translate }}</div>
<div class="error" *ngIf="error">{{ error }}</div>
</div>
<!-- textarea -->
<div *ngIf="configItem.inputType === 'text'">
<mat-form-field>
<textarea rows="10" matInput placeholder="{{ configItem.label | translate }}" [value]="translatedValue"></textarea>
<div class="hint" *ngIf="configItem.helpText && !error">{{ configItem.helpText | translate }}</div>
</mat-form-field>
</div>
<!-- The editor -->
<div *ngIf="configItem.inputType === 'markupText'">
<h4>{{ configItem.label | translate }}</h4>

View File

@ -102,7 +102,11 @@ export class ConfigFieldComponent extends BaseComponent implements OnInit {
});
this.translatedValue = this.configItem.value;
if (this.configItem.inputType === 'string' || this.configItem.inputType === 'markupText') {
if (
this.configItem.inputType === 'string' ||
this.configItem.inputType === 'markupText' ||
this.configItem.inputType === 'text'
) {
if (typeof this.configItem.value === 'string' && this.configItem.value !== '') {
this.translatedValue = this.translate.instant(this.configItem.value);
}
@ -207,7 +211,7 @@ export class ConfigFieldComponent extends BaseComponent implements OnInit {
* @returns wheather it should be excluded or not
*/
public isExcludedType(type: string): boolean {
const excluded = ['boolean', 'markupText'];
const excluded = ['boolean', 'markupText', 'text'];
return excluded.includes(type);
}
}