Feature/prettify scraper symbol in chart (#448)
* Prettify scraper symbol in chart * Update changelog
This commit is contained in:
@@ -4,6 +4,7 @@ import { DataService } from '@ghostfolio/client/services/data.service';
|
||||
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
|
||||
import { UserService } from '@ghostfolio/client/services/user/user.service';
|
||||
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
|
||||
import { prettifySymbol } from '@ghostfolio/common/helper';
|
||||
import {
|
||||
PortfolioDetails,
|
||||
PortfolioPosition,
|
||||
@@ -246,9 +247,9 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
if (position.assetClass === AssetClass.EQUITY) {
|
||||
this.symbols[symbol] = {
|
||||
symbol,
|
||||
this.symbols[prettifySymbol(symbol)] = {
|
||||
name: position.name,
|
||||
symbol: prettifySymbol(symbol),
|
||||
value: aPeriod === 'original' ? position.investment : position.value
|
||||
};
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DataService } from '@ghostfolio/client/services/data.service';
|
||||
import { UNKNOWN_KEY } from '@ghostfolio/common/config';
|
||||
import { prettifySymbol } from '@ghostfolio/common/helper';
|
||||
import {
|
||||
PortfolioPosition,
|
||||
PortfolioPublicDetails
|
||||
@@ -169,9 +170,9 @@ export class PublicPageComponent implements OnInit {
|
||||
this.portfolioPublicDetails.holdings[symbol].value;
|
||||
}
|
||||
|
||||
this.symbols[symbol] = {
|
||||
symbol,
|
||||
this.symbols[prettifySymbol(symbol)] = {
|
||||
name: position.name,
|
||||
symbol: prettifySymbol(symbol),
|
||||
value: position.value
|
||||
};
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { ghostfolioScraperApiSymbolPrefix } from '@ghostfolio/common/config';
|
||||
import { prettifySymbol } from '@ghostfolio/common/helper';
|
||||
|
||||
@Pipe({ name: 'gfSymbol' })
|
||||
export class SymbolPipe implements PipeTransform {
|
||||
public constructor() {}
|
||||
|
||||
public transform(aSymbol: string): string {
|
||||
return aSymbol?.replace(ghostfolioScraperApiSymbolPrefix, '');
|
||||
public transform(aSymbol: string) {
|
||||
return prettifySymbol(aSymbol);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user