-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect the homepage to static proxy #7176
Conversation
@@ -177,9 +177,9 @@ export default class NotificationSection extends Component { | |||
avatar = <img src={src} className="notification-section__img" alt="Project Avatar" />; | |||
} | |||
return ( | |||
<Link to={this.props.slug ? `/projects/${this.props.slug}` : '/'}> | |||
<a href={this.props.slug ? `https://www.zooniverse.org/projects/${this.props.slug}` : 'https://www.zooniverse.org'}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure about this one. Should it be <a href={this.props.slug ?
/projects/${this.props.slug} : 'https://www.zooniverse.org'}>
because the notifications page is PFE and if there is a slug prop then you'd want to stay on PFE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think this can remain as Link. For FEM projects the PFE rerouting will kick in. But this works, and eventually when all projects migrate we'll need to make a handful of similar changes.
app/pages/profile/stats.cjsx
Outdated
<div className="content-container"> | ||
<p>Your classification stats are now displayed on <Link to="/">your Zooniverse home page</Link>.</p> | ||
</div> No newline at end of file | ||
<p>Your classification stats are now displayed on <Link to="https://www.zooniverse.org">your Zooniverse home page</Link>.</p> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is a fallback message for the Stats button on your profile page (e.g. https://www.zooniverse.org/users/[login]/stats prior to Sept 17 launch of new pages). Likely to be forever ignored after this PR is deployed, but being thorough 💁♀️
<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} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are the most consequential. There has to be a <Route path="/"
importing './partials/app'
in order for PFE to work at all. However, the ExternalRedirect in IndexRoute does the redirecting when a browser hits /
.
I also kept path="home"
because I'm unsure of its legacy, but if you hit /home you'll be redirected to the static proxy (and passed on to FEM). It was mentioned here: #6041
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Browsing around, clicking links locally works as expected 👍 . Very exciting. Good to update README about running locally, I'm not sure what else we can do.
❌ Do not deploy until Sept 17
Describe your changes.
/
.How To Review
Visit https://pr-7176.pfe-preview.zooniverse.org and you'll be redirected to "www".
❓ The consequence of adding a redirect like this to the router is you can't use the browser back button 🤔 The only scenario where someone might hit this redirect though is if
'/'
is used in markdown beyond our control. All other links to the homepage are hardcoded to www.Visit subpaths that are intended to still use PFE such as /lab and /talk and /projects and see the app still works.