Browse Source
Merge branch 'main' into task/upgrade-yahoo-finance2-to-version-3.15.3
pull/7067/head
Thomas Kaul
4 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with
37 additions and
30 deletions
-
CHANGELOG.md
-
apps/api/src/app/user/user.service.ts
-
apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
-
apps/client/src/app/components/admin-market-data/admin-market-data.service.ts
-
apps/client/src/app/components/admin-platform/admin-platform.component.ts
-
apps/client/src/app/components/admin-tag/admin-tag.component.ts
-
apps/client/src/app/components/admin-users/admin-users.component.ts
-
apps/client/src/app/components/home-watchlist/home-watchlist.component.ts
-
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
-
libs/common/src/lib/config.ts
-
libs/common/src/lib/helper.ts
-
libs/ui/src/lib/fire-calculator/fire-calculator.component.stories.ts
|
|
|
@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Changed |
|
|
|
|
|
|
|
- Added the selected asset profile count to the delete menu item of the historical market data table in the admin control panel |
|
|
|
- Added the selected asset profile count to the deletion confirmation dialog of the historical market data table in the admin control panel |
|
|
|
- Improved the sorting to be case-insensitive in the platform management of the admin control panel |
|
|
|
- Improved the sorting to be case-insensitive in the tag management of the admin control panel |
|
|
|
- Upgraded `yahoo-finance2` from version `3.14.2` to `3.15.3` |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
@ -28,11 +28,11 @@ import { |
|
|
|
DEFAULT_CURRENCY, |
|
|
|
DEFAULT_DATE_RANGE, |
|
|
|
DEFAULT_LANGUAGE_CODE, |
|
|
|
DEFAULT_LOCALE, |
|
|
|
PROPERTY_IS_READ_ONLY_MODE, |
|
|
|
PROPERTY_REFERRAL_PARTNERS, |
|
|
|
PROPERTY_SYSTEM_MESSAGE, |
|
|
|
TAG_ID_EXCLUDE_FROM_ANALYSIS, |
|
|
|
locale as defaultLocale |
|
|
|
TAG_ID_EXCLUDE_FROM_ANALYSIS |
|
|
|
} from '@ghostfolio/common/config'; |
|
|
|
import { SubscriptionType } from '@ghostfolio/common/enums'; |
|
|
|
import { |
|
|
|
@ -102,7 +102,7 @@ export class UserService { |
|
|
|
|
|
|
|
public async getUser({ |
|
|
|
impersonationUserId, |
|
|
|
locale = defaultLocale, |
|
|
|
locale = DEFAULT_LOCALE, |
|
|
|
user |
|
|
|
}: { |
|
|
|
impersonationUserId: string; |
|
|
|
|
|
|
|
@ -1,8 +1,8 @@ |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { |
|
|
|
DEFAULT_COLOR_SCHEME, |
|
|
|
DEFAULT_PAGE_SIZE, |
|
|
|
locale |
|
|
|
DEFAULT_LOCALE, |
|
|
|
DEFAULT_PAGE_SIZE |
|
|
|
} from '@ghostfolio/common/config'; |
|
|
|
import { |
|
|
|
canDeleteAssetProfile, |
|
|
|
@ -429,7 +429,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
|
colorScheme: |
|
|
|
this.user?.settings.colorScheme ?? DEFAULT_COLOR_SCHEME, |
|
|
|
deviceType: this.deviceType(), |
|
|
|
locale: this.user?.settings?.locale ?? locale |
|
|
|
locale: this.user?.settings?.locale ?? DEFAULT_LOCALE |
|
|
|
} satisfies AssetProfileDialogParams, |
|
|
|
height: this.deviceType() === 'mobile' ? '98vh' : '80vh', |
|
|
|
width: this.deviceType() === 'mobile' ? '100vw' : '50rem' |
|
|
|
@ -464,7 +464,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
|
autoFocus: false, |
|
|
|
data: { |
|
|
|
deviceType: this.deviceType(), |
|
|
|
locale: this.user?.settings?.locale ?? locale |
|
|
|
locale: this.user?.settings?.locale ?? DEFAULT_LOCALE |
|
|
|
} satisfies CreateAssetProfileDialogParams, |
|
|
|
width: this.deviceType() === 'mobile' ? '100vw' : '50rem' |
|
|
|
}); |
|
|
|
|
|
|
|
@ -32,6 +32,8 @@ export class AdminMarketDataService { |
|
|
|
public deleteAssetProfiles( |
|
|
|
aAssetProfileIdentifiers: AssetProfileIdentifier[] |
|
|
|
) { |
|
|
|
const assetProfileCount = aAssetProfileIdentifiers.length; |
|
|
|
|
|
|
|
this.notificationService.confirm({ |
|
|
|
confirmFn: () => { |
|
|
|
const deleteRequests = aAssetProfileIdentifiers.map( |
|
|
|
@ -44,7 +46,10 @@ export class AdminMarketDataService { |
|
|
|
.pipe( |
|
|
|
catchError(() => { |
|
|
|
this.notificationService.alert({ |
|
|
|
title: $localize`Oops! Could not delete profiles.` |
|
|
|
title: |
|
|
|
assetProfileCount === 1 |
|
|
|
? $localize`Oops! Could not delete the asset profile.` |
|
|
|
: $localize`Oops! Could not delete the asset profiles.` |
|
|
|
}); |
|
|
|
|
|
|
|
return EMPTY; |
|
|
|
@ -56,7 +61,10 @@ export class AdminMarketDataService { |
|
|
|
.subscribe(); |
|
|
|
}, |
|
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
|
title: $localize`Do you really want to delete these profiles?` |
|
|
|
title: |
|
|
|
assetProfileCount === 1 |
|
|
|
? $localize`Do you really want to delete this asset profile?` |
|
|
|
: $localize`Do you really want to delete these ${assetProfileCount}:count: asset profiles?` |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { CreatePlatformDto, UpdatePlatformDto } from '@ghostfolio/common/dtos'; |
|
|
|
import { ConfirmationDialogType } from '@ghostfolio/common/enums'; |
|
|
|
import { getLocale } from '@ghostfolio/common/helper'; |
|
|
|
import { getLocale, getLowercase } from '@ghostfolio/common/helper'; |
|
|
|
import { GfEntityLogoComponent } from '@ghostfolio/ui/entity-logo'; |
|
|
|
import { NotificationService } from '@ghostfolio/ui/notifications'; |
|
|
|
import { AdminService, DataService } from '@ghostfolio/ui/services'; |
|
|
|
@ -33,7 +33,6 @@ import { |
|
|
|
ellipsisHorizontal, |
|
|
|
trashOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { get } from 'lodash'; |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
|
|
|
|
import { GfCreateOrUpdatePlatformDialogComponent } from './create-or-update-platform-dialog/create-or-update-platform-dialog.component'; |
|
|
|
@ -147,7 +146,7 @@ export class GfAdminPlatformComponent implements OnInit { |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(platforms); |
|
|
|
this.dataSource.sort = this.sort(); |
|
|
|
this.dataSource.sortingDataAccessor = get; |
|
|
|
this.dataSource.sortingDataAccessor = getLowercase; |
|
|
|
|
|
|
|
this.dataService.updateInfo(); |
|
|
|
|
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { CreateTagDto, UpdateTagDto } from '@ghostfolio/common/dtos'; |
|
|
|
import { ConfirmationDialogType } from '@ghostfolio/common/enums'; |
|
|
|
import { getLocale } from '@ghostfolio/common/helper'; |
|
|
|
import { getLocale, getLowercase } from '@ghostfolio/common/helper'; |
|
|
|
import { NotificationService } from '@ghostfolio/ui/notifications'; |
|
|
|
import { DataService } from '@ghostfolio/ui/services'; |
|
|
|
import { GfValueComponent } from '@ghostfolio/ui/value'; |
|
|
|
@ -32,7 +32,6 @@ import { |
|
|
|
ellipsisHorizontal, |
|
|
|
trashOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
import { get } from 'lodash'; |
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
|
|
|
|
|
import { GfCreateOrUpdateTagDialogComponent } from './create-or-update-tag-dialog/create-or-update-tag-dialog.component'; |
|
|
|
@ -149,7 +148,7 @@ export class GfAdminTagComponent implements OnInit { |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(this.tags); |
|
|
|
this.dataSource.sort = this.sort(); |
|
|
|
this.dataSource.sortingDataAccessor = get; |
|
|
|
this.dataSource.sortingDataAccessor = getLowercase; |
|
|
|
|
|
|
|
this.dataService.updateInfo(); |
|
|
|
|
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ import { |
|
|
|
import { GfUserDetailDialogComponent } from '@ghostfolio/client/components/user-detail-dialog/user-detail-dialog.component'; |
|
|
|
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { DEFAULT_PAGE_SIZE, locale } from '@ghostfolio/common/config'; |
|
|
|
import { DEFAULT_LOCALE, DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config'; |
|
|
|
import { ConfirmationDialogType } from '@ghostfolio/common/enums'; |
|
|
|
import { |
|
|
|
getDateFnsLocale, |
|
|
|
@ -317,7 +317,7 @@ export class GfAdminUsersComponent implements OnInit { |
|
|
|
currentUserId: this.user?.id, |
|
|
|
deviceType: this.deviceType(), |
|
|
|
hasPermissionForSubscription: this.hasPermissionForSubscription, |
|
|
|
locale: this.user?.settings?.locale ?? locale, |
|
|
|
locale: this.user?.settings?.locale ?? DEFAULT_LOCALE, |
|
|
|
userId: aUserId |
|
|
|
} satisfies UserDetailDialogParams, |
|
|
|
height: this.deviceType() === 'mobile' ? '98vh' : '60vh', |
|
|
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { locale as defaultLocale } from '@ghostfolio/common/config'; |
|
|
|
import { DEFAULT_LOCALE } from '@ghostfolio/common/config'; |
|
|
|
import { |
|
|
|
AssetProfileIdentifier, |
|
|
|
Benchmark, |
|
|
|
@ -149,7 +149,7 @@ export class GfHomeWatchlistComponent implements OnInit { |
|
|
|
autoFocus: false, |
|
|
|
data: { |
|
|
|
deviceType: this.deviceType(), |
|
|
|
locale: this.user?.settings?.locale ?? defaultLocale |
|
|
|
locale: this.user?.settings?.locale ?? DEFAULT_LOCALE |
|
|
|
}, |
|
|
|
width: this.deviceType() === 'mobile' ? '100vw' : '50rem' |
|
|
|
}); |
|
|
|
|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { ASSET_CLASS_MAPPING } from '@ghostfolio/common/config'; |
|
|
|
import { locale as defaultLocale } from '@ghostfolio/common/config'; |
|
|
|
import { ASSET_CLASS_MAPPING, DEFAULT_LOCALE } from '@ghostfolio/common/config'; |
|
|
|
import { CreateOrderDto, UpdateOrderDto } from '@ghostfolio/common/dtos'; |
|
|
|
import { getDateFormatString } from '@ghostfolio/common/helper'; |
|
|
|
import { |
|
|
|
@ -120,7 +119,7 @@ export class GfCreateOrUpdateActivityDialogComponent { |
|
|
|
this.hasPermissionToCreateOwnTag = |
|
|
|
this.data.user?.settings?.isExperimentalFeatures && |
|
|
|
hasPermission(this.data.user?.permissions, permissions.createOwnTag); |
|
|
|
this.locale = this.data.user.settings.locale ?? defaultLocale; |
|
|
|
this.locale = this.data.user.settings.locale ?? DEFAULT_LOCALE; |
|
|
|
this.mode = this.data.activity?.id ? 'update' : 'create'; |
|
|
|
|
|
|
|
this.dateAdapter.setLocale(this.locale); |
|
|
|
|
|
|
|
@ -13,8 +13,6 @@ export const ghostfolioFearAndGreedIndexSymbol = `${ghostfolioScraperApiSymbolPr |
|
|
|
export const ghostfolioFearAndGreedIndexSymbolCryptocurrencies = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_CRYPTOCURRENCIES`; |
|
|
|
export const ghostfolioFearAndGreedIndexSymbolStocks = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_STOCKS`; |
|
|
|
|
|
|
|
export const locale = 'en-US'; |
|
|
|
|
|
|
|
export const primaryColorHex = '#36cfcc'; |
|
|
|
export const primaryColorRgb = { |
|
|
|
r: 54, |
|
|
|
@ -85,6 +83,7 @@ export const DEFAULT_DATE_FORMAT_MONTH_YEAR = 'MMM yyyy'; |
|
|
|
export const DEFAULT_DATE_RANGE: DateRange = 'max'; |
|
|
|
export const DEFAULT_HOST = '0.0.0.0'; |
|
|
|
export const DEFAULT_LANGUAGE_CODE = 'en'; |
|
|
|
export const DEFAULT_LOCALE = 'en-US'; |
|
|
|
export const DEFAULT_PAGE_SIZE = 50; |
|
|
|
export const DEFAULT_PORT = 3333; |
|
|
|
export const DEFAULT_PROCESSOR_GATHER_ASSET_PROFILE_CONCURRENCY = 1; |
|
|
|
|
|
|
|
@ -36,12 +36,12 @@ import { get, isNil, isString } from 'lodash'; |
|
|
|
|
|
|
|
import { |
|
|
|
DEFAULT_CURRENCY, |
|
|
|
DEFAULT_LOCALE, |
|
|
|
DERIVED_CURRENCIES, |
|
|
|
ghostfolioFearAndGreedIndexSymbol, |
|
|
|
ghostfolioFearAndGreedIndexSymbolCryptocurrencies, |
|
|
|
ghostfolioFearAndGreedIndexSymbolStocks, |
|
|
|
ghostfolioScraperApiSymbolPrefix, |
|
|
|
locale |
|
|
|
ghostfolioScraperApiSymbolPrefix |
|
|
|
} from './config'; |
|
|
|
import { |
|
|
|
AdminMarketDataItem, |
|
|
|
@ -261,7 +261,7 @@ export function getCurrencyFromSymbol(aSymbol = '') { |
|
|
|
export function getCountryName({ code }: { code: string }): string { |
|
|
|
try { |
|
|
|
return ( |
|
|
|
new Intl.DisplayNames([document.documentElement.lang || locale], { |
|
|
|
new Intl.DisplayNames([document.documentElement.lang || DEFAULT_LOCALE], { |
|
|
|
type: 'region' |
|
|
|
}).of(code) ?? code |
|
|
|
); |
|
|
|
@ -338,7 +338,7 @@ export function getEmojiFlag(aCountryCode: string) { |
|
|
|
} |
|
|
|
|
|
|
|
export function getLocale() { |
|
|
|
return navigator.language ?? locale; |
|
|
|
return navigator.language ?? DEFAULT_LOCALE; |
|
|
|
} |
|
|
|
|
|
|
|
export function getLowercase(object: object, path: string) { |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { locale } from '@ghostfolio/common/config'; |
|
|
|
import { DEFAULT_LOCALE } from '@ghostfolio/common/config'; |
|
|
|
|
|
|
|
import { CommonModule } from '@angular/common'; |
|
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
|
|
|
@ -47,7 +47,7 @@ export const Simple: Story = { |
|
|
|
annualInterestRate: 5, |
|
|
|
currency: 'USD', |
|
|
|
fireWealth: 50000, |
|
|
|
locale: locale, |
|
|
|
locale: DEFAULT_LOCALE, |
|
|
|
savingsRate: 1000 |
|
|
|
} |
|
|
|
}; |
|
|
|
|