diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ebb665c..f52d28802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded `Nx` from version `22.4.5` to `22.5.3` +### Fixed + +- Fixed the _Save_ button state in the rule settings dialog on the _X-ray_ page + ## 2.245.0 - 2026-03-01 ### Changed diff --git a/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts b/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts index 65300c6d8..7f18444e0 100644 --- a/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts +++ b/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.component.ts @@ -3,7 +3,7 @@ import { GfValueComponent } from '@ghostfolio/ui/value'; import { CommonModule } from '@angular/common'; import { Component, Inject } from '@angular/core'; -import { FormsModule } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MAT_DIALOG_DATA, @@ -17,7 +17,7 @@ import { RuleSettingsDialogParams } from './interfaces/interfaces'; @Component({ imports: [ CommonModule, - FormsModule, + ReactiveFormsModule, GfValueComponent, MatButtonModule, MatDialogModule, @@ -29,9 +29,23 @@ import { RuleSettingsDialogParams } from './interfaces/interfaces'; }) export class GfRuleSettingsDialogComponent { public settings: XRayRulesSettings['AccountClusterRiskCurrentInvestment']; + public form: FormGroup; public constructor( @Inject(MAT_DIALOG_DATA) public data: RuleSettingsDialogParams, - public dialogRef: MatDialogRef - ) {} + public dialogRef: MatDialogRef, + private formBuilder: FormBuilder + ) { + this.form = this.formBuilder.group({ + thresholdMax: [this.data.settings?.thresholdMax], + thresholdMin: [this.data.settings?.thresholdMin] + }); + } + + public onSave() { + this.dialogRef.close({ + ...this.data.settings, + ...this.form.value + }); + } } diff --git a/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html b/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html index 83d4e2d19..21950b526 100644 --- a/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html +++ b/apps/client/src/app/components/rule/rule-settings-dialog/rule-settings-dialog.html @@ -1,138 +1,144 @@
{{ data.categoryName }} › {{ data.rule.name }}
-
- @if ( - data.rule.configuration.thresholdMin && data.rule.configuration.thresholdMax - ) { -
-
- Threshold range: - - - - -
-
- - - - - - +
+
+ @if ( + data.rule.configuration.thresholdMin && + data.rule.configuration.thresholdMax + ) { +
+
+ Threshold range: + + - + +
+
+ + + + + + +
-
- } @else { -
-
- Threshold Min: - -
-
- - - - - + } @else { +
+
+ Threshold Min: + +
+
+ + + + + +
-
-
-
- Threshold Max: - -
-
- - - - - +
+
+ Threshold Max: + +
+
+ + + + + +
-
- } -
+ } +
-
- - -
+
+ + +
+