Browse Source

Bugfix/persistence of empty comment in create or update account dialog (#7512)

* Fix persistence of empty comment

* Update changelog
pull/7514/head
Thomas Kaul 6 days ago
committed by GitHub
parent
commit
b37654c7c6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 3
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts
  3. 7
      apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
  4. 2
      libs/common/src/lib/dtos/create-account.dto.ts
  5. 2
      libs/common/src/lib/dtos/create-order.dto.ts
  6. 2
      libs/common/src/lib/dtos/update-account.dto.ts
  7. 2
      libs/common/src/lib/dtos/update-order.dto.ts

1
CHANGELOG.md

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed the handling of the _Exclude from Analysis_ tag in the activities table - Fixed the handling of the _Exclude from Analysis_ tag in the activities table
- Fixed the persistence of an empty comment in the create or update account dialog
- Resolved a validation error caused by empty strings in the asset profile details dialog of the admin control panel - Resolved a validation error caused by empty strings in the asset profile details dialog of the admin control panel
## 3.39.0 - 2026-08-01 ## 3.39.0 - 2026-08-01

3
apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts

@ -1,6 +1,7 @@
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { TAG_ID_EXCLUDE_FROM_ANALYSIS } from '@ghostfolio/common/config'; import { TAG_ID_EXCLUDE_FROM_ANALYSIS } from '@ghostfolio/common/config';
import { CreateAccountDto, UpdateAccountDto } from '@ghostfolio/common/dtos'; import { CreateAccountDto, UpdateAccountDto } from '@ghostfolio/common/dtos';
import { getStringOrNull } from '@ghostfolio/common/helper';
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { validateObjectForForm } from '@ghostfolio/common/utils'; import { validateObjectForForm } from '@ghostfolio/common/utils';
import { GfCurrencySelectorComponent } from '@ghostfolio/ui/currency-selector'; import { GfCurrencySelectorComponent } from '@ghostfolio/ui/currency-selector';
@ -198,7 +199,7 @@ export class GfCreateOrUpdateAccountDialogComponent {
protected async onSubmit() { protected async onSubmit() {
const account: CreateAccountDto | UpdateAccountDto = { const account: CreateAccountDto | UpdateAccountDto = {
balance: this.accountForm.get('balance')?.value, balance: this.accountForm.get('balance')?.value,
comment: this.accountForm.get('comment')?.value ?? null, comment: getStringOrNull(this.accountForm.get('comment')?.value),
currency: this.accountForm.get('currency')?.value, currency: this.accountForm.get('currency')?.value,
id: this.accountForm.get('accountId')?.value, id: this.accountForm.get('accountId')?.value,
name: this.accountForm.get('name')?.value, name: this.accountForm.get('name')?.value,

7
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts

@ -1,7 +1,10 @@
import { UserService } from '@ghostfolio/client/services/user/user.service'; import { UserService } from '@ghostfolio/client/services/user/user.service';
import { ASSET_CLASS_MAPPING, DEFAULT_LOCALE } from '@ghostfolio/common/config'; import { ASSET_CLASS_MAPPING, DEFAULT_LOCALE } from '@ghostfolio/common/config';
import { CreateOrderDto, UpdateOrderDto } from '@ghostfolio/common/dtos'; import { CreateOrderDto, UpdateOrderDto } from '@ghostfolio/common/dtos';
import { getDateFormatString } from '@ghostfolio/common/helper'; import {
getDateFormatString,
getStringOrNull
} from '@ghostfolio/common/helper';
import { import {
AssetClassSelectorOption, AssetClassSelectorOption,
LookupItem LookupItem
@ -471,7 +474,7 @@ export class GfCreateOrUpdateActivityDialogComponent {
accountId: this.activityForm.get('accountId')?.value, accountId: this.activityForm.get('accountId')?.value,
assetClass: this.activityForm.get('assetClass')?.value, assetClass: this.activityForm.get('assetClass')?.value,
assetSubClass: this.activityForm.get('assetSubClass')?.value, assetSubClass: this.activityForm.get('assetSubClass')?.value,
comment: this.activityForm.get('comment')?.value ?? null, comment: getStringOrNull(this.activityForm.get('comment')?.value),
currency: this.activityForm.get('currency')?.value, currency: this.activityForm.get('currency')?.value,
customCurrency: this.activityForm.get('currencyOfUnitPrice')?.value, customCurrency: this.activityForm.get('currencyOfUnitPrice')?.value,
dataSource: ['FEE', 'INTEREST', 'LIABILITY', 'VALUABLE'].includes( dataSource: ['FEE', 'INTEREST', 'LIABILITY', 'VALUABLE'].includes(

2
libs/common/src/lib/dtos/create-account.dto.ts

@ -20,7 +20,7 @@ export class CreateAccountDto {
@Transform(({ value }: TransformFnParams) => @Transform(({ value }: TransformFnParams) =>
isString(value) ? value.trim() : value isString(value) ? value.trim() : value
) )
comment?: string; comment?: string | null;
@IsCurrencyCode() @IsCurrencyCode()
currency: string; currency: string;

2
libs/common/src/lib/dtos/create-order.dto.ts

@ -35,7 +35,7 @@ export class CreateOrderDto {
@Transform(({ value }: TransformFnParams) => @Transform(({ value }: TransformFnParams) =>
isString(value) ? value.trim() : value isString(value) ? value.trim() : value
) )
comment?: string; comment?: string | null;
@IsCurrencyCode() @IsCurrencyCode()
currency: string; currency: string;

2
libs/common/src/lib/dtos/update-account.dto.ts

@ -20,7 +20,7 @@ export class UpdateAccountDto {
@Transform(({ value }: TransformFnParams) => @Transform(({ value }: TransformFnParams) =>
isString(value) ? value.trim() : value isString(value) ? value.trim() : value
) )
comment?: string; comment?: string | null;
@IsCurrencyCode() @IsCurrencyCode()
currency: string; currency: string;

2
libs/common/src/lib/dtos/update-order.dto.ts

@ -34,7 +34,7 @@ export class UpdateOrderDto {
@Transform(({ value }: TransformFnParams) => @Transform(({ value }: TransformFnParams) =>
isString(value) ? value.trim() : value isString(value) ? value.trim() : value
) )
comment?: string; comment?: string | null;
@IsCurrencyCode() @IsCurrencyCode()
currency: string; currency: string;

Loading…
Cancel
Save