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 3264c27e..51e65386 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 @@ -19,6 +19,8 @@ import CollapsibleParagraph from '../../../../../../components/ascribe_collapsib import HistoryIterator from '../../../../../ascribe_detail/history_iterator'; import Note from '../../../../../ascribe_detail/note'; +import CylandAdditionalDataForm from '../../cyland/ascribe_forms/cyland_additional_data_form'; + import FurtherDetailsFileuploader from '../../../../../ascribe_detail/further_details_fileuploader'; import DetailProperty from '../../../../../ascribe_detail/detail_property'; @@ -102,7 +104,15 @@ let CylandPieceContainer = React.createClass({ url={ApiUrls.note_private_piece} currentUser={this.state.currentUser}/> - + + + ); } else { @@ -115,47 +125,4 @@ let CylandPieceContainer = React.createClass({ } }); - -let CylandPieceDetails = React.createClass({ - propTypes: { - piece: React.PropTypes.object - }, - - render() { - if (this.props.piece && Object.keys(this.props.piece.extra_data).length !== 0){ - return ( - -
- {Object.keys(this.props.piece.extra_data).map((data, i) => { - let label = data.replace('_', ' '); - return ( - - - ); - } - )} - -
- -
- ); - } - return null; - } -}); - export default CylandPieceContainer; 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 9214123c..0fd023c2 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 @@ -9,6 +9,9 @@ import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_t import FurtherDetailsFileuploader from '../../../../../ascribe_detail/further_details_fileuploader'; +import GlobalNotificationModel from '../../../../../../models/global_notification_model'; +import GlobalNotificationActions from '../../../../../../actions/global_notification_actions'; + import ApiUrls from '../../../../../../constants/api_urls'; import AppConstants from '../../../../../../constants/application_constants'; @@ -20,10 +23,21 @@ import { formSubmissionValidation } from '../../../../../ascribe_uploader/react_ let CylandAdditionalDataForm = React.createClass({ propTypes: { - handleSuccess: React.PropTypes.func.isRequired, + handleSuccess: React.PropTypes.func, piece: React.PropTypes.object.isRequired, + disabled: React.PropTypes.bool, + isInline: React.PropTypes.bool + }, - disabled: React.PropTypes.bool + getDefaultProps() { + return { + isInline: false + }; + }, + + handleSuccess() { + let notification = new GlobalNotificationModel('Further details successfully updated', 'success', 10000); + GlobalNotificationActions.appendGlobalNotification(notification); }, getInitialState() { @@ -63,56 +77,69 @@ let CylandAdditionalDataForm = React.createClass({ }, render() { - if(this.props.piece && this.props.piece.id) { + let { piece, isInline, disabled, handleSuccess } = this.props; + let buttons, spinner, heading; + + if(!isInline) { + buttons = ( + + ); + + spinner = ( +
+ +
+ ); + + heading = ( +
+

+ {getLangText('Provide supporting materials')} +

+
+ ); + } + + if(piece && piece.id) { return (
- {getLangText('Proceed to loan')} - - } - spinner={ -
- -
- }> -
-

- {getLangText('Provide supporting materials')} -

-
+ buttons={buttons} + spinner={spinner}> + {heading} + defaultValue={piece.extra_data.artist_bio} + placeholder={getLangText('Enter the artist\'s biography...')}/> + defaultValue={piece.extra_data.conceptual_overview} + placeholder={getLangText('Enter a conceptual overview...')}/> ); 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 93c4ef63..1fe5016d 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 @@ -20,7 +20,7 @@ import { getLangText } from '../../../../../../utils/lang_utils'; let IkonotvArtistDetailsForm = React.createClass({ propTypes: { - handleSuccess: React.PropTypes.func.isRequired, + handleSuccess: React.PropTypes.func, piece: React.PropTypes.object.isRequired, disabled: React.PropTypes.bool, @@ -57,10 +57,9 @@ let IkonotvArtistDetailsForm = React.createClass({ GlobalNotificationActions.appendGlobalNotification(notification); }, - render() { let buttons, spinner, heading; - let { isInline } = this.props; + let { isInline, handleSuccess } = this.props; if(!isInline) { @@ -95,7 +94,7 @@ let IkonotvArtistDetailsForm = React.createClass({ className="ascribe-form-bordered" ref='form' url={requests.prepareUrl(ApiUrls.piece_extradata, {piece_id: this.props.piece.id})} - handleSuccess={this.handleSuccess} + handleSuccess={handleSuccess || this.handleSuccess} getFormData={this.getFormData} buttons={buttons} spinner={spinner}> 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 cfd51d5b..f091d860 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 @@ -20,6 +20,7 @@ import { getLangText } from '../../../../../../utils/lang_utils'; let IkonotvArtworkDetailsForm = React.createClass({ propTypes: { + handleSuccess: React.PropTypes.func, piece: React.PropTypes.object.isRequired, disabled: React.PropTypes.bool, @@ -58,7 +59,7 @@ let IkonotvArtworkDetailsForm = React.createClass({ render() { let buttons, spinner, heading; - let { isInline } = this.props; + let { isInline, handleSuccess } = this.props; if(!isInline) { buttons = ( @@ -92,7 +93,7 @@ let IkonotvArtworkDetailsForm = React.createClass({ className="ascribe-form-bordered" ref='form' url={requests.prepareUrl(ApiUrls.piece_extradata, {piece_id: this.props.piece.id})} - handleSuccess={this.handleSuccess} + handleSuccess={handleSuccess || this.handleSuccess} getFormData={this.getFormData} buttons={buttons} spinner={spinner}>