From c00e003aeb4454842be98aa712b5b1a551268898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 21 Sep 2015 12:05:42 +0200 Subject: [PATCH] refactor input textarea to use disabled instead of editable --- js/components/ascribe_detail/note.js | 9 ++++--- js/components/ascribe_forms/form_consign.js | 4 ++-- .../ascribe_forms/form_contract_agreement.js | 4 +++- js/components/ascribe_forms/form_loan.js | 2 +- .../ascribe_forms/form_piece_extradata.js | 7 +++--- .../ascribe_forms/form_register_piece.js | 2 +- .../ascribe_forms/form_share_email.js | 4 ++-- .../ascribe_forms/form_submit_to_prize.js | 8 +++---- js/components/ascribe_forms/form_transfer.js | 4 ++-- js/components/ascribe_forms/form_unconsign.js | 4 ++-- .../ascribe_forms/form_unconsign_request.js | 4 ++-- .../ascribe_forms/input_fineuploader.js | 10 ++++---- .../ascribe_forms/input_textarea_toggable.js | 4 ++-- js/components/coa_verify_container.js | 5 ++-- .../ascribe_detail/prize_piece_container.js | 4 ++-- .../prize/components/prize_register_piece.js | 8 +++---- .../ascribe_detail/cyland_piece_container.js | 4 ++-- .../cyland_additional_data_form.js | 9 ++----- .../ascribe_detail/ikonotv_piece_container.js | 8 +++---- .../ikonotv_artist_details_form.js | 16 ++++--------- .../ikonotv_artwork_details_form.js | 24 +++++-------------- 21 files changed, 61 insertions(+), 83 deletions(-) diff --git a/js/components/ascribe_detail/note.js b/js/components/ascribe_detail/note.js index 0f32e5da..b377ff5c 100644 --- a/js/components/ascribe_detail/note.js +++ b/js/components/ascribe_detail/note.js @@ -44,14 +44,13 @@ let Note = React.createClass({
+ handleSuccess={this.showNotification} + disabled={!this.props.editable}> + label={this.props.label}> @@ -63,4 +62,4 @@ let Note = React.createClass({ } }); -export default Note \ No newline at end of file +export default Note; \ No newline at end of file diff --git a/js/components/ascribe_forms/form_consign.js b/js/components/ascribe_forms/form_consign.js index 6f85adc2..de4a4788 100644 --- a/js/components/ascribe_forms/form_consign.js +++ b/js/components/ascribe_forms/form_consign.js @@ -56,10 +56,10 @@ let ConsignForm = React.createClass({ + editable={true} + overrideForm={true}> diff --git a/js/components/ascribe_forms/form_contract_agreement.js b/js/components/ascribe_forms/form_contract_agreement.js index 94ab26d0..85ed6b6a 100644 --- a/js/components/ascribe_forms/form_contract_agreement.js +++ b/js/components/ascribe_forms/form_contract_agreement.js @@ -129,9 +129,11 @@ let ContractAgreementForm = React.createClass({ name='appendix' checkboxLabel={getLangText('Add appendix to the contract')}> {getLangText('Appendix')} + {/* We're using disabled on a form here as PropertyCollapsible currently + does not support the disabled + overrideForm functionality */} diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index aeb942ee..b15ac909 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -256,10 +256,10 @@ let LoanForm = React.createClass({ name='loan_message' label={getLangText('Personal Message')} editable={true} + overrideForm={true} hidden={!this.props.showPersonalMessage}> diff --git a/js/components/ascribe_forms/form_piece_extradata.js b/js/components/ascribe_forms/form_piece_extradata.js index 293ca09e..45f684ad 100644 --- a/js/components/ascribe_forms/form_piece_extradata.js +++ b/js/components/ascribe_forms/form_piece_extradata.js @@ -41,14 +41,13 @@ let PieceExtraDataForm = React.createClass({ ref='form' url={url} handleSuccess={this.props.handleSuccess} - getFormData={this.getFormData}> + getFormData={this.getFormData} + disabled={!this.props.editable}> + label={this.props.title}> diff --git a/js/components/ascribe_forms/form_register_piece.js b/js/components/ascribe_forms/form_register_piece.js index 68902290..118b3968 100644 --- a/js/components/ascribe_forms/form_register_piece.js +++ b/js/components/ascribe_forms/form_register_piece.js @@ -112,7 +112,7 @@ let RegisterPieceForm = React.createClass({ isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} isFineUploaderActive={this.props.isFineUploaderActive} onLoggedOut={this.props.onLoggedOut} - editable={this.props.isFineUploaderEditable} + disabled={!this.props.isFineUploaderEditable} enableLocalHashing={enableLocalHashing}/> + editable={true} + overrideForm={true}> diff --git a/js/components/ascribe_forms/form_submit_to_prize.js b/js/components/ascribe_forms/form_submit_to_prize.js index ff853c01..23075791 100644 --- a/js/components/ascribe_forms/form_submit_to_prize.js +++ b/js/components/ascribe_forms/form_submit_to_prize.js @@ -45,20 +45,20 @@ let PieceSubmitToPrizeForm = React.createClass({ + editable={true} + overrideForm={true}> + editable={true} + overrideForm={true}> diff --git a/js/components/ascribe_forms/form_transfer.js b/js/components/ascribe_forms/form_transfer.js index 6ec73d38..8bbcf110 100644 --- a/js/components/ascribe_forms/form_transfer.js +++ b/js/components/ascribe_forms/form_transfer.js @@ -61,10 +61,10 @@ let TransferForm = React.createClass({ + editable={true} + overrideForm={true}> diff --git a/js/components/ascribe_forms/form_unconsign.js b/js/components/ascribe_forms/form_unconsign.js index 9bc5b4bd..ed6362da 100644 --- a/js/components/ascribe_forms/form_unconsign.js +++ b/js/components/ascribe_forms/form_unconsign.js @@ -50,10 +50,10 @@ let UnConsignForm = React.createClass({ + editable={true} + overrideForm={true}> diff --git a/js/components/ascribe_forms/form_unconsign_request.js b/js/components/ascribe_forms/form_unconsign_request.js index c47b5411..750ee72d 100644 --- a/js/components/ascribe_forms/form_unconsign_request.js +++ b/js/components/ascribe_forms/form_unconsign_request.js @@ -50,10 +50,10 @@ let UnConsignRequestForm = React.createClass({ + editable={true} + overrideForm={true}> diff --git a/js/components/ascribe_forms/input_fineuploader.js b/js/components/ascribe_forms/input_fineuploader.js index 82d6bf92..915d915f 100644 --- a/js/components/ascribe_forms/input_fineuploader.js +++ b/js/components/ascribe_forms/input_fineuploader.js @@ -8,12 +8,14 @@ import AppConstants from '../../constants/application_constants'; import { getCookie } from '../../utils/fetch_api_utils'; -let InputFileUploader = React.createClass({ +let InputFineUploader = React.createClass({ propTypes: { setIsUploadReady: React.PropTypes.func, isReadyForFormSubmission: React.PropTypes.func, submitFileName: React.PropTypes.func, + areAssetsDownloadable: React.PropTypes.bool, + onClick: React.PropTypes.func, keyRoutine: React.PropTypes.shape({ url: React.PropTypes.string, @@ -33,7 +35,7 @@ let InputFileUploader = React.createClass({ // before login in isFineUploaderActive: React.PropTypes.bool, onLoggedOut: React.PropTypes.func, - editable: React.PropTypes.bool, + enableLocalHashing: React.PropTypes.bool, // provided by Property @@ -86,7 +88,7 @@ let InputFileUploader = React.createClass({ submitFile={this.submitFile} setIsUploadReady={this.props.setIsUploadReady} isReadyForFormSubmission={this.props.isReadyForFormSubmission} - areAssetsDownloadable={false} + areAssetsDownloadable={this.props.areAssetsDownloadable} areAssetsEditable={editable} signature={{ endpoint: AppConstants.serverUrl + 's3/signature/', @@ -109,4 +111,4 @@ let InputFileUploader = React.createClass({ } }); -export default InputFileUploader; \ No newline at end of file +export default InputFineUploader; \ No newline at end of file diff --git a/js/components/ascribe_forms/input_textarea_toggable.js b/js/components/ascribe_forms/input_textarea_toggable.js index 39ef36fc..97f880f3 100644 --- a/js/components/ascribe_forms/input_textarea_toggable.js +++ b/js/components/ascribe_forms/input_textarea_toggable.js @@ -7,7 +7,7 @@ import TextareaAutosize from 'react-textarea-autosize'; let InputTextAreaToggable = React.createClass({ propTypes: { - editable: React.PropTypes.bool.isRequired, + disabled: React.PropTypes.bool, rows: React.PropTypes.number.isRequired, required: React.PropTypes.string, defaultValue: React.PropTypes.string @@ -54,7 +54,7 @@ let InputTextAreaToggable = React.createClass({ let className = 'form-control ascribe-textarea'; let textarea = null; - if(this.props.editable) { + if(!this.props.disabled) { className = className + ' ascribe-textarea-editable'; textarea = ( + label="Signature" + editable={true} + overrideForm={true}> diff --git a/js/components/whitelabel/prize/components/ascribe_detail/prize_piece_container.js b/js/components/whitelabel/prize/components/ascribe_detail/prize_piece_container.js index 406b5827..44a727e4 100644 --- a/js/components/whitelabel/prize/components/ascribe_detail/prize_piece_container.js +++ b/js/components/whitelabel/prize/components/ascribe_detail/prize_piece_container.js @@ -426,10 +426,10 @@ let PrizePieceDetails = React.createClass({ + editable={false} + overrideForm={true}> ); } diff --git a/js/components/whitelabel/prize/components/prize_register_piece.js b/js/components/whitelabel/prize/components/prize_register_piece.js index e7a97541..0bd3fe75 100644 --- a/js/components/whitelabel/prize/components/prize_register_piece.js +++ b/js/components/whitelabel/prize/components/prize_register_piece.js @@ -41,20 +41,20 @@ let PrizeRegisterPiece = React.createClass({ + editable={true} + overrideForm={true}> + editable={true} + overrideForm={true}> diff --git a/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js b/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js index dab5eda4..f4a63ec8 100644 --- a/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js +++ b/js/components/whitelabel/wallet/components/cyland/ascribe_detail/cyland_piece_container.js @@ -143,10 +143,10 @@ let CylandPieceDetails = React.createClass({ key={i} name={data} label={label} - editable={false}> + editable={false} + overrideForm={true}> ); } diff --git a/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js b/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js index 123ad2b7..9214123c 100644 --- a/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js +++ b/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js @@ -92,21 +92,17 @@ let CylandAdditionalDataForm = React.createClass({ + label={getLangText('Artist Biography')}> + label={getLangText('Conceptual Overview')}> @@ -115,7 +111,6 @@ let CylandAdditionalDataForm = React.createClass({ submitFile={this.submitFile} setIsUploadReady={this.setIsUploadReady} isReadyForFormSubmission={formSubmissionValidation.fileOptional} - editable={!this.props.disabled} pieceId={this.props.piece.id} otherData={this.props.piece.other_data} multiple={true}/> diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js index ac7d16da..2025c10b 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js @@ -185,7 +185,9 @@ let IkonotvPieceDetails = React.createClass({ title={getLangText('Further Details')} show={true} defaultExpanded={true}> -
+ {Object.keys(this.props.piece.extra_data).map((data, i) => { let label = data.replace('_', ' '); return ( @@ -193,11 +195,9 @@ let IkonotvPieceDetails = React.createClass({ key={i} name={data} label={label} - hidden={!this.props.piece.extra_data[data]} - editable={false}> + hidden={!this.props.piece.extra_data[data]}> ); } diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js index e840173a..ae7324b5 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artist_details_form.js @@ -91,41 +91,33 @@ let IkonotvArtistDetailsForm = React.createClass({ + label={getLangText('Artist Website')}> + label={getLangText('Website of related Gallery, Museum, etc.')}> + label={getLangText('Additional Websites/Publications')}> + label={getLangText('Short text about the Artist')}> diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artwork_details_form.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artwork_details_form.js index 0ff3ae50..1a424011 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artwork_details_form.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_artwork_details_form.js @@ -89,61 +89,49 @@ let IkonotvArtworkDetailsForm = React.createClass({ + label={getLangText('Medium')}> + label={getLangText('Size/Duration')}> + label={getLangText('Copyright')}> + label={getLangText('Courtesy of')}> + label={getLangText('Copyright of Photography')}> + label={getLangText('Additional Details about the artwork')}>