1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +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:
Tim Daubenschütz 2015-12-07 11:00:39 +01:00
commit 45919f93a6
3 changed files with 11 additions and 7 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

@ -147,7 +147,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

@ -109,7 +109,6 @@ let PieceContainer = React.createClass({
let pieceState = mergeOptions({}, state.piece);
pieceState.acl.acl_loan = false;
this.setState({
piece: pieceState
});
@ -264,7 +263,6 @@ let PieceContainer = React.createClass({
}
buttons={this.getActions()}>
{this.getCreateEditionsDialog()}
<CollapsibleParagraph
title={getLangText('Loan History')}
show={this.state.piece.loan_history && this.state.piece.loan_history.length > 0}>
@ -273,11 +271,14 @@ 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)')}
defaultValue={this.state.piece.private_note || null}
show = {!!this.state.currentUser.username}
placeholder={getLangText('Enter your comments ...')}
editable={true}
successMessage={getLangText('Private note saved')}
@ -285,11 +286,12 @@ let PieceContainer = React.createClass({
currentUser={this.state.currentUser}/>
<Note
id={this.getId}
label={getLangText('Piece note (public)')}
label={getLangText('Personal note (public)')}
defaultValue={this.state.piece.public_note || null}
placeholder={getLangText('Enter your comments ...')}
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}
currentUser={this.state.currentUser}/>
</CollapsibleParagraph>