Browse Source

UI: Fixed advanced settings style in Save ts rule node config

pull/12413/head
Vladyslav_Prykhodko 2 years ago
parent
commit
e8dbe56219
  1. 3
      ui-ngx/src/app/modules/home/components/rule-node/action/timeseries-config.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/rule-node/common/time-unit-input.component.html
  3. 4
      ui-ngx/src/app/modules/home/components/rule-node/common/time-unit-input.component.ts

3
ui-ngx/src/app/modules/home/components/rule-node/action/timeseries-config.component.html

@ -57,7 +57,7 @@
></tb-advanced-persistence-settings>
}
</div>
<section class="tb-form-panel stroked no-padding-bottom">
<section class="tb-form-panel stroked">
<mat-expansion-panel class="tb-settings">
<mat-expansion-panel-header>
<mat-panel-title translate>rule-node-config.advanced-settings</mat-panel-title>
@ -71,6 +71,7 @@
</div>
<tb-time-unit-input
required
subscriptSizing="dynamic"
labelText="{{ 'rule-node-config.default-ttl' | translate }}"
requiredText="{{ 'rule-node-config.default-ttl-required' | translate }}"
minErrorText="{{ 'rule-node-config.min-default-ttl-message' | translate }}"

4
ui-ngx/src/app/modules/home/components/rule-node/common/time-unit-input.component.html

@ -22,7 +22,7 @@
<div matSuffix>
<ng-content select="[matSuffix]"></ng-content>
</div>
<mat-hint></mat-hint>
<mat-hint *ngIf="subscriptSizing === 'fixed'"></mat-hint>
<mat-error *ngIf="timeInputForm.get('time').hasError('required') && requiredText">
{{ requiredText }}
</mat-error>
@ -33,7 +33,7 @@
{{ maxErrorText }}
</mat-error>
</mat-form-field>
<mat-form-field class="h-fit max-w-33% flex-full">
<mat-form-field class="h-fit max-w-33% flex-full" [subscriptSizing]="subscriptSizing">
<mat-label translate>rule-node-config.units</mat-label>
<mat-select formControlName="timeUnit">
@for (timeUnit of timeUnits; track timeUnit) {

4
ui-ngx/src/app/modules/home/components/rule-node/common/time-unit-input.component.ts

@ -30,6 +30,7 @@ import { isDefinedAndNotNull, isNumeric } from '@core/utils';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { coerceBoolean, coerceNumber } from '@shared/decorators/coercion';
import { DAY, HOUR, MINUTE, SECOND } from '@shared/models/time/time.models';
import { SubscriptSizing } from '@angular/material/form-field';
interface TimeUnitInputModel {
time: number;
@ -75,6 +76,9 @@ export class TimeUnitInputComponent implements ControlValueAccessor, Validator,
@Input()
maxErrorText: string;
@Input()
subscriptSizing: SubscriptSizing = 'fixed';
timeUnits = Object.values(TimeUnit).filter(item => item !== TimeUnit.MILLISECONDS) as TimeUnit[];
timeUnitTranslations = timeUnitTranslations;

Loading…
Cancel
Save