1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Fix render bug for personal piece note

This commit is contained in:
Tim Daubenschütz 2015-12-02 16:51:56 +01:00
parent 81f28a02f9
commit 8fcb7fcb01
3 changed files with 8 additions and 3 deletions

View File

@ -12,7 +12,9 @@ const CollapsibleParagraph = React.createClass({
React.PropTypes.object,
React.PropTypes.array
]),
iconName: React.PropTypes.string
iconName: React.PropTypes.string,
show: React.PropTypes.bool,
defaultExpanded: React.PropTypes.bool
},
getDefaultProps() {

View File

@ -136,7 +136,7 @@ let Edition = React.createClass({
currentUser={this.state.currentUser}/>
<Note
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}
placeholder={getLangText('Enter your comments ...')}
editable={!!this.props.edition.acl.acl_edit}

View File

@ -258,7 +258,9 @@ let PieceContainer = React.createClass({
</CollapsibleParagraph>
<CollapsibleParagraph
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
id={this.getId}
label={getLangText('Personal note (private)')}
@ -275,6 +277,7 @@ let PieceContainer = React.createClass({
defaultValue={this.state.piece.public_note || null}
placeholder={getLangText('Enter your comments ...')}
editable={!!this.state.piece.acl.acl_edit}
show={!!this.state.piece.public_note || !!this.state.piece.acl.acl_edit}
successMessage={getLangText('Public note saved')}
url={ApiUrls.note_public_piece}
currentUser={this.state.currentUser}/>