From 30d57a943f0416139bd4a76ca8bfe82ab8beabba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 21 Aug 2015 11:01:13 +0200 Subject: [PATCH 1/3] fix lock form --- .../ascribe_detail/further_details_fileuploader.js | 2 +- js/components/ascribe_forms/form_loan.js | 4 ++-- .../ascribe_forms/cyland_additional_data_form.js | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/components/ascribe_detail/further_details_fileuploader.js b/js/components/ascribe_detail/further_details_fileuploader.js index 7c5525fd..2c9f2854 100644 --- a/js/components/ascribe_detail/further_details_fileuploader.js +++ b/js/components/ascribe_detail/further_details_fileuploader.js @@ -33,7 +33,7 @@ let FurtherDetailsFileuploader = React.createClass({ // // 1. there is no other_data => do not show the fileuploader at all // 2. there is other_data, but user has no edit rights => show fileuploader but without action buttons - // 3. both other_data and editable are defined or true => show fileuploade with all action buttons + // 3. both other_data and editable are defined or true => show fileuploader with all action buttons if (!this.props.editable && !this.props.otherData){ return null; } diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index 201ba174..1beac5f9 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -148,7 +148,7 @@ let LoanForm = React.createClass({ label={getLangText('Loanee Email')} onBlur={this.handleOnBlur} editable={!this.props.email} - overrideForm={!this.props.email}> + overrideForm={this.props.email}> + overrideForm={this.props.gallery}> + editable={!this.props.disabled}> + editable={!this.props.disabled}> @@ -115,7 +115,7 @@ let CylandAdditionalDataForm = React.createClass({ submitKey={this.submitKey} setIsUploadReady={this.setIsUploadReady} isReadyForFormSubmission={this.isReadyForFormSubmission} - editable={true} + editable={!this.props.disabled} pieceId={this.props.piece.id} otherData={this.props.piece.other_data} multiple={true}/> From 3b46dbb9f59792f32ce4f022ee329e6a74f0a499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 21 Aug 2015 11:11:31 +0200 Subject: [PATCH 2/3] add upload busy function to fineuploader --- .../ascribe_detail/further_details_fileuploader.js | 2 ++ js/components/ascribe_uploader/react_s3_fine_uploader.js | 6 ++++++ .../cyland/ascribe_forms/cyland_additional_data_form.js | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/js/components/ascribe_detail/further_details_fileuploader.js b/js/components/ascribe_detail/further_details_fileuploader.js index 2c9f2854..69f7bdc8 100644 --- a/js/components/ascribe_detail/further_details_fileuploader.js +++ b/js/components/ascribe_detail/further_details_fileuploader.js @@ -13,6 +13,7 @@ import { getCookie } from '../../utils/fetch_api_utils'; let FurtherDetailsFileuploader = React.createClass({ propTypes: { + uploadStarted: React.PropTypes.func, pieceId: React.PropTypes.number, otherData: React.PropTypes.arrayOf(React.PropTypes.object), setIsUploadReady: React.PropTypes.func, @@ -43,6 +44,7 @@ let FurtherDetailsFileuploader = React.createClass({ 1) { 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 71b91485..b97d568c 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 @@ -48,6 +48,12 @@ let CylandAdditionalDataForm = React.createClass({ }, + uploadStarted() { + this.setState({ + isUploadReady: false + }); + }, + setIsUploadReady(isReady) { this.setState({ isUploadReady: isReady @@ -112,6 +118,7 @@ let CylandAdditionalDataForm = React.createClass({ required="required"/> Date: Fri, 21 Aug 2015 11:29:57 +0200 Subject: [PATCH 3/3] fix locked fields --- js/components/ascribe_forms/form_loan.js | 4 ++-- js/components/ascribe_slides_container/slides_container.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index 1beac5f9..e86a5387 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -148,7 +148,7 @@ let LoanForm = React.createClass({ label={getLangText('Loanee Email')} onBlur={this.handleOnBlur} editable={!this.props.email} - overrideForm={this.props.email}> + overrideForm={!!this.props.email}> + overrideForm={!!this.props.gallery}>