Skip to content

Commit

Permalink
Redirect the homepage to static proxy (#7176)
Browse files Browse the repository at this point in the history
* redirect '/' to static proxy (www) and update links to homepage

* add link to www /stats to user profile page
  • Loading branch information
goplayoutside3 authored Sep 17, 2024
1 parent 8c0a0c5 commit 8036774
Showing 7 changed files with 20 additions and 29 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -36,9 +36,11 @@ Make sure you have Node 8 and `npm` 5 or greater. It's recommended you manage yo

### Viewing the Website

Open your web browser of choice and go to `https://localhost:3735/`
The root `/` is redirected to www.zooniverse.org because this frontend app is no longer used for the homepage. Point your browser to a subpath to view this app run locally.

If you want to _login_ via the Panoptes API and _view authenticated pages,_ then you'll need to set up and use `https://local.zooniverse.org:3735` instead of using localhost:3735. Otherwise, you'll run into CORS errors. (You need to add the hostname to your hosts file, pointing to local. Instructions are on [our Stackoverflow](https://stackoverflow.com/c/zooniverse/questions/109).)
Open your web browser of choice and go to `https://localhost:3735/lab`

If you want to _login_ via the Panoptes API and _view authenticated pages,_ then you'll need to set up and use `https://local.zooniverse.org:3735/lab` instead of using localhost:3735. Otherwise, you'll run into CORS errors. (You need to add the hostname to your hosts file, pointing to local. Instructions are on [our Stackoverflow](https://stackoverflow.com/c/zooniverse/questions/109).)

**Troubleshooting: web browser blocks local website**

9 changes: 4 additions & 5 deletions app/layout/account-bar.jsx
Original file line number Diff line number Diff line change
@@ -143,14 +143,13 @@ export default class AccountBar extends React.Component {
<Translate content="accountMenu.profile" />
</Link>
<br />
<Link
<a
role="menuitem"
to="/"
href="https://www.zooniverse.org"
className="site-nav__link"
onClick={this.logClick ? this.logClick.bind(this, 'accountMenu.home') : null}
>
<Translate content="accountMenu.home" />
</Link>
</a>
<br />
<Link
role="menuitem"
@@ -207,4 +206,4 @@ AccountBar.contextTypes = {
AccountBar.propTypes = {
params: PropTypes.object,
isMobile: PropTypes.bool
};
};
17 changes: 6 additions & 11 deletions app/layout/site-nav.jsx
Original file line number Diff line number Diff line change
@@ -87,15 +87,12 @@ const SiteNav = createReactClass({
})}
>
{!!this.state.isMobile &&
<Link
to="/"
<a
href="https://www.zooniverse.org"
className="site-nav__link"
activeClassName="site-nav__link--active"
onlyActiveOnIndex={true}
onClick={!!this.logClick ? this.logClick.bind(this, 'mainNav.home') : null}
>
<Translate content="siteNav.home" />
</Link>
</a>
}
<Link
to="/projects"
@@ -191,14 +188,12 @@ const SiteNav = createReactClass({
render() {
return (
<nav className="site-nav">
<IndexLink
to="/"
<a
href="https://www.zooniverse.org"
className="site-nav__link"
activeClassName="site-nav__link--active"
onClick={!!this.logClick ? this.logClick.bind(this, 'logo') : null}
>
{ZOO_LOGO}
</IndexLink>
</a>

{!this.state.isMobile && this.renderLinks()}

6 changes: 1 addition & 5 deletions app/pages/notifications/notification-section.spec.js
Original file line number Diff line number Diff line change
@@ -47,10 +47,6 @@ describe('Notification Section', function() {
assert.equal(wrapper.find('.notification-section__title').text(), 'Zooniverse');
});

it('should link to the home page', function () {
assert.equal(wrapper.find('Link').prop('to'), '/');
});

it('shows the Zooniverse logo', function () {
assert.equal(wrapper.find('ZooniverseLogo').length, 1);
});
@@ -147,7 +143,7 @@ describe('Notification Section', function() {
user={{ id: '1' }}
/>,
{
context: { notificationsCounter },
context: { notificationsCounter },
disableLifeCycleMethods: true
}
);
4 changes: 2 additions & 2 deletions app/pages/profile/stats.cjsx
Original file line number Diff line number Diff line change
@@ -3,5 +3,5 @@ React = require 'react'

module.exports = (props) =>
<div className="content-container">
<p>Your classification stats are now displayed on <Link to="/">your Zooniverse home page</Link>.</p>
</div>
<p>Your classification stats are now displayed on <Link to="https://www.zooniverse.org">your Zooniverse home page</Link>.</p>
</div>
4 changes: 2 additions & 2 deletions app/pages/profile/user.jsx
Original file line number Diff line number Diff line change
@@ -82,9 +82,9 @@ class ProfileUser extends Component {
);
} else {
return (
<Link to="/#projects" className={classes} onClick={this.logClick.bind(this, 'stats')}>
<a href={`https://www.zooniverse.org/users/${this.props.profileUser.login}/stats`} className={classes}>
<Translate content="profile.nav.stats" />
</Link>
</a>
);
}
}
3 changes: 1 addition & 2 deletions app/router.jsx
Original file line number Diff line number Diff line change
@@ -95,9 +95,8 @@ class ExternalRedirect extends React.Component {

export const routes = (
<Route path="/" component={require('./partials/app')}>
<IndexRoute component={HomePageRoot} />
<IndexRoute component={() => <ExternalRedirect newUrl='https://www.zooniverse.org' />} />
<Route path="home" component={ONE_UP_REDIRECT} />
<Route path="home-for-user" component={require('./pages/home-for-user').default} />

<Route path="about" onEnter={redirectAboutPage} ignoreScrollBehavior>
<Route path="team" onEnter={redirectAboutPage} />

0 comments on commit 8036774

Please sign in to comment.