From 15be42c7a66fde5c6401a08e7e2c8669cb9607e9 Mon Sep 17 00:00:00 2001 From: Attila Cseh <77381875+csehatt741@users.noreply.github.com> Date: Thu, 10 Jul 2025 08:12:08 +0200 Subject: [PATCH] Feature/reflect global settings in data gathering checkbox of asset profile dialog (#5134) * Reflect global settings in data gathering checkbox of asset profile dialog * Update changelog --- CHANGELOG.md | 1 + .../asset-profile-dialog.component.ts | 16 +++++++++++++++- .../asset-profile-dialog.html | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e687137b..884401532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the asset profile dialog’s data gathering checkbox of the admin control panel to reflect the global settings - Improved the language localization for Catalan (`ca`) - Improved the language localization for Portuguese (`pt`) - Improved the language localization for Spanish (`es`) 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 958679fcd..3dad22488 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 @@ -5,7 +5,10 @@ import { AdminService } from '@ghostfolio/client/services/admin.service'; import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; -import { ghostfolioScraperApiSymbolPrefix } from '@ghostfolio/common/config'; +import { + ghostfolioScraperApiSymbolPrefix, + PROPERTY_IS_DATA_GATHERING_ENABLED +} from '@ghostfolio/common/config'; import { DATE_FORMAT } from '@ghostfolio/common/helper'; import { AdminMarketDataDetails, @@ -133,6 +136,7 @@ export class AssetProfileDialog implements OnDestroy, OnInit { public ghostfolioScraperApiSymbolPrefix = ghostfolioScraperApiSymbolPrefix; public historicalDataItems: LineChartItem[]; public isBenchmark = false; + public isDataGatheringEnabled: boolean; public isEditAssetProfileIdentifierMode = false; public marketDataItems: MarketData[] = []; @@ -196,6 +200,16 @@ export class AssetProfileDialog implements OnDestroy, OnInit { public initialize() { this.historicalDataItems = undefined; + this.adminService + .fetchAdminData() + .pipe(takeUntil(this.unsubscribeSubject)) + .subscribe(({ settings }) => { + this.isDataGatheringEnabled = + settings[PROPERTY_IS_DATA_GATHERING_ENABLED] === false ? false : true; + + this.changeDetectorRef.markForCheck(); + }); + this.userService.stateChanged .pipe(takeUntil(this.unsubscribeSubject)) .subscribe((state) => { diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html index 4c7d39fc0..0657d9fa5 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html @@ -534,8 +534,8 @@