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
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user