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

feat(ramp): enable buy button in asset overview #12396

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

wachunei
Copy link
Member

@wachunei wachunei commented Nov 22, 2024

Description

This PR adds the buy button to the Token (AssetOverview) page, using the Ramp Intent parameters to optimistically open the Buy flow with the token selected. The Buy button will show if the network is supported.

Happy Path / Optimistic case description:

Given:

  • The user has already started the Buy flow before and has a region selected from a previous interaction
  • The asset is supported in the current region and payment method the user has selected from the previous buy flow interaction

Then:

  • As a user, I want to press the Buy button from the Token page and have the token selected on the Buy flow

Other cases:

  • If the user has not started the buy button, not selected a region
    • Then the user will land on the buy flow start page or region selector
  • If the asset is not supported in the current region/payment method configuration
    • Then the user will land on the buy flow and the default token will be selected.

Related issues

Fixes: #12396

Manual testing steps

  1. Go to Token page
  2. Click on the Buy button

Screenshots/Recordings

Before

No Buy button

no_buy_button.mp4

After

Happy Path

buy_button_asset_overview.mp4

Token unavailable (default token is selected)

other_cases.mp4

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@wachunei wachunei added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Triggers smoke e2e on Bitrise team-ramp issues related to Ramp features labels Nov 22, 2024
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: be7c818
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ecc227aa-7fef-4311-8ad0-133f14cc26a6

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@wachunei wachunei added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 22, 2024
Copy link
Contributor

github-actions bot commented Nov 22, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 2de74a0
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ccee4fa6-3988-42ea-b61c-9f7ed2a76817

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@wachunei wachunei marked this pull request as ready for review November 22, 2024 16:36
@wachunei wachunei requested a review from a team as a code owner November 22, 2024 16:36
@wachunei wachunei added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 22, 2024
Copy link
Contributor

github-actions bot commented Nov 22, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1cbd3bf
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/46007726-deeb-4096-9633-a3084146675e

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

georgeweiler
georgeweiler previously approved these changes Nov 22, 2024
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Code LGTM. However, it seems like we're missing some UX here since we're not notifying the user that the token is not available for buying in their region. Defaulting to the default token can also easily be interpreted as a bug in a sense that the wrong token may have been selected. Is the fallback condition a result of not having a region selected in the first place?

@wachunei
Copy link
Member Author

However, it seems like we're missing some UX here since we're not notifying the user that the token is not available for buying in their region. Defaulting to the default token can also easily be interpreted as a bug in a sense that the wrong token may have been selected.

Yes I agree, we can improve this by adding a message to let the user the token is not available.

Is the fallback condition a result of not having a region selected in the first place?

No, the fallback happens when the token is not available. In the case has not selected region and payment method and they do it in this flow, the token will be selected if it was available.

@wachunei wachunei removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Nov 26, 2024
@wachunei wachunei added this pull request to the merge queue Nov 26, 2024
Merged via the queue into main with commit 90b4ed1 Nov 26, 2024
42 checks passed
@wachunei wachunei deleted the feat/ramp-asset-overview-button branch November 26, 2024 14:01
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2024
@metamaskbot metamaskbot added the release-7.37.0 Issue or pull request that will be included in release 7.37.0 label Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.37.0 Issue or pull request that will be included in release 7.37.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-ramp issues related to Ramp features
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants