Browse Source

Feature/implement range slider in rule settings dialog (#4043)

* Implement range slider in rule settings dialog

* Update changelog
pull/4047/head
Amandee Ellawala 2 months ago
committed by GitHub
parent
commit
a1934ee82b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 188
      apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html
  3. 3
      apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.scss

1
CHANGELOG.md

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Moved the chart of the holdings tab on the home page from experimental to general availability - Moved the chart of the holdings tab on the home page from experimental to general availability
- Extended the assistant by a holding selector - Extended the assistant by a holding selector
- Separated the _FIRE_ / _X-ray_ page - Separated the _FIRE_ / _X-ray_ page
- Improved the usability to customize the rule thresholds in the _X-ray_ page by introducing range sliders (experimental)
- Improved the language localization for Italian (`it`) - Improved the language localization for Italian (`it`)
- Upgraded `ngx-skeleton-loader` from version `7.0.0` to `9.0.0` - Upgraded `ngx-skeleton-loader` from version `7.0.0` to `9.0.0`
- Upgraded `uuid` from version `9.0.1` to `11.0.2` - Upgraded `uuid` from version `9.0.1` to `11.0.2`

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

@ -1,76 +1,128 @@
<div mat-dialog-title>{{ data.rule.name }}</div> <div mat-dialog-title>{{ data.rule.name }}</div>
<div class="py-3" mat-dialog-content> <div class="py-3" mat-dialog-content>
<div @if (
class="w-100" data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMin }" ) {
> <div class="w-100">
<h6 class="mb-0"> <h6 class="mb-0">
<ng-container i18n>Threshold Min</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 {
{{ data.settings.thresholdMin }} {{ data.settings.thresholdMin }}
} }
</h6> -
@if (data.rule.configuration.threshold.unit === '%') { @if (data.rule.configuration.threshold.unit === '%') {
<label>{{ {{ data.settings.thresholdMax | percent: '1.2-2' }}
data.rule.configuration.threshold.min | percent: '1.2-2' } @else {
}}</label> {{ data.settings.thresholdMax }}
} @else { }
<label>{{ data.rule.configuration.threshold.min }}</label> </h6>
} <div class="align-items-center d-flex w-100">
<mat-slider @if (data.rule.configuration.threshold.unit === '%') {
name="thresholdMin" <label>{{
[max]="data.rule.configuration.threshold.max" data.rule.configuration.threshold.min | percent: '1.2-2'
[min]="data.rule.configuration.threshold.min" }}</label>
[step]="data.rule.configuration.threshold.step" } @else {
<label>{{ data.rule.configuration.threshold.min }}</label>
}
<mat-slider
class="flex-grow-1"
[max]="data.rule.configuration.threshold.max"
[min]="data.rule.configuration.threshold.min"
[step]="data.rule.configuration.threshold.step"
>
<input matSliderStartThumb [(ngModel)]="data.settings.thresholdMin" />
<input matSliderEndThumb [(ngModel)]="data.settings.thresholdMax" />
</mat-slider>
@if (data.rule.configuration.threshold.unit === '%') {
<label>{{
data.rule.configuration.threshold.max | percent: '1.2-2'
}}</label>
} @else {
<label>{{ data.rule.configuration.threshold.max }}</label>
}
</div>
</div>
} @else {
<div
class="w-100"
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMin }"
> >
<input matSliderThumb [(ngModel)]="data.settings.thresholdMin" /> <h6 class="mb-0">
</mat-slider> <ng-container i18n>Threshold Min</ng-container>:
@if (data.rule.configuration.threshold.unit === '%') { @if (data.rule.configuration.threshold.unit === '%') {
<label>{{ {{ data.settings.thresholdMin | percent: '1.2-2' }}
data.rule.configuration.threshold.max | percent: '1.2-2' } @else {
}}</label> {{ data.settings.thresholdMin }}
} @else { }
<label>{{ data.rule.configuration.threshold.max }}</label> </h6>
} <div class="align-items-center d-flex w-100">
</div> @if (data.rule.configuration.threshold.unit === '%') {
<div <label>{{
class="w-100" data.rule.configuration.threshold.min | percent: '1.2-2'
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMax }" }}</label>
> } @else {
<h6 class="mb-0"> <label>{{ data.rule.configuration.threshold.min }}</label>
<ng-container i18n>Threshold Max</ng-container>: }
@if (data.rule.configuration.threshold.unit === '%') { <mat-slider
{{ data.settings.thresholdMax | percent: '1.2-2' }} class="flex-grow-1"
} @else { name="thresholdMin"
{{ data.settings.thresholdMax }} [max]="data.rule.configuration.threshold.max"
} [min]="data.rule.configuration.threshold.min"
</h6> [step]="data.rule.configuration.threshold.step"
@if (data.rule.configuration.threshold.unit === '%') { >
<label>{{ <input matSliderThumb [(ngModel)]="data.settings.thresholdMin" />
data.rule.configuration.threshold.min | percent: '1.2-2' </mat-slider>
}}</label> @if (data.rule.configuration.threshold.unit === '%') {
} @else { <label>{{
<label>{{ data.rule.configuration.threshold.min }}</label> data.rule.configuration.threshold.max | percent: '1.2-2'
} }}</label>
<mat-slider } @else {
name="thresholdMax" <label>{{ data.rule.configuration.threshold.max }}</label>
[max]="data.rule.configuration.threshold.max" }
[min]="data.rule.configuration.threshold.min" </div>
[step]="data.rule.configuration.threshold.step" </div>
<div
class="w-100"
[ngClass]="{ 'd-none': !data.rule.configuration.thresholdMax }"
> >
<input matSliderThumb [(ngModel)]="data.settings.thresholdMax" /> <h6 class="mb-0">
</mat-slider> <ng-container i18n>Threshold Max</ng-container>:
@if (data.rule.configuration.threshold.unit === '%') { @if (data.rule.configuration.threshold.unit === '%') {
<label>{{ {{ data.settings.thresholdMax | percent: '1.2-2' }}
data.rule.configuration.threshold.max | percent: '1.2-2' } @else {
}}</label> {{ data.settings.thresholdMax }}
} @else { }
<label>{{ data.rule.configuration.threshold.max }}</label> </h6>
} <div class="align-items-center d-flex w-100">
</div> @if (data.rule.configuration.threshold.unit === '%') {
<label>{{
data.rule.configuration.threshold.min | percent: '1.2-2'
}}</label>
} @else {
<label>{{ data.rule.configuration.threshold.min }}</label>
}
<mat-slider
class="flex-grow-1"
name="thresholdMax"
[max]="data.rule.configuration.threshold.max"
[min]="data.rule.configuration.threshold.min"
[step]="data.rule.configuration.threshold.step"
>
<input matSliderThumb [(ngModel)]="data.settings.thresholdMax" />
</mat-slider>
@if (data.rule.configuration.threshold.unit === '%') {
<label>{{
data.rule.configuration.threshold.max | percent: '1.2-2'
}}</label>
} @else {
<label>{{ data.rule.configuration.threshold.max }}</label>
}
</div>
</div>
}
</div> </div>
<div align="end" mat-dialog-actions> <div align="end" mat-dialog-actions>

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

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

Loading…
Cancel
Save