From 83c652a4f0a2b2f8493d6fe37bc78f5a7c626913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 1 Oct 2015 14:30:11 +0200 Subject: [PATCH] Rename pieces routes back to collection --- js/app.js | 3 ++- js/components/ascribe_detail/edition.js | 2 +- js/components/ascribe_detail/piece_container.js | 2 +- js/components/ascribe_forms/form_contract_agreement.js | 2 +- js/components/ascribe_forms/form_login.js | 2 +- js/components/ascribe_forms/form_signup.js | 4 ++-- js/components/ascribe_pagination/pagination_button.js | 2 +- js/components/password_reset_container.js | 2 +- js/components/register_piece.js | 3 ++- js/components/whitelabel/prize/components/prize_landing.js | 2 +- .../whitelabel/wallet/components/cyland/cyland_landing.js | 2 +- .../components/ikonotv/ikonotv_contract_notifications.js | 4 ++-- .../whitelabel/wallet/components/ikonotv/ikonotv_landing.js | 2 +- .../wallet/components/ikonotv/ikonotv_register_piece.js | 2 +- js/routes.js | 1 - 15 files changed, 18 insertions(+), 17 deletions(-) diff --git a/js/app.js b/js/app.js index 26129893..d56700bc 100644 --- a/js/app.js +++ b/js/app.js @@ -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(( + {getRoutes(type, subdomain)} ), document.getElementById('main')); diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 918c0c9b..de118d6a 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -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() { diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index c0b4c17c..e2ebaa43 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -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() { diff --git a/js/components/ascribe_forms/form_contract_agreement.js b/js/components/ascribe_forms/form_contract_agreement.js index 5de58d6e..8140743b 100644 --- a/js/components/ascribe_forms/form_contract_agreement.js +++ b/js/components/ascribe_forms/form_contract_agreement.js @@ -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(){ diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js index ddfbfc10..1b52c1ce 100644 --- a/js/components/ascribe_forms/form_login.js +++ b/js/components/ascribe_forms/form_login.js @@ -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); } }, diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index 75bbd72b..60962508 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -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'); } }, diff --git a/js/components/ascribe_pagination/pagination_button.js b/js/components/ascribe_pagination/pagination_button.js index 633d964c..297fb45e 100644 --- a/js/components/ascribe_pagination/pagination_button.js +++ b/js/components/ascribe_pagination/pagination_button.js @@ -42,7 +42,7 @@ let PaginationButton = React.createClass({ if (this.isInRange(page)) { anchor = ( - {directionDisplay} diff --git a/js/components/password_reset_container.js b/js/components/password_reset_container.js index e61c0789..6a9f70e9 100644 --- a/js/components/password_reset_container.js +++ b/js/components/password_reset_container.js @@ -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); }, diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 3a92d6a3..83bcfb3d 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -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}/> ); diff --git a/js/components/whitelabel/prize/components/prize_landing.js b/js/components/whitelabel/prize/components/prize_landing.js index 2004e1b3..355b3786 100644 --- a/js/components/whitelabel/prize/components/prize_landing.js +++ b/js/components/whitelabel/prize/components/prize_landing.js @@ -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); } }, diff --git a/js/components/whitelabel/wallet/components/cyland/cyland_landing.js b/js/components/whitelabel/wallet/components/cyland/cyland_landing.js index 2b57a2f8..72ce9ea9 100644 --- a/js/components/whitelabel/wallet/components/cyland/cyland_landing.js +++ b/js/components/whitelabel/wallet/components/cyland/cyland_landing.js @@ -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); } }, diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_contract_notifications.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_contract_notifications.js index 52605a94..42b1fc9b 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_contract_notifications.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_contract_notifications.js @@ -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(){ diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js index 60c82fab..43d2d803 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js @@ -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; diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js index 970521dd..a9c27b35 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js @@ -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(); diff --git a/js/routes.js b/js/routes.js index baf9a6fd..9424e0ab 100644 --- a/js/routes.js +++ b/js/routes.js @@ -32,7 +32,6 @@ let baseUrl = AppConstants.baseUrl; const COMMON_ROUTES = ( -