From 146b5201b53a38a32d4af97be3847c579d6b524b Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Tue, 1 Jun 2021 21:40:32 +0200 Subject: [PATCH] Feature/make x ray rules order consistent (#134) * Make order of X-ray rules consistent * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/portfolio/portfolio.controller.ts | 14 +------------- apps/api/src/models/portfolio.ts | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a83d1fff4..092a21d26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed the sorting in various tables +- Made the order of the rules in the _X-ray_ section consistent ## 1.8.0 - 24.05.2021 diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 8c957fe70..462a12404 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -315,18 +315,6 @@ export class PortfolioController { impersonationUserId || this.request.user.id ); - let report = await portfolio.getReport(); - - if ( - impersonationId && - !hasPermission( - getPermissions(this.request.user.role), - permissions.readForeignPortfolio - ) - ) { - // TODO: Filter out absolute numbers - } - - return report; + return await portfolio.getReport(); } } diff --git a/apps/api/src/models/portfolio.ts b/apps/api/src/models/portfolio.ts index 4bea0ac2a..1176fa945 100644 --- a/apps/api/src/models/portfolio.ts +++ b/apps/api/src/models/portfolio.ts @@ -402,10 +402,10 @@ export class Portfolio implements PortfolioInterface { accountClusterRisk: await this.rulesService.evaluate( this, [ - new AccountClusterRiskCurrentInvestment( + new AccountClusterRiskInitialInvestment( this.exchangeRateDataService ), - new AccountClusterRiskInitialInvestment( + new AccountClusterRiskCurrentInvestment( this.exchangeRateDataService ), new AccountClusterRiskSingleAccount(this.exchangeRateDataService)