Browse Source

Fix review comments

pull/4043/head
Amandee Ellawala 9 months ago
parent
commit
ccf3e44cc4
  1. 152
      apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html
  2. 4
      apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.scss

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

@ -4,16 +4,9 @@
@if ( @if (
data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax
) { ) {
<div <div class="w-100">
class="w-100"
[ngClass]="{
'd-none':
!data.rule.configuration.thresholdMin ||
!data.rule.configuration.thresholdMax
}"
>
<h6 class="mb-0"> <h6 class="mb-0">
<ng-container i18n>Threshold</ng-container>: <ng-container i18n>Threshold range</ng-container>:
@if (data.rule.configuration.threshold.unit === '%') { @if (data.rule.configuration.threshold.unit === '%') {
{{ data.settings.thresholdMin | percent: '1.2-2' }} {{ data.settings.thresholdMin | percent: '1.2-2' }}
} @else { } @else {
@ -26,28 +19,31 @@
{{ data.settings.thresholdMax }} {{ data.settings.thresholdMax }}
} }
</h6> </h6>
@if (data.rule.configuration.threshold.unit === '%') { <div class="align-items-center d-flex w-100">
<label>{{ @if (data.rule.configuration.threshold.unit === '%') {
data.rule.configuration.threshold.min | percent: '1.2-2' <label>{{
}}</label> data.rule.configuration.threshold.min | percent: '1.2-2'
} @else { }}</label>
<label>{{ data.rule.configuration.threshold.min }}</label> } @else {
} <label>{{ data.rule.configuration.threshold.min }}</label>
<mat-slider }
[max]="data.rule.configuration.threshold.max" <mat-slider
[min]="data.rule.configuration.threshold.min" class="flex-grow-1"
[step]="data.rule.configuration.threshold.step" [max]="data.rule.configuration.threshold.max"
> [min]="data.rule.configuration.threshold.min"
<input matSliderStartThumb [(ngModel)]="data.settings.thresholdMin" /> [step]="data.rule.configuration.threshold.step"
<input matSliderEndThumb [(ngModel)]="data.settings.thresholdMax" /> >
</mat-slider> <input matSliderStartThumb [(ngModel)]="data.settings.thresholdMin" />
@if (data.rule.configuration.threshold.unit === '%') { <input matSliderEndThumb [(ngModel)]="data.settings.thresholdMax" />
<label>{{ </mat-slider>
data.rule.configuration.threshold.max | percent: '1.2-2' @if (data.rule.configuration.threshold.unit === '%') {
}}</label> <label>{{
} @else { data.rule.configuration.threshold.max | percent: '1.2-2'
<label>{{ data.rule.configuration.threshold.max }}</label> }}</label>
} } @else {
<label>{{ data.rule.configuration.threshold.max }}</label>
}
</div>
</div> </div>
} @else { } @else {
<div <div
@ -62,28 +58,31 @@
{{ data.settings.thresholdMin }} {{ data.settings.thresholdMin }}
} }
</h6> </h6>
@if (data.rule.configuration.threshold.unit === '%') { <div class="align-items-center d-flex w-100">
<label>{{ @if (data.rule.configuration.threshold.unit === '%') {
data.rule.configuration.threshold.min | percent: '1.2-2' <label>{{
}}</label> data.rule.configuration.threshold.min | percent: '1.2-2'
} @else { }}</label>
<label>{{ data.rule.configuration.threshold.min }}</label> } @else {
} <label>{{ data.rule.configuration.threshold.min }}</label>
<mat-slider }
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]="data.rule.configuration.threshold.max"
> [min]="data.rule.configuration.threshold.min"
<input matSliderThumb [(ngModel)]="data.settings.thresholdMin" /> [step]="data.rule.configuration.threshold.step"
</mat-slider> >
@if (data.rule.configuration.threshold.unit === '%') { <input matSliderThumb [(ngModel)]="data.settings.thresholdMin" />
<label>{{ </mat-slider>
data.rule.configuration.threshold.max | percent: '1.2-2' @if (data.rule.configuration.threshold.unit === '%') {
}}</label> <label>{{
} @else { data.rule.configuration.threshold.max | percent: '1.2-2'
<label>{{ data.rule.configuration.threshold.max }}</label> }}</label>
} } @else {
<label>{{ data.rule.configuration.threshold.max }}</label>
}
</div>
</div> </div>
<div <div
class="w-100" class="w-100"
@ -97,28 +96,31 @@
{{ data.settings.thresholdMax }} {{ data.settings.thresholdMax }}
} }
</h6> </h6>
@if (data.rule.configuration.threshold.unit === '%') { <div class="align-items-center d-flex w-100">
<label>{{ @if (data.rule.configuration.threshold.unit === '%') {
data.rule.configuration.threshold.min | percent: '1.2-2' <label>{{
}}</label> data.rule.configuration.threshold.min | percent: '1.2-2'
} @else { }}</label>
<label>{{ data.rule.configuration.threshold.min }}</label> } @else {
} <label>{{ data.rule.configuration.threshold.min }}</label>
<mat-slider }
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]="data.rule.configuration.threshold.max"
> [min]="data.rule.configuration.threshold.min"
<input matSliderThumb [(ngModel)]="data.settings.thresholdMax" /> [step]="data.rule.configuration.threshold.step"
</mat-slider> >
@if (data.rule.configuration.threshold.unit === '%') { <input matSliderThumb [(ngModel)]="data.settings.thresholdMax" />
<label>{{ </mat-slider>
data.rule.configuration.threshold.max | percent: '1.2-2' @if (data.rule.configuration.threshold.unit === '%') {
}}</label> <label>{{
} @else { data.rule.configuration.threshold.max | percent: '1.2-2'
<label>{{ data.rule.configuration.threshold.max }}</label> }}</label>
} } @else {
<label>{{ data.rule.configuration.threshold.max }}</label>
}
</div>
</div> </div>
} }
</div> </div>

4
apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.scss

@ -1,2 +1,6 @@
:host { :host {
} }
label {
margin-bottom: 0;
}

Loading…
Cancel
Save