Bugfix/fix holdings for basic users (#1064)
* Fix holdings for basic users * Update changelog
This commit is contained in:
parent
8897f32bc5
commit
30835ced88
@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Improved the _Create Account_ link in the _Live Demo_
|
- Improved the _Create Account_ link in the _Live Demo_
|
||||||
- Upgraded `ngx-markdown` from version `13.0.0` to `14.0.1`
|
- Upgraded `ngx-markdown` from version `13.0.0` to `14.0.1`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue in the _Holdings_ section for users without a subscription
|
||||||
|
|
||||||
## 1.166.0 - 30.06.2022
|
## 1.166.0 - 30.06.2022
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -190,14 +190,27 @@ export class PortfolioController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isBasicUser =
|
let hasDetails = true;
|
||||||
this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') &&
|
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) {
|
||||||
this.request.user.subscription.type === 'Basic';
|
hasDetails = this.request.user.subscription.type === 'Premium';
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [symbol, portfolioPosition] of Object.entries(holdings)) {
|
||||||
|
holdings[symbol] = {
|
||||||
|
...portfolioPosition,
|
||||||
|
assetClass: hasDetails ? portfolioPosition.assetClass : undefined,
|
||||||
|
assetSubClass: hasDetails ? portfolioPosition.assetSubClass : undefined,
|
||||||
|
countries: hasDetails ? portfolioPosition.countries : [],
|
||||||
|
currency: hasDetails ? portfolioPosition.currency : undefined,
|
||||||
|
markets: hasDetails ? portfolioPosition.markets : undefined,
|
||||||
|
sectors: hasDetails ? portfolioPosition.sectors : []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accounts,
|
accounts,
|
||||||
hasError,
|
hasError,
|
||||||
holdings: isBasicUser ? {} : holdings
|
holdings
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,8 +353,8 @@ export class PortfolioController {
|
|||||||
portfolioPublicDetails.holdings[symbol] = {
|
portfolioPublicDetails.holdings[symbol] = {
|
||||||
allocationCurrent: portfolioPosition.value / totalValue,
|
allocationCurrent: portfolioPosition.value / totalValue,
|
||||||
countries: hasDetails ? portfolioPosition.countries : [],
|
countries: hasDetails ? portfolioPosition.countries : [],
|
||||||
currency: portfolioPosition.currency,
|
currency: hasDetails ? portfolioPosition.currency : undefined,
|
||||||
markets: portfolioPosition.markets,
|
markets: hasDetails ? portfolioPosition.markets : undefined,
|
||||||
name: portfolioPosition.name,
|
name: portfolioPosition.name,
|
||||||
netPerformancePercent: portfolioPosition.netPerformancePercent,
|
netPerformancePercent: portfolioPosition.netPerformancePercent,
|
||||||
sectors: hasDetails ? portfolioPosition.sectors : [],
|
sectors: hasDetails ? portfolioPosition.sectors : [],
|
||||||
|
@ -94,13 +94,9 @@
|
|||||||
<div class="col-md-12 allocations-by-symbol">
|
<div class="col-md-12 allocations-by-symbol">
|
||||||
<mat-card class="mb-3">
|
<mat-card class="mb-3">
|
||||||
<mat-card-header class="overflow-hidden w-100">
|
<mat-card-header class="overflow-hidden w-100">
|
||||||
<mat-card-title class="align-items-center d-flex text-truncate"
|
<mat-card-title class="align-items-center d-flex text-truncate" i18n>
|
||||||
><span i18n>By Position</span
|
By Holding</mat-card-title
|
||||||
><gf-premium-indicator
|
>
|
||||||
*ngIf="user?.subscription?.type === 'Basic'"
|
|
||||||
class="ml-1"
|
|
||||||
></gf-premium-indicator
|
|
||||||
></mat-card-title>
|
|
||||||
<gf-toggle
|
<gf-toggle
|
||||||
[defaultValue]="period"
|
[defaultValue]="period"
|
||||||
[isLoading]="false"
|
[isLoading]="false"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<div class="col-md-12 allocations-by-symbol">
|
<div class="col-md-12 allocations-by-symbol">
|
||||||
<mat-card class="mb-3">
|
<mat-card class="mb-3">
|
||||||
<mat-card-header class="overflow-hidden w-100">
|
<mat-card-header class="overflow-hidden w-100">
|
||||||
<mat-card-title class="text-truncate" i18n>Positions</mat-card-title>
|
<mat-card-title class="text-truncate" i18n>Holdings</mat-card-title>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<gf-portfolio-proportion-chart
|
<gf-portfolio-proportion-chart
|
||||||
|
@ -205,7 +205,7 @@ export class PortfolioProportionChartComponent
|
|||||||
chartDataSorted.forEach(([, item]) => {
|
chartDataSorted.forEach(([, item]) => {
|
||||||
let lightnessRatio = 0.2;
|
let lightnessRatio = 0.2;
|
||||||
|
|
||||||
Object.keys(item.subCategory).forEach((subCategory) => {
|
Object.keys(item.subCategory ?? {}).forEach((subCategory) => {
|
||||||
backgroundColorSubCategory.push(
|
backgroundColorSubCategory.push(
|
||||||
Color(item.color).lighten(lightnessRatio).hex()
|
Color(item.color).lighten(lightnessRatio).hex()
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user