Use missing textarea field for config inputtype 'text'.
This commit is contained in:
parent
793066935e
commit
f3b96d4386
@ -51,11 +51,19 @@
|
|||||||
|
|
||||||
<div class="config-form-group" *ngIf="isExcludedType(configItem.inputType)">
|
<div class="config-form-group" *ngIf="isExcludedType(configItem.inputType)">
|
||||||
<div *ngIf="configItem.inputType === 'boolean'">
|
<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="hint" *ngIf="configItem.helpText && !error">{{ configItem.helpText | translate }}</div>
|
||||||
<div class="error" *ngIf="error">{{ error }}</div>
|
<div class="error" *ngIf="error">{{ error }}</div>
|
||||||
</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 -->
|
<!-- The editor -->
|
||||||
<div *ngIf="configItem.inputType === 'markupText'">
|
<div *ngIf="configItem.inputType === 'markupText'">
|
||||||
<h4>{{ configItem.label | translate }}</h4>
|
<h4>{{ configItem.label | translate }}</h4>
|
||||||
|
@ -102,7 +102,11 @@ export class ConfigFieldComponent extends BaseComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.translatedValue = this.configItem.value;
|
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 !== '') {
|
if (typeof this.configItem.value === 'string' && this.configItem.value !== '') {
|
||||||
this.translatedValue = this.translate.instant(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
|
* @returns wheather it should be excluded or not
|
||||||
*/
|
*/
|
||||||
public isExcludedType(type: string): boolean {
|
public isExcludedType(type: string): boolean {
|
||||||
const excluded = ['boolean', 'markupText'];
|
const excluded = ['boolean', 'markupText', 'text'];
|
||||||
return excluded.includes(type);
|
return excluded.includes(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user