Browse Source

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
pull/5151/head
Attila Cseh 2 weeks ago
committed by GitHub
parent
commit
15be42c7a6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 16
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts
  3. 4
      apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html

1
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`)

16
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) => {

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

@ -534,8 +534,8 @@
<div class="gf-spacer">
<mat-checkbox
color="primary"
[checked]="assetProfile?.isActive ?? false"
[disabled]="isEditAssetProfileIdentifierMode"
[checked]="isDataGatheringEnabled && (assetProfile?.isActive ?? false)"
[disabled]="!isDataGatheringEnabled || isEditAssetProfileIdentifierMode"
(change)="onToggleIsActive($event)"
>
<ng-container i18n>Data Gathering</ng-container>

Loading…
Cancel
Save