Skip to content
Snippets Groups Projects
Commit 37388ee0 authored by rhenck's avatar rhenck
Browse files

[editor] Improve element property inputs to only appear when useful

This is made for any warn message properties, which only appear when the 
corresponding velidator is actually used.
parent b5e47840
No related branches found
No related tags found
No related merge requests found
...@@ -79,20 +79,23 @@ import { MessageService } from '../../../../../../../common/message.service'; ...@@ -79,20 +79,23 @@ import { MessageService } from '../../../../../../../common/message.service';
(change)="updateModel('required', $event.checked)"> (change)="updateModel('required', $event.checked)">
Pflichtfeld Pflichtfeld
</mat-checkbox> </mat-checkbox>
<mat-form-field *ngIf="combinedProperties.hasOwnProperty('requiredWarnMessage')" appearance="fill"> <mat-form-field *ngIf="combinedProperties.hasOwnProperty('required') && combinedProperties.required"
appearance="fill">
<mat-label>Warnmeldung</mat-label> <mat-label>Warnmeldung</mat-label>
<input matInput type="text" [value]="combinedProperties.requiredWarnMessage" <input matInput type="text" [value]="combinedProperties.requiredWarnMessage"
(input)="updateModel('requiredWarnMessage', $any($event.target).value)"> (input)="updateModel('requiredWarnMessage', $any($event.target).value)">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="combinedProperties.hasOwnProperty('minLength')" appearance="fill"> <mat-form-field *ngIf="combinedProperties.hasOwnProperty('minLength')" appearance="fill">
<mat-label>Minimalwert</mat-label> <mat-label>Minimallänge</mat-label>
<input matInput type="number" #minLength="ngModel" min="0" <input matInput type="number" #minLength="ngModel" min="0"
[ngModel]="combinedProperties.minLength" [ngModel]="combinedProperties.minLength"
(ngModelChange)="updateModel('minLength', $event, minLength.valid)"> (ngModelChange)="updateModel('minLength', $event, minLength.valid)">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="combinedProperties.hasOwnProperty('minLength')" appearance="fill"> <mat-form-field *ngIf="combinedProperties.hasOwnProperty('minLength') &&
<mat-label>MInimalwert Warnmeldung</mat-label> $any(combinedProperties.minLength) > 0"
appearance="fill">
<mat-label>Minimalwert Warnmeldung</mat-label>
<input matInput type="text" [value]="combinedProperties.minLengthWarnMessage" <input matInput type="text" [value]="combinedProperties.minLengthWarnMessage"
(input)="updateModel('minLengthWarnMessage', $any($event.target).value)"> (input)="updateModel('minLengthWarnMessage', $any($event.target).value)">
</mat-form-field> </mat-form-field>
...@@ -103,7 +106,9 @@ import { MessageService } from '../../../../../../../common/message.service'; ...@@ -103,7 +106,9 @@ import { MessageService } from '../../../../../../../common/message.service';
[ngModel]="combinedProperties.maxLength" [ngModel]="combinedProperties.maxLength"
(ngModelChange)="updateModel('maxLength', $event, maxLength.valid)"> (ngModelChange)="updateModel('maxLength', $event, maxLength.valid)">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="combinedProperties.hasOwnProperty('maxLength')" appearance="fill"> <mat-form-field *ngIf="combinedProperties.hasOwnProperty('maxLength')&&
$any(combinedProperties.maxLength) > 0"
appearance="fill">
<mat-label>Maximalwert Warnmeldung</mat-label> <mat-label>Maximalwert Warnmeldung</mat-label>
<input matInput type="text" [value]="combinedProperties.maxLengthWarnMessage" <input matInput type="text" [value]="combinedProperties.maxLengthWarnMessage"
(input)="updateModel('maxLengthWarnMessage', $any($event.target).value)"> (input)="updateModel('maxLengthWarnMessage', $any($event.target).value)">
...@@ -114,7 +119,9 @@ import { MessageService } from '../../../../../../../common/message.service'; ...@@ -114,7 +119,9 @@ import { MessageService } from '../../../../../../../common/message.service';
<input matInput [value]="combinedProperties.pattern" <input matInput [value]="combinedProperties.pattern"
(input)="updateModel('pattern', $any($event.target).value)"> (input)="updateModel('pattern', $any($event.target).value)">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="combinedProperties.hasOwnProperty('pattern')" appearance="fill"> <mat-form-field *ngIf="combinedProperties.hasOwnProperty('pattern') &&
$any(combinedProperties.pattern) != ''"
appearance="fill">
<mat-label>Muster Warnmeldung</mat-label> <mat-label>Muster Warnmeldung</mat-label>
<input matInput type="text" [value]="combinedProperties.patternWarnMessage" <input matInput type="text" [value]="combinedProperties.patternWarnMessage"
(input)="updateModel('patternWarnMessage', $any($event.target).value)"> (input)="updateModel('patternWarnMessage', $any($event.target).value)">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment