mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Merge pull request #33 from ascribe/AD-1270-piece-detail-hangs-on-empty-piece-title
Check for piece and edition validity by using their ids instead of titles
This commit is contained in:
commit
64030473cd
@ -42,8 +42,7 @@ import { getLangText } from '../../utils/lang_utils';
|
||||
let Edition = React.createClass({
|
||||
propTypes: {
|
||||
edition: React.PropTypes.object,
|
||||
loadEdition: React.PropTypes.func,
|
||||
location: React.PropTypes.object
|
||||
loadEdition: React.PropTypes.func
|
||||
},
|
||||
|
||||
mixins: [History],
|
||||
@ -156,8 +155,7 @@ let Edition = React.createClass({
|
||||
pieceId={this.props.edition.parent}
|
||||
extraData={this.props.edition.extra_data}
|
||||
otherData={this.props.edition.other_data}
|
||||
handleSuccess={this.props.loadEdition}
|
||||
location={this.props.location}/>
|
||||
handleSuccess={this.props.loadEdition} />
|
||||
</CollapsibleParagraph>
|
||||
<CollapsibleParagraph
|
||||
title={getLangText('SPOOL Details')}>
|
||||
|
@ -17,8 +17,7 @@ import { setDocumentTitle } from '../../utils/dom_utils';
|
||||
*/
|
||||
let EditionContainer = React.createClass({
|
||||
propTypes: {
|
||||
params: React.PropTypes.object,
|
||||
location: React.PropTypes.object
|
||||
params: React.PropTypes.object
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
@ -67,14 +66,13 @@ let EditionContainer = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
if(this.state.edition && this.state.edition.title) {
|
||||
if(this.state.edition && this.state.edition.id) {
|
||||
setDocumentTitle([this.state.edition.artist_name, this.state.edition.title].join(', '));
|
||||
|
||||
return (
|
||||
<Edition
|
||||
edition={this.state.edition}
|
||||
loadEdition={this.loadEdition}
|
||||
location={this.props.location}/>
|
||||
loadEdition={this.loadEdition} />
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
@ -23,8 +23,7 @@ let FurtherDetails = React.createClass({
|
||||
pieceId: React.PropTypes.number,
|
||||
extraData: React.PropTypes.object,
|
||||
otherData: React.PropTypes.arrayOf(React.PropTypes.object),
|
||||
handleSuccess: React.PropTypes.func,
|
||||
location: React.PropTypes.object
|
||||
handleSuccess: React.PropTypes.func
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
@ -86,8 +85,7 @@ let FurtherDetails = React.createClass({
|
||||
overrideForm={true}
|
||||
pieceId={this.props.pieceId}
|
||||
otherData={this.props.otherData}
|
||||
multiple={true}
|
||||
location={this.props.location}/>
|
||||
multiple={true} />
|
||||
</Form>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -50,8 +50,7 @@ import { setDocumentTitle } from '../../utils/dom_utils';
|
||||
*/
|
||||
let PieceContainer = React.createClass({
|
||||
propTypes: {
|
||||
params: React.PropTypes.object,
|
||||
location: React.PropTypes.object
|
||||
params: React.PropTypes.object
|
||||
},
|
||||
|
||||
mixins: [History],
|
||||
@ -226,7 +225,7 @@ let PieceContainer = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
if(this.state.piece && this.state.piece.title) {
|
||||
if(this.state.piece && this.state.piece.id) {
|
||||
setDocumentTitle([this.state.piece.artist_name, this.state.piece.title].join(', '));
|
||||
|
||||
return (
|
||||
@ -292,8 +291,7 @@ let PieceContainer = React.createClass({
|
||||
pieceId={this.state.piece.id}
|
||||
extraData={this.state.piece.extra_data}
|
||||
otherData={this.state.piece.other_data}
|
||||
handleSuccess={this.loadPiece}
|
||||
location={this.props.location}/>
|
||||
handleSuccess={this.loadPiece} />
|
||||
</CollapsibleParagraph>
|
||||
|
||||
</Piece>
|
||||
|
Loading…
Reference in New Issue
Block a user