Compare commits

...

5 Commits

Author SHA1 Message Date
5356bf568e Release 1.126.0 (#756) 2022-03-14 17:41:23 +01:00
d8da574ae4 Feature/add support for bonds (#755)
* Add support for bonds

* Update changelog
2022-03-14 17:39:09 +01:00
e769fabbae Feature/add multilines to tooltips in proportion chart (#753)
* Introduce multilines for tooltips

* Update changelog
2022-03-13 21:39:06 +01:00
5a369f29d4 Feature/restructure portfolio summary tab (#754)
* Restructure portfolio summary

* Update changelog
2022-03-13 21:01:15 +01:00
122ba9046f Add type (#751)
* Add type

* Refactor import to import type
2022-03-13 21:00:40 +01:00
8 changed files with 43 additions and 21 deletions

View File

@ -5,6 +5,21 @@ 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).
## 1.126.0 - 14.03.2022
### Added
- Added support for bonds
### Changed
- Restructured the portfolio summary tab on the home page
- Improved the tooltips in the portfolio proportion chart component by introducing multilines
### Todo
- Apply data migration (`yarn database:migrate`)
## 1.125.0 - 12.03.2022
### Added

View File

@ -21,6 +21,7 @@ import Big from 'big.js';
import { countries } from 'countries-list';
import { addDays, format, isSameDay } from 'date-fns';
import yahooFinance from 'yahoo-finance2';
import type { Price } from 'yahoo-finance2/dist/esm/src/modules/quoteSummary-iface';
@Injectable()
export class YahooFinanceService implements DataProviderInterface {
@ -303,7 +304,7 @@ export class YahooFinanceService implements DataProviderInterface {
return { items };
}
private parseAssetClass(aPrice: any): {
private parseAssetClass(aPrice: Price): {
assetClass: AssetClass;
assetSubClass: AssetSubClass;
} {

View File

@ -119,7 +119,7 @@
<div class="col"><hr /></div>
</div>
<div class="row px-3 py-1">
<div class="d-flex flex-grow-1" i18n>Value</div>
<div class="d-flex flex-grow-1" i18n>Total</div>
<div class="d-flex flex-column flex-wrap justify-content-end">
<gf-value
class="justify-content-end"
@ -130,6 +130,17 @@
></gf-value>
</div>
</div>
<div class="row px-3 py-1">
<div class="d-flex flex-grow-1" i18n>Valuables</div>
<div class="d-flex justify-content-end">
<gf-value
class="justify-content-end"
[currency]="baseCurrency"
[locale]="locale"
[value]="isLoading ? undefined : summary?.items"
></gf-value>
</div>
</div>
<div class="row px-3 py-1">
<div class="d-flex flex-grow-1" i18n>Emergency Fund</div>
<div
@ -151,7 +162,7 @@
</div>
</div>
<div class="row px-3 py-1">
<div class="d-flex flex-grow-1" i18n>Cash (Buying Power)</div>
<div class="d-flex flex-grow-1" i18n>Buying Power</div>
<div class="d-flex justify-content-end">
<gf-value
class="justify-content-end"
@ -161,17 +172,6 @@
></gf-value>
</div>
</div>
<div class="row px-3 py-1">
<div class="d-flex flex-grow-1" i18n>Items</div>
<div class="d-flex justify-content-end">
<gf-value
class="justify-content-end"
[currency]="baseCurrency"
[locale]="locale"
[value]="isLoading ? undefined : summary?.items"
></gf-value>
</div>
</div>
<div class="row">
<div class="col"><hr /></div>
</div>

View File

@ -324,16 +324,16 @@ export class PortfolioProportionChartComponent
const percentage = (context.parsed * 100) / sum;
if (this.isInPercent) {
return `${name ?? symbol} (${percentage.toFixed(2)}%)`;
return [`${name ?? symbol}`, `${percentage.toFixed(2)}%`];
} else {
const value = <number>context.raw;
return `${name ?? symbol}: ${value.toLocaleString(
this.locale,
{
return [
`${name ?? symbol}`,
`${value.toLocaleString(this.locale, {
maximumFractionDigits: 2,
minimumFractionDigits: 2
}
)} ${this.baseCurrency} (${percentage.toFixed(2)}%)`;
})} ${this.baseCurrency} (${percentage.toFixed(2)}%)`
];
}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "ghostfolio",
"version": "1.125.0",
"version": "1.126.0",
"homepage": "https://ghostfol.io",
"license": "AGPL-3.0",
"scripts": {

View File

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "AssetClass" ADD VALUE 'FIXED_INCOME';

View File

@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "AssetSubClass" ADD VALUE 'BOND';

View File

@ -171,9 +171,11 @@ enum AssetClass {
CASH
COMMODITY
EQUITY
FIXED_INCOME
}
enum AssetSubClass {
BOND
CRYPTOCURRENCY
ETF
MUTUALFUND