Feature/prettify scraper symbol in chart (#448)

* Prettify scraper symbol in chart

* Update changelog
pull/449/head
Thomas Kaul 3 years ago committed by GitHub
parent 9933967e42
commit 54bbc8446b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Prettified the generic scraper symbols in the portfolio proportion chart component
## 1.67.0 - 31.10.2021
### Added

@ -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);
}
}

@ -116,3 +116,7 @@ export const DATE_FORMAT = 'yyyy-MM-dd';
export function parseDate(date: string) {
return parse(date, DATE_FORMAT, new Date());
}
export function prettifySymbol(aSymbol: string): string {
return aSymbol?.replace(ghostfolioScraperApiSymbolPrefix, '');
}

Loading…
Cancel
Save