make new resource markdown (resource migration 2/3)#73
make new resource markdown (resource migration 2/3)#73
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/idea-board into feature/resource-query
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/idea-board into feature/resource-query
…eature/resource-query
…/idea-board into migrate-resources-1
There was a problem hiding this comment.
Pull request overview
This PR is part of the ongoing migration to a single unified Resource collection by introducing new /resource markdown entries and updating the /resource index page to query and display resources bucketed by type.
Changes:
- Added multiple new resource markdown files under
src/pages/resource/(software tools, datasets, cell lines). - Updated
src/pages/resource/index.tsxto queryallResourceby type buckets using new GraphQL fragments. - Added resource-type constants and expanded GraphQL fragments/schema to support protocol file resources (
filefield).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/resource/index.tsx | Buckets resources by type and renders grouped lists (Software/Datasets/Cell Lines/Protocols). |
| src/graphql/fragments.ts | Splits Resource fragments by resource type and adds a composite ResourceFields fragment. |
| src/constants/resourceTypes.ts | Introduces shared string constants for resource types. |
| src/cms/widgets/VariableResourceWidget/constants.ts | Switches widget type values to use RESOURCE_TYPES constants. |
| gatsby/schema/base.gql | Adds file: String to the Resource GraphQL type. |
| src/pages/resource/*.md | Adds new unified resource-template markdown entries. |
| src/pages/ideas/*.md | Updates idea posts to reference the new resources via frontmatter.resources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
src/pages/resource/60x-timelapse-images-of-tagged-lines-after-emt-sandwich-dataset.md
Outdated
Show resolved
Hide resolved
…igrate-resources-1
✅ Deploy Preview for project-idea-board ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
src/pages/resource/index.tsx
Outdated
| )} | ||
| </li> | ||
| ))} | ||
| {protocolFileResources?.nodes.map((node) => ( |
There was a problem hiding this comment.
I think a way to make this cleaner is to have an object that has the keys and the titles for each resource type that you then map over and call a single render function that creates the JSX since this is so much repeated code
There was a problem hiding this comment.
Will push that change, could also just delete this, I'm really not married to this long term
| ...DatasetResourceFields | ||
| } | ||
| } | ||
| softwareResources: allResource( |
There was a problem hiding this comment.
similar to my comment above can you make these keys instead of strings
There was a problem hiding this comment.
These need to be static like this due to graphql limitations, the other option here would be to query all fields en masse and the filter in the javascript, but I thought this was more fun and I was learning about fragments.
…emt-sandwich-dataset.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Problem
Advances #40
Due to largeness, I split this PR:
#72
I'm requesting the same reviewers and I see these as a single feature that should be merged together.
We are migrating from multiple resource type collections, to a single resource collection.
Solution
This PR:
/resourcegraphqlfragments to query bucketed resources inresource/index.tsxtemplateKeysin non-gatsby TS code (can't use TS/JS constants inside thegraphql, even in react files