|
|
|
@ -153,26 +153,35 @@ |
|
|
|
} |
|
|
|
</div> |
|
|
|
@if (fieldFormGroup.get('type').value === CalculatedFieldType.SIMPLE) { |
|
|
|
<mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label> |
|
|
|
{{ (outputFormGroup.get('type').value === OutputType.Timeseries |
|
|
|
? 'calculated-fields.timeseries-key' |
|
|
|
: 'calculated-fields.attribute-key') |
|
|
|
| translate }} |
|
|
|
</mat-label> |
|
|
|
<input matInput formControlName="name" required> |
|
|
|
@if (outputFormGroup.get('name').errors && outputFormGroup.get('name').touched) { |
|
|
|
<mat-error> |
|
|
|
@if (outputFormGroup.get('name').hasError('required')) { |
|
|
|
{{ 'common.hint.key-required' | translate }} |
|
|
|
} @else if (outputFormGroup.get('name').hasError('pattern')) { |
|
|
|
{{ 'common.hint.key-pattern' | translate }} |
|
|
|
} @else if (outputFormGroup.get('name').hasError('maxlength')) { |
|
|
|
{{ 'common.hint.key-max-length' | translate }} |
|
|
|
} |
|
|
|
</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
<div class="flex items-center gap-3"> |
|
|
|
<mat-form-field class="flex-1" appearance="outline"> |
|
|
|
<mat-label> |
|
|
|
{{ (outputFormGroup.get('type').value === OutputType.Timeseries |
|
|
|
? 'calculated-fields.timeseries-key' |
|
|
|
: 'calculated-fields.attribute-key') |
|
|
|
| translate }} |
|
|
|
</mat-label> |
|
|
|
<input matInput formControlName="name" required> |
|
|
|
@if (outputFormGroup.get('name').errors && outputFormGroup.get('name').touched) { |
|
|
|
<mat-error> |
|
|
|
@if (outputFormGroup.get('name').hasError('required')) { |
|
|
|
{{ 'common.hint.key-required' | translate }} |
|
|
|
} @else if (outputFormGroup.get('name').hasError('pattern')) { |
|
|
|
{{ 'common.hint.key-pattern' | translate }} |
|
|
|
} @else if (outputFormGroup.get('name').hasError('maxlength')) { |
|
|
|
{{ 'common.hint.key-max-length' | translate }} |
|
|
|
} |
|
|
|
</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field class="flex-1" appearance="outline"> |
|
|
|
<mat-label>{{ 'calculated-fields.decimals-by-default' | translate }}</mat-label> |
|
|
|
<input matInput type="number" formControlName="decimalsByDefault"> |
|
|
|
@if (outputFormGroup.get('decimalsByDefault').errors && outputFormGroup.get('decimalsByDefault').touched) { |
|
|
|
<mat-error>{{ 'calculated-fields.hint.decimals-range' | translate }}</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
</div> |
|
|
|
</ng-container> |
|
|
|
|