From 906ef7c37e3dceabfbc95227cd0317757e120760 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Wed, 28 Oct 2015 19:19:14 +0100 Subject: [PATCH 1/2] Refactor InputTextAreaToggable's required property to take a bool instead --- js/components/ascribe_forms/form_consign.js | 4 ++-- js/components/ascribe_forms/form_loan.js | 4 ++-- js/components/ascribe_forms/form_piece_extradata.js | 2 +- js/components/ascribe_forms/form_share_email.js | 4 ++-- js/components/ascribe_forms/form_submit_to_prize.js | 4 ++-- js/components/ascribe_forms/form_transfer.js | 4 ++-- js/components/ascribe_forms/form_unconsign.js | 4 ++-- js/components/ascribe_forms/input_textarea_toggable.js | 9 ++++++--- .../whitelabel/prize/components/prize_register_piece.js | 4 ++-- 9 files changed, 21 insertions(+), 18 deletions(-) diff --git a/js/components/ascribe_forms/form_consign.js b/js/components/ascribe_forms/form_consign.js index 5f6e2fc8..da40f009 100644 --- a/js/components/ascribe_forms/form_consign.js +++ b/js/components/ascribe_forms/form_consign.js @@ -65,7 +65,7 @@ let ConsignForm = React.createClass({ rows={1} defaultValue={this.props.message} placeholder={getLangText('Enter a message...')} - required="required"/> + required /> + required={this.props.showPersonalMessage ? true : false}/> {this.getContractCheckbox()} {this.getAppendix()} @@ -304,4 +304,4 @@ let LoanForm = React.createClass({ } }); -export default LoanForm; \ No newline at end of file +export default LoanForm; diff --git a/js/components/ascribe_forms/form_piece_extradata.js b/js/components/ascribe_forms/form_piece_extradata.js index 45f684ad..f6ee4177 100644 --- a/js/components/ascribe_forms/form_piece_extradata.js +++ b/js/components/ascribe_forms/form_piece_extradata.js @@ -50,7 +50,7 @@ let PieceExtraDataForm = React.createClass({ rows={1} defaultValue={defaultValue} placeholder={getLangText('Fill in%s', ' ') + this.props.title} - required="required"/> + required />
diff --git a/js/components/ascribe_forms/form_share_email.js b/js/components/ascribe_forms/form_share_email.js index 53ca87c1..920df0da 100644 --- a/js/components/ascribe_forms/form_share_email.js +++ b/js/components/ascribe_forms/form_share_email.js @@ -71,11 +71,11 @@ let ShareForm = React.createClass({ rows={1} defaultValue={this.props.message} placeholder={getLangText('Enter a message...')} - required="required"/> + required /> ); } }); -export default ShareForm; \ No newline at end of file +export default ShareForm; diff --git a/js/components/ascribe_forms/form_submit_to_prize.js b/js/components/ascribe_forms/form_submit_to_prize.js index d9850ef7..5818a9ce 100644 --- a/js/components/ascribe_forms/form_submit_to_prize.js +++ b/js/components/ascribe_forms/form_submit_to_prize.js @@ -52,7 +52,7 @@ let PieceSubmitToPrizeForm = React.createClass({ + required /> + required /> + required /> + required /> + required /> + required /> Date: Thu, 29 Oct 2015 15:45:00 +0100 Subject: [PATCH 2/2] Remove redundant truth check for required prop --- js/components/ascribe_forms/form_loan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index eb5d60cf..7a0af7fd 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -285,7 +285,7 @@ let LoanForm = React.createClass({ rows={1} defaultValue={this.props.message} placeholder={getLangText('Enter a message...')} - required={this.props.showPersonalMessage ? true : false}/> + required={this.props.showPersonalMessage}/> {this.getContractCheckbox()} {this.getAppendix()}