Skip to content

Commit

Permalink
refactor: update RecordVersionsList to enhance version display and ti…
Browse files Browse the repository at this point in the history
…mestamp
  • Loading branch information
corovcam committed Feb 15, 2025
1 parent 9c052b3 commit 3742a6f
Showing 1 changed file with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const deserializeRecord = (record) => ({
id: record.id,
parent: record?.parent,
parent_id: record?.parent?.id,
publication_date: record?.ui?.publication_date_l10n_medium,
publication_date: record.metadata?.dateIssued,
version: record?.versions?.index,
version_note: record.metadata?.version,
links: record.links,
pids: record?.metadata.objectIdentifiers,
new_draft_parent_doi: record?.ui?.new_draft_parent_doi,
Expand All @@ -32,24 +33,36 @@ const RecordVersionItem = ({ item, activeVersion }) => {
return (
<List.Item key={item.id} {...(activeVersion && { className: "version active" })}>
<List.Content floated="left">
{activeVersion ? (
<span className="text-break">
{i18next.t("Version {{- version}}", { version: item.version })}
</span>
) : (
<a href={`/docs/${item.id}`} className="text-break">
{i18next.t("Version {{- version}}", { version: item.version })}
</a>
)}

{doi && (
<a
href={`https://doi.org/${doi}`}
className={"doi" + (activeVersion ? " text-muted-darken" : " text-muted")}
>
{doi}
</a>
)}
<List.Header>
{activeVersion ? (
<span className="text-break">
{i18next.t("Version {{- version}}", { version: item.version })}
</span>
) : (
<a href={`/docs/${item.id}`} className="text-break">
{i18next.t("Version {{- version}}", { version: item.version })}
</a>
)}
</List.Header>

<List.Description>
{doi && (
<div>
DOI:{" "}
<a
href={`https://doi.org/${doi}`}
className={"doi" + (activeVersion ? " text-muted-darken" : " text-muted")}
>
{doi}
</a>
</div>
)}
{item.version_note && (
<div>
{item.version_note}
</div>
)}
</List.Description>
</List.Content>

<List.Content floated="right">
Expand Down

0 comments on commit 3742a6f

Please sign in to comment.