Browse Source

Merge branch 'main' into feature/parallelize-asset-profile-requests-in-get-quotes-functionality-of-financial-modeling-prep-service

pull/4569/head
Thomas Kaul 4 months ago
committed by GitHub
parent
commit
e26281605f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 18
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html
  3. 4
      libs/common/src/lib/permissions.ts
  4. 18
      libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts
  5. 11
      libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.html
  6. 2
      libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html

2
CHANGELOG.md

@ -9,10 +9,12 @@ 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
### Changed ### Changed
- Made the historical market data editor expandable in the admin control panel
- Parallelized the requests in the get quotes functionality of the _Financial Modeling Prep_ service - Parallelized the requests in the get quotes functionality of the _Financial Modeling Prep_ service
### Fixed ### Fixed

18
apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html

@ -77,6 +77,15 @@
[showYAxis]="true" [showYAxis]="true"
[symbol]="data.symbol" [symbol]="data.symbol"
/> />
<div class="mb-3">
<mat-accordion class="my-3">
<mat-expansion-panel class="shadow-none">
<mat-expansion-panel-header class="p-0 pr-3">
<mat-panel-title class="font-weight-bold" i18n
>Historical Market Data</mat-panel-title
>
</mat-expansion-panel-header>
<gf-historical-market-data-editor <gf-historical-market-data-editor
class="mb-3" class="mb-3"
[currency]="assetProfile?.currency" [currency]="assetProfile?.currency"
@ -88,6 +97,9 @@
[user]="user" [user]="user"
(marketDataChanged)="onMarketDataChanged($event)" (marketDataChanged)="onMarketDataChanged($event)"
/> />
</mat-expansion-panel>
</mat-accordion>
</div>
<div class="row"> <div class="row">
@if (isEditAssetProfileIdentifierMode) { @if (isEditAssetProfileIdentifierMode) {
@ -360,8 +372,10 @@
(closed)="scraperConfiguationIsExpanded.set(false)" (closed)="scraperConfiguationIsExpanded.set(false)"
(opened)="scraperConfiguationIsExpanded.set(true)" (opened)="scraperConfiguationIsExpanded.set(true)"
> >
<mat-expansion-panel-header class="p-0"> <mat-expansion-panel-header class="p-0 pr-3">
<mat-panel-title i18n>Scraper Configuration</mat-panel-title> <mat-panel-title class="font-weight-bold" i18n
>Scraper Configuration</mat-panel-title
>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div formGroupName="scraperConfiguration"> <div formGroupName="scraperConfiguration">
<div class="mt-3"> <div class="mt-3">

4
libs/common/src/lib/permissions.ts

@ -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',

18
libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.component.ts

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

11
libs/ui/src/lib/benchmark/benchmark-detail-dialog/benchmark-detail-dialog.html

@ -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"

2
libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html

@ -1,7 +1,7 @@
<div> <div>
@for (itemByMonth of marketDataByMonth | keyvalue; track itemByMonth) { @for (itemByMonth of marketDataByMonth | keyvalue; track itemByMonth) {
<div class="d-flex"> <div class="d-flex">
<div class="date px-1 text-nowrap">{{ itemByMonth.key }}</div> <div class="date mr-1 text-nowrap">{{ itemByMonth.key }}</div>
<div class="align-items-center d-flex flex-grow-1 px-1"> <div class="align-items-center d-flex flex-grow-1 px-1">
@for (dayItem of days; track dayItem; let i = $index) { @for (dayItem of days; track dayItem; let i = $index) {
<div <div

Loading…
Cancel
Save