Feature/usability improvements in the create or edit transaction dialog (#483)

* Usability improvements
  * Disable the symbol input in edit mode
  * Filter accounts by type (SECURITIES)

* Update changelog
pull/480/head
Thomas Kaul 3 years ago committed by GitHub
parent 0cb632b165
commit bc58ee86ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,13 @@ 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
- Locked the symbol input in the edit transaction dialog
- Filtered the account selector by account type (`SECURITIES`) in the create or edit transaction dialog
## 1.78.0 - 20.11.2021
### Added

@ -84,6 +84,10 @@ export class CreateOrUpdateTransactionDialog implements OnDestroy {
})
);
if (this.data.transaction.id) {
this.searchSymbolCtrl.disable();
}
if (this.data.transaction.symbol) {
this.dataService
.fetchSymbolItem({

@ -10,9 +10,7 @@
required
[(value)]="data.transaction.accountId"
>
<mat-option
*ngFor="let account of data.user?.accounts"
[value]="account.id"
<mat-option *ngFor="let account of data.accounts" [value]="account.id"
>{{ account.name }}</mat-option
>
</mat-select>

@ -1,8 +1,9 @@
import { User } from '@ghostfolio/common/interfaces';
import { Order } from '@prisma/client';
import { Account, Order } from '@prisma/client';
export interface CreateOrUpdateTransactionDialogParams {
accountId: string;
accounts: Account[];
transaction: Order;
user: User;
}

@ -261,6 +261,9 @@ export class TransactionsPageComponent implements OnDestroy, OnInit {
}: OrderModel): void {
const dialogRef = this.dialog.open(CreateOrUpdateTransactionDialog, {
data: {
accounts: this.user.accounts.filter((account) => {
return account.accountType === 'SECURITIES';
}),
transaction: {
accountId,
currency,
@ -343,6 +346,9 @@ export class TransactionsPageComponent implements OnDestroy, OnInit {
private openCreateTransactionDialog(aTransaction?: OrderModel): void {
const dialogRef = this.dialog.open(CreateOrUpdateTransactionDialog, {
data: {
accounts: this.user.accounts.filter((account) => {
return account.accountType === 'SECURITIES';
}),
transaction: {
accountId: aTransaction?.accountId ?? this.defaultAccountId,
currency: aTransaction?.currency ?? null,

Loading…
Cancel
Save