Bugfix/fix dynamic decimal places for cryptocurrencies in position detail dialog (#1464)
* Fix dynamic decimal places * Update changelog
This commit is contained in:
parent
b0d708fb82
commit
0d338bb083
@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed the activities sorting in the position detail dialog
|
- Fixed the activities sorting in the position detail dialog
|
||||||
|
- Fixed the dynamic number of decimal places for cryptocurrencies in the position detail dialog
|
||||||
- Fixed a division by zero error in the cash positions calculation
|
- Fixed a division by zero error in the cash positions calculation
|
||||||
|
|
||||||
## 1.213.0 - 14.11.2022
|
## 1.213.0 - 14.11.2022
|
||||||
|
@ -14,6 +14,7 @@ import {
|
|||||||
LineChartItem
|
LineChartItem
|
||||||
} from '@ghostfolio/common/interfaces';
|
} from '@ghostfolio/common/interfaces';
|
||||||
import { OrderWithAccount } from '@ghostfolio/common/types';
|
import { OrderWithAccount } from '@ghostfolio/common/types';
|
||||||
|
import { translate } from '@ghostfolio/ui/i18n';
|
||||||
import { Tag } from '@prisma/client';
|
import { Tag } from '@prisma/client';
|
||||||
import { format, isSameMonth, isToday, parseISO } from 'date-fns';
|
import { format, isSameMonth, isToday, parseISO } from 'date-fns';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
@ -29,6 +30,8 @@ import { PositionDetailDialogParams } from './interfaces/interfaces';
|
|||||||
styleUrls: ['./position-detail-dialog.component.scss']
|
styleUrls: ['./position-detail-dialog.component.scss']
|
||||||
})
|
})
|
||||||
export class PositionDetailDialog implements OnDestroy, OnInit {
|
export class PositionDetailDialog implements OnDestroy, OnInit {
|
||||||
|
public assetClass: string;
|
||||||
|
public assetSubClass: string;
|
||||||
public averagePrice: number;
|
public averagePrice: number;
|
||||||
public benchmarkDataItems: LineChartItem[];
|
public benchmarkDataItems: LineChartItem[];
|
||||||
public countries: {
|
public countries: {
|
||||||
@ -126,6 +129,14 @@ export class PositionDetailDialog implements OnDestroy, OnInit {
|
|||||||
this.transactionCount = transactionCount;
|
this.transactionCount = transactionCount;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
|
||||||
|
if (SymbolProfile?.assetClass) {
|
||||||
|
this.assetClass = translate(SymbolProfile?.assetClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SymbolProfile?.assetSubClass) {
|
||||||
|
this.assetSubClass = translate(SymbolProfile?.assetSubClass);
|
||||||
|
}
|
||||||
|
|
||||||
if (SymbolProfile?.countries?.length > 0) {
|
if (SymbolProfile?.countries?.length > 0) {
|
||||||
for (const country of SymbolProfile.countries) {
|
for (const country of SymbolProfile.countries) {
|
||||||
this.countries[country.code] = {
|
this.countries[country.code] = {
|
||||||
|
@ -139,11 +139,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 mb-3">
|
<div class="col-6 mb-3">
|
||||||
<gf-value
|
<gf-value i18n size="medium" [hidden]="!assetClass" [value]="assetClass"
|
||||||
i18n
|
|
||||||
size="medium"
|
|
||||||
[hidden]="!SymbolProfile?.assetClass"
|
|
||||||
[value]="SymbolProfile?.assetClass"
|
|
||||||
>Asset Class</gf-value
|
>Asset Class</gf-value
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@ -151,8 +147,8 @@
|
|||||||
<gf-value
|
<gf-value
|
||||||
i18n
|
i18n
|
||||||
size="medium"
|
size="medium"
|
||||||
[hidden]="!SymbolProfile?.assetSubClass"
|
[hidden]="!assetSubClass"
|
||||||
[value]="SymbolProfile?.assetSubClass"
|
[value]="assetSubClass"
|
||||||
>Asset Sub Class</gf-value
|
>Asset Sub Class</gf-value
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
@ -304,20 +304,6 @@ export class DataService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.SymbolProfile) {
|
|
||||||
if (data.SymbolProfile.assetClass) {
|
|
||||||
data.SymbolProfile.assetClass = <AssetClass>(
|
|
||||||
translate(data.SymbolProfile.assetClass)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.SymbolProfile.assetSubClass) {
|
|
||||||
data.SymbolProfile.assetSubClass = <AssetSubClass>(
|
|
||||||
translate(data.SymbolProfile.assetSubClass)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user