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

Hide empty collection on users profile #1367

Closed
1 task done
Tracked by #2650 ...
onerawartist opened this issue Dec 2, 2021 · 22 comments · Fixed by #2705
Closed
1 task done
Tracked by #2650 ...

Hide empty collection on users profile #1367

onerawartist opened this issue Dec 2, 2021 · 22 comments · Fixed by #2705
Labels
A-explorer A-profile related to profile section A-search related to search components bug Something isn't working FAQ

Comments

@onerawartist
Copy link

What happened?

i used ( extra > Admin panel ) to consume the collection i created by mistake but its still here:

https://nft.kodadot.xyz/rmrk/collection/FC77C33AB229A2056A-THECUBE
all the nfts in it are gone, but it is still shown in my profile

Please reproduce in steps

/

Expected Behavior

to not be shown in my profile

What browsers are you seeing the problem on?

Chrome

Are you logged in?

Yes

At which address did you encounter bug?

nft.kodadot.xyz / kodadot.xyz

Screenshots

admin


admin 2

Relevant log output

/

Code of Conduct

  • I agree to follow this project's Code of Conduct
@onerawartist onerawartist added the bug Something isn't working label Dec 2, 2021
@onerawartist
Copy link
Author

the collection doesn't show up in ( extra > Admin panel ), but its still there in my profile when i see " collections "

@onerawartist
Copy link
Author

when i visited my profile through singular i don't see the collection i removed using Admin panel

singular

@vikiival
Copy link
Member

vikiival commented Dec 2, 2021

Hey, according to the implementation standards of RMRK you cannot delete the collection.

the collection doesn't show up

We do not want to show people empty collections in admin panel (as you can't do any action)

@vikiival vikiival added the FAQ label Dec 2, 2021
@onerawartist
Copy link
Author

@vikiival im not saying there's something wrong with admin panel,
I created a collection , added some nfts in it
Then i used the admin panel to consume the nfts,
The result should be: the empty collection not showing up in my profile.
There must be a hack around , to hide collections when they become empty

@onerawartist
Copy link
Author

I don't want all the tutorials showing up in my profile in the future.
Change the option in profiles , to only show a collection if it has an nft in it or more.
And stay invisible if its empty
@vikiival @yangwao

@onerawartist
Copy link
Author

kodadot
singular

@onerawartist
Copy link
Author

kodadot shows the empty collection, while singular don't, i really think you should add feature to kodadot

@vikiival vikiival changed the title i used ( extra > Admin panel ) to consume the collection i created by mistake but its still here Hide empty collection on users profile Dec 2, 2021
@roiLeo
Copy link
Contributor

roiLeo commented Dec 3, 2021

#1357 related

@onerawartist
Copy link
Author

onerawartist commented Dec 5, 2021

@yangwao , can't we try to fix this one first? then work on #1357 . because this looks like a simple thing to do, to just hide the empty collections ?

@kkukelka
Copy link
Member

kkukelka commented Dec 5, 2021

this can only be solved on the api-level through rewriting the respective resolver for the "collectionListWithSearch" query, since graphql queries cant filter out items with empty arrays in one of their properties

Screenshot 2021-12-05 at 18 52 12

@vikiival
Copy link
Member

vikiival commented Dec 6, 2021

Ref kodadot/magick#11

@onerawartist
Copy link
Author

@vikiival @yangwao
can you also hide the number of the consumed nfts , from the collection statistics ?
i removed most of the nfts , because you guys added the thumbnail option, so i burned all my nfts , and minted them again, but when the statistics are shown like that , it gives bad image to the collection and to me

01

@onerawartist
Copy link
Author

Hide empty collections and hide consumed nfts from collection statistics

@onerawartist
Copy link
Author

@vikiival @yangwao i'm hating how my profile is looking :( , when can we get this feature ?

@yangwao
Copy link
Member

yangwao commented Jan 3, 2022

Hey, according to the implementation standards of RMRK you cannot delete the collection.

the collection doesn't show up

We do not want to show people empty collections in admin panel (as you can't do any action)

Well, you mean floating RMRK standard, yah? :D

I mean, let's add KODA::HIDE or something like that! :) later we can evolve into zkHIDE ;D

@onerawartist
Copy link
Author

im still waiting for this to be solved because i hate how my profile looks right now lol , its a mess.

@yangwao @vikiival @XyloDrone @kkukelka please help

@XyloDrone
Copy link

Explorer has been redesigned, profile in the works, landing page is a priority atm :)

@XyloDrone XyloDrone added A-search related to search components A-profile related to profile section A-explorer labels Mar 23, 2022
@vikiival
Copy link
Member

As @XyloDrone asked me if we could do that asap @roiLeo opened issue months ago

@vikiival
Copy link
Member

So the correct answer for this issue is:

  1. Rework query from SubQuery to Subsquid (made for you)
    **PLEASE NOTE THAT THIS NEW QUERY HAS TO GO UNDER queries/rmrk/subsquid directory.
query collectionListByAccount($account: String!, $first: Int!, $offset: Int) {
  collectionEntities(where: {issuer_eq: $account, nfts_some: {}}, orderBy: blockNumber_DESC, limit: $first, offset: $offset) {
    ...collection
    ...collectionDetails
  }
}
  1. change client from SubQuery to SubSquid
    in ProfileDetail.vue line 318 change the value to subsquid
  2. updated handleCollectionResult accordingly

I heard @Jarsen136 wanted to pick that up :)

@Jarsen136
Copy link
Contributor

So the correct answer for this issue is:

  1. Rework query from SubQuery to Subsquid (made for you)
    **PLEASE NOTE THAT THIS NEW QUERY HAS TO GO UNDER queries/rmrk/subsquid directory.
query collectionListByAccount($account: String!, $first: Int!, $offset: Int) {
  collectionEntities(where: {issuer_eq: $account, nfts_some: {}}, orderBy: blockNumber_DESC, limit: $first, offset: $offset) {
    ...collection
    ...collectionDetails
  }
}
  1. change client from SubQuery to SubSquid
    in ProfileDetail.vue line 318 change the value to subsquid
  2. updated handleCollectionResult accordingly

I heard @Jarsen136 wanted to pick that up :)

Well, I will have a try later!

@Jarsen136
Copy link
Contributor

query collectionListByAccount($account: String!, $first: Int!, $offset: Int) {
  collectionEntities(where: {issuer_eq: $account, nfts_some: {}}, orderBy: blockNumber_DESC, limit: $first, offset: $offset) {
    ...collection
    ...collectionDetails
  }
}

this Subsquid seem not works well as it return all collections including the one with consumed nfts.
I think we need to do some change on nfts_some: {}
Could you give me some help? @vikiival

I test it on the account: /rmrk/u/JHMAL5CyvxWc3Ud42QxRUTpSnUa4m56mRSzPK69d1TU8NG7?tab=collection
request payload:
image
responce:
image

@vikiival
Copy link
Member

vikiival commented Mar 28, 2022

Good catch!

query collectionListByAccount($account: String!, $first: Int!, $offset: Int) {
  collectionEntities(where: {issuer_eq: $account, nfts_some: { burned_eq: false }}, orderBy: blockNumber_DESC, limit: $first, offset: $offset) {
    ...collection
    ...collectionDetails
  }
}

also do not be confused with max: 0 it means that the collection is infinite :) (B ❤️ PHP)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-explorer A-profile related to profile section A-search related to search components bug Something isn't working FAQ
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants