Skip to content

Commit

Permalink
Add "Data updated" date to byline
Browse files Browse the repository at this point in the history
This seems like important information that shouldn't only be buried at
the bottom of the page.

Keep the existing text at the bottom for users who are used to finding
it there.

Suggested by @joverlee521.
  • Loading branch information
victorlin committed Oct 20, 2023
1 parent 3f51ffa commit 8bcbe1a
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 8bcbe1a

Please sign in to comment.