1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +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'); require('babel/polyfill');
import React from 'react'; import React from 'react';
import { Router } from 'react-router'; import { Router, Redirect } from 'react-router';
import createBrowserHistory from 'history/lib/createBrowserHistory'; import createBrowserHistory from 'history/lib/createBrowserHistory';
@ -85,6 +85,7 @@ class AppGateway {
let history = createBrowserHistory(); let history = createBrowserHistory();
React.render(( React.render((
<Router history={history}> <Router history={history}>
<Redirect from="/" to="/collection" />
{getRoutes(type, subdomain)} {getRoutes(type, subdomain)}
</Router> </Router>
), document.getElementById('main')); ), document.getElementById('main'));

View File

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

View File

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

View File

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

View File

@ -57,7 +57,7 @@ let LoginForm = React.createClass({
// if user is already logged in, redirect him to piece list // if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email && this.props.redirectOnLoggedIn) { if(this.state.currentUser && this.state.currentUser.email && this.props.redirectOnLoggedIn) {
// FIXME: hack to redirect out of the dispatch cycle // 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 user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email) { 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') + '.'); this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.');
} }
else if (response.redirect) { 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)) { if (this.isInRange(page)) {
anchor = ( anchor = (
<Link to="/pieces" <Link to="/collection"
query={{page}} query={{page}}
onClick={this.props.goToPage(page)}> onClick={this.props.goToPage(page)}>
{directionDisplay} {directionDisplay}

View File

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

View File

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

View File

@ -46,7 +46,7 @@ let Landing = React.createClass({
// if user is already logged in, redirect him to piece list // if user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email) { if(this.state.currentUser && this.state.currentUser.email) {
// FIXME: hack to redirect out of the dispatch cycle // 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 user is already logged in, redirect him to piece list
if(this.state.currentUser && this.state.currentUser.email) { if(this.state.currentUser && this.state.currentUser.email) {
// FIXME: hack to redirect out of the dispatch cycle // 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() { handleConfirmSuccess() {
let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 5000); let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces'); this.history.pushState(null, '/collection');
}, },
handleDeny() { handleDeny() {
@ -126,7 +126,7 @@ let IkonotvContractNotifications = React.createClass({
handleDenySuccess() { handleDenySuccess() {
let notification = new GlobalNotificationModel(getLangText('You have denied the conditions'), 'success', 5000); let notification = new GlobalNotificationModel(getLangText('You have denied the conditions'), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
this.history.pushState(null, '/pieces'); this.history.pushState(null, '/collection');
}, },
getCopyrightAssociationForm(){ getCopyrightAssociationForm(){

View File

@ -38,7 +38,7 @@ let IkonotvLanding = React.createClass({
let redirect = '/login'; let redirect = '/login';
if(this.state.currentUser && this.state.currentUser.email) { if(this.state.currentUser && this.state.currentUser.email) {
redirect = '/pieces'; redirect = '/collection';
} }
else if (this.props.location.query && this.props.location.query.redirect) { else if (this.props.location.query && this.props.location.query.redirect) {
redirect = '/' + 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); PieceActions.updatePiece(response.piece);
} }
if (!this.canSubmit()) { if (!this.canSubmit()) {
this.history.pushState(null, '/pieces'); this.history.pushState(null, '/collection');
} }
else { else {
this.incrementStep(); this.incrementStep();

View File

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