diff --git a/CHANGELOG.md b/CHANGELOG.md index 297677b966..256c545a87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Changed the default date range of users without a stored date range from `max` to `ytd` - Improved the market price in the benchmark detail dialog by adding the currency and reducing the precision on mobile - Improved the style of the close button in the dialog footer component - Improved the style of the close button in the dialog header component diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index c2f5ad5661..f997c8366a 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -12,7 +12,7 @@ import { PropertyService } from '@ghostfolio/api/services/property/property.serv import { TagService } from '@ghostfolio/api/services/tag/tag.service'; import { DEFAULT_CURRENCY, - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, DEFAULT_LOCALE, DELETE_OWN_USER_PERIOD, PROPERTY_API_KEY_GHOSTFOLIO, @@ -362,7 +362,7 @@ export class UserService { (user.settings.settings as UserSettings).viewMode === 'ZEN' ? 'max' : ((user.settings.settings as UserSettings)?.dateRange ?? - DEFAULT_DATE_RANGE); + DEFAULT_USER_DATE_RANGE); // Set default value for performance calculation type if (!(user.settings.settings as UserSettings)?.performanceCalculationType) { diff --git a/apps/client/src/app/components/home-holdings/home-holdings.component.ts b/apps/client/src/app/components/home-holdings/home-holdings.component.ts index 333a24d5d6..c20191f750 100644 --- a/apps/client/src/app/components/home-holdings/home-holdings.component.ts +++ b/apps/client/src/app/components/home-holdings/home-holdings.component.ts @@ -1,7 +1,7 @@ import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_CURRENCY, - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, DEFAULT_LOCALE } from '@ghostfolio/common/config'; import { @@ -66,7 +66,7 @@ export class GfHomeHoldingsComponent implements OnInit { }); protected readonly dateRange = computed(() => { - return this.user()?.settings?.dateRange ?? DEFAULT_DATE_RANGE; + return this.user()?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE; }); protected readonly deviceType = computed(() => { diff --git a/apps/client/src/app/components/home-overview/home-overview.component.ts b/apps/client/src/app/components/home-overview/home-overview.component.ts index 5e6601886c..73c25ee788 100644 --- a/apps/client/src/app/components/home-overview/home-overview.component.ts +++ b/apps/client/src/app/components/home-overview/home-overview.component.ts @@ -4,7 +4,7 @@ import { ImpersonationStorageService } from '@ghostfolio/client/services/imperso import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_CURRENCY, - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, DEFAULT_LOCALE, NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; @@ -203,7 +203,7 @@ export class GfHomeOverviewComponent implements OnInit { this.dataService .fetchPortfolioPerformance({ - range: userSettings?.dateRange ?? DEFAULT_DATE_RANGE + range: userSettings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ chart, errors, performance }) => { diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts index 8ba3f0fd8a..cd1b20cf5d 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -1,7 +1,7 @@ import { GfBenchmarkComparatorComponent } from '@ghostfolio/client/components/benchmark-comparator/benchmark-comparator.component'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; import { SubscriptionType } from '@ghostfolio/common/enums'; @@ -249,12 +249,12 @@ export class GfAnalysisPageComponent implements OnInit { dividends: this.dataService.fetchDividends({ filters: this.userService.getFilters(), groupBy: this.mode(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }), investments: this.dataService.fetchInvestments({ filters: this.userService.getFilters(), groupBy: this.mode(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) }) .pipe(takeUntilDestroyed(this.destroyRef)) @@ -323,7 +323,7 @@ export class GfAnalysisPageComponent implements OnInit { .fetchPortfolioPerformance({ filters: this.userService.getFilters(), groupBy: 'year', - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ chart }) => { @@ -353,7 +353,7 @@ export class GfAnalysisPageComponent implements OnInit { this.dataService .fetchPortfolioPerformance({ filters: this.userService.getFilters(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ chart, dateOfFirstActivity, performance }) => { @@ -482,7 +482,7 @@ export class GfAnalysisPageComponent implements OnInit { dataSource, symbol, filters: this.userService.getFilters(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE, + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE, startDate: this.dateOfFirstActivity }) .pipe(takeUntilDestroyed(this.destroyRef)) diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index 31caf6d3a1..a16d110bf6 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -100,6 +100,7 @@ export const STATISTICS_GATHERING_QUEUE = 'STATISTICS_GATHERING_QUEUE'; export const DEFAULT_CURRENCY = 'USD'; export const DEFAULT_DATE_FORMAT_MONTH_YEAR = 'MMM yyyy'; export const DEFAULT_DATE_RANGE: DateRange = 'max'; +export const DEFAULT_USER_DATE_RANGE: DateRange = 'ytd'; export const DEFAULT_HOST = '0.0.0.0'; export const DEFAULT_LANGUAGE_CODE = 'en'; export const DEFAULT_LOCALE = 'en-US';