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

buy flow #6596

Merged
merged 9 commits into from
Aug 8, 2023
Merged

buy flow #6596

merged 9 commits into from
Aug 8, 2023

Conversation

daiagi
Copy link
Contributor

@daiagi daiagi commented Aug 7, 2023

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Needs QA check

  • @kodadot/qa-guild please review

Testing

3 relevant places:
shopping cart, Gallery Item page, and explore
clicking buy in these places while not connected should

  1. open connect wallet modal
  2. after a successful wallet connection => close the wallet modal and open the complete purchase modal

clicking buy while wallet is connected => just open confirmation modal

@exezbcz
showing the loader spinner on the button and keeping the button visible while the wallet modal is open turned out quite challenging and is not included in this PR.

Context

Did your issue had any of the "$" label on it?

Screenshot 📸

  • My fix has changed UI

Copilot Summary

🤖 Generated by Copilot at e3c875b

This pull request enhances the user experience of buying items from the gallery by adding a custom connect event to the ConnectWalletModal.vue component and using it to open the CompletePurchaseModal.vue component after connecting the wallet. It also refactors the openConnectWalletModal function in the useConnectWallet.ts file to accept an optional object with a callback function and a flag to control the modal closing behavior. It updates the ShoppingCartModal.vue and GalleryItemBuy.vue components to use the modified function and pass the appropriate parameters.

🤖 Generated by Copilot at e3c875b

openConnectWallet
closes after connection
autumn leaves fall fast

@daiagi daiagi requested a review from a team as a code owner August 7, 2023 09:23
@daiagi daiagi requested review from roiLeo and vikiival and removed request for a team August 7, 2023 09:23
@kodabot
Copy link
Collaborator

kodabot commented Aug 7, 2023

WARNING @daiagi PR for issue #6372 which isn't assigned to you. Please be warned that this PR may get rejected if there's another assignee for issue #6372

@netlify
Copy link

netlify bot commented Aug 7, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 1846c70
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64d0ec1bebd5d2000896d804
😎 Deploy Preview https://deploy-preview-6596--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 7, 2023

AI-Generated Summary: This pull request introduces changes to enhance the user experience in regards to the process of connecting the wallet and making a purchase in an e-commerce application. More specifically, the changes consist of opening the "confirm purchase" modal once the wallet connection is successfully established. The patch adjusts several Vue.js components, notably the ConnectWalletModal.vue, and useConnectWallet.ts, ShoppingCartModal.vue, the GalleryItemBuy.vue and the ItemsGridImage.vue. It modifies the behavior of the wallet connection event, triggering additional actions upon successful connection, such as closing the modal or proceeding to complete purchase. This helps in streamlining and improving the buying process for users.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Aug 7, 2023
@daiagi daiagi changed the title open confirm purchase modal after wallet connect buy flow Aug 7, 2023
@daiagi daiagi requested review from Jarsen136 and removed request for vikiival August 7, 2023 09:30
@exezbcz
Copy link
Member

exezbcz commented Aug 7, 2023

image

  • looks like its not absolute position or?
  • steps: go to explore, click buy now, connect wallet, then this appears - its closed after like 3 sec, but I could not see the confirmation dialog anymore

@daiagi daiagi marked this pull request as draft August 7, 2023 09:49
@daiagi
Copy link
Contributor Author

daiagi commented Aug 7, 2023

@exezbcz unrelated to this PR. it happens on kodadot.xyz as well
when the shopping cart Pr was merged it worked. something broke since then

@roiLeo
Copy link
Contributor

roiLeo commented Aug 7, 2023

something broke since then

Hello! maybe it's me from #6575 could you try with #6591 patch?

@daiagi
Copy link
Contributor Author

daiagi commented Aug 7, 2023

something broke since then

Hello! maybe it's me from #6575 could you try with #6591 patch?

yes I suspect the same.
on my local shopping cart branch it works well

could you try with #6591 patch?

how?

@roiLeo
Copy link
Contributor

roiLeo commented Aug 7, 2023

how?

apply same change, or merge it on your PR

@daiagi
Copy link
Contributor Author

daiagi commented Aug 7, 2023

what is this witchcraft?
it does solve the problem

how is scoped on neoButton style cause this?

@daiagi daiagi marked this pull request as ready for review August 7, 2023 10:17
@roiLeo
Copy link
Contributor

roiLeo commented Aug 7, 2023

how is scoped on neoButton style cause this?

magical-magic

@exezbcz
Copy link
Member

exezbcz commented Aug 7, 2023

So, is it ready for testing sir?

I got this when I opened the link
image

also, I see some corner radius 👀 not yet on app, please
image

@reviewpad reviewpad bot added medium Pull request is medium and removed small Pull request is small labels Aug 7, 2023
@daiagi
Copy link
Contributor Author

daiagi commented Aug 7, 2023

So, is it ready for testing sir?

yes

I got this when I opened the link

that's because you didn't close the modal when it was buggy, and the app state is persistent

also, I see some corner radius eyes not yet on app, please

I'll make another PR for that. don't want to mix it here

Copy link
Contributor

@Jarsen136 Jarsen136 left a comment

Choose a reason for hiding this comment

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

It would be better if we could reuse this part by a composable.

if (!isLogIn.value) {
    openConnectWalletModal(instance, {
      onConnect: callback,
      closeAfterConnect: true,
    })
  } else {
    callback()
  }

@roiLeo roiLeo added the S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved label Aug 7, 2023
@codeclimate
Copy link

codeclimate bot commented Aug 7, 2023

Code Climate has analyzed commit 1846c70 and detected 0 issues on this pull request.

View more on Code Climate.

@daiagi
Copy link
Contributor Author

daiagi commented Aug 7, 2023

It would be better if we could reuse this part by a composable.

Thanks @Jarsen136
Done

@sonarcloud
Copy link

sonarcloud bot commented Aug 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@prury prury added the S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked label Aug 7, 2023
@prury
Copy link
Member

prury commented Aug 7, 2023

Testing
3 relevant places:
shopping cart, Gallery Item page, and explore
clicking buy in these places while not connected should
open connect wallet modal
after a successful wallet connection => close the wallet modal and open the complete purchase modal
clicking buy while wallet is connected => just open confirmation modal

they all work, thanks for the guidance

@yangwao
Copy link
Member

yangwao commented Aug 8, 2023

pay 50 usd

@yangwao yangwao merged commit 17152c7 into main Aug 8, 2023
18 of 20 checks passed
@yangwao yangwao deleted the feat/buy-flow branch August 8, 2023 16:49
@yangwao
Copy link
Member

yangwao commented Aug 8, 2023

😍 Perfect, I’ve sent the payout
💵 $50 @ 5.05 USD/DOT ~ 9.901 $DOT
🧗 1cAsKZYNRb8dkSCpn4eVkEn6ycNZTGoDo5dGDgB8J1UUWK8
🔗 0x986c5f8bca8215babb6855ee26a0d9d58445991d2c7300e50abe666166f86f34

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Aug 8, 2023
This was referenced Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Pull request is medium paid pull-request has been paid S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buy now flow
7 participants