Skip to content

Commit

Permalink
Merge pull request #2985 from effigies/fix/list-metadata-lists
Browse files Browse the repository at this point in the history
FIX: Display metadata lists as unordered lists
  • Loading branch information
nellh authored Feb 8, 2024
2 parents 2d9dcc7 + e3b17e6 commit 94af3ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ OCI-1131441 (R. Poldrack, PI) in any publications.
>
Funding
</h2>
<ul />
</div>
<div
class="dataset-meta-block dmb-list"
Expand All @@ -1297,6 +1298,7 @@ OCI-1131441 (R. Poldrack, PI) in any publications.
>
References and Links
</h2>
<ul />
</div>
<div
class="dataset-meta-block dmb-list"
Expand All @@ -1306,6 +1308,7 @@ OCI-1131441 (R. Poldrack, PI) in any publications.
>
Ethics Approvals
</h2>
<ul />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import { Markdown } from "../../utils/markdown"

export interface MetaDataListBlockProps {
heading: string
Expand All @@ -17,7 +18,15 @@ export const MetaDataListBlock = ({
return (
<div className={"dataset-meta-block " + className}>
<h2 className="dmb-heading">{heading}</h2>
{fieldContent}
<ul>
{Array.isArray(fieldContent)
? fieldContent.map((item, index) => (
<li key={index}>
<Markdown>{item}</Markdown>
</li>
))
: item}
</ul>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DatasetGitAccess } from "./components/DatasetGitAccess"
import { DatasetHeader } from "./components/DatasetHeader"
import { DatasetTools } from "./components/DatasetTools"
import { MetaDataBlock } from "./components/MetaDataBlock"
import { MetaDataListBlock } from "./components/MetaDataListBlock"
import { ModalitiesMetaDataBlock } from "./components/ModalitiesMetaDataBlock"
import { ValidationBlock } from "./components/ValidationBlock"
import { VersionList } from "./components/VersionList"
Expand Down Expand Up @@ -316,19 +317,19 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
heading="How to Acknowledge"
item={description.HowToAcknowledge}
/>
<MetaDataBlock
<MetaDataListBlock
heading="Funding"
item={description.Funding}
className="dmb-list"
/>

<MetaDataBlock
<MetaDataListBlock
heading="References and Links"
item={description.ReferencesAndLinks}
className="dmb-list"
/>

<MetaDataBlock
<MetaDataListBlock
heading="Ethics Approvals"
item={description.EthicsApprovals}
className="dmb-list"
Expand Down

0 comments on commit 94af3ad

Please sign in to comment.