mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Merge pull request #53 from ascribe/AD-1362-implement-portfolioreview-judging-flow
Implement first cut of judging flow for portfolio review
This commit is contained in:
commit
b467a840a4
132
js/components/ascribe_routes/proxy_handler.js
Normal file
132
js/components/ascribe_routes/proxy_handler.js
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { RouteContext } from 'react-router';
|
||||||
|
import history from '../../history';
|
||||||
|
|
||||||
|
import UserStore from '../../stores/user_store';
|
||||||
|
import UserActions from '../../actions/user_actions';
|
||||||
|
|
||||||
|
import AppConstants from '../../constants/application_constants';
|
||||||
|
|
||||||
|
|
||||||
|
const { object } = React.PropTypes;
|
||||||
|
const WHEN_ENUM = ['loggedIn', 'loggedOut'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirects the user conditionally according to his authentication
|
||||||
|
*
|
||||||
|
* @param {enum/string} options.when ('loggedIn' || 'loggedOut')
|
||||||
|
*/
|
||||||
|
export function AuthRedirect({to, when}) {
|
||||||
|
// validate `when`, must be contained in `WHEN_ENUM`.
|
||||||
|
// Throw an error otherwise.
|
||||||
|
if(WHEN_ENUM.indexOf(when) === -1) {
|
||||||
|
let whenValues = WHEN_ENUM.join(', ');
|
||||||
|
throw new Error(`"when" must be one of: [${whenValues}] got "${when}" instead`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return function(currentUser, query) {
|
||||||
|
const { redirectAuthenticated, redirect } = query;
|
||||||
|
|
||||||
|
// The user of this handler specifies with `when`, what kind of status
|
||||||
|
// needs to be checked to conditionally do - if that state is `true` -
|
||||||
|
// a redirect.
|
||||||
|
//
|
||||||
|
// So if when === 'loggedIn', we're checking if the user is logged in (and
|
||||||
|
// vice versa)
|
||||||
|
let exprToValidate = when === 'loggedIn' ? currentUser && currentUser.email
|
||||||
|
: currentUser && !currentUser.email;
|
||||||
|
|
||||||
|
// and redirect if `true`.
|
||||||
|
if(exprToValidate) {
|
||||||
|
window.setTimeout(() => history.replaceState(null, to, query));
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Otherwise there can also be the case that the backend
|
||||||
|
// wants to redirect the user to a specific route when the user is logged out already
|
||||||
|
} else if(!exprToValidate && when === 'loggedIn' && redirect) {
|
||||||
|
|
||||||
|
delete query.redirect;
|
||||||
|
window.setTimeout(() => history.replaceState(null, '/' + redirect, query));
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} else if(!exprToValidate && when === 'loggedOut' && redirectAuthenticated) {
|
||||||
|
/*
|
||||||
|
* redirectAuthenticated contains an arbitrary path
|
||||||
|
* eg pieces/<id>, editions/<bitcoin_id>, collection, settings, ...
|
||||||
|
* hence transitionTo cannot be used directly.
|
||||||
|
*
|
||||||
|
* While we're getting rid of `query.redirect` explicitly in the
|
||||||
|
* above `else if` statement, here it's sufficient to just call
|
||||||
|
* `baseUrl` + `redirectAuthenticated`, as it gets rid of queries as well.
|
||||||
|
*/
|
||||||
|
window.location = AppConstants.baseUrl + redirectAuthenticated;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Can be used in combination with `Route` as an intermediate Handler
|
||||||
|
* between the actual component we want to display dependent on a certain state
|
||||||
|
* that is required to display that component.
|
||||||
|
*
|
||||||
|
* @param {[function]} redirectFn A function that conditionally redirects
|
||||||
|
*/
|
||||||
|
export function ProxyHandler(...redirectFunctions) {
|
||||||
|
return (Component) => {
|
||||||
|
return React.createClass({
|
||||||
|
displayName: 'ProxyHandler',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
location: object
|
||||||
|
},
|
||||||
|
|
||||||
|
// We need insert `RouteContext` here in order to be able
|
||||||
|
// to use the `Lifecycle` widget in further down nested components
|
||||||
|
mixins: [RouteContext],
|
||||||
|
|
||||||
|
getInitialState() {
|
||||||
|
return UserStore.getState();
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
UserStore.listen(this.onChange);
|
||||||
|
UserActions.fetchCurrentUser();
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
if(!UserStore.isLoading()) {
|
||||||
|
const { currentUser } = this.state;
|
||||||
|
const { query } = this.props.location;
|
||||||
|
|
||||||
|
for(let i = 0; i < redirectFunctions.length; i++) {
|
||||||
|
// if a redirectFunction redirects the user,
|
||||||
|
// it should return `true` and therefore
|
||||||
|
// stop/avoid the execution of all functions
|
||||||
|
// that follow
|
||||||
|
if(redirectFunctions[i](currentUser, query)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
UserStore.unlisten(this.onChange);
|
||||||
|
},
|
||||||
|
|
||||||
|
onChange(state) {
|
||||||
|
this.setState(state);
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Component {...this.props}/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
@ -1,115 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { History, RouteContext } from 'react-router';
|
|
||||||
|
|
||||||
import UserStore from '../../../stores/user_store';
|
|
||||||
import UserActions from '../../../actions/user_actions';
|
|
||||||
|
|
||||||
import AppConstants from '../../../constants/application_constants';
|
|
||||||
|
|
||||||
|
|
||||||
const { object } = React.PropTypes;
|
|
||||||
const WHEN_ENUM = ['loggedIn', 'loggedOut'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can be used in combination with `Route` as an intermediate Handler
|
|
||||||
* between the actual component we want to display dependent on a certain state
|
|
||||||
* that is required to display that component.
|
|
||||||
*
|
|
||||||
* @param {string} options.to Any type of route path that is defined in routes.js
|
|
||||||
* @param {enum/string} options.when ('loggedIn' || 'loggedOut')
|
|
||||||
*/
|
|
||||||
export default function AuthProxyHandler({to, when}) {
|
|
||||||
|
|
||||||
// validate `when`, must be contained in `WHEN_ENUM`.
|
|
||||||
// Throw an error otherwise.
|
|
||||||
if(WHEN_ENUM.indexOf(when) === -1) {
|
|
||||||
let whenValues = WHEN_ENUM.join(', ');
|
|
||||||
throw new Error(`"when" must be one of: [${whenValues}] got "${when}" instead`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Component) => {
|
|
||||||
return React.createClass({
|
|
||||||
displayName: 'AuthProxyHandler',
|
|
||||||
|
|
||||||
propTypes: {
|
|
||||||
location: object
|
|
||||||
},
|
|
||||||
|
|
||||||
// We need insert `RouteContext` here in order to be able
|
|
||||||
// to use the `Lifecycle` widget in further down nested components
|
|
||||||
mixins: [History, RouteContext],
|
|
||||||
|
|
||||||
getInitialState() {
|
|
||||||
return UserStore.getState();
|
|
||||||
},
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
UserStore.listen(this.onChange);
|
|
||||||
UserActions.fetchCurrentUser();
|
|
||||||
},
|
|
||||||
|
|
||||||
componentDidUpdate() {
|
|
||||||
// Only refresh this component, when UserSources are not loading
|
|
||||||
// data from the server
|
|
||||||
if(!UserStore.isLoading()) {
|
|
||||||
this.redirectConditionally();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
UserStore.unlisten(this.onChange);
|
|
||||||
},
|
|
||||||
|
|
||||||
redirectConditionally() {
|
|
||||||
const { query } = this.props.location;
|
|
||||||
const { redirectAuthenticated, redirect } = query;
|
|
||||||
|
|
||||||
// The user of this handler specifies with `when`, what kind of status
|
|
||||||
// needs to be checked to conditionally do - if that state is `true` -
|
|
||||||
// a redirect.
|
|
||||||
//
|
|
||||||
// So if when === 'loggedIn', we're checking if the user is logged in (and
|
|
||||||
// vice versa)
|
|
||||||
let exprToValidate = when === 'loggedIn' ?
|
|
||||||
this.state.currentUser && this.state.currentUser.email :
|
|
||||||
this.state.currentUser && !this.state.currentUser.email;
|
|
||||||
|
|
||||||
// and redirect if `true`.
|
|
||||||
if(exprToValidate) {
|
|
||||||
window.setTimeout(() => this.history.replaceState(null, to, query));
|
|
||||||
|
|
||||||
// Otherwise there can also be the case that the backend
|
|
||||||
// wants to redirect the user to a specific route when the user is logged out already
|
|
||||||
} else if(!exprToValidate && when === 'loggedIn' && redirect) {
|
|
||||||
|
|
||||||
delete query.redirect;
|
|
||||||
window.setTimeout(() => this.history.replaceState(null, '/' + redirect, query));
|
|
||||||
|
|
||||||
} else if(!exprToValidate && when === 'loggedOut' && redirectAuthenticated) {
|
|
||||||
/*
|
|
||||||
* redirectAuthenticated contains an arbirary path
|
|
||||||
* eg pieces/<id>, editions/<bitcoin_id>, collection, settings, ...
|
|
||||||
* hence transitionTo cannot be used directly.
|
|
||||||
*
|
|
||||||
* While we're getting rid of `query.redirect` explicitly in the
|
|
||||||
* above `else if` statement, here it's sufficient to just call
|
|
||||||
* `baseUrl` + `redirectAuthenticated`, as it gets rid of queries as well.
|
|
||||||
*/
|
|
||||||
window.location = AppConstants.baseUrl + redirectAuthenticated;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onChange(state) {
|
|
||||||
this.setState(state);
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<Component {...this.props}/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
@ -37,16 +37,9 @@ import { constructHead } from '../utils/dom_utils';
|
|||||||
|
|
||||||
let Header = React.createClass({
|
let Header = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
showAddWork: React.PropTypes.bool,
|
|
||||||
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
|
||||||
return {
|
|
||||||
showAddWork: true
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return mergeOptions(
|
return mergeOptions(
|
||||||
WhitelabelStore.getState(),
|
WhitelabelStore.getState(),
|
||||||
@ -55,10 +48,11 @@ let Header = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserActions.fetchCurrentUser();
|
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
WhitelabelActions.fetchWhitelabel();
|
UserActions.fetchCurrentUser.defer();
|
||||||
|
|
||||||
WhitelabelStore.listen(this.onChange);
|
WhitelabelStore.listen(this.onChange);
|
||||||
|
WhitelabelActions.fetchWhitelabel.defer();
|
||||||
|
|
||||||
// react-bootstrap 0.25.1 has a bug in which it doesn't
|
// react-bootstrap 0.25.1 has a bug in which it doesn't
|
||||||
// close the mobile expanded navigation after a click by itself.
|
// close the mobile expanded navigation after a click by itself.
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Link } from 'react-router';
|
||||||
|
|
||||||
|
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
||||||
|
|
||||||
import UserStore from '../../../../../stores/user_store';
|
import UserStore from '../../../../../stores/user_store';
|
||||||
import UserActions from '../../../../../actions/user_actions';
|
import UserActions from '../../../../../actions/user_actions';
|
||||||
|
|
||||||
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
import { getLangText } from '../../../../../utils/lang_utils';
|
||||||
|
|
||||||
|
|
||||||
const PRHero = React.createClass({
|
const PRHero = React.createClass({
|
||||||
@ -15,7 +18,7 @@ const PRHero = React.createClass({
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
UserActions.fetchCurrentUser();
|
UserActions.fetchCurrentUser.defer();
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@ -31,9 +34,11 @@ const PRHero = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="piece--hero">
|
<div className="piece--hero">
|
||||||
<h2><Glyphicon glyph="ok" /> Congratulations {currentUser.email}!</h2>
|
<h2><Glyphicon glyph="ok" />
|
||||||
<h1>You have successfully submitted to Portfolio Review 2016</h1>
|
{getLangText('Congratulations') + (currentUser.email ? ` ${currentUser.email}!` : '!')}
|
||||||
<p>See below, your uploaded portfolio:</p>
|
</h2>
|
||||||
|
<h1>{getLangText('You have successfully submitted to Portfolio Review 2016.')}</h1>
|
||||||
|
<p>Not you? <Link to="/logout">{getLangText('Change account.')}</Link></p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import history from '../../../../../../history';
|
||||||
|
|
||||||
|
|
||||||
|
export function AuthPrizeRoleRedirect({ to, when }) {
|
||||||
|
if (when.constructor !== Array || !when.length) {
|
||||||
|
throw new Error('`when` of AuthPrizeRoleRedirect must be an array containing values');
|
||||||
|
}
|
||||||
|
if (!to || to.indexOf('/') === -1) {
|
||||||
|
throw new Error('`to` of AuthPrizeRoleRedirect must be defined and contain a valid route');
|
||||||
|
}
|
||||||
|
|
||||||
|
return function(currentUser, query) {
|
||||||
|
const exprToValidate = when
|
||||||
|
.map(role => currentUser[role])
|
||||||
|
.reduce((a, b) => a || b);
|
||||||
|
|
||||||
|
if (exprToValidate) {
|
||||||
|
window.setTimeout(() => history.replaceState(null, to, query));
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
@ -4,6 +4,7 @@ import React from 'react';
|
|||||||
import GlobalNotification from '../../../global_notification';
|
import GlobalNotification from '../../../global_notification';
|
||||||
|
|
||||||
import Hero from './components/pr_hero';
|
import Hero from './components/pr_hero';
|
||||||
|
import Header from '../../../header';
|
||||||
|
|
||||||
import UserStore from '../../../../stores/user_store';
|
import UserStore from '../../../../stores/user_store';
|
||||||
import UserActions from '../../../../actions/user_actions';
|
import UserActions from '../../../../actions/user_actions';
|
||||||
@ -40,19 +41,28 @@ let PRApp = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { history, children } = this.props;
|
const { history, children, routes } = this.props;
|
||||||
const { currentUser } = this.state;
|
const { currentUser } = this.state;
|
||||||
|
let style = {};
|
||||||
let subdomain = getSubdomain();
|
let subdomain = getSubdomain();
|
||||||
let header;
|
let header;
|
||||||
|
|
||||||
|
|
||||||
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
|
if (currentUser && currentUser.email && history.isActive(`/pieces/${getCookie(currentUser.email)}`)) {
|
||||||
header = <Hero />;
|
header = <Hero />;
|
||||||
|
style = { paddingTop: '0 !important' };
|
||||||
|
} else if(currentUser && (currentUser.is_admin || currentUser.is_jury || currentUser.is_judge)) {
|
||||||
|
header = <Header routes={routes} />;
|
||||||
|
} else {
|
||||||
|
style = { paddingTop: '0 !important' };
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{header}
|
{header}
|
||||||
<div className={'container ascribe-prize-app client--' + subdomain}>
|
<div
|
||||||
|
style={style}
|
||||||
|
className={'container ascribe-prize-app client--' + subdomain}>
|
||||||
{children}
|
{children}
|
||||||
<GlobalNotification />
|
<GlobalNotification />
|
||||||
<div id="modal" className="container"></div>
|
<div id="modal" className="container"></div>
|
||||||
|
@ -22,7 +22,8 @@ import PasswordResetContainer from '../../password_reset_container';
|
|||||||
import CoaVerifyContainer from '../../coa_verify_container';
|
import CoaVerifyContainer from '../../coa_verify_container';
|
||||||
import ErrorNotFoundPage from '../../error_not_found_page';
|
import ErrorNotFoundPage from '../../error_not_found_page';
|
||||||
|
|
||||||
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
import { ProxyHandler, AuthRedirect } from '../../../components/ascribe_routes/proxy_handler';
|
||||||
|
import { AuthPrizeRoleRedirect } from './portfolioreview/components/pr_routes/pr_proxy_handler';
|
||||||
|
|
||||||
|
|
||||||
const ROUTES = {
|
const ROUTES = {
|
||||||
@ -31,28 +32,27 @@ const ROUTES = {
|
|||||||
<IndexRoute component={SPLanding} />
|
<IndexRoute component={SPLanding} />
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SPLoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SPLoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SPSignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SPSignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SPSettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPSettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SPRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPRegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'/>
|
headerTitle='+ NEW WORK'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SPPieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
|
|
||||||
<Route path='pieces/:pieceId' component={SPPieceContainer} />
|
<Route path='pieces/:pieceId' component={SPPieceContainer} />
|
||||||
<Route path='editions/:editionId' component={EditionContainer} />
|
<Route path='editions/:editionId' component={EditionContainer} />
|
||||||
<Route path='verify' component={CoaVerifyContainer} />
|
<Route path='verify' component={CoaVerifyContainer} />
|
||||||
@ -61,24 +61,41 @@ const ROUTES = {
|
|||||||
),
|
),
|
||||||
portfolioreview: (
|
portfolioreview: (
|
||||||
<Route path='/' component={PRApp}>
|
<Route path='/' component={PRApp}>
|
||||||
<IndexRoute component={PRLanding} />
|
<IndexRoute component={ProxyHandler(AuthPrizeRoleRedirect({ to: '/collection', when: ['is_admin', 'is_judge', 'is_jury'] }))(PRLanding)} />
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(PRRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PRRegisterPiece)}/>
|
||||||
headerTitle='+ NEW WORK'/>
|
<Route
|
||||||
|
path='collection'
|
||||||
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
|
||||||
|
headerTitle='SUBMISSIONS'/>
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(SPLoginContainer)} />
|
component={ProxyHandler(
|
||||||
|
AuthPrizeRoleRedirect({ to: '/collection', when: ['is_admin', 'is_judge', 'is_jury'] }),
|
||||||
|
AuthRedirect({to: '/register_piece', when: 'loggedIn'})
|
||||||
|
)(SPLoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(SPSignupContainer)} />
|
component={ProxyHandler(
|
||||||
|
AuthPrizeRoleRedirect({ to: '/collection', when: ['is_admin', 'is_judge', 'is_jury'] }),
|
||||||
|
AuthRedirect({to: '/register_piece', when: 'loggedIn'})
|
||||||
|
)(SPSignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(
|
||||||
|
AuthPrizeRoleRedirect({ to: '/collection', when: ['is_admin', 'is_judge', 'is_jury'] }),
|
||||||
|
AuthRedirect({to: '/register_piece', when: 'loggedIn'})
|
||||||
|
)(PasswordResetContainer)} />
|
||||||
|
<Route
|
||||||
|
path='settings'
|
||||||
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPSettingsContainer)}/>
|
||||||
<Route path='pieces/:pieceId' component={SPPieceContainer} />
|
<Route path='pieces/:pieceId' component={SPPieceContainer} />
|
||||||
|
<Route path='editions/:editionId' component={EditionContainer} />
|
||||||
|
<Route path='verify' component={CoaVerifyContainer} />
|
||||||
<Route path='*' component={ErrorNotFoundPage} />
|
<Route path='*' component={ErrorNotFoundPage} />
|
||||||
</Route>
|
</Route>
|
||||||
)
|
)
|
||||||
|
@ -16,7 +16,7 @@ class PrizeActions {
|
|||||||
.fetch()
|
.fetch()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.actions.updatePrize({
|
this.actions.updatePrize({
|
||||||
prize: res.prize
|
prize: res
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@ -48,7 +48,9 @@ let PrizePieceList = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getButtonSubmit() {
|
getButtonSubmit() {
|
||||||
if (this.state.prize && this.state.prize.active && !this.state.currentUser.is_jury){
|
const { currentUser } = this.state;
|
||||||
|
if (this.state.prize && this.state.prize.active &&
|
||||||
|
!currentUser.is_jury && !currentUser.is_admin && !currentUser.is_judge){
|
||||||
return (
|
return (
|
||||||
<LinkContainer to="/register_piece">
|
<LinkContainer to="/register_piece">
|
||||||
<Button>
|
<Button>
|
||||||
@ -57,9 +59,6 @@ let PrizePieceList = React.createClass({
|
|||||||
</LinkContainer>
|
</LinkContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (this.state.prize && this.state.currentUser.is_judge){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ import LumenusLanding from './components/lumenus/lumenus_landing';
|
|||||||
import Vivi23Landing from './components/23vivi/23vivi_landing';
|
import Vivi23Landing from './components/23vivi/23vivi_landing';
|
||||||
import Vivi23PieceList from './components/23vivi/23vivi_piece_list';
|
import Vivi23PieceList from './components/23vivi/23vivi_piece_list';
|
||||||
|
|
||||||
import AuthProxyHandler from '../../../components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
import { ProxyHandler, AuthRedirect } from '../../../components/ascribe_routes/proxy_handler';
|
||||||
|
|
||||||
import WalletApp from './wallet_app';
|
import WalletApp from './wallet_app';
|
||||||
|
|
||||||
@ -51,29 +51,29 @@ let ROUTES = {
|
|||||||
<IndexRoute component={CylandLanding} />
|
<IndexRoute component={CylandLanding} />
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_settings'
|
path='contract_settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(ContractSettings)}/>
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(CylandRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CylandRegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'/>
|
headerTitle='+ NEW WORK'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(CylandPieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CylandPieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
<Route path='editions/:editionId' component={EditionContainer} />
|
<Route path='editions/:editionId' component={EditionContainer} />
|
||||||
<Route path='verify' component={CoaVerifyContainer} />
|
<Route path='verify' component={CoaVerifyContainer} />
|
||||||
@ -85,29 +85,29 @@ let ROUTES = {
|
|||||||
<Route path='/' component={WalletApp}>
|
<Route path='/' component={WalletApp}>
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_settings'
|
path='contract_settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(ContractSettings)}/>
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(CCRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CCRegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'/>
|
headerTitle='+ NEW WORK'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(PieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
<Route path='pieces/:pieceId' component={PieceContainer} />
|
<Route path='pieces/:pieceId' component={PieceContainer} />
|
||||||
<Route path='editions/:editionId' component={EditionContainer} />
|
<Route path='editions/:editionId' component={EditionContainer} />
|
||||||
@ -120,39 +120,39 @@ let ROUTES = {
|
|||||||
<IndexRoute component={IkonotvLanding} />
|
<IndexRoute component={IkonotvLanding} />
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_settings'
|
path='contract_settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(ContractSettings)}/>
|
||||||
<Route
|
<Route
|
||||||
path='request_loan'
|
path='request_loan'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SendContractAgreementForm)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SendContractAgreementForm)}
|
||||||
headerTitle='SEND NEW CONTRACT'
|
headerTitle='SEND NEW CONTRACT'
|
||||||
aclName='acl_create_contractagreement'/>
|
aclName='acl_create_contractagreement'/>
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(IkonotvRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvRegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'
|
headerTitle='+ NEW WORK'
|
||||||
aclName='acl_create_piece'/>
|
aclName='acl_create_piece'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(IkonotvPieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvPieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_notifications'
|
path='contract_notifications'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(IkonotvContractNotifications)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvContractNotifications)}/>
|
||||||
<Route path='pieces/:pieceId' component={IkonotvPieceContainer} />
|
<Route path='pieces/:pieceId' component={IkonotvPieceContainer} />
|
||||||
<Route path='editions/:editionId' component={EditionContainer} />
|
<Route path='editions/:editionId' component={EditionContainer} />
|
||||||
<Route path='verify' component={CoaVerifyContainer} />
|
<Route path='verify' component={CoaVerifyContainer} />
|
||||||
@ -161,32 +161,32 @@ let ROUTES = {
|
|||||||
),
|
),
|
||||||
'lumenus': (
|
'lumenus': (
|
||||||
<Route path='/' component={WalletApp}>
|
<Route path='/' component={WalletApp}>
|
||||||
<IndexRoute component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LumenusLanding)} />
|
<IndexRoute component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LumenusLanding)} />
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_settings'
|
path='contract_settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(ContractSettings)}/>
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketRegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'/>
|
headerTitle='+ NEW WORK'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketPieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketPieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
|
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
|
||||||
<Route path='editions/:editionId' component={MarketEditionContainer} />
|
<Route path='editions/:editionId' component={MarketEditionContainer} />
|
||||||
@ -196,33 +196,33 @@ let ROUTES = {
|
|||||||
),
|
),
|
||||||
'23vivi': (
|
'23vivi': (
|
||||||
<Route path='/' component={WalletApp}>
|
<Route path='/' component={WalletApp}>
|
||||||
<IndexRoute component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(Vivi23Landing)} />
|
<IndexRoute component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(Vivi23Landing)} />
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_settings'
|
path='contract_settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(ContractSettings)}/>
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(MarketRegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketRegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'
|
headerTitle='+ NEW WORK'
|
||||||
aclName='acl_wallet_submit'/>
|
aclName='acl_wallet_submit'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(Vivi23PieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(Vivi23PieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
|
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
|
||||||
<Route path='editions/:editionId' component={MarketEditionContainer} />
|
<Route path='editions/:editionId' component={MarketEditionContainer} />
|
||||||
|
18
js/routes.js
18
js/routes.js
@ -25,39 +25,39 @@ import ErrorNotFoundPage from './components/error_not_found_page';
|
|||||||
|
|
||||||
import RegisterPiece from './components/register_piece';
|
import RegisterPiece from './components/register_piece';
|
||||||
|
|
||||||
import AuthProxyHandler from './components/ascribe_routes/proxy_routes/auth_proxy_handler';
|
import { ProxyHandler, AuthRedirect } from './components/ascribe_routes/proxy_handler';
|
||||||
|
|
||||||
|
|
||||||
let COMMON_ROUTES = (
|
let COMMON_ROUTES = (
|
||||||
<Route path='/' component={App}>
|
<Route path='/' component={App}>
|
||||||
<Route
|
<Route
|
||||||
path='login'
|
path='login'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(LoginContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(LoginContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='register_piece'
|
path='register_piece'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(RegisterPiece)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(RegisterPiece)}
|
||||||
headerTitle='+ NEW WORK'/>
|
headerTitle='+ NEW WORK'/>
|
||||||
<Route
|
<Route
|
||||||
path='collection'
|
path='collection'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(PieceList)}
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PieceList)}
|
||||||
headerTitle='COLLECTION'/>
|
headerTitle='COLLECTION'/>
|
||||||
<Route
|
<Route
|
||||||
path='signup'
|
path='signup'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(SignupContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(SignupContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='logout'
|
path='logout'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(LogoutContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(LogoutContainer)}/>
|
||||||
<Route path='pieces/:pieceId' component={PieceContainer} />
|
<Route path='pieces/:pieceId' component={PieceContainer} />
|
||||||
<Route path='editions/:editionId' component={EditionContainer} />
|
<Route path='editions/:editionId' component={EditionContainer} />
|
||||||
<Route
|
<Route
|
||||||
path='password_reset'
|
path='password_reset'
|
||||||
component={AuthProxyHandler({to: '/collection', when: 'loggedIn'})(PasswordResetContainer)} />
|
component={ProxyHandler(AuthRedirect({to: '/collection', when: 'loggedIn'}))(PasswordResetContainer)} />
|
||||||
<Route
|
<Route
|
||||||
path='settings'
|
path='settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(SettingsContainer)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SettingsContainer)}/>
|
||||||
<Route
|
<Route
|
||||||
path='contract_settings'
|
path='contract_settings'
|
||||||
component={AuthProxyHandler({to: '/login', when: 'loggedOut'})(ContractSettings)}/>
|
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(ContractSettings)}/>
|
||||||
<Route path='coa_verify' component={CoaVerifyContainer} />
|
<Route path='coa_verify' component={CoaVerifyContainer} />
|
||||||
<Route path='*' component={ErrorNotFoundPage} />
|
<Route path='*' component={ErrorNotFoundPage} />
|
||||||
</Route>
|
</Route>
|
||||||
|
@ -7,6 +7,8 @@ import EditionActions from '../actions/edition_actions';
|
|||||||
import EditionSource from '../sources/edition_source';
|
import EditionSource from '../sources/edition_source';
|
||||||
import CoaSource from '../sources/coa_source';
|
import CoaSource from '../sources/coa_source';
|
||||||
|
|
||||||
|
import { mergeOptions } from '../utils/general_utils';
|
||||||
|
|
||||||
|
|
||||||
class EditionStore {
|
class EditionStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -20,7 +22,7 @@ class EditionStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.bindActions(EditionActions);
|
this.bindActions(EditionActions);
|
||||||
this.registerAsync(Object.assign(EditionSource, CoaSource));
|
this.registerAsync(mergeOptions(EditionSource, CoaSource));
|
||||||
}
|
}
|
||||||
|
|
||||||
onFetchEdition(idToFetch) {
|
onFetchEdition(idToFetch) {
|
||||||
|
@ -26,7 +26,7 @@ class UserStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSuccessFetchCurrentUser({users: [user]}) {
|
onSuccessFetchCurrentUser({users: [user = {}]}) {
|
||||||
this.userMeta.invalidateCache = false;
|
this.userMeta.invalidateCache = false;
|
||||||
this.userMeta.err = null;
|
this.userMeta.err = null;
|
||||||
this.currentUser = user;
|
this.currentUser = user;
|
||||||
|
@ -28,7 +28,7 @@ class WebhookStore {
|
|||||||
this.getInstance().lookupWebhooks();
|
this.getInstance().lookupWebhooks();
|
||||||
}
|
}
|
||||||
|
|
||||||
onSuccessFetchWebhooks({ webhooks }) {
|
onSuccessFetchWebhooks({ webhooks = [] }) {
|
||||||
this.webhookMeta.invalidateCache = false;
|
this.webhookMeta.invalidateCache = false;
|
||||||
this.webhookMeta.err = null;
|
this.webhookMeta.err = null;
|
||||||
this.webhooks = webhooks;
|
this.webhooks = webhooks;
|
||||||
|
@ -25,7 +25,7 @@ class WhitelabelStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSuccessFetchWhitelabel({ whitelabel }) {
|
onSuccessFetchWhitelabel({ whitelabel = {} }) {
|
||||||
this.whitelabelMeta.invalidateCache = false;
|
this.whitelabelMeta.invalidateCache = false;
|
||||||
this.whitelabelMeta.err = null;
|
this.whitelabelMeta.err = null;
|
||||||
this.whitelabel = whitelabel;
|
this.whitelabel = whitelabel;
|
||||||
|
@ -2,7 +2,6 @@ $pr--nav-fg-prim-color: black;
|
|||||||
$pr--button-color: $pr--nav-fg-prim-color;
|
$pr--button-color: $pr--nav-fg-prim-color;
|
||||||
|
|
||||||
.client--portfolioreview {
|
.client--portfolioreview {
|
||||||
padding-top: 0 !important;
|
|
||||||
|
|
||||||
.btn-wide,
|
.btn-wide,
|
||||||
.btn-default {
|
.btn-default {
|
||||||
@ -23,10 +22,59 @@ $pr--button-color: $pr--nav-fg-prim-color;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-default {
|
||||||
|
.navbar-nav > .ascribe-powered-by, li > a {
|
||||||
|
color: $pr--button-color !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active a {
|
||||||
|
border-bottom-color: $pr--button-color !important;
|
||||||
|
color: $pr--button-color !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-bar > .form-group > .input-group input {
|
||||||
|
&::-webkit-input-placeholder {
|
||||||
|
color: rgba($pr--button-color, 0.5);
|
||||||
|
}
|
||||||
|
&::-moz-placeholder {
|
||||||
|
color: rgba($pr--button-color, 0.5);
|
||||||
|
}
|
||||||
|
&:-ms-input-placeholder {
|
||||||
|
color: rgba($pr--button-color, 0.5);
|
||||||
|
}
|
||||||
|
&:-moz-placeholder {
|
||||||
|
color: rgba($pr--button-color, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-ascribe-search {
|
||||||
|
color: $pr--button-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
// filter widget
|
||||||
|
.ascribe-piece-list-toolbar-filter-widget button {
|
||||||
|
background-color: transparent !important;
|
||||||
|
border-color: transparent !important;
|
||||||
|
color: $pr--button-color !important;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:active {
|
||||||
|
background-color: $pr--button-color !important;
|
||||||
|
border-color: $pr--button-color !important;
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ascribe-property {
|
.ascribe-property {
|
||||||
> p > span:not(> .span),
|
> div,
|
||||||
> textarea,
|
> input,
|
||||||
> input {
|
> pre,
|
||||||
|
> select,
|
||||||
|
> span:not(.glyphicon),
|
||||||
|
> p,
|
||||||
|
> p > span,
|
||||||
|
> textarea {
|
||||||
color: $pr--nav-fg-prim-color;
|
color: $pr--nav-fg-prim-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user