Skip to content

Commit

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

Suggested by @joverlee521.
  • Loading branch information
victorlin committed Oct 20, 2023
1 parent 3f51ffa commit 21ddfc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/components/framework/fine-print.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@ class FinePrint extends React.Component {
return false;
}

getUpdated() {
const { t } = this.props;
if (this.props.metadata.updated) {
return (<span>{t("Data updated")} {this.props.metadata.updated}</span>);
}
return null;
}
downloadDataButton() {
const { t } = this.props;
return (
Expand All @@ -97,8 +90,6 @@ class FinePrint extends React.Component {
<FinePrintStyles>
<div style={{width: width}}>
<Flex className='finePrint'>
{this.getUpdated()}
{dot}
{this.downloadDataButton()}
{dot}
{"Auspice v" + version}
Expand Down
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 21ddfc8

Please sign in to comment.