From 29a0d92e03c82127d7b3682310ad334a6a8f9491 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Sat, 13 Oct 2018 01:05:10 -0300 Subject: [PATCH 1/3] Add classname to browser title --- package.json | 3 ++- src/dashboard/Data/Browser/Browser.react.js | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a813acde5e..45e977641e 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,8 @@ "json-file-plus": "3.2.0", "package-json": "5.0.0", "passport": "0.4.0", - "passport-local": "1.0.0" + "passport-local": "1.0.0", + "react-document-title": "2.0.3" }, "devDependencies": { "@babel/core": "7.2.2", diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index f57f5bfadf..5a90949593 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -33,6 +33,7 @@ import styles from 'dashboard/Data/Browser/Browser.s import subscribeTo from 'lib/subscribeTo'; import * as ColumnPreferences from 'lib/ColumnPreferences'; import * as queryString from 'query-string'; +import DocumentTitle from 'react-document-title'; export default @subscribeTo('Schema', 'schema') @@ -851,6 +852,11 @@ class Browser extends DashboardView { }, 3500); } + title() { + const { className } = this.props.params; + return `${className} - Parse Dashboard`; + } + renderContent() { let browser = null; let className = this.props.params.className; @@ -1042,11 +1048,13 @@ class Browser extends DashboardView { ); } return ( -
- {browser} - {notification} - {extras} -
+ +
+ {browser} + {notification} + {extras} +
+
); } } From 393bb65f9ee81aa356a3c45e86a9567d9b16c1ec Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Sat, 13 Oct 2018 14:48:21 -0300 Subject: [PATCH 2/3] Change to react-helmet --- package.json | 2 +- src/dashboard/Dashboard.js | 8 +++++-- src/dashboard/Data/Browser/Browser.react.js | 23 +++++++++------------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 45e977641e..22dec36b7a 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "package-json": "5.0.0", "passport": "0.4.0", "passport-local": "1.0.0", - "react-document-title": "2.0.3" + "react-helmet": "5.2.0" }, "devDependencies": { "@babel/core": "7.2.2", diff --git a/src/dashboard/Dashboard.js b/src/dashboard/Dashboard.js index c6530d170d..e48e93cd1a 100644 --- a/src/dashboard/Dashboard.js +++ b/src/dashboard/Dashboard.js @@ -53,6 +53,7 @@ import { } from 'react-router'; import { Route, Redirect } from 'react-router-dom'; import createClass from 'create-react-class'; +import { Helmet } from 'react-helmet'; const ShowSchemaOverview = false; //In progress features. Change false to true to work on this feature. @@ -257,7 +258,7 @@ export default class Dashboard extends React.Component { - + ( )} /> @@ -266,7 +267,7 @@ export default class Dashboard extends React.Component { /> - + @@ -301,6 +302,9 @@ export default class Dashboard extends React.Component { return (
+ + Parse Dashboard + diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 5a90949593..7bed34f3fa 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -33,7 +33,7 @@ import styles from 'dashboard/Data/Browser/Browser.s import subscribeTo from 'lib/subscribeTo'; import * as ColumnPreferences from 'lib/ColumnPreferences'; import * as queryString from 'query-string'; -import DocumentTitle from 'react-document-title'; +import { Helmet } from 'react-helmet'; export default @subscribeTo('Schema', 'schema') @@ -852,11 +852,6 @@ class Browser extends DashboardView { }, 3500); } - title() { - const { className } = this.props.params; - return `${className} - Parse Dashboard`; - } - renderContent() { let browser = null; let className = this.props.params.className; @@ -1037,6 +1032,7 @@ class Browser extends DashboardView { } let notification = null; + const pageTitle = `${this.props.params} - Parse Dashboard`; if (this.state.lastError) { notification = ( @@ -1048,13 +1044,14 @@ class Browser extends DashboardView { ); } return ( - -
- {browser} - {notification} - {extras} -
-
+
+ + {pageTitle} + + {browser} + {notification} + {extras} +
); } } From 7b6f8588051ecc845bdb0d29dabe3f3184da9ae4 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Sat, 13 Oct 2018 14:52:42 -0300 Subject: [PATCH 3/3] Fix the classname get --- src/dashboard/Data/Browser/Browser.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 7bed34f3fa..4cf68bd2cf 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -1032,7 +1032,7 @@ class Browser extends DashboardView { } let notification = null; - const pageTitle = `${this.props.params} - Parse Dashboard`; + const pageTitle = `${this.props.params.className} - Parse Dashboard`; if (this.state.lastError) { notification = (