diff --git a/CHANGELOG.md b/CHANGELOG.md index cb597c155..1ac273b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the usability of the user account registration - Improved the usability of the _Copy AI prompt to clipboard_ actions on the analysis page (experimental) +- Removed the exchange rates from the overview of the admin control panel - Improved the language localization for German (`de`) - Upgraded `angular` from version `19.0.5` to `19.2.1` - Upgraded `Nx` from version `20.3.2` to `20.5.0` diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 7f2b0da5a..edb96a28e 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -10,7 +10,6 @@ import { PrismaService } from '@ghostfolio/api/services/prisma/prisma.service'; import { PropertyService } from '@ghostfolio/api/services/property/property.service'; import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; import { - DEFAULT_CURRENCY, PROPERTY_CURRENCIES, PROPERTY_IS_READ_ONLY_MODE, PROPERTY_IS_USER_SIGNUP_ENABLED @@ -37,7 +36,6 @@ import { BadRequestException, Injectable, Logger } from '@nestjs/common'; import { AssetClass, AssetSubClass, - DataSource, Prisma, PrismaClient, Property, @@ -132,31 +130,6 @@ export class AdminService { } public async get(): Promise { - const exchangeRates = this.exchangeRateDataService - .getCurrencies() - .filter((currency) => { - return currency !== DEFAULT_CURRENCY; - }) - .map((currency) => { - const label1 = DEFAULT_CURRENCY; - const label2 = currency; - - return { - label1, - label2, - dataSource: - DataSource[ - this.configurationService.get('DATA_SOURCE_EXCHANGE_RATES') - ], - symbol: `${label1}${label2}`, - value: this.exchangeRateDataService.toCurrency( - 1, - DEFAULT_CURRENCY, - currency - ) - }; - }); - const [settings, transactionCount, userCount] = await Promise.all([ this.propertyService.get(), this.prismaService.order.count(), @@ -164,7 +137,6 @@ export class AdminService { ]); return { - exchangeRates, settings, transactionCount, userCount, diff --git a/apps/client/src/app/components/admin-overview/admin-overview.component.ts b/apps/client/src/app/components/admin-overview/admin-overview.component.ts index f54af4174..2f814668a 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.component.ts +++ b/apps/client/src/app/components/admin-overview/admin-overview.component.ts @@ -6,7 +6,6 @@ import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { PROPERTY_COUPONS, - PROPERTY_CURRENCIES, PROPERTY_IS_DATA_GATHERING_ENABLED, PROPERTY_IS_READ_ONLY_MODE, PROPERTY_IS_USER_SIGNUP_ENABLED, @@ -41,8 +40,6 @@ import { takeUntil } from 'rxjs/operators'; export class AdminOverviewComponent implements OnDestroy, OnInit { public couponDuration: StringValue = '14 days'; public coupons: Coupon[]; - public customCurrencies: string[]; - public exchangeRates: { label1: string; label2: string; value: number }[]; public hasPermissionForSubscription: boolean; public hasPermissionForSystemMessage: boolean; public hasPermissionToToggleReadOnlyMode: boolean; @@ -138,19 +135,6 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { }); } - public onDeleteCurrency(aCurrency: string) { - this.notificationService.confirm({ - confirmFn: () => { - const currencies = this.customCurrencies.filter((currency) => { - return currency !== aCurrency; - }); - this.putAdminSetting({ key: PROPERTY_CURRENCIES, value: currencies }); - }, - confirmType: ConfirmationDialogType.Warn, - title: $localize`Do you really want to delete this currency?` - }); - } - public onDeleteSystemMessage() { this.notificationService.confirm({ confirmFn: () => { @@ -231,25 +215,17 @@ export class AdminOverviewComponent implements OnDestroy, OnInit { this.adminService .fetchAdminData() .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe( - ({ exchangeRates, settings, transactionCount, userCount, version }) => { - this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; - this.customCurrencies = settings[PROPERTY_CURRENCIES] as string[]; - this.exchangeRates = exchangeRates; - this.isDataGatheringEnabled = - settings[PROPERTY_IS_DATA_GATHERING_ENABLED] === false - ? false - : true; - this.systemMessage = settings[ - PROPERTY_SYSTEM_MESSAGE - ] as SystemMessage; - this.transactionCount = transactionCount; - this.userCount = userCount; - this.version = version; + .subscribe(({ settings, transactionCount, userCount, version }) => { + this.coupons = (settings[PROPERTY_COUPONS] as Coupon[]) ?? []; + this.isDataGatheringEnabled = + settings[PROPERTY_IS_DATA_GATHERING_ENABLED] === false ? false : true; + this.systemMessage = settings[PROPERTY_SYSTEM_MESSAGE] as SystemMessage; + this.transactionCount = transactionCount; + this.userCount = userCount; + this.version = version; - this.changeDetectorRef.markForCheck(); - } - ); + this.changeDetectorRef.markForCheck(); + }); } private generateCouponCode(aLength: number) { 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 a85c32d43..bcbf666ef 100644 --- a/apps/client/src/app/components/admin-overview/admin-overview.html +++ b/apps/client/src/app/components/admin-overview/admin-overview.html @@ -30,73 +30,6 @@ } -
-
Exchange Rates
-
- - @for (exchangeRate of exchangeRates; track exchangeRate) { - - - - - - - - - } -
- - {{ exchangeRate.label1 }}= - - {{ exchangeRate.label2 }} - - - - - - Edit - - - @if (customCurrencies.includes(exchangeRate.label2)) { -
- - } -
-
-
-
User Signup
diff --git a/libs/common/src/lib/interfaces/admin-data.interface.ts b/libs/common/src/lib/interfaces/admin-data.interface.ts index 3dc476df8..e14429493 100644 --- a/libs/common/src/lib/interfaces/admin-data.interface.ts +++ b/libs/common/src/lib/interfaces/admin-data.interface.ts @@ -1,11 +1,4 @@ -import { AssetProfileIdentifier } from '@ghostfolio/common/interfaces'; - export interface AdminData { - exchangeRates: ({ - label1: string; - label2: string; - value: number; - } & AssetProfileIdentifier)[]; settings: { [key: string]: boolean | object | string | string[] }; transactionCount: number; userCount: number;