diff --git a/CHANGELOG.md b/CHANGELOG.md index 2331f1a8e..c9ea9ad93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Disabled the text hover effect in the chart of the holdings tab on the home page (experimental) +- Improved the usability to customize the rule thresholds in the _X-ray_ section by introducing units (experimental) - Improved the language localization for German (`de`) ## 2.115.0 - 2024-10-14 diff --git a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts index 95a8022ed..564af935d 100644 --- a/apps/api/src/models/rules/account-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/account-cluster-risk/current-investment.ts @@ -81,7 +81,8 @@ export class AccountClusterRiskCurrentInvestment extends Rule { threshold: { max: 1, min: 0, - step: 0.01 + step: 0.01, + unit: '%' }, thresholdMax: true }; diff --git a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts index a928412ae..024d5b614 100644 --- a/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts +++ b/apps/api/src/models/rules/currency-cluster-risk/current-investment.ts @@ -66,7 +66,8 @@ export class CurrencyClusterRiskCurrentInvestment extends Rule { threshold: { max: 1, min: 0, - step: 0.01 + step: 0.01, + unit: '%' }, thresholdMax: true }; diff --git a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts index a3ea8d059..fa9d7e7bc 100644 --- a/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts +++ b/apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts @@ -48,7 +48,8 @@ export class FeeRatioInitialInvestment extends Rule { threshold: { max: 0.1, min: 0, - step: 0.005 + step: 0.0025, + unit: '%' }, thresholdMax: true }; 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 3ae5234e9..8806dae6a 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 @@ -6,11 +6,20 @@ [ngClass]="{ 'd-none': !data.rule.configuration.thresholdMin }" >
- Threshold Min ({{ - data.settings.thresholdMin?.toFixed(2) - }}) + Threshold Min: + @if (data.rule.configuration.threshold.unit === '%') { + {{ data.settings.thresholdMin | percent: '1.2-2' }} + } @else { + {{ data.settings.thresholdMin }} + }
- + @if (data.rule.configuration.threshold.unit === '%') { + + } @else { + + } - + @if (data.rule.configuration.threshold.unit === '%') { + + } @else { + + }
- Threshold Max ({{ - data.settings.thresholdMax?.toFixed(2) - }}) + Threshold Max: + @if (data.rule.configuration.threshold.unit === '%') { + {{ data.settings.thresholdMax | percent: '1.2-2' }} + } @else { + {{ data.settings.thresholdMax }} + }
- + @if (data.rule.configuration.threshold.unit === '%') { + + } @else { + + } - + @if (data.rule.configuration.threshold.unit === '%') { + + } @else { + + }
diff --git a/libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts b/libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts index f69c097fc..0296606b8 100644 --- a/libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts +++ b/libs/common/src/lib/interfaces/portfolio-report-rule.interface.ts @@ -4,6 +4,7 @@ export interface PortfolioReportRule { max: number; min: number; step: number; + unit?: string; }; thresholdMax?: boolean; thresholdMin?: boolean;