Skip to content

Commit

Permalink
ui: add noarchive meta tag to all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
karolina-siemieniuk-morawska committed May 30, 2024
1 parent 9e25c9a commit 7aab90e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
1 change: 1 addition & 0 deletions ui/src/common/components/DocumentHead.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class DocumentHead extends Component {
<title>{title} - INSPIRE</title>
{description && <meta name="description" content={description} />}
{children}
<meta name="robots" content="noarchive" />
</Helmet>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ exports[`DocumentHead renders with only title 1`] = `
Jessica Jones
- INSPIRE
</title>
<meta
content="noarchive"
name="robots"
/>
</HelmetWrapper>
`;

Expand All @@ -29,5 +33,9 @@ exports[`DocumentHead renders with title, description and children 1`] = `
content="Page Title"
name="citation_title"
/>
<meta
content="noarchive"
name="robots"
/>
</HelmetWrapper>
`;
39 changes: 23 additions & 16 deletions ui/src/holdingpen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,32 @@ import {
HOLDINGPEN_SEARCH,
} from '../common/routes';
import SafeSwitch from '../common/components/SafeSwitch';
import DocumentHead from '../common/components/DocumentHead';

const META_DESCRIPTION = 'Tool for curators to manage submissions and harvests';
const TITLE = 'Holdingpen';

const Holdingpen = () => {
return (
<div className="w-100" data-testid="holdingpen">
<SafeSwitch>
<Redirect exact from={HOLDINGPEN} to={HOLDINGPEN_DASHBOARD} />
<Route exact path={HOLDINGPEN_DASHBOARD} component={DashboardPage} />
<Route
exact
path={`${HOLDINGPEN_SEARCH}`}
component={SearchPageContainer}
/>
<Route
exact
path={`${HOLDINGPEN}/:id`}
component={DetailPageContainer}
/>
</SafeSwitch>
</div>
<>
<DocumentHead title={TITLE} description={META_DESCRIPTION} />
<div className="w-100" data-testid="holdingpen">
<SafeSwitch>
<Redirect exact from={HOLDINGPEN} to={HOLDINGPEN_DASHBOARD} />
<Route exact path={HOLDINGPEN_DASHBOARD} component={DashboardPage} />
<Route
exact
path={`${HOLDINGPEN_SEARCH}`}
component={SearchPageContainer}
/>
<Route
exact
path={`${HOLDINGPEN}/:id`}
component={DetailPageContainer}
/>
</SafeSwitch>
</div>
</>
);
};

Expand Down

0 comments on commit 7aab90e

Please sign in to comment.