1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Fix AccordionListTable item links and missing location propagation

This commit is contained in:
Tim Daubenschütz 2015-10-01 14:54:56 +02:00
parent f9393c5bb3
commit 8ba6f11dfe
7 changed files with 22 additions and 19 deletions

View File

@ -110,7 +110,7 @@ let AccordionListItemTableEditions = React.createClass({
showExpandOption = true; showExpandOption = true;
} }
let transition = new TransitionModel('edition', 'editionId', 'bitcoin_id', (e) => e.stopPropagation() ); let transition = new TransitionModel('editions', 'editionId', 'bitcoin_id', (e) => e.stopPropagation() );
let columnList = [ let columnList = [
new ColumnModel( new ColumnModel(

View File

@ -26,7 +26,7 @@ import Form from './../ascribe_forms/form';
import Property from './../ascribe_forms/property'; import Property from './../ascribe_forms/property';
import EditionDetailProperty from './detail_property'; import EditionDetailProperty from './detail_property';
import LicenseDetail from './license_detail'; import LicenseDetail from './license_detail';
import EditionFurtherDetails from './further_details'; import FurtherDetails from './further_details';
import ListRequestActions from './../ascribe_forms/list_form_request_actions'; import ListRequestActions from './../ascribe_forms/list_form_request_actions';
import AclButtonList from './../ascribe_buttons/acl_button_list'; import AclButtonList from './../ascribe_buttons/acl_button_list';
@ -51,7 +51,8 @@ import { mergeOptions } from '../../utils/general_utils';
let Edition = React.createClass({ let Edition = React.createClass({
propTypes: { propTypes: {
edition: React.PropTypes.object, edition: React.PropTypes.object,
loadEdition: React.PropTypes.func loadEdition: React.PropTypes.func,
location: React.PropTypes.object
}, },
mixins: [History], mixins: [History],
@ -186,12 +187,13 @@ let Edition = React.createClass({
show={this.props.edition.acl.acl_edit show={this.props.edition.acl.acl_edit
|| Object.keys(this.props.edition.extra_data).length > 0 || Object.keys(this.props.edition.extra_data).length > 0
|| this.props.edition.other_data.length > 0}> || this.props.edition.other_data.length > 0}>
<EditionFurtherDetails <FurtherDetails
editable={this.props.edition.acl.acl_edit} editable={this.props.edition.acl.acl_edit}
pieceId={this.props.edition.parent} pieceId={this.props.edition.parent}
extraData={this.props.edition.extra_data} extraData={this.props.edition.extra_data}
otherData={this.props.edition.other_data} otherData={this.props.edition.other_data}
handleSuccess={this.props.loadEdition}/> handleSuccess={this.props.loadEdition}
location={this.props.location}/>
</CollapsibleParagraph> </CollapsibleParagraph>
<CollapsibleParagraph <CollapsibleParagraph

View File

@ -10,11 +10,14 @@ import Edition from './edition';
import AppConstants from '../../constants/application_constants'; import AppConstants from '../../constants/application_constants';
/** /**
* This is the component that implements resource/data specific functionality * This is the component that implements resource/data specific functionality
*/ */
let EditionContainer = React.createClass({ let EditionContainer = React.createClass({
propTypes: {
location: React.PropTypes.object
},
getInitialState() { getInitialState() {
return EditionStore.getState(); return EditionStore.getState();
}, },
@ -65,7 +68,8 @@ let EditionContainer = React.createClass({
return ( return (
<Edition <Edition
edition={this.state.edition} edition={this.state.edition}
loadEdition={this.loadEdition}/> loadEdition={this.loadEdition}
location={this.props.location}/>
); );
} else { } else {
return ( return (

View File

@ -6,8 +6,6 @@ import Header from '../../header';
import Footer from '../../footer'; import Footer from '../../footer';
import GlobalNotification from '../../global_notification'; import GlobalNotification from '../../global_notification';
import getRoutes from './prize_routes';
import { getSubdomain } from '../../../utils/general_utils'; import { getSubdomain } from '../../../utils/general_utils';
@ -17,19 +15,18 @@ let PrizeApp = React.createClass({
React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element React.PropTypes.element
]), ]),
history: React.PropTypes.object history: React.PropTypes.object,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
}, },
render() { render() {
let header = null; let header = null;
let subdomain = getSubdomain(); let subdomain = getSubdomain();
let ROUTES = getRoutes(null, subdomain);
if (this.props.history.isActive('/') || this.props.history.isActive('/login') || this.props.history.isActive('/signup')) { if (this.props.history.isActive('/') || this.props.history.isActive('/login') || this.props.history.isActive('/signup')) {
header = <Hero />; header = <Hero />;
} else { } else {
header = <Header showAddWork={false} routes={ROUTES}/>; header = <Header showAddWork={false} routes={this.props.routes}/>;
} }
return ( return (

View File

@ -11,6 +11,9 @@ import { getLangText } from '../../../../../utils/lang_utils';
import { mergeOptions } from '../../../../../utils/general_utils'; import { mergeOptions } from '../../../../../utils/general_utils';
let CCRegisterPiece = React.createClass({ let CCRegisterPiece = React.createClass({
propTypes: {
location: React.PropTypes.object
},
getInitialState() { getInitialState() {
return mergeOptions( return mergeOptions(
@ -82,7 +85,8 @@ let CCRegisterPiece = React.createClass({
<RegisterPiece <RegisterPiece
enableLocalHashing={false} enableLocalHashing={false}
headerMessage={getLangText('Register under a Creative Commons license')} headerMessage={getLangText('Register under a Creative Commons license')}
submitMessage={getLangText('Submit')}> submitMessage={getLangText('Submit')}
location={this.props.location}>
{this.getLicenses()} {this.getLicenses()}
</RegisterPiece> </RegisterPiece>
); );

View File

@ -6,7 +6,6 @@ import Footer from '../../footer';
import GlobalNotification from '../../global_notification'; import GlobalNotification from '../../global_notification';
import getRoutes from './wallet_routes';
import classNames from 'classnames'; import classNames from 'classnames';
import { getSubdomain } from '../../../utils/general_utils'; import { getSubdomain } from '../../../utils/general_utils';
@ -24,7 +23,6 @@ let WalletApp = React.createClass({
render() { render() {
let subdomain = getSubdomain(); let subdomain = getSubdomain();
let ROUTES = getRoutes(null, subdomain);
// In react-router 1.0, Routes have no 'name' property anymore. To keep functionality however, // In react-router 1.0, Routes have no 'name' property anymore. To keep functionality however,
// we split the path by the first occurring slash and take the first splitter. // we split the path by the first occurring slash and take the first splitter.
@ -35,7 +33,7 @@ let WalletApp = React.createClass({
&& (['ikonotv', 'cyland']).indexOf(subdomain) > -1) { && (['ikonotv', 'cyland']).indexOf(subdomain) > -1) {
header = (<div className="hero"/>); header = (<div className="hero"/>);
} else { } else {
header = <Header showAddWork={true} routes={ROUTES} />; header = <Header showAddWork={true} routes={this.props.routes} />;
} }
return ( return (

View File

@ -56,8 +56,6 @@ let ROUTES = {
), ),
'cc': ( 'cc': (
<Route path={baseUrl} component={WalletApp}> <Route path={baseUrl} component={WalletApp}>
<Redirect from={baseUrl} to="login" />
<Redirect from={baseUrl + '/'} to="login" />
<Route path="login" component={LoginContainer} /> <Route path="login" component={LoginContainer} />
<Route path="logout" component={LogoutContainer} /> <Route path="logout" component={LogoutContainer} />
<Route path="signup" component={SignupContainer} /> <Route path="signup" component={SignupContainer} />