From 116cb9c2fca628d2af882b9010bf4dc7b380831a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 21 Aug 2015 14:07:10 +0200 Subject: [PATCH] fix disappearing fineuploader in additional data --- .../ascribe_detail/further_details_fileuploader.js | 1 + js/components/ascribe_forms/form.js | 1 + .../wallet/components/cyland/cyland_register_piece.js | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/js/components/ascribe_detail/further_details_fileuploader.js b/js/components/ascribe_detail/further_details_fileuploader.js index a6a84416..2b04a210 100644 --- a/js/components/ascribe_detail/further_details_fileuploader.js +++ b/js/components/ascribe_detail/further_details_fileuploader.js @@ -38,6 +38,7 @@ let FurtherDetailsFileuploader = React.createClass({ if (!this.props.editable && (!this.props.otherData || this.props.otherData.length === 0)) { return null; } + let otherDataIds = this.props.otherData ? this.props.otherData.map((data)=>{return data.id; }).join() : null; return ( diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index 12e4ebae..54d4f197 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -106,6 +106,7 @@ let Form = React.createClass({ if ('getFormData' in this.props){ data = mergeOptionsWithDuplicates(data, this.props.getFormData()); } + return data; }, diff --git a/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js b/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js index 7b4e3fe9..489be043 100644 --- a/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js +++ b/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js @@ -106,6 +106,12 @@ let CylandRegisterPiece = React.createClass({ }, handleAdditionalDataSuccess() { + + // We need to refetch the piece again after submitting the additional data + // since we want it's otherData to be displayed when the user choses to click + // on the browsers back button. + PieceActions.fetchOne(this.state.piece.id); + this.refreshPieceList(); this.incrementStep(); @@ -161,7 +167,7 @@ let CylandRegisterPiece = React.createClass({ let today = new Moment(); let datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain = new Moment(); datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain.add(1000, 'years'); - console.log(this.state.piece.id) + return (