Browse Source
Task/prefill form with current cash balance value in account details dialog (#6998)
* Prefill form with current cash balance value
* Update changelog
main
David Requeno
14 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
20 additions and
0 deletions
-
CHANGELOG.md
-
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
-
libs/ui/src/lib/account-balances/account-balances.component.ts
|
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. |
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Prefilled the form in the account balance management with the current cash balance |
|
|
|
|
|
|
|
## 3.8.0 - 2026-06-07 |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
|
|
@ -148,6 +148,7 @@ |
|
|
|
[accountBalances]="accountBalances" |
|
|
|
[accountCurrency]="currency" |
|
|
|
[accountId]="data.accountId" |
|
|
|
[currentBalance]="balance" |
|
|
|
[locale]="user?.settings?.locale" |
|
|
|
[showActions]=" |
|
|
|
!data.hasImpersonationId && |
|
|
|
|
|
|
|
@ -13,6 +13,7 @@ import { |
|
|
|
OnChanges, |
|
|
|
OnInit, |
|
|
|
Output, |
|
|
|
effect, |
|
|
|
inject, |
|
|
|
input, |
|
|
|
viewChild |
|
|
|
@ -70,6 +71,7 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit { |
|
|
|
input.required<AccountBalancesResponse['balances']>(); |
|
|
|
public readonly accountCurrency = input.required<string>(); |
|
|
|
public readonly accountId = input.required<string>(); |
|
|
|
public readonly currentBalance = input<number | null>(); |
|
|
|
public readonly displayedColumns: string[] = ['date', 'value', 'actions']; |
|
|
|
public readonly locale = input(getLocale()); |
|
|
|
public readonly showActions = input(true); |
|
|
|
@ -89,6 +91,17 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit { |
|
|
|
|
|
|
|
public constructor() { |
|
|
|
addIcons({ calendarClearOutline, ellipsisHorizontal, trashOutline }); |
|
|
|
|
|
|
|
effect(() => { |
|
|
|
const currentBalance = this.currentBalance(); |
|
|
|
|
|
|
|
if ( |
|
|
|
this.accountBalanceForm.controls.balance.pristine && |
|
|
|
typeof currentBalance === 'number' |
|
|
|
) { |
|
|
|
this.accountBalanceForm.controls.balance.setValue(currentBalance); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
|
|