diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts index e2c63f191..357b9d5a2 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.component.ts @@ -20,6 +20,7 @@ import { Observable, Subject } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; import { CreateOrUpdateAccountDialogParams } from './interfaces/interfaces'; +import { Currency } from '@ghostfolio/common/interfaces/currency.interface'; @Component({ host: { class: 'h-100' }, @@ -30,7 +31,7 @@ import { CreateOrUpdateAccountDialogParams } from './interfaces/interfaces'; }) export class CreateOrUpdateAccountDialog implements OnDestroy { public accountForm: FormGroup; - public currencies: string[] = []; + public currencies: Currency[] = []; public filteredPlatforms: Observable; public platforms: Platform[]; @@ -46,7 +47,10 @@ export class CreateOrUpdateAccountDialog implements OnDestroy { public ngOnInit() { const { currencies, platforms } = this.dataService.fetchInfo(); - this.currencies = currencies; + this.currencies = currencies.map((currency) => ({ + label: currency, + value: currency + })); this.platforms = platforms; this.accountForm = this.formBuilder.group({ diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html index 91efd0972..a456e2290 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.html @@ -20,11 +20,10 @@
Currency - - {{ currency }} - +
diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts index 0f8b8ecb8..0022b5659 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts @@ -9,7 +9,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { GfSymbolIconModule } from '@ghostfolio/client/components/symbol-icon/symbol-icon.module'; - +import { GfCurrencyAutocompleteModule } from '@ghostfolio/ui/currency-selector/currency-selector.module'; import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog.component'; @NgModule({ @@ -17,6 +17,7 @@ import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog.c imports: [ CommonModule, FormsModule, + GfCurrencyAutocompleteModule, GfSymbolIconModule, MatAutocompleteModule, MatButtonModule, diff --git a/libs/common/src/lib/interfaces/currency.interface.ts b/libs/common/src/lib/interfaces/currency.interface.ts new file mode 100644 index 000000000..619144c0f --- /dev/null +++ b/libs/common/src/lib/interfaces/currency.interface.ts @@ -0,0 +1,4 @@ +export interface Currency { + label: string; + value: string; +}