diff --git a/CHANGELOG.md b/CHANGELOG.md index d77b922ea..ae48c564d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added a button to edit the exchange rates in the admin control panel + ### Changed - Improved the language localization for German (`de`) diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index a42723ba3..b46a0a13a 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -23,7 +23,13 @@ import { } from '@ghostfolio/common/interfaces'; import { MarketDataPreset } from '@ghostfolio/common/types'; import { BadRequestException, Injectable } from '@nestjs/common'; -import { AssetSubClass, Prisma, Property, SymbolProfile } from '@prisma/client'; +import { + AssetSubClass, + DataSource, + Prisma, + Property, + SymbolProfile +} from '@prisma/client'; import { differenceInDays } from 'date-fns'; import { groupBy } from 'lodash'; @@ -94,9 +100,17 @@ export class AdminService { return currency !== DEFAULT_CURRENCY; }) .map((currency) => { + const label1 = DEFAULT_CURRENCY; + const label2 = currency; + return { - label1: DEFAULT_CURRENCY, - label2: currency, + label1, + label2, + dataSource: + DataSource[ + this.configurationService.get('DATA_SOURCE_EXCHANGE_RATES') + ], + symbol: `${label1}${label2}`, value: this.exchangeRateDataService.toCurrency( 1, DEFAULT_CURRENCY, diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index 5e331ca91..5ccfda503 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -128,10 +128,10 @@ export class AssetProfileDialog implements OnDestroy, OnInit { } this.assetProfileForm.setValue({ - name: this.assetProfile.name, - assetClass: this.assetProfile.assetClass, - assetSubClass: this.assetProfile.assetSubClass, + assetClass: this.assetProfile.assetClass ?? null, + assetSubClass: this.assetProfile.assetSubClass ?? null, comment: this.assetProfile?.comment ?? '', + name: this.assetProfile.name ?? this.assetProfile.symbol, scraperConfiguration: JSON.stringify( this.assetProfile?.scraperConfiguration ?? {} ), diff --git a/apps/client/src/app/components/admin-overview/admin-overview.html b/apps/client/src/app/components/admin-overview/admin-overview.html index 40ae7a150..e82f787f9 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -55,6 +55,18 @@ {{ exchangeRate.label2 }} + + +