Merge pull request #4200 from emanuelschuetze/config-textarea-field
Use missing textarea field for config inputtype 'text'.
This commit is contained in:
commit
214b74e091
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user