Skip to content

Commit

Permalink
feat: set page title to project or dataset title (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
cramakri committed Jun 14, 2022
1 parent 01e6d07 commit 4216077
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 20 deletions.
176 changes: 156 additions & 20 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"react-collapse": "^5.0.0",
"react-cookie-consent": "^5.2.0",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-js-pagination": "^3.0.2",
"react-katex": "^2.0.2",
"react-markdown": "^8.0.3",
Expand Down
4 changes: 4 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

import React, { Component, Fragment } from "react";
import { Helmet } from "react-helmet";
import { Route, Switch } from "react-router-dom";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
Expand Down Expand Up @@ -72,6 +73,9 @@ function CentralContentContainer(props) {

return <div className="container-xxl pt-4 mt-2 renku-container">
<AppContext.Provider value={appContext}>
<Helmet>
<title>Reproducible Data Science | Open Research | Renku</title>
</Helmet>
<Switch>
<Route exact path="/login" render={
p => <Login key="login" {...p} {...props} />} />
Expand Down
7 changes: 7 additions & 0 deletions client/src/dataset/Dataset.present.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import React, { useState } from "react";
import { Helmet } from "react-helmet";
import {
Button, Card, CardBody, CardHeader, Col, DropdownItem, DropdownMenu, DropdownToggle, Row,
Table, UncontrolledButtonDropdown, Badge
Expand Down Expand Up @@ -336,6 +337,12 @@ export default function DatasetView(props) {

return <Col>
<ErrorAfterCreation location={props.location} dataset={dataset} />
{
props.insideProject ? null :
<Helmet>
<title>{dataset.title || dataset.name}</title>
</Helmet>
}
<Row>
<Col md={8} sm={12}>
{props.insideProject ?
Expand Down
Loading

0 comments on commit 4216077

Please sign in to comment.