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: edit collection permission #11217

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Jarsen136
Copy link
Contributor

@Jarsen136 Jarsen136 commented Dec 5, 2024

Thank you for your contribution to the Koda - Generative Art Marketplace.

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

PR Type

  • Feature

Needs QA check

  • @kodadot/qa-guild please review

Context

Screenshot 📸

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

ref: https://wiki.polkadot.network/docs/learn-nft-pallets

@Jarsen136 Jarsen136 requested a review from a team as a code owner December 5, 2024 13:34
@Jarsen136 Jarsen136 requested review from preschian and hassnian and removed request for a team December 5, 2024 13:34
Copy link

netlify bot commented Dec 5, 2024

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit ecd38e1
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/6759747186915e0008f4810e
😎 Deploy Preview https://deploy-preview-11217--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.

@Jarsen136 Jarsen136 requested a review from vikiival December 5, 2024 13:34
@vikiival
Copy link
Member

vikiival commented Dec 5, 2024

Please use normal price input

Screenshot 2024-12-05 at 16 00 05
Screenshot 2024-12-05 at 15 59 49

@Jarsen136
Copy link
Contributor Author

Please use normal price input

✅ Updated

Copy link
Member

@preschian preschian left a comment

Choose a reason for hiding this comment

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

nice, lgtm


<div>
<div class="flex justify-between">
<p>{{ $t('mint.collection.permission.noPriceSet') }}</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

after setting a price this did not change

CleanShot 2024-12-06 at 14 36 43@2x

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. This text will be changed after toggling.

Comment on lines 88 to 96
watchEffect(async () => {
const { apiInstance } = useApi()
const api = await apiInstance.value
const config = await api.query.nfts.collectionConfigOf(collectionId)
const mintSettings = (config.toHuman() as { mintSettings: CollectionMintSetting }).mintSettings
mintSettings.price = mintSettings.price?.replaceAll(',', '')
collectionPermissionSettings.value = mintSettings
})
Copy link
Contributor

Choose a reason for hiding this comment

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

since this was added lets disable the edit collection button if !collectionMetadata

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

}

const COLLECTION_MINTING_TYPES_OPTIONS = ['Issuer', 'Public', 'HolderOf'].map(type => ({ value: type as CollectionMintSettingType, text: type }))
Copy link
Contributor

@hassnian hassnian Dec 6, 2024

Choose a reason for hiding this comment

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

maybe ?

Suggested change
const COLLECTION_MINTING_TYPES_OPTIONS = ['Issuer', 'Public', 'HolderOf'].map(type => ({ value: type as CollectionMintSettingType, text: type }))
const COLLECTION_MINTING_TYPES_OPTIONS = (['Issuer', 'Public', 'HolderOf'] as CollectionMintSettingType[] ).map(type => ({ value: type, text: type }))

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

Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

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

~ incorrect impl

  1. It does not make sense to have issuer & price :) (will you pay for yourself?)

  2. Setting public & set price > 0 means that you wont be able to mint on koda
    2.1 Warning that setting public will allow anyone to mint into your collection

  3. Holder of is missing search input where user can select which collection is eligible.
    3.1 Warning that by setting type to holder of user wont be able to mint on koda

Screenshot 2024-12-07 at 22 37 21

@Jarsen136
Copy link
Contributor Author

~ incorrect impl

  1. It does not make sense to have issuer & price :) (will you pay for yourself?)
  2. Setting public & set price > 0 means that you wont be able to mint on koda
    2.1 Warning that setting public will allow anyone to mint into your collection
  3. Holder of is missing search input where user can select which address is eligible.
    3.1 Warning that by setting type to holder of user wont be able to mint on koda

Thanks for providing more details.

A question about the holderOf type. You're talking about the address search input. Shouldn't it be an input of collection id? With this collection id, we could know if the user is the holder of collection A and is eligible to mint nft on collection B.
image

@vikiival
Copy link
Member

vikiival commented Dec 8, 2024

A question about the holderOf type. You're talking about the address search input. Shouldn't it be an input of collection id?

Yes, you are completely right, I apologize for my mistake. (I have edited the comment)

I meant

 search input where user can select which collection is eligible

Why search input?

Well if you take it from perspective of artist / @JustLuuuu they have no idea what collection Id is. (example https://koda.art/ahp/collection/258)
They do not know that this collection has id 258, but they do know that collection is called ANOMALY ^-^

@JustLuuuu
Copy link
Member

I know what a collection ID is! But its true that artists don't know it 😂

@Jarsen136
Copy link
Contributor Author

~ incorrect impl

  1. It does not make sense to have issuer & price :) (will you pay for yourself?)
  2. Setting public & set price > 0 means that you wont be able to mint on koda
    2.1 Warning that setting public will allow anyone to mint into your collection
  3. Holder of is missing search input where user can select which collection is eligible.
    3.1 Warning that by setting type to holder of user wont be able to mint on koda

Updated

image image image image

@hassnian
Copy link
Contributor

hassnian commented Dec 11, 2024

no price has been set but i can still submit, if the switch is not meant to be clickable we should hide it

CleanShot 2024-12-11 at 16 10 01@2x

after pressing save changes

CleanShot 2024-12-11 at 16 11 44@2x

Copy link

sonarcloud bot commented Dec 11, 2024

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.

Collection Edit: Support Permissions Update
5 participants