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

refactor: mergeCollection & mergeNFT #7011

Merged
merged 2 commits into from
Aug 29, 2023

Conversation

stephenjason89
Copy link
Contributor

@stephenjason89 stephenjason89 commented Aug 28, 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

@/components/rmrk/service/scheme has 2 functions which are synonymous but have different types.
This PR aims to combine those 2 functions into 1.

Since it wasn't used anywhere, I didn't had to change references to the old functions.

  • Bugfix
  • Feature
  • Refactoring

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality

Optional

  • I've tested it at </ksm/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

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

  • Fill up your DOT address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

Copilot Summary

🤖 Generated by Copilot at 7997e50

Refactored mergeCollection and mergeNFT into a single generic function mergeNFTCollection in scheme.ts. This simplifies the code and ensures consistent merging of NFT and collection data with metadata.

🤖 Generated by Copilot at 7997e50

mergeNFTCollection
One function for both types
Simpler and safer

@stephenjason89 stephenjason89 requested a review from a team as a code owner August 28, 2023 14:24
@stephenjason89 stephenjason89 requested review from floyd-li and daiagi and removed request for a team August 28, 2023 14:24
@netlify
Copy link

netlify bot commented Aug 28, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 755394e
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64ee3b9cc51bf4000874d069
😎 Deploy Preview https://deploy-preview-7011--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 28, 2023

AI-Generated Summary: This pull request contains a code refactoring in the scheme.ts file within the RMRK service. The changes specifically focus on merging the separate mergeCollection and mergeNFT functions into a single, reusable, and more general function named mergeNFTCollection. A type alias MergedData<T> is also introduced which makes use of TypeScript's conditional types. This allows for a clean, generic function that works for both Collection and NFT types, improving the maintainability of the code.

@codeclimate
Copy link

codeclimate bot commented Aug 28, 2023

Code Climate has analyzed commit 7997e50 and detected 0 issues on this pull request.

View more on Code Climate.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Aug 28, 2023
@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 28, 2023

Reviewpad Report

⚠️ Warnings

  • Please link an issue to the pull request

@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

pay 30 usd

@yangwao yangwao enabled auto-merge August 29, 2023 18:11
@yangwao yangwao disabled auto-merge August 29, 2023 18:12
@yangwao yangwao merged commit 9e9df54 into kodadot:main Aug 29, 2023
4 checks passed
@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

pay 30 usd

@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

😍 Perfect, I’ve sent the payout
💵 $30 @ 4.7 USD/DOT ~ 6.383 $DOT
🧗 13rFRPVKjJzQXVC8ZqHZv5YMmwmk4MU7z4HeYk218hEMpQXH
🔗 0x5562ba07fedf2c6f6737487ba146eaeba781f58229117348f6af97fbc1e5c575

🪅 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 29, 2023
@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

😍 Perfect, I’ve sent the payout
💵 $30 @ 4.7 USD/DOT ~ 6.383 $DOT
🧗 13rFRPVKjJzQXVC8ZqHZv5YMmwmk4MU7z4HeYk218hEMpQXH
🔗 0x8105e340a9ef12a725c5792ae572f7c518eff686f5a59ae923c17c53ced5f054

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

@sonarcloud
Copy link

sonarcloud bot commented Aug 29, 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 0 Code Smells

No Coverage information No Coverage information
0.6% 0.6% Duplication

@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

😍 Perfect, I’ve sent the payout
💵 $30 @ 4.69 USD/DOT ~ 6.397 $DOT
🧗 13rFRPVKjJzQXVC8ZqHZv5YMmwmk4MU7z4HeYk218hEMpQXH
🔗 0x7ba545afaa5fb719642b0d3a980000fd1be447ad259dc3d462f9f266d5dcb016

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

@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

impressive, bot hijack 😅
seems Github Webhooks <> Autocode Gateway has some delayed dispatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants