-
Notifications
You must be signed in to change notification settings - Fork 9
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: add pinnedIds to useProjectsWithOrders #2191
Conversation
✅ Deploy Preview for regen-website ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@erikalogie You can check the featured projects change here: https://deploy-preview-2191--regen-marketplace.netlify.app/ |
Looks great! |
netlify.toml
Outdated
@@ -41,7 +41,7 @@ | |||
NEXT_PUBLIC_INTERCOM_APP_ID = "kn5di10s" | |||
|
|||
[context.deploy-preview.environment] | |||
VITE_SANITY_TAG = "default" | |||
VITE_SANITY_TAG = "pinned-projects" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporarily set this to a specific graphql endpoint tag so it doesn't interfere with other work
will need to set it back to default before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to reverse this and deploy graphql to staging default
@@ -35,6 +38,7 @@ export interface ProjectsWithOrdersProps { | |||
projectId?: string; // to filter by project | |||
skippedProjectId?: string; // to discard a specific project | |||
classId?: string; // to filter by class | |||
pinnedIds?: string[]; // list of on-chain id, uuid or slug to pinned at the top |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the pinned project if I provide a slug or uuid, looks like it might not be handled yet here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's most likely because the project you tried to pin was not approved or published. We're using the following hook to get off-chain projects there.
Also, note that slug takes precedent over uuid: https://github.com/regen-network/regen-web/blob/dev/web-marketplace/src/lib/normalizers/projects/normalizeProjectsWithMetadata.ts#L85-L90
Could probably fix that by adding a uuid
or offchainId
in the normalizedObject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried with "woodburn" as slug which is both published and approved (see data on sanity staging)
postgres=> select approved, published from project where slug='woodburn';
approved | published
----------+-----------
t | t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a fix for the last part mentioned above here: 0ac4071
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blushi There was an in the commit I made earlier, which I just fixed. Also, I stopped relying on the name
field and created separate ones for both uuid
and slug
this should ensure consistent results. Woodburn is now correctly pinned here: https://deploy-preview-2191--regen-marketplace.netlify.app/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I guess that might be due to the projects on chain pagination limit...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because this project is neither returned by the on-chain projects hooks (beyond the 100 projects current limitation) or the off-chain projects hooks (since it has an on-chain id).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I figured, I'll create an issue to track the on chain queries pagination default limit related work, I guess one solution would be to query for all the pages to make sure we get all projects or credit classes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the modification to use the slug whenever available here: c64154f
c64154f
to
c4db783
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
netlify.toml
Outdated
@@ -41,7 +41,7 @@ | |||
NEXT_PUBLIC_INTERCOM_APP_ID = "kn5di10s" | |||
|
|||
[context.deploy-preview.environment] | |||
VITE_SANITY_TAG = "default" | |||
VITE_SANITY_TAG = "pinned-projects" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to reverse this and deploy graphql to staging default
Description
Closes: regen-network/rnd-dev-team#1811
Needs: regen-network/regen-sanity#49
Add the possibility to pin projects to the featured projects section on the registry homepage.
useProjectsWithOrders
now accepts apinnedIds
prop to enable this feature.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
How to test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...