Bugfix/fix issue with value in value redaction interceptor (#1627)
* Fix issue with value in value redaction interceptor * Fix format of world map * Update changelog
This commit is contained in:
@@ -111,7 +111,7 @@ export class PositionDetailDialog implements OnDestroy, OnInit {
|
||||
|
||||
return {
|
||||
date: historicalDataItem.date,
|
||||
value: historicalDataItem.value
|
||||
value: historicalDataItem.marketPrice
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@@ -21,6 +21,7 @@ import { hasPermission, permissions } from '@ghostfolio/common/permissions';
|
||||
import { Market } from '@ghostfolio/common/types';
|
||||
import { translate } from '@ghostfolio/ui/i18n';
|
||||
import { Account, AssetClass, DataSource } from '@prisma/client';
|
||||
import { isNumber } from 'lodash';
|
||||
import { DeviceDetectorService } from 'ngx-device-detector';
|
||||
import { Subject } from 'rxjs';
|
||||
import { distinctUntilChanged, switchMap, takeUntil } from 'rxjs/operators';
|
||||
@@ -339,7 +340,9 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
||||
dataSource: position.dataSource,
|
||||
name: position.name,
|
||||
symbol: prettifySymbol(symbol),
|
||||
value: position.value
|
||||
value: isNumber(position.value)
|
||||
? position.value
|
||||
: position.valueInPercentage
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { DateRange, GroupBy, ToggleOption } from '@ghostfolio/common/types';
|
||||
import { translate } from '@ghostfolio/ui/i18n';
|
||||
import { AssetClass, DataSource, SymbolProfile } from '@prisma/client';
|
||||
import { differenceInDays } from 'date-fns';
|
||||
import { sortBy } from 'lodash';
|
||||
import { isNumber, sortBy } from 'lodash';
|
||||
import { DeviceDetectorService } from 'ngx-device-detector';
|
||||
import { Subject } from 'rxjs';
|
||||
import { distinctUntilChanged, map, takeUntil } from 'rxjs/operators';
|
||||
@@ -312,12 +312,13 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
|
||||
date,
|
||||
netPerformanceInPercentage,
|
||||
totalInvestment,
|
||||
value
|
||||
value,
|
||||
valueInPercentage
|
||||
} of chart) {
|
||||
this.investments.push({ date, investment: totalInvestment });
|
||||
this.performanceDataItems.push({
|
||||
date,
|
||||
value
|
||||
value: isNumber(value) ? value : valueInPercentage
|
||||
});
|
||||
this.performanceDataItemsInPercentage.push({
|
||||
date,
|
||||
|
@@ -9,6 +9,7 @@ import {
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
import { Market } from '@ghostfolio/common/types';
|
||||
import { StatusCodes } from 'http-status-codes';
|
||||
import { isNumber } from 'lodash';
|
||||
import { DeviceDetectorService } from 'ngx-device-detector';
|
||||
import { EMPTY, Subject } from 'rxjs';
|
||||
import { catchError, takeUntil } from 'rxjs/operators';
|
||||
@@ -198,7 +199,9 @@ export class PublicPageComponent implements OnInit {
|
||||
this.symbols[prettifySymbol(symbol)] = {
|
||||
name: position.name,
|
||||
symbol: prettifySymbol(symbol),
|
||||
value: position.value
|
||||
value: isNumber(position.value)
|
||||
? position.value
|
||||
: position.valueInPercentage
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -77,6 +77,7 @@
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<gf-world-map-chart
|
||||
format="{0}%"
|
||||
[countries]="countries"
|
||||
[isInPercent]="true"
|
||||
></gf-world-map-chart>
|
||||
|
@@ -41,7 +41,7 @@ import { AccountWithValue, DateRange, GroupBy } from '@ghostfolio/common/types';
|
||||
import { translate } from '@ghostfolio/ui/i18n';
|
||||
import { DataSource, Order as OrderModel } from '@prisma/client';
|
||||
import { format, parseISO } from 'date-fns';
|
||||
import { cloneDeep, groupBy } from 'lodash';
|
||||
import { cloneDeep, groupBy, isNumber } from 'lodash';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@@ -299,6 +299,12 @@ export class DataService {
|
||||
].dateOfFirstActivity
|
||||
? parseISO(response.holdings[symbol].dateOfFirstActivity)
|
||||
: undefined;
|
||||
|
||||
response.holdings[symbol].value = isNumber(
|
||||
response.holdings[symbol].value
|
||||
)
|
||||
? response.holdings[symbol].value
|
||||
: response.holdings[symbol].valueInPercentage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,9 +339,23 @@ export class DataService {
|
||||
}
|
||||
|
||||
public fetchPortfolioPublic(aId: string) {
|
||||
return this.http.get<PortfolioPublicDetails>(
|
||||
`/api/v1/portfolio/public/${aId}`
|
||||
);
|
||||
return this.http
|
||||
.get<PortfolioPublicDetails>(`/api/v1/portfolio/public/${aId}`)
|
||||
.pipe(
|
||||
map((response) => {
|
||||
if (response.holdings) {
|
||||
for (const symbol of Object.keys(response.holdings)) {
|
||||
response.holdings[symbol].value = isNumber(
|
||||
response.holdings[symbol].value
|
||||
)
|
||||
? response.holdings[symbol].value
|
||||
: response.holdings[symbol].valueInPercentage;
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public fetchPortfolioReport() {
|
||||
|
Reference in New Issue
Block a user