Browse Source

resolve comments

pull/7996/head
KenTandrian 2 weeks ago
parent
commit
c83ad2c02f
  1. 14
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
  2. 3
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

14
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -365,11 +365,15 @@ export class GfAccountDetailDialogComponent implements OnInit {
portfolioPerformance.chart.length > 0 portfolioPerformance.chart.length > 0
) { ) {
this.historicalDataItems = portfolioPerformance.chart this.historicalDataItems = portfolioPerformance.chart
.map(({ date, netWorth, netWorthInPercentage }) => ({ .map(({ date, netWorth, netWorthInPercentage }) => {
date, return {
value: isNumber(netWorth) ? netWorth : netWorthInPercentage date,
})) value: isNumber(netWorth) ? netWorth : netWorthInPercentage
.filter((item): item is LineChartItem => isNumber(item.value)); };
})
.filter((item): item is LineChartItem => {
return isNumber(item.value);
});
} else { } else {
this.historicalDataItems = this.accountBalances.map( this.historicalDataItems = this.accountBalances.map(
({ date, valueInBaseCurrency }) => { ({ date, valueInBaseCurrency }) => {

3
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -7,7 +7,6 @@ import {
} from '@ghostfolio/common/config'; } from '@ghostfolio/common/config';
import { canOpenHoldingDetail } from '@ghostfolio/common/helper'; import { canOpenHoldingDetail } from '@ghostfolio/common/helper';
import { import {
HistoricalDataItem,
InvestmentItem, InvestmentItem,
LineChartItem, LineChartItem,
PortfolioInvestmentsResponse, PortfolioInvestmentsResponse,
@ -80,7 +79,7 @@ import { forkJoin } from 'rxjs';
}) })
export class GfAnalysisPageComponent implements OnInit { export class GfAnalysisPageComponent implements OnInit {
protected benchmark?: Partial<SymbolProfile>; protected benchmark?: Partial<SymbolProfile>;
protected benchmarkDataItems: HistoricalDataItem[] = []; protected benchmarkDataItems: LineChartItem[] = [];
protected readonly benchmarks: Partial<SymbolProfile>[]; protected readonly benchmarks: Partial<SymbolProfile>[];
protected bottom3: PortfolioPosition[]; protected bottom3: PortfolioPosition[];
protected dividendsByGroup: InvestmentItem[]; protected dividendsByGroup: InvestmentItem[];

Loading…
Cancel
Save