mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Merge pull request #32 from ascribe/AD-1342-Public-piece-note-doesnt-render-correctly-def-data-null
Ad 1342 public piece note doesnt render correctly def data null
This commit is contained in:
commit
45919f93a6
@ -12,7 +12,9 @@ const CollapsibleParagraph = React.createClass({
|
|||||||
React.PropTypes.object,
|
React.PropTypes.object,
|
||||||
React.PropTypes.array
|
React.PropTypes.array
|
||||||
]),
|
]),
|
||||||
iconName: React.PropTypes.string
|
iconName: React.PropTypes.string,
|
||||||
|
show: React.PropTypes.bool,
|
||||||
|
defaultExpanded: React.PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
|
@ -147,7 +147,7 @@ let Edition = React.createClass({
|
|||||||
currentUser={this.state.currentUser}/>
|
currentUser={this.state.currentUser}/>
|
||||||
<Note
|
<Note
|
||||||
id={() => {return {'bitcoin_id': this.props.edition.bitcoin_id}; }}
|
id={() => {return {'bitcoin_id': this.props.edition.bitcoin_id}; }}
|
||||||
label={getLangText('Edition note (public)')}
|
label={getLangText('Personal note (public)')}
|
||||||
defaultValue={this.props.edition.public_note ? this.props.edition.public_note : null}
|
defaultValue={this.props.edition.public_note ? this.props.edition.public_note : null}
|
||||||
placeholder={getLangText('Enter your comments ...')}
|
placeholder={getLangText('Enter your comments ...')}
|
||||||
editable={!!this.props.edition.acl.acl_edit}
|
editable={!!this.props.edition.acl.acl_edit}
|
||||||
|
@ -109,7 +109,6 @@ let PieceContainer = React.createClass({
|
|||||||
|
|
||||||
let pieceState = mergeOptions({}, state.piece);
|
let pieceState = mergeOptions({}, state.piece);
|
||||||
pieceState.acl.acl_loan = false;
|
pieceState.acl.acl_loan = false;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
piece: pieceState
|
piece: pieceState
|
||||||
});
|
});
|
||||||
@ -264,7 +263,6 @@ let PieceContainer = React.createClass({
|
|||||||
}
|
}
|
||||||
buttons={this.getActions()}>
|
buttons={this.getActions()}>
|
||||||
{this.getCreateEditionsDialog()}
|
{this.getCreateEditionsDialog()}
|
||||||
|
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Loan History')}
|
title={getLangText('Loan History')}
|
||||||
show={this.state.piece.loan_history && this.state.piece.loan_history.length > 0}>
|
show={this.state.piece.loan_history && this.state.piece.loan_history.length > 0}>
|
||||||
@ -273,11 +271,14 @@ let PieceContainer = React.createClass({
|
|||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
<CollapsibleParagraph
|
<CollapsibleParagraph
|
||||||
title={getLangText('Notes')}
|
title={getLangText('Notes')}
|
||||||
show={!!(this.state.currentUser.username || this.state.piece.public_note)}>
|
show={!!(this.state.currentUser.username
|
||||||
|
|| this.state.piece.acl.acl_edit
|
||||||
|
|| this.state.piece.public_note)}>
|
||||||
<Note
|
<Note
|
||||||
id={this.getId}
|
id={this.getId}
|
||||||
label={getLangText('Personal note (private)')}
|
label={getLangText('Personal note (private)')}
|
||||||
defaultValue={this.state.piece.private_note || null}
|
defaultValue={this.state.piece.private_note || null}
|
||||||
|
show = {!!this.state.currentUser.username}
|
||||||
placeholder={getLangText('Enter your comments ...')}
|
placeholder={getLangText('Enter your comments ...')}
|
||||||
editable={true}
|
editable={true}
|
||||||
successMessage={getLangText('Private note saved')}
|
successMessage={getLangText('Private note saved')}
|
||||||
@ -285,11 +286,12 @@ let PieceContainer = React.createClass({
|
|||||||
currentUser={this.state.currentUser}/>
|
currentUser={this.state.currentUser}/>
|
||||||
<Note
|
<Note
|
||||||
id={this.getId}
|
id={this.getId}
|
||||||
label={getLangText('Piece note (public)')}
|
label={getLangText('Personal note (public)')}
|
||||||
defaultValue={this.state.piece.public_note || null}
|
defaultValue={this.state.piece.public_note || null}
|
||||||
placeholder={getLangText('Enter your comments ...')}
|
placeholder={getLangText('Enter your comments ...')}
|
||||||
editable={!!this.state.piece.acl.acl_edit}
|
editable={!!this.state.piece.acl.acl_edit}
|
||||||
successMessage={getLangText('Public piece note saved')}
|
show={!!(this.state.piece.public_note || this.state.piece.acl.acl_edit)}
|
||||||
|
successMessage={getLangText('Public note saved')}
|
||||||
url={ApiUrls.note_public_piece}
|
url={ApiUrls.note_public_piece}
|
||||||
currentUser={this.state.currentUser}/>
|
currentUser={this.state.currentUser}/>
|
||||||
</CollapsibleParagraph>
|
</CollapsibleParagraph>
|
||||||
|
Loading…
Reference in New Issue
Block a user