diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c86cf4a..514f89393 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ 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). +## 2.91.0 - 2024-06-26 + +### Added + +- Added a benchmarks preset to the historical market data table of the admin control panel + +### Changed + +- Upgraded `angular` from version `18.0.2` to `18.0.4` + +### Fixed + +- Fixed the dialog position (center) on mobile +- Fixed the horizontal overflow in the historical market data table of the admin control panel +- Changed the mechanism of the `INTRADAY` data gathering to persist data only if the market state is `OPEN` +- Fixed the creation of activities with `MANUAL` data source (with no historical market data) + ## 2.90.0 - 2024-06-22 ### Added diff --git a/apps/api/src/app/admin/admin.module.ts b/apps/api/src/app/admin/admin.module.ts index de9aecf3b..f8cf8e8ac 100644 --- a/apps/api/src/app/admin/admin.module.ts +++ b/apps/api/src/app/admin/admin.module.ts @@ -1,3 +1,4 @@ +import { BenchmarkModule } from '@ghostfolio/api/app/benchmark/benchmark.module'; import { OrderModule } from '@ghostfolio/api/app/order/order.module'; import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module'; import { TransformDataSourceInRequestModule } from '@ghostfolio/api/interceptors/transform-data-source-in-request/transform-data-source-in-request.module'; @@ -20,6 +21,7 @@ import { QueueModule } from './queue/queue.module'; @Module({ imports: [ ApiModule, + BenchmarkModule, ConfigurationModule, DataGatheringModule, DataProviderModule, diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 21f0253ee..3d81435ab 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -1,3 +1,4 @@ +import { BenchmarkService } from '@ghostfolio/api/app/benchmark/benchmark.service'; import { OrderService } from '@ghostfolio/api/app/order/order.service'; import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service'; import { environment } from '@ghostfolio/api/environments/environment'; @@ -41,6 +42,7 @@ import { groupBy } from 'lodash'; @Injectable() export class AdminService { public constructor( + private readonly benchmarkService: BenchmarkService, private readonly configurationService: ConfigurationService, private readonly dataProviderService: DataProviderService, private readonly exchangeRateDataService: ExchangeRateDataService, @@ -151,7 +153,16 @@ export class AdminService { [{ symbol: 'asc' }]; const where: Prisma.SymbolProfileWhereInput = {}; - if (presetId === 'CURRENCIES') { + if (presetId === 'BENCHMARKS') { + const benchmarkAssetProfiles = + await this.benchmarkService.getBenchmarkAssetProfiles(); + + where.id = { + in: benchmarkAssetProfiles.map(({ id }) => { + return id; + }) + }; + } else if (presetId === 'CURRENCIES') { return this.getMarketDataForCurrencies(); } else if ( presetId === 'ETF_WITHOUT_COUNTRIES' || diff --git a/apps/api/src/app/info/info.module.ts b/apps/api/src/app/info/info.module.ts index ba58bc36f..473a966ad 100644 --- a/apps/api/src/app/info/info.module.ts +++ b/apps/api/src/app/info/info.module.ts @@ -7,7 +7,6 @@ import { ConfigurationModule } from '@ghostfolio/api/services/configuration/conf import { DataGatheringModule } from '@ghostfolio/api/services/data-gathering/data-gathering.module'; import { DataProviderModule } from '@ghostfolio/api/services/data-provider/data-provider.module'; import { ExchangeRateDataModule } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.module'; -import { PrismaModule } from '@ghostfolio/api/services/prisma/prisma.module'; import { PropertyModule } from '@ghostfolio/api/services/property/property.module'; import { SymbolProfileModule } from '@ghostfolio/api/services/symbol-profile/symbol-profile.module'; import { TagModule } from '@ghostfolio/api/services/tag/tag.module'; diff --git a/apps/api/src/services/data-provider/data-provider.service.ts b/apps/api/src/services/data-provider/data-provider.service.ts index 34067fa6f..9a468f10e 100644 --- a/apps/api/src/services/data-provider/data-provider.service.ts +++ b/apps/api/src/services/data-provider/data-provider.service.ts @@ -516,7 +516,8 @@ export class DataProviderService { .filter((symbol) => { return ( isNumber(response[symbol].marketPrice) && - response[symbol].marketPrice > 0 + response[symbol].marketPrice > 0 && + response[symbol].marketState === 'open' ); }) .map((symbol) => { diff --git a/apps/api/src/services/data-provider/manual/manual.service.ts b/apps/api/src/services/data-provider/manual/manual.service.ts index 5066a4d3a..d2e5bca85 100644 --- a/apps/api/src/services/data-provider/manual/manual.service.ts +++ b/apps/api/src/services/data-provider/manual/manual.service.ts @@ -167,9 +167,10 @@ export class ManualService implements DataProviderInterface { }); for (const { currency, symbol } of symbolProfiles) { - let marketPrice = marketData.find((marketDataItem) => { - return marketDataItem.symbol === symbol; - })?.marketPrice; + let marketPrice = + marketData.find((marketDataItem) => { + return marketDataItem.symbol === symbol; + })?.marketPrice ?? 0; response[symbol] = { currency, diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts index 61f11c9bd..6051c94dc 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts @@ -68,6 +68,11 @@ export class AdminMarketDataComponent }; }) .concat([ + { + id: 'BENCHMARKS', + label: $localize`Benchmarks`, + type: 'PRESET_ID' + }, { id: 'CURRENCIES', label: $localize`Currencies`, diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.html b/apps/client/src/app/components/admin-market-data/admin-market-data.html index e3a16dd62..0606b136a 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.html +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.html @@ -11,208 +11,210 @@
- - - - - +
+
- Symbol - - {{ element.symbol }} -
+ + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + - + + + + + Edit + + + + + + - - -
+ Symbol + + {{ element.symbol }} + - Name - -
{{ element.name }}
- @if (!isUUID(element.symbol)) { -
- {{ - element.symbol | gfSymbol - }} -
- } -
+ Name + +
{{ element.name }}
+ @if (!isUUID(element.symbol)) { +
+ {{ + element.symbol | gfSymbol + }} +
+ } +
- Data Source - - {{ element.dataSource }} - + Data Source + + {{ element.dataSource }} + - Asset Class - - {{ element.assetClass }} - + Asset Class + + {{ element.assetClass }} + - Asset Sub Class - - {{ element.assetSubClass }} - + Asset Sub Class + + {{ element.assetSubClass }} + - First Activity - - {{ (element.date | date: defaultDateFormat) ?? '' }} - + First Activity + + {{ (element.date | date: defaultDateFormat) ?? '' }} + - Activities Count - - {{ element.activitiesCount }} - + Activities Count + + {{ element.activitiesCount }} + - Historical Data - - {{ element.marketDataItemCount }} - + Historical Data + + {{ element.marketDataItemCount }} + - Sectors Count - - {{ element.sectorsCount }} - + Sectors Count + + {{ element.sectorsCount }} + - Countries Count - - {{ element.countriesCount }} - + Countries Count + + {{ element.countriesCount }} + - @if (element.comment) { - - } - + @if (element.comment) { + + } + - - - - - - - - - - + + + + + + + + - -
+ + + +