Browse Source

Task/resolve strict template errors in rule settings dialog (#8084)

Resolve strict template errors
main
Kenrick Tandrian 9 hours ago
committed by GitHub
parent
commit
4b14053b2c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 236
      apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html

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

@ -6,123 +6,131 @@
(ngSubmit)="onSubmit()" (ngSubmit)="onSubmit()"
> >
<div class="py-3" mat-dialog-content> <div class="py-3" mat-dialog-content>
@if ( @if (data.rule.configuration?.threshold; as threshold) {
data.rule.configuration?.thresholdMin && @if (
data.rule.configuration?.thresholdMax data.rule.configuration.thresholdMin &&
) { data.rule.configuration.thresholdMax
<div class="w-100"> ) {
<h6 class="d-flex mb-0"> <div class="w-100">
<ng-container i18n>Threshold range</ng-container>: <h6 class="d-flex mb-0">
<gf-value <ng-container i18n>Threshold range</ng-container>:
class="ml-1" <gf-value
[isPercent]="data.rule.configuration.threshold.unit === '%'" class="ml-1"
[locale]="data.locale" [isPercent]="threshold.unit === '%'"
[precision]="2" [locale]="data.locale"
[value]="settingsForm.get('thresholdMin').value" [precision]="2"
/> [value]="settingsForm.get('thresholdMin')?.value"
<span class="mx-1">-</span> />
<gf-value <span class="mx-1">-</span>
[isPercent]="data.rule.configuration.threshold.unit === '%'" <gf-value
[locale]="data.locale" [isPercent]="threshold.unit === '%'"
[precision]="2" [locale]="data.locale"
[value]="settingsForm.get('thresholdMax').value" [precision]="2"
/> [value]="settingsForm.get('thresholdMax')?.value"
</h6> />
<div class="align-items-center d-flex w-100"> </h6>
<gf-value <div class="align-items-center d-flex w-100">
[isPercent]="data.rule.configuration.threshold.unit === '%'" <gf-value
[locale]="data.locale" [isPercent]="threshold.unit === '%'"
[precision]="2" [locale]="data.locale"
[value]="data.rule.configuration.threshold.min" [precision]="2"
/> [value]="threshold.min"
<mat-slider />
class="flex-grow-1" <mat-slider
[max]="data.rule.configuration.threshold.max" class="flex-grow-1"
[min]="data.rule.configuration.threshold.min" [max]="threshold.max"
[step]="data.rule.configuration.threshold.step" [min]="threshold.min"
> [step]="threshold.step"
<input formControlName="thresholdMin" matSliderStartThumb /> >
<input formControlName="thresholdMax" matSliderEndThumb /> <input formControlName="thresholdMin" matSliderStartThumb />
</mat-slider> <input formControlName="thresholdMax" matSliderEndThumb />
<gf-value </mat-slider>
[isPercent]="data.rule.configuration.threshold.unit === '%'" <gf-value
[locale]="data.locale" [isPercent]="threshold.unit === '%'"
[precision]="2" [locale]="data.locale"
[value]="data.rule.configuration.threshold.max" [precision]="2"
/> [value]="threshold.max"
/>
</div>
</div> </div>
</div> } @else {
} @else { <div
<div class="w-100" [class.d-none]="!data.rule.configuration.thresholdMin"> class="w-100"
<h6 class="d-flex mb-0"> [class.d-none]="!data.rule.configuration.thresholdMin"
<ng-container i18n>Threshold Min</ng-container>: >
<gf-value <h6 class="d-flex mb-0">
class="ml-1" <ng-container i18n>Threshold Min</ng-container>:
[isPercent]="data.rule.configuration.threshold.unit === '%'" <gf-value
[locale]="data.locale" class="ml-1"
[precision]="2" [isPercent]="threshold.unit === '%'"
[value]="settingsForm.get('thresholdMin').value" [locale]="data.locale"
/> [precision]="2"
</h6> [value]="settingsForm.get('thresholdMin')?.value"
<div class="align-items-center d-flex w-100"> />
<gf-value </h6>
[isPercent]="data.rule.configuration.threshold.unit === '%'" <div class="align-items-center d-flex w-100">
[locale]="data.locale" <gf-value
[precision]="2" [isPercent]="threshold.unit === '%'"
[value]="data.rule.configuration.threshold.min" [locale]="data.locale"
/> [precision]="2"
<mat-slider [value]="threshold.min"
class="flex-grow-1" />
name="thresholdMin" <mat-slider
[max]="data.rule.configuration.threshold.max" class="flex-grow-1"
[min]="data.rule.configuration.threshold.min" name="thresholdMin"
[step]="data.rule.configuration.threshold.step" [max]="threshold.max"
> [min]="threshold.min"
<input formControlName="thresholdMin" matSliderThumb /> [step]="threshold.step"
</mat-slider> >
<gf-value <input formControlName="thresholdMin" matSliderThumb />
[isPercent]="data.rule.configuration.threshold.unit === '%'" </mat-slider>
[locale]="data.locale" <gf-value
[precision]="2" [isPercent]="threshold.unit === '%'"
[value]="data.rule.configuration.threshold.max" [locale]="data.locale"
/> [precision]="2"
[value]="threshold.max"
/>
</div>
</div> </div>
</div> <div
<div class="w-100" [class.d-none]="!data.rule.configuration.thresholdMax"> class="w-100"
<h6 class="d-flex mb-0"> [class.d-none]="!data.rule.configuration.thresholdMax"
<ng-container i18n>Threshold Max</ng-container>: >
<gf-value <h6 class="d-flex mb-0">
class="ml-1" <ng-container i18n>Threshold Max</ng-container>:
[isPercent]="data.rule.configuration.threshold.unit === '%'" <gf-value
[locale]="data.locale" class="ml-1"
[precision]="2" [isPercent]="threshold.unit === '%'"
[value]="settingsForm.get('thresholdMax').value" [locale]="data.locale"
/> [precision]="2"
</h6> [value]="settingsForm.get('thresholdMax')?.value"
<div class="align-items-center d-flex w-100"> />
<gf-value </h6>
[isPercent]="data.rule.configuration.threshold.unit === '%'" <div class="align-items-center d-flex w-100">
[locale]="data.locale" <gf-value
[precision]="2" [isPercent]="threshold.unit === '%'"
[value]="data.rule.configuration.threshold.min" [locale]="data.locale"
/> [precision]="2"
<mat-slider [value]="threshold.min"
class="flex-grow-1" />
name="thresholdMax" <mat-slider
[max]="data.rule.configuration.threshold.max" class="flex-grow-1"
[min]="data.rule.configuration.threshold.min" name="thresholdMax"
[step]="data.rule.configuration.threshold.step" [max]="threshold.max"
> [min]="threshold.min"
<input formControlName="thresholdMax" matSliderThumb /> [step]="threshold.step"
</mat-slider> >
<gf-value <input formControlName="thresholdMax" matSliderThumb />
[isPercent]="data.rule.configuration.threshold.unit === '%'" </mat-slider>
[locale]="data.locale" <gf-value
[precision]="2" [isPercent]="threshold.unit === '%'"
[value]="data.rule.configuration.threshold.max" [locale]="data.locale"
/> [precision]="2"
[value]="threshold.max"
/>
</div>
</div> </div>
</div> }
} }
</div> </div>

Loading…
Cancel
Save