Skip to content

Commit

Permalink
Merge pull request #1715: Add "Data updated" date to byline
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored Oct 20, 2023
2 parents 3f51ffa + 8bcbe1a commit ba7e1c2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/info/byline.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Byline extends React.Component {
{renderAvatar(t, this.props.metadata)}
{renderBuildInfo(t, this.props.metadata)}
{renderMaintainers(t, this.props.metadata)}
{renderDataUpdated(t, this.props.metadata)}
{renderDataProvenance(t, this.props.metadata)}
</>
);
Expand Down Expand Up @@ -101,6 +102,20 @@ function renderMaintainers(t, metadata) {
return null;
}

/**
* Returns a React component detailing the date the data was last updated.
* Renders a <span> containing "Data updated X", where X derives from `metadata.updated`
*/
function renderDataUpdated(t, metadata) {
if (metadata.updated) {
return (
<span>
{`${t("Data updated")} ${metadata.updated}. `}
</span>
);
}
return null;
}

/**
* Returns a React component detailing the data provenance of the build (pipeline).
Expand Down

0 comments on commit ba7e1c2

Please sign in to comment.