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

Colection required amount #6849

Closed
wants to merge 18 commits into from

Conversation

pbkompasz
Copy link
Contributor

@pbkompasz pbkompasz commented Aug 21, 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

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.

Screenshot from 2023-08-21 13-11-47

Screenshot from 2023-08-21 13-11-57

Copilot Summary

🤖 Generated by Copilot at 5156e82

This pull request adds a deposit feature for creating collections and enhances the user interface and feedback for this process. It introduces a variant prop for the SubmitButton component, uses the NeoField and NeoButtonVariant components from the @kodadot1/brick package, and updates the locales/en.json and utils/constants.ts files.

🤖 Generated by Copilot at 5156e82

SubmitButton shines
Creating collections with ease
Autumn of Neo

@pbkompasz pbkompasz requested a review from a team as a code owner August 21, 2023 10:14
@pbkompasz pbkompasz requested review from roiLeo and Jarsen136 and removed request for a team August 21, 2023 10:14
@netlify
Copy link

netlify bot commented Aug 21, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 12f1a84
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64e4c8a7cde0af0008c07b3a
😎 Deploy Preview https://deploy-preview-6849--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.

@kodabot
Copy link
Collaborator

kodabot commented Aug 21, 2023

SUCCESS @pbkompasz PR for issue #6738 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 21, 2023

AI-Generated Summary: This pull request includes five patches focused on several aspects of the code. Firstly, constants related to collection URLs and deposit amounts are added to a constants file. In the second patch, a variant attribute was added to the SubmitButton component, which allows this component to received a variant prop that modifies its appearance. Thirdly, strings relating to insufficient funds and deposit requirements have been added to the locale file to improve the application's internationalization. Fourthly, the message displayed when creating a collection was adjusted to provide more information about balance requirements and deposits. Finally, an unused import reference was removed from a collection creation component to improve the code's cleanliness and efficiency.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Aug 21, 2023
components/rmrk/Create/CreateCollection.vue Outdated Show resolved Hide resolved
components/rmrk/Create/CreateCollection.vue Outdated Show resolved Hide resolved
components/rmrk/Create/CreateCollection.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

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

Why is this only available for rmrk Create collection? and it link towards AssetHub (Statemine) doc?

Comment on lines 54 to 59
<a
v-safe-href="
'https://hello.kodadot.xyz/multi-chain/fees/assethub-fees#polkadot-asset-hub-fees-prev.-statemint'
"
>Learn more</a
>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<a
v-safe-href="
'https://hello.kodadot.xyz/multi-chain/fees/assethub-fees#polkadot-asset-hub-fees-prev.-statemint'
"
>Learn more</a
>
<a
v-safe-href="
https://hello.kodadot.xyz/multi-chain/fees/assethub-fees#polkadot-asset-hub-fees-prev.-statemint
"
>Learn more</a
>

missing translation helper.learnMore

Copy link
Contributor Author

@pbkompasz pbkompasz Aug 21, 2023

Choose a reason for hiding this comment

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

Where should the 'Learn more' link to for /bsx?

Copy link
Contributor

Choose a reason for hiding this comment

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

Depends on the chain (urlPrefix) you're on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

urlPrefix has the following type Prefix = 'bsx' | 'glmr' | 'rmrk' | 'movr' | 'ksm' | 'snek' | 'ahk' | 'dot' | 'ahp';
Each one has a different deposit value?

Copy link
Contributor

Choose a reason for hiding this comment

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

Each one has a different deposit value?

Yes, maybe bsx & snek has the same, I think it can be fetched through polkadot api package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The values should be fetched from the API or kept in the constants.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I use this?

export function getclassDeposit(api: ApiPromise): bigint {

locales/en.json Outdated
@@ -35,6 +35,7 @@
"facts": "Facts",
"computed id": "Computed id",
"create collection": "Create Collection",
"not enough funds": "Not Enough Funds",
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate of confirmPurchase.notEnoughFuns

components/rmrk/Create/CreateCollection.vue Outdated Show resolved Hide resolved
locales/en.json Outdated Show resolved Hide resolved
Comment on lines 171 to 177
a {
@include ktheme() {
color: theme('k-blue') !important;
}
text-decoration: underline;
white-space: nowrap;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... even on scoped component this can be smelly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem here is styling directly the a tag?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes there could be side effects If we'll use another a tag on this component


export interface Props {
disabled?: boolean
expanded?: boolean
disabledIcon?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't you just check if there is icon prop behing passed?
something like:

const hasIcon = computed(() => +props.icon)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That wouldn't work because it has a default value (paper-plane). Should I remove the default value, but that might break functionality on other pages.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we'll keep this icon on all submit button in app, might be time to remove it.

@reviewpad reviewpad bot added medium Pull request is medium and removed small Pull request is small labels Aug 21, 2023
components/base/SubmitButton.vue Outdated Show resolved Hide resolved
components/bsx/Create/CreateCollection.vue Outdated Show resolved Hide resolved
components/rmrk/Create/CreateCollection.vue Outdated Show resolved Hide resolved
components/shared/CollectionDeposit.vue Outdated Show resolved Hide resolved
Comment on lines 30 to 31
? 'https://hello.kodadot.xyz/multi-chain/fees/assethub-fees#polkadot-asset-hub-fees-prev.-statemint'
: 'https://hello.kodadot.xyz/multi-chain/fees/assethub-fees#polkadot-asset-hub-fees-prev.-statemint?'
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on previous comments I was under the impression that there should be a different link based on urlPrefix.
Is that correct? Can you also confirm what the links should be?

Copy link
Contributor

Choose a reason for hiding this comment

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

This link is for Ahk & Ahb prefix
for the other one it looks like the page havn't been written, maybe @yangwao can help?

Comment on lines 25 to 27
const token = urlPrefix.value.toUpperCase()
const requiredAmount =
token === 'KSM' ? COLLECTION_DEPOSIT_KSM : COLLECTION_DEPOSIT_BSX
Copy link
Contributor

Choose a reason for hiding this comment

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

check out assets page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/bsx 3 tokens and /snek shows 2. Which one is correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

the one that you've set ie https://beta.kodadot.xyz/bsx/assets/

@exezbcz
Copy link
Member

exezbcz commented Aug 22, 2023

image
  • from the UI point of view, there should be an info icon, and the text inside button should be 16px

@prury
Copy link
Member

prury commented Aug 22, 2023

  • RMRK1 showing that you need to have the RMRK token, but you need KSM.
    image

  • The learn more button always redirect to the same Asset Hub Page on our docs, it should lead to the equivalent one in the chain you are:
    image

  • @exezbcz maybe we should add a similar info when creating NFT aswell? lmk, i can open another issue for that

@prury prury added the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Aug 22, 2023
@codeclimate
Copy link

codeclimate bot commented Aug 22, 2023

Code Climate has analyzed commit 12f1a84 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Aug 22, 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 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@exezbcz
Copy link
Member

exezbcz commented Aug 22, 2023

  • @exezbcz maybe we should add a similar info when creating NFT aswell? lmk, i can open another issue for that

I think these things should be included in:

@prury
Copy link
Member

prury commented Aug 24, 2023

how's this one? both assets hubs still missing the required amount message, right?

@yangwao
Copy link
Member

yangwao commented Aug 29, 2023

@prury
Copy link
Member

prury commented Aug 30, 2023

Closing this one because no response and PR above prob solves it, can be reopened later if needed.

@prury prury closed this Aug 30, 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 S-changes-requested-🤞 PR is almost good to go, just some fine tunning waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display the deposit required to create a collection
7 participants