diff --git a/CHANGELOG.md b/CHANGELOG.md index 44c052c78..470521134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Sorted the activity types alphabetically on the activities page (experimental) - Sorted the asset classes of the assistant alphabetically - Sorted the tags of the assistant alphabetically - Upgraded `angular` from version `21.1.1` to `21.2.7` - Upgraded `Nx` from version `22.5.3` to `22.6.4` +- Upgraded `yahoo-finance2` from version `3.13.2` to `3.14.0` + +### Fixed + +- Fixed the missing value column of the accounts table component on mobile ## 2.254.0 - 2026-03-10 @@ -6046,10 +6052,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed the alias from the user interface as a preparation to remove it from the `User` database schema - Removed the activities import limit for users with a subscription -### Todo - -- Rename the environment variable from `MAX_ORDERS_TO_IMPORT` to `MAX_ACTIVITIES_TO_IMPORT` - ## 1.169.0 - 14.07.2022 ### Added diff --git a/apps/api/src/app/import/import.controller.ts b/apps/api/src/app/import/import.controller.ts index d5724bef2..521be56f7 100644 --- a/apps/api/src/app/import/import.controller.ts +++ b/apps/api/src/app/import/import.controller.ts @@ -3,6 +3,7 @@ import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard' import { TransformDataSourceInRequestInterceptor } from '@ghostfolio/api/interceptors/transform-data-source-in-request/transform-data-source-in-request.interceptor'; import { TransformDataSourceInResponseInterceptor } from '@ghostfolio/api/interceptors/transform-data-source-in-response/transform-data-source-in-response.interceptor'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; +import { SubscriptionType } from '@ghostfolio/common/enums'; import { ImportResponse } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import type { RequestWithUser } from '@ghostfolio/common/types'; @@ -62,7 +63,7 @@ export class ImportController { if ( this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && - this.request.user.subscription.type === 'Premium' + this.request.user.subscription.type === SubscriptionType.Premium ) { maxActivitiesToImport = Number.MAX_SAFE_INTEGER; } @@ -100,6 +101,17 @@ export class ImportController { @Param('dataSource') dataSource: DataSource, @Param('symbol') symbol: string ): Promise { + let maxActivitiesToImport = this.configurationService.get( + 'MAX_ACTIVITIES_TO_IMPORT' + ); + + if ( + this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && + this.request.user.subscription.type === SubscriptionType.Premium + ) { + maxActivitiesToImport = Number.MAX_SAFE_INTEGER; + } + const activities = await this.importService.getDividends({ dataSource, symbol, @@ -107,6 +119,6 @@ export class ImportController { userId: this.request.user.id }); - return { activities }; + return { activities: activities.slice(0, maxActivitiesToImport) }; } } diff --git a/apps/client/src/app/components/admin-jobs/admin-jobs.component.ts b/apps/client/src/app/components/admin-jobs/admin-jobs.component.ts index b9f4d590d..b4c228881 100644 --- a/apps/client/src/app/components/admin-jobs/admin-jobs.component.ts +++ b/apps/client/src/app/components/admin-jobs/admin-jobs.component.ts @@ -20,12 +20,13 @@ import { ChangeDetectorRef, Component, DestroyRef, + inject, OnInit, - ViewChild + viewChild } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { - FormBuilder, + FormControl, FormGroup, FormsModule, ReactiveFormsModule @@ -74,19 +75,25 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; templateUrl: './admin-jobs.html' }) export class GfAdminJobsComponent implements OnInit { - @ViewChild(MatSort) sort: MatSort; + protected readonly sort = viewChild.required(MatSort); - public DATA_GATHERING_QUEUE_PRIORITY_LOW = DATA_GATHERING_QUEUE_PRIORITY_LOW; - public DATA_GATHERING_QUEUE_PRIORITY_HIGH = + protected readonly DATA_GATHERING_QUEUE_PRIORITY_HIGH = DATA_GATHERING_QUEUE_PRIORITY_HIGH; - public DATA_GATHERING_QUEUE_PRIORITY_MEDIUM = + + protected readonly DATA_GATHERING_QUEUE_PRIORITY_LOW = + DATA_GATHERING_QUEUE_PRIORITY_LOW; + + protected readonly DATA_GATHERING_QUEUE_PRIORITY_MEDIUM = DATA_GATHERING_QUEUE_PRIORITY_MEDIUM; - public dataSource = new MatTableDataSource(); - public defaultDateTimeFormat: string; - public filterForm: FormGroup; + protected dataSource = new MatTableDataSource(); + protected defaultDateTimeFormat: string; + + protected readonly filterForm = new FormGroup({ + status: new FormControl(null) + }); - public displayedColumns = [ + protected readonly displayedColumns = [ 'index', 'type', 'symbol', @@ -99,21 +106,20 @@ export class GfAdminJobsComponent implements OnInit { 'actions' ]; - public hasPermissionToAccessBullBoard = false; - public isLoading = false; - public statusFilterOptions = QUEUE_JOB_STATUS_LIST; + protected hasPermissionToAccessBullBoard = false; + protected isLoading = false; + protected readonly statusFilterOptions = QUEUE_JOB_STATUS_LIST; private user: User; - public constructor( - private adminService: AdminService, - private changeDetectorRef: ChangeDetectorRef, - private destroyRef: DestroyRef, - private formBuilder: FormBuilder, - private notificationService: NotificationService, - private tokenStorageService: TokenStorageService, - private userService: UserService - ) { + private readonly adminService = inject(AdminService); + private readonly changeDetectorRef = inject(ChangeDetectorRef); + private readonly destroyRef = inject(DestroyRef); + private readonly notificationService = inject(NotificationService); + private readonly tokenStorageService = inject(TokenStorageService); + private readonly userService = inject(UserService); + + public constructor() { this.userService.stateChanged .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe((state) => { @@ -148,21 +154,17 @@ export class GfAdminJobsComponent implements OnInit { } public ngOnInit() { - this.filterForm = this.formBuilder.group({ - status: [] - }); - this.filterForm.valueChanges .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(() => { - const currentFilter = this.filterForm.get('status').value; + const currentFilter = this.filterForm.controls.status.value; this.fetchJobs(currentFilter ? [currentFilter] : undefined); }); this.fetchJobs(); } - public onDeleteJob(aId: string) { + protected onDeleteJob(aId: string) { this.adminService .deleteJob(aId) .pipe(takeUntilDestroyed(this.destroyRef)) @@ -171,18 +173,18 @@ export class GfAdminJobsComponent implements OnInit { }); } - public onDeleteJobs() { - const currentFilter = this.filterForm.get('status').value; + protected onDeleteJobs() { + const currentFilter = this.filterForm.controls.status.value; this.adminService - .deleteJobs({ status: currentFilter ? [currentFilter] : undefined }) + .deleteJobs({ status: currentFilter ? [currentFilter] : [] }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(() => { this.fetchJobs(currentFilter ? [currentFilter] : undefined); }); } - public onExecuteJob(aId: string) { + protected onExecuteJob(aId: string) { this.adminService .executeJob(aId) .pipe(takeUntilDestroyed(this.destroyRef)) @@ -191,7 +193,7 @@ export class GfAdminJobsComponent implements OnInit { }); } - public onOpenBullBoard() { + protected onOpenBullBoard() { const token = this.tokenStorageService.getToken(); document.cookie = [ @@ -203,13 +205,13 @@ export class GfAdminJobsComponent implements OnInit { window.open(BULL_BOARD_ROUTE, '_blank'); } - public onViewData(aData: AdminJobs['jobs'][0]['data']) { + protected onViewData(aData: AdminJobs['jobs'][0]['data']) { this.notificationService.alert({ title: JSON.stringify(aData, null, ' ') }); } - public onViewStacktrace(aStacktrace: AdminJobs['jobs'][0]['stacktrace']) { + protected onViewStacktrace(aStacktrace: AdminJobs['jobs'][0]['stacktrace']) { this.notificationService.alert({ title: JSON.stringify(aStacktrace, null, ' ') }); @@ -223,7 +225,7 @@ export class GfAdminJobsComponent implements OnInit { .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ jobs }) => { this.dataSource = new MatTableDataSource(jobs); - this.dataSource.sort = this.sort; + this.dataSource.sort = this.sort(); this.dataSource.sortingDataAccessor = get; this.isLoading = false; diff --git a/libs/ui/src/lib/accounts-table/accounts-table.component.ts b/libs/ui/src/lib/accounts-table/accounts-table.component.ts index 99e68c679..aa104f795 100644 --- a/libs/ui/src/lib/accounts-table/accounts-table.component.ts +++ b/libs/ui/src/lib/accounts-table/accounts-table.component.ts @@ -64,7 +64,7 @@ export class GfAccountsTableComponent { public readonly showBalance = input(true); public readonly showFooter = input(true); public readonly showValue = input(true); - public readonly showValueInBaseCurrency = input(false); + public readonly showValueInBaseCurrency = input(true); public readonly totalBalanceInBaseCurrency = input(); public readonly totalValueInBaseCurrency = input(); diff --git a/libs/ui/src/lib/activities-table/activities-table.component.html b/libs/ui/src/lib/activities-table/activities-table.component.html index b8fe962d7..14089f061 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.html +++ b/libs/ui/src/lib/activities-table/activities-table.component.html @@ -5,7 +5,7 @@ Type @for ( - activityType of activityTypesTranslationMap | keyvalue; + activityType of activityTypesTranslationMap | keyvalue: sortByValue; track activityType.key ) { diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.ts index ffc07f09c..766abcc23 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.ts @@ -353,6 +353,13 @@ export class GfActivitiesTableComponent implements AfterViewInit, OnInit { this.activityToUpdate.emit(aActivity); } + public sortByValue( + a: { key: ActivityType; value: string }, + b: { key: ActivityType; value: string } + ) { + return a.value.localeCompare(b.value); + } + public toggleAllRows() { if (this.areAllRowsSelected()) { this.selectedRows.clear(); diff --git a/package-lock.json b/package-lock.json index 35fde3c6e..4027116d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -93,7 +93,7 @@ "svgmap": "2.19.2", "tablemark": "4.1.0", "twitter-api-v2": "1.29.0", - "yahoo-finance2": "3.13.2", + "yahoo-finance2": "3.14.0", "zone.js": "0.16.1" }, "devDependencies": { @@ -39587,9 +39587,9 @@ } }, "node_modules/yahoo-finance2": { - "version": "3.13.2", - "resolved": "https://registry.npmjs.org/yahoo-finance2/-/yahoo-finance2-3.13.2.tgz", - "integrity": "sha512-aAOJEjuLClfDxVPRKxjcwFoyzMr8BE/svgUqr5IjnQR+kppYbKO92Wl3SbAGz5DRghy6FiUfqi5FBDSBA/e2jg==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/yahoo-finance2/-/yahoo-finance2-3.14.0.tgz", + "integrity": "sha512-gsT/tqgeizKtMxbIIWFiFyuhM/6MZE4yEyNLmPekr88AX14JL2HWw0/QNMOR081jVtzTjihqDW0zV7IayH1Wcw==", "license": "MIT", "dependencies": { "@deno/shim-deno": "~0.18.0", diff --git a/package.json b/package.json index 177d142f7..e7a192af8 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "svgmap": "2.19.2", "tablemark": "4.1.0", "twitter-api-v2": "1.29.0", - "yahoo-finance2": "3.13.2", + "yahoo-finance2": "3.14.0", "zone.js": "0.16.1" }, "devDependencies": {