2015-08-11 13:10:15 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2015-10-01 15:57:46 +02:00
|
|
|
import { Route, IndexRoute } from 'react-router';
|
2015-08-11 13:10:15 +02:00
|
|
|
|
2015-08-12 09:30:24 +02:00
|
|
|
// general components
|
2015-09-25 11:50:55 +02:00
|
|
|
import CoaVerifyContainer from '../../../components/coa_verify_container';
|
2015-08-11 14:47:28 +02:00
|
|
|
import LoginContainer from '../../../components/login_container';
|
2015-08-11 13:10:15 +02:00
|
|
|
import LogoutContainer from '../../../components/logout_container';
|
2015-08-11 14:47:28 +02:00
|
|
|
import SignupContainer from '../../../components/signup_container';
|
2015-08-11 13:10:15 +02:00
|
|
|
import PasswordResetContainer from '../../../components/password_reset_container';
|
2015-08-11 14:47:28 +02:00
|
|
|
import PieceList from '../../../components/piece_list';
|
|
|
|
import PieceContainer from '../../../components/ascribe_detail/piece_container';
|
|
|
|
import EditionContainer from '../../../components/ascribe_detail/edition_container';
|
2015-08-31 16:36:24 +02:00
|
|
|
import SettingsContainer from '../../../components/ascribe_settings/settings_container';
|
2015-09-23 15:16:46 +02:00
|
|
|
import ContractSettings from '../../../components/ascribe_settings/contract_settings';
|
2015-09-29 16:00:58 +02:00
|
|
|
import ErrorNotFoundPage from '../../../components/error_not_found_page';
|
2015-11-24 12:04:08 +01:00
|
|
|
|
|
|
|
import CCRegisterPiece from './components/cc/cc_register_piece';
|
2015-08-11 13:10:15 +02:00
|
|
|
|
2015-08-19 09:31:36 +02:00
|
|
|
import CylandLanding from './components/cyland/cyland_landing';
|
2015-10-13 11:23:21 +02:00
|
|
|
import CylandPieceContainer from './components/cyland/cyland_detail/cyland_piece_container';
|
2015-08-12 09:30:24 +02:00
|
|
|
import CylandRegisterPiece from './components/cyland/cyland_register_piece';
|
2015-08-17 20:52:36 +02:00
|
|
|
import CylandPieceList from './components/cyland/cyland_piece_list';
|
|
|
|
|
2015-09-16 18:31:46 +02:00
|
|
|
import IkonotvLanding from './components/ikonotv/ikonotv_landing';
|
2015-08-18 12:36:38 +02:00
|
|
|
import IkonotvPieceList from './components/ikonotv/ikonotv_piece_list';
|
2015-10-01 15:57:46 +02:00
|
|
|
import ContractAgreementForm from '../../../components/ascribe_forms/form_contract_agreement';
|
2015-09-15 13:15:29 +02:00
|
|
|
import IkonotvRegisterPiece from './components/ikonotv/ikonotv_register_piece';
|
2015-10-13 11:39:33 +02:00
|
|
|
import IkonotvPieceContainer from './components/ikonotv/ikonotv_detail/ikonotv_piece_container';
|
2015-09-04 11:49:55 +02:00
|
|
|
import IkonotvContractNotifications from './components/ikonotv/ikonotv_contract_notifications';
|
2015-08-18 12:36:38 +02:00
|
|
|
|
2015-11-24 12:04:08 +01:00
|
|
|
import MarketPieceList from './components/market/market_piece_list';
|
|
|
|
import MarketRegisterPiece from './components/market/market_register_piece';
|
|
|
|
import MarketPieceContainer from './components/market/market_detail/market_piece_container';
|
|
|
|
import MarketEditionContainer from './components/market/market_detail/market_edition_container';
|
2015-10-21 17:37:29 +02:00
|
|
|
|
2015-11-24 12:04:08 +01:00
|
|
|
import LumenusLanding from './components/lumenus/lumenus_landing';
|
2015-08-11 17:40:26 +02:00
|
|
|
|
2015-10-12 17:00:53 +02:00
|
|
|
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
2015-10-09 15:19:24 +02:00
|
|
|
|
2015-08-11 14:47:28 +02:00
|
|
|
import WalletApp from './wallet_app';
|
2015-08-11 13:10:15 +02:00
|
|
|
|
|
|
|
|
2015-08-11 17:40:26 +02:00
|
|
|
let ROUTES = {
|
|
|
|
'cyland': (
|
2015-10-13 14:19:08 +02:00
|
|
|
<Route path='/' component={WalletApp}>
|
2015-10-01 15:57:46 +02:00
|
|
|
<IndexRoute component={CylandLanding} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='login'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='logout'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='signup'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='password_reset'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='contract_settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='register_piece'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(CylandRegisterPiece)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='+ NEW WORK'/>
|
|
|
|
<Route
|
|
|
|
path='collection'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(CylandPieceList)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='COLLECTION'/>
|
|
|
|
<Route path='editions/:editionId' component={EditionContainer} />
|
|
|
|
<Route path='verify' component={CoaVerifyContainer} />
|
|
|
|
<Route path='pieces/:pieceId' component={CylandPieceContainer} />
|
|
|
|
<Route path='*' component={ErrorNotFoundPage} />
|
2015-08-11 13:10:15 +02:00
|
|
|
</Route>
|
2015-08-11 17:40:26 +02:00
|
|
|
),
|
|
|
|
'cc': (
|
2015-10-13 14:19:08 +02:00
|
|
|
<Route path='/' component={WalletApp}>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='login'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='logout'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='signup'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='password_reset'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='contract_settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='register_piece'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(CCRegisterPiece)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='+ NEW WORK'/>
|
|
|
|
<Route
|
|
|
|
path='collection'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(PieceList)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='COLLECTION'/>
|
|
|
|
<Route path='pieces/:pieceId' component={PieceContainer} />
|
|
|
|
<Route path='editions/:editionId' component={EditionContainer} />
|
|
|
|
<Route path='verify' component={CoaVerifyContainer} />
|
|
|
|
<Route path='*' component={ErrorNotFoundPage} />
|
2015-08-11 17:40:26 +02:00
|
|
|
</Route>
|
2015-08-18 12:08:01 +02:00
|
|
|
),
|
|
|
|
'ikonotv': (
|
2015-10-13 14:19:08 +02:00
|
|
|
<Route path='/' component={WalletApp}>
|
2015-10-01 15:57:46 +02:00
|
|
|
<IndexRoute component={IkonotvLanding} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='login'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='logout'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='signup'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='password_reset'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='contract_settings'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route
|
|
|
|
path='request_loan'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractAgreementForm)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='SEND NEW CONTRACT'
|
|
|
|
aclName='acl_create_contractagreement'/>
|
|
|
|
<Route
|
|
|
|
path='register_piece'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(IkonotvRegisterPiece)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='+ NEW WORK'
|
|
|
|
aclName='acl_create_piece'/>
|
|
|
|
<Route
|
|
|
|
path='collection'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(IkonotvPieceList)}
|
2015-10-12 16:51:03 +02:00
|
|
|
headerTitle='COLLECTION'/>
|
|
|
|
<Route
|
|
|
|
path='contract_notifications'
|
2015-10-12 17:00:53 +02:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(IkonotvContractNotifications)}/>
|
2015-10-12 16:51:03 +02:00
|
|
|
<Route path='pieces/:pieceId' component={IkonotvPieceContainer} />
|
|
|
|
<Route path='editions/:editionId' component={EditionContainer} />
|
|
|
|
<Route path='verify' component={CoaVerifyContainer} />
|
|
|
|
<Route path='*' component={ErrorNotFoundPage} />
|
2015-08-18 12:08:01 +02:00
|
|
|
</Route>
|
2015-10-21 14:10:21 +02:00
|
|
|
),
|
|
|
|
'lumenus': (
|
|
|
|
<Route path='/' component={WalletApp}>
|
2015-11-10 18:49:08 +01:00
|
|
|
<IndexRoute component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LumenusLanding)} />
|
2015-10-21 14:10:21 +02:00
|
|
|
<Route
|
|
|
|
path='login'
|
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
|
|
|
<Route
|
|
|
|
path='logout'
|
|
|
|
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
|
|
|
<Route
|
|
|
|
path='signup'
|
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
|
|
|
<Route
|
|
|
|
path='password_reset'
|
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
|
|
|
<Route
|
|
|
|
path='settings'
|
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
|
|
|
<Route
|
|
|
|
path='contract_settings'
|
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
|
|
|
<Route
|
|
|
|
path='register_piece'
|
2015-11-24 12:04:08 +01:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketRegisterPiece)}
|
2015-10-21 14:10:21 +02:00
|
|
|
headerTitle='+ NEW WORK'/>
|
|
|
|
<Route
|
|
|
|
path='collection'
|
2015-11-24 12:04:08 +01:00
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketPieceList)}
|
2015-10-21 14:10:21 +02:00
|
|
|
headerTitle='COLLECTION'/>
|
2015-11-24 12:04:08 +01:00
|
|
|
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
|
|
|
|
<Route path='editions/:editionId' component={MarketEditionContainer} />
|
2015-10-21 14:10:21 +02:00
|
|
|
<Route path='verify' component={CoaVerifyContainer} />
|
|
|
|
<Route path='*' component={ErrorNotFoundPage} />
|
|
|
|
</Route>
|
2015-11-24 12:08:37 +01:00
|
|
|
),
|
|
|
|
'23vivi': (
|
|
|
|
<Route path='/' component={WalletApp}>
|
|
|
|
<IndexRoute component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LumenusLanding)} />
|
|
|
|
<Route
|
|
|
|
path='login'
|
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
|
|
|
<Route
|
|
|
|
path='logout'
|
|
|
|
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
|
|
|
<Route
|
|
|
|
path='signup'
|
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
|
|
|
<Route
|
|
|
|
path='password_reset'
|
|
|
|
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
|
|
|
<Route
|
|
|
|
path='settings'
|
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
|
|
|
<Route
|
|
|
|
path='contract_settings'
|
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
|
|
|
<Route
|
|
|
|
path='register_piece'
|
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketRegisterPiece)}
|
|
|
|
headerTitle='+ NEW WORK'/>
|
|
|
|
<Route
|
|
|
|
path='collection'
|
|
|
|
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketPieceList)}
|
|
|
|
headerTitle='COLLECTION'/>
|
|
|
|
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
|
|
|
|
<Route path='editions/:editionId' component={MarketEditionContainer} />
|
|
|
|
<Route path='verify' component={CoaVerifyContainer} />
|
|
|
|
<Route path='*' component={ErrorNotFoundPage} />
|
|
|
|
</Route>
|
2015-08-11 17:40:26 +02:00
|
|
|
)
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-24 12:08:37 +01:00
|
|
|
function getRoutes(commonRoutes, subdomain) {
|
|
|
|
if(subdomain in ROUTES) {
|
|
|
|
return ROUTES[subdomain];
|
|
|
|
} else {
|
|
|
|
throw new Error('Subdomain wasn\'t specified in the wallet app.');
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-08-11 17:40:26 +02:00
|
|
|
function getRoutes(commonRoutes, subdomain) {
|
|
|
|
if(subdomain in ROUTES) {
|
|
|
|
return ROUTES[subdomain];
|
|
|
|
} else {
|
|
|
|
throw new Error('Subdomain wasn\'t specified in the wallet app.');
|
|
|
|
}
|
2015-08-11 13:10:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-12 16:51:03 +02:00
|
|
|
export default getRoutes;
|