From a66888335f44632a71493dac126e8d26e6a01f64 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Tue, 30 Apr 2024 17:10:29 -0600 Subject: [PATCH] Add title to landing page (#208) --- docs/configuration/messages.js | 3 ++ src/components/pages/LoginPage.jsx | 18 -------- src/components/pages/LogoutPage.jsx | 4 +- src/components/pages/RootPage.jsx | 4 +- src/components/pages/WelcomePage.jsx | 45 +++++++++++++++++++ .../{LoginPage.css => WelcomePage.css} | 0 ...oginPage.spec.jsx => WelcomePage.spec.jsx} | 6 +-- 7 files changed, 55 insertions(+), 25 deletions(-) delete mode 100644 src/components/pages/LoginPage.jsx create mode 100644 src/components/pages/WelcomePage.jsx rename styles/cspace-ui/{LoginPage.css => WelcomePage.css} (100%) rename test/specs/components/pages/{LoginPage.spec.jsx => WelcomePage.spec.jsx} (89%) diff --git a/docs/configuration/messages.js b/docs/configuration/messages.js index eed3102e..a01fe51d 100644 --- a/docs/configuration/messages.js +++ b/docs/configuration/messages.js @@ -5007,6 +5007,9 @@ export default { // The title of the login modal. "loginModal.title": "Sign In", + // The title of the welcome page. + "welcomePage.title": "Welcome", + // The title (advisory text) of the application logo image. "logo.title": "CollectionSpace", diff --git a/src/components/pages/LoginPage.jsx b/src/components/pages/LoginPage.jsx deleted file mode 100644 index 9dedaeab..00000000 --- a/src/components/pages/LoginPage.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import About from '../sections/About'; -import LoginForm from '../login/LoginForm'; -import styles from '../../../styles/cspace-ui/LoginPage.css'; - -export default function LoginPage() { - return ( -
-
- -
- -
- -
-
- ); -} diff --git a/src/components/pages/LogoutPage.jsx b/src/components/pages/LogoutPage.jsx index 475e94d0..a6b1f5b6 100644 --- a/src/components/pages/LogoutPage.jsx +++ b/src/components/pages/LogoutPage.jsx @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import qs from 'qs'; -import styles from '../../../styles/cspace-ui/LoginPage.css'; +import styles from '../../../styles/cspace-ui/WelcomePage.css'; const propTypes = { history: PropTypes.shape({ @@ -76,7 +76,7 @@ export default class LogoutPage extends Component { logout(); } - history.replace('/login'); + history.replace('/welcome'); } render() { diff --git a/src/components/pages/RootPage.jsx b/src/components/pages/RootPage.jsx index c7cfe22c..94c3b27a 100644 --- a/src/components/pages/RootPage.jsx +++ b/src/components/pages/RootPage.jsx @@ -15,7 +15,7 @@ import CreatePageContainer from '../../containers/pages/CreatePageContainer'; import DashboardPage from './DashboardPage'; import ExportViewerPageContainer from '../../containers/pages/ExportViewerPageContainer'; import ToolPageContainer from '../../containers/pages/ToolPageContainer'; -import LoginPage from './LoginPage'; +import WelcomePage from './WelcomePage'; import LogoutPageContainer from '../../containers/pages/LogoutPageContainer'; import RecordPageContainer from '../../containers/pages/RecordPageContainer'; import ReportViewerPageContainer from '../../containers/pages/ReportViewerPageContainer'; @@ -62,7 +62,7 @@ function RootPage(props) { - + diff --git a/src/components/pages/WelcomePage.jsx b/src/components/pages/WelcomePage.jsx new file mode 100644 index 00000000..d2c0eaf0 --- /dev/null +++ b/src/components/pages/WelcomePage.jsx @@ -0,0 +1,45 @@ +import React from 'react'; +import { Helmet } from 'react-helmet'; +import { defineMessages, injectIntl, intlShape } from 'react-intl'; +import About from '../sections/About'; +import LoginForm from '../login/LoginForm'; +import styles from '../../../styles/cspace-ui/WelcomePage.css'; + +const propTypes = { + intl: intlShape.isRequired, +}; + +const messages = defineMessages({ + title: { + id: 'welcomePage.title', + description: 'Title of the welcome page.', + defaultMessage: 'Welcome', + }, +}); + +function WelcomePage(props) { + const { + intl, + } = props; + + return ( + <> + + {intl.formatMessage(messages.title)} + +
+
+ +
+ +
+ +
+
+ + ); +} + +WelcomePage.propTypes = propTypes; + +export default injectIntl(WelcomePage); diff --git a/styles/cspace-ui/LoginPage.css b/styles/cspace-ui/WelcomePage.css similarity index 100% rename from styles/cspace-ui/LoginPage.css rename to styles/cspace-ui/WelcomePage.css diff --git a/test/specs/components/pages/LoginPage.spec.jsx b/test/specs/components/pages/WelcomePage.spec.jsx similarity index 89% rename from test/specs/components/pages/LoginPage.spec.jsx rename to test/specs/components/pages/WelcomePage.spec.jsx index f5406d76..b9eb26ff 100644 --- a/test/specs/components/pages/LoginPage.spec.jsx +++ b/test/specs/components/pages/WelcomePage.spec.jsx @@ -7,7 +7,7 @@ import Immutable from 'immutable'; import createTestContainer from '../../../helpers/createTestContainer'; import { render } from '../../../helpers/renderHelpers'; import mockHistory from '../../../helpers/mockHistory'; -import LoginPage from '../../../../src/components/pages/LoginPage'; +import WelcomePage from '../../../../src/components/pages/WelcomePage'; chai.should(); @@ -19,7 +19,7 @@ const store = mockStore({ const history = mockHistory(); -describe('LoginPage', () => { +describe('WelcomePage', () => { beforeEach(function before() { this.container = createTestContainer(this); }); @@ -29,7 +29,7 @@ describe('LoginPage', () => { -