1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

Rename pieces routes back to collection

This commit is contained in:
Tim Daubenschütz 2015-10-01 14:30:11 +02:00
parent a4e00ba89e
commit 83c652a4f0
15 changed files with 18 additions and 17 deletions

View File

@ -3,7 +3,7 @@
require('babel/polyfill');
import React from 'react';
import { Router } from 'react-router';
import { Router, Redirect } from 'react-router';
import createBrowserHistory from 'history/lib/createBrowserHistory';
@ -85,6 +85,7 @@ class AppGateway {
let history = createBrowserHistory();
React.render((
<Router history={history}>
<Redirect from="/" to="/collection" />
{getRoutes(type, subdomain)}
</Router>
), document.getElementById('main'));

View File

@ -96,7 +96,7 @@ let Edition = React.createClass({
let notification = new GlobalNotificationModel(response.notification, 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
},
refreshCollection() {

View File

@ -135,7 +135,7 @@ let PieceContainer = React.createClass({
let notification = new GlobalNotificationModel(response.notification, 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
},
getCreateEditionsDialog() {

View File

@ -58,7 +58,7 @@ let ContractAgreementForm = React.createClass({
notification = new GlobalNotificationModel(notification, 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
},
getFormData(){

View File

@ -57,7 +57,7 @@ let LoginForm = React.createClass({
// if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email && this.props.redirectOnLoggedIn) {
// FIXME: hack to redirect out of the dispatch cycle
window.setTimeout(() => this.history.pushState(null, '/pieces'), 0);
window.setTimeout(() => this.history.pushState(null, '/collection'), 0);
}
},

View File

@ -51,7 +51,7 @@ let SignupForm = React.createClass({
// if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email) {
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
}
},
@ -62,7 +62,7 @@ let SignupForm = React.createClass({
this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.');
}
else if (response.redirect) {
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
}
},

View File

@ -42,7 +42,7 @@ let PaginationButton = React.createClass({
if (this.isInRange(page)) {
anchor = (
<Link to="/pieces"
<Link to="/collection"
query={{page}}
onClick={this.props.goToPage(page)}>
{directionDisplay}

View File

@ -120,7 +120,7 @@ let PasswordResetForm = React.createClass({
},
handleSuccess() {
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
let notification = new GlobalNotificationModel(getLangText('password successfully updated'), 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
},

View File

@ -164,7 +164,8 @@ let RegisterPiece = React.createClass( {
message={getLangText('Please login before ascribing your work%s', '...')}
redirectOnLoggedIn={false}
redirectOnLoginSuccess={false}
onLogin={this.onLogin}/>
onLogin={this.onLogin}
location={this.props.location}/>
</div>
</SlidesContainer>
);

View File

@ -46,7 +46,7 @@ let Landing = React.createClass({
// if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email) {
// FIXME: hack to redirect out of the dispatch cycle
window.setTimeout(() => this.history.replaceState(null, '/pieces'), 0);
window.setTimeout(() => this.history.replaceState(null, '/collection'), 0);
}
},

View File

@ -45,7 +45,7 @@ let CylandLanding = React.createClass({
// if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email) {
// FIXME: hack to redirect out of the dispatch cycle
window.setTimeout(() => this.history.replaceState(null, '/pieces'), 0);
window.setTimeout(() => this.history.replaceState(null, '/collection'), 0);
}
},

View File

@ -113,7 +113,7 @@ let IkonotvContractNotifications = React.createClass({
handleConfirmSuccess() {
let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
},
handleDeny() {
@ -126,7 +126,7 @@ let IkonotvContractNotifications = React.createClass({
handleDenySuccess() {
let notification = new GlobalNotificationModel(getLangText('You have denied the conditions'), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
},
getCopyrightAssociationForm(){

View File

@ -38,7 +38,7 @@ let IkonotvLanding = React.createClass({
let redirect = '/login';
if(this.state.currentUser && this.state.currentUser.email) {
redirect = '/pieces';
redirect = '/collection';
}
else if (this.props.location.query && this.props.location.query.redirect) {
redirect = '/' + this.props.location.query.redirect;

View File

@ -102,7 +102,7 @@ let IkonotvRegisterPiece = React.createClass({
PieceActions.updatePiece(response.piece);
}
if (!this.canSubmit()) {
this.history.pushState(null, '/pieces');
this.history.pushState(null, '/collection');
}
else {
this.incrementStep();

View File

@ -32,7 +32,6 @@ let baseUrl = AppConstants.baseUrl;
const COMMON_ROUTES = (
<Route path={baseUrl} component={App}>
<IndexRoute component={PieceList} headerTitle="COLLECTION" />
<Route path="register_piece" component={RegisterPiece} headerTitle="+ NEW WORK" />
<Route path="collection" component={PieceList} headerTitle="COLLECTION" />
<Route path="signup" component={SignupContainer} />