-
Notifications
You must be signed in to change notification settings - Fork 0
use local file or url for protocols #39
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
base: main
Are you sure you want to change the base?
Changes from all commits
3007636
950eb8b
2d362b2
46b40d3
41f6a46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,13 +48,21 @@ exports.createSchemaCustomization = ({ actions, schema }) => { | |
| """ | ||
| type MaterialsAndMethods { | ||
| dataset: MarkdownRemark @link(by: "frontmatter.name") | ||
| protocols: [ProtocolItem!]! | ||
| protocols: [Protocol!]! | ||
| cellLines: [CellLineItem!]! | ||
| software: [SoftwareTool!]! | ||
| } | ||
|
|
||
| type ProtocolItem { | ||
| protocol: String! | ||
| """ | ||
| The front end and CMS assume that you enter EITHER a url OR a file which | ||
| this type doesn't strictly enforce. Directly entering data into markdown | ||
| with both fields populated may lead to unexpected behavior. | ||
| """ | ||
| type Protocol @dontInfer { | ||
| type: String! | ||
| name: String! | ||
| url: String | ||
| file: File @fileByRelativePath | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and the query are where I think we could get a little more into the weeds with |
||
| } | ||
|
|
||
| type CellLineItem { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,8 +27,12 @@ preliminaryFindings: | |||||
| materialsAndMethods: | ||||||
| dataset: Released EMT dataset | ||||||
| protocols: | ||||||
| # - protocol: /protocols/emt_junction_segmentation.pdf | ||||||
| # - protocol: /protocols/emt_tracking_qc.pdf | ||||||
| - type: protocolLink | ||||||
| name: Culture And Freezing Methods | ||||||
| url: https://cell-catalog.allencell.org/pdf/AICS_WTC_cell_culture_protocol.pdf | ||||||
| - type: protocolFile | ||||||
| name: Cell culture protocol | ||||||
| file: /img/cell_culture_protocol.pdf | ||||||
|
Comment on lines
+30
to
+35
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type field is created by Decap when you use a variable type widget.
|
||||||
| file: /img/cell_culture_protocol.pdf | |
| file: img/cell_culture_protocol.pdf |
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.
Not sure about this, it's working as is, and its the same way the img file path for the banner was written.
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.
In the CMS config,
protocolsis markedrequired: false, but the schema declaresprotocols: [Protocol!]!(non-null). If a markdown entry omitsmaterialsAndMethods.protocols, Gatsby schema/query resolution can fail at build time. Consider making this field nullable (e.g.,[Protocol!]) or making the CMS field required so the data always exists.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.
We have a resolver to handle this case and provide an empty array in that case.