Browse Source

fix: update rule-settings-dialog template for reactive forms

pull/6747/head
mailtoboggavarapu-coder 2 days ago
parent
commit
d7e6b326c8
  1. 14
      apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html

14
apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html

@ -1,6 +1,6 @@
<div mat-dialog-title>{{ data.categoryName }} {{ data.rule.name }}</div> <div mat-dialog-title>{{ data.categoryName }} › {{ data.rule.name }}</div>
<div class="py-3" mat-dialog-content> <div class="py-3" mat-dialog-content [formGroup]="settingsForm">
@if ( @if (
data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax
) { ) {
@ -35,8 +35,8 @@
[min]="data.rule.configuration.threshold.min" [min]="data.rule.configuration.threshold.min"
[step]="data.rule.configuration.threshold.step" [step]="data.rule.configuration.threshold.step"
> >
<input matSliderStartThumb [(ngModel)]="data.settings.thresholdMin" /> <input matSliderStartThumb formControlName="thresholdMin" />
<input matSliderEndThumb [(ngModel)]="data.settings.thresholdMax" /> <input matSliderEndThumb formControlName="thresholdMax" />
</mat-slider> </mat-slider>
<gf-value <gf-value
[isPercent]="data.rule.configuration.threshold.unit === '%'" [isPercent]="data.rule.configuration.threshold.unit === '%'"
@ -75,7 +75,7 @@
[min]="data.rule.configuration.threshold.min" [min]="data.rule.configuration.threshold.min"
[step]="data.rule.configuration.threshold.step" [step]="data.rule.configuration.threshold.step"
> >
<input matSliderThumb [(ngModel)]="data.settings.thresholdMin" /> <input matSliderThumb formControlName="thresholdMin" />
</mat-slider> </mat-slider>
<gf-value <gf-value
[isPercent]="data.rule.configuration.threshold.unit === '%'" [isPercent]="data.rule.configuration.threshold.unit === '%'"
@ -113,7 +113,7 @@
[min]="data.rule.configuration.threshold.min" [min]="data.rule.configuration.threshold.min"
[step]="data.rule.configuration.threshold.step" [step]="data.rule.configuration.threshold.step"
> >
<input matSliderThumb [(ngModel)]="data.settings.thresholdMax" /> <input matSliderThumb formControlName="thresholdMax" />
</mat-slider> </mat-slider>
<gf-value <gf-value
[isPercent]="data.rule.configuration.threshold.unit === '%'" [isPercent]="data.rule.configuration.threshold.unit === '%'"
@ -131,7 +131,7 @@
<button <button
color="primary" color="primary"
mat-flat-button mat-flat-button
(click)="dialogRef.close(data.settings)" [disabled]="!settingsForm.dirty" (click)="dialogRef.close(updatedSettings)"
> >
<ng-container i18n>Save</ng-container> <ng-container i18n>Save</ng-container>
</button> </button>

Loading…
Cancel
Save