Merge branch 'main' of github.com:ghostfolio/ghostfolio
All checks were successful
Docker image CD / build_and_push (push) Successful in 21m16s

This commit is contained in:
sudacode 2025-04-20 00:00:43 -07:00
commit b287257a29
4 changed files with 29 additions and 5 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Extended the benchmark detail dialog by the current market price
- Added `watchlist` to the `User` database schema as a preparation for watching assets - Added `watchlist` to the `User` database schema as a preparation for watching assets
### Fixed ### Fixed

View File

@ -18,8 +18,8 @@ export const permissions = {
createTag: 'createTag', createTag: 'createTag',
createUserAccount: 'createUserAccount', createUserAccount: 'createUserAccount',
deleteAccess: 'deleteAccess', deleteAccess: 'deleteAccess',
deleteAccount: 'deleteAcccount', deleteAccount: 'deleteAccount',
deleteAccountBalance: 'deleteAcccountBalance', deleteAccountBalance: 'deleteAccountBalance',
deleteAuthDevice: 'deleteAuthDevice', deleteAuthDevice: 'deleteAuthDevice',
deleteOrder: 'deleteOrder', deleteOrder: 'deleteOrder',
deleteOwnUser: 'deleteOwnUser', deleteOwnUser: 'deleteOwnUser',

View File

@ -7,6 +7,7 @@ import {
LineChartItem LineChartItem
} from '@ghostfolio/common/interfaces'; } from '@ghostfolio/common/interfaces';
import { GfLineChartComponent } from '@ghostfolio/ui/line-chart'; import { GfLineChartComponent } from '@ghostfolio/ui/line-chart';
import { GfValueComponent } from '@ghostfolio/ui/value';
import { import {
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
@ -35,6 +36,7 @@ import { BenchmarkDetailDialogParams } from './interfaces/interfaces';
GfDialogFooterModule, GfDialogFooterModule,
GfDialogHeaderModule, GfDialogHeaderModule,
GfLineChartComponent, GfLineChartComponent,
GfValueComponent,
MatDialogModule MatDialogModule
], ],
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
@ -45,6 +47,7 @@ import { BenchmarkDetailDialogParams } from './interfaces/interfaces';
export class GfBenchmarkDetailDialogComponent implements OnDestroy, OnInit { export class GfBenchmarkDetailDialogComponent implements OnDestroy, OnInit {
public assetProfile: AdminMarketDataDetails['assetProfile']; public assetProfile: AdminMarketDataDetails['assetProfile'];
public historicalDataItems: LineChartItem[]; public historicalDataItems: LineChartItem[];
public value: number;
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
@ -65,9 +68,18 @@ export class GfBenchmarkDetailDialogComponent implements OnDestroy, OnInit {
.subscribe(({ assetProfile, marketData }) => { .subscribe(({ assetProfile, marketData }) => {
this.assetProfile = assetProfile; this.assetProfile = assetProfile;
this.historicalDataItems = marketData.map(({ date, marketPrice }) => { this.historicalDataItems = marketData.map(
return { date: format(date, DATE_FORMAT), value: marketPrice }; ({ date, marketPrice }, index) => {
}); if (marketData.length - 1 === index) {
this.value = marketPrice;
}
return {
date: format(date, DATE_FORMAT),
value: marketPrice
};
}
);
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
}); });

View File

@ -8,6 +8,17 @@
<div class="flex-grow-1" mat-dialog-content> <div class="flex-grow-1" mat-dialog-content>
<div class="container p-0"> <div class="container p-0">
<div class="row">
<div class="col-12 d-flex justify-content-center mb-3">
<gf-value
size="large"
[locale]="data.locale"
[precision]="2"
[value]="value"
/>
</div>
</div>
<gf-line-chart <gf-line-chart
benchmarkLabel="Average Unit Price" benchmarkLabel="Average Unit Price"
class="mb-4" class="mb-4"