Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fix state of CurrencySelectorComponent #2795

Open
dtslvr opened this issue Dec 29, 2023 · 4 comments · May be fixed by #3429
Open

[BUG] Fix state of CurrencySelectorComponent #2795

dtslvr opened this issue Dec 29, 2023 · 4 comments · May be fixed by #3429
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dtslvr
Copy link
Member

dtslvr commented Dec 29, 2023

Bug Description

After changing the @Input parameters, the CurrencySelectorComponent does not display the correct state.

To Reproduce

  1. Open Admin Control > Market Data
  2. Open an asset profile where data source is MANUAL
  3. Change the Currency and Save
  4. The component does not display the current currency and all options are gone

Expected behavior

The component displays the current currency and all options are still available.

Environment

  • Ghostfolio Version 2.32.0
@dtslvr dtslvr added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Dec 29, 2023
@dtslvr
Copy link
Member Author

dtslvr commented Jan 2, 2024

Do you perhaps have any ideas for a solution, @Dhoni77?

@SirZemar
Copy link
Contributor

image

The reason of this bug is in the way the data is being displayed in the mat autocomplete component. There is some disparity on the currency type when form option is selected and when form data is summited, changing it to type string. Couldn't find a particular reason to keep Currency type ({value: string, label: string}).

Which type for currency should we keep?

@SirZemar
Copy link
Contributor

What do you think @dtslvr? I would like take on this issue 😁

@dtslvr
Copy link
Member Author

dtslvr commented May 22, 2024

What do you think @dtslvr?

currency is persisted as a string (ISO 4217). The Angular Material component seems to be using label and value (USD for both). Can you convert it properly after loading and before submitting to fix the issue?

SirZemar added a commit to SirZemar/ghostfolio that referenced this issue May 23, 2024
* Fix state of currency selector component
@dtslvr dtslvr linked a pull request May 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants