|
|
@ -13,6 +13,7 @@ import { |
|
|
OnChanges, |
|
|
OnChanges, |
|
|
OnInit, |
|
|
OnInit, |
|
|
Output, |
|
|
Output, |
|
|
|
|
|
effect, |
|
|
inject, |
|
|
inject, |
|
|
input, |
|
|
input, |
|
|
viewChild |
|
|
viewChild |
|
|
@ -90,6 +91,17 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit { |
|
|
|
|
|
|
|
|
public constructor() { |
|
|
public constructor() { |
|
|
addIcons({ calendarClearOutline, ellipsisHorizontal, trashOutline }); |
|
|
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() { |
|
|
public ngOnInit() { |
|
|
@ -103,8 +115,6 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit { |
|
|
this.dataSource.sort = this.sort(); |
|
|
this.dataSource.sort = this.sort(); |
|
|
this.dataSource.sortingDataAccessor = get; |
|
|
this.dataSource.sortingDataAccessor = get; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.prefillAccountBalanceForm(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onDeleteAccountBalance(aId: string) { |
|
|
public onDeleteAccountBalance(aId: string) { |
|
|
@ -143,17 +153,4 @@ export class GfAccountBalancesComponent implements OnChanges, OnInit { |
|
|
|
|
|
|
|
|
this.accountBalanceCreated.emit(accountBalance); |
|
|
this.accountBalanceCreated.emit(accountBalance); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private prefillAccountBalanceForm() { |
|
|
|
|
|
const currentBalance = this.currentBalance(); |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
typeof currentBalance !== 'number' || |
|
|
|
|
|
!this.accountBalanceForm.controls.balance.pristine |
|
|
|
|
|
) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.accountBalanceForm.patchValue({ balance: currentBalance }); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|