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

[BRAAV-11383] Dynamically populate blockchain dropdown #242

Merged
merged 9 commits into from
Jul 18, 2022

Conversation

elizalucas
Copy link
Contributor

This PR dynamically populates the blockchain dropdown of the POST /paymentintents screen based on an api output. The flow of the page is as follows:

  • when you navigate to the POST /paymentIntents page, only the currency dropdown is visible
  • after selecting your desired currency the remaining fields of the page appear, and the blockchain dropdown is populated with the blockchains for the selected currency
  • if you select a different currency, your selection in the blockchain dropdown clears and the items in the blockchain dropdown are repopulated based on the new currency selection

@huaweigu huaweigu changed the title Dynamically populate blockchain dropdown [BRAAV-11383] Dynamically populate blockchain dropdown Jul 12, 2022
@@ -86,17 +104,30 @@ export default class CreatePaymentIntentClass extends Vue {
expiresOn: '',
}

currencyBlockchainPairs: CurrencyBlockchainPairs =
this.$cryptoPaymentMetadataApi.getSupportedCurrencyAndBlockchainCombinations()

required = [(v: string) => !!v || 'Field is required']
error = {}
loading = false
showError = false
supportedCurrencies = ['BTC', 'ETH', 'USD']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need to hardcode supportedCurrencies initially? It should be dynamically populated from the api response

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True - I will update this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in this commit: get currencies dynamically

@huaweigu huaweigu merged commit 343a042 into circlefin:master Jul 18, 2022
@@ -86,17 +104,33 @@ export default class CreatePaymentIntentClass extends Vue {
expiresOn: '',
}

currencyBlockchainPairs: CurrencyBlockchainPairs =
this.$cryptoPaymentMetadataApi.getSupportedCurrencyAndBlockchainCombinations()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this missing await?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
@elizalucas could it be the bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has to do with it - I added this in this PR but still not fully solved yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants