diff --git a/js/actions/contract_agreement_list_actions.js b/js/actions/contract_agreement_list_actions.js index fe089f24..cd78b52b 100644 --- a/js/actions/contract_agreement_list_actions.js +++ b/js/actions/contract_agreement_list_actions.js @@ -16,7 +16,6 @@ class ContractAgreementListActions { fetchContractAgreementList(issuer, accepted, pending) { this.actions.updateContractAgreementList(null); - return Q.Promise((resolve, reject) => { OwnershipFetcher.fetchContractAgreementList(issuer, accepted, pending) .then((contractAgreementList) => { diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index f7b1f76f..c5f60b76 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -203,7 +203,7 @@ let Form = React.createClass({ } let buttons = null; - if (this.state.edited){ + if (this.state.edited && !this.props.disabled){ buttons = (

diff --git a/js/components/ascribe_forms/input_textarea_toggable.js b/js/components/ascribe_forms/input_textarea_toggable.js index 97f880f3..e789b61e 100644 --- a/js/components/ascribe_forms/input_textarea_toggable.js +++ b/js/components/ascribe_forms/input_textarea_toggable.js @@ -41,10 +41,6 @@ let InputTextAreaToggable = React.createClass({ } }, - componentWillUnmount() { - this.setState({value: null}); - }, - handleChange(event) { this.setState({value: event.target.value}); this.props.onChange(event); 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 f4a63ec8..3264c27e 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 @@ -42,13 +42,6 @@ let CylandPieceContainer = React.createClass({ UserStore.listen(this.onChange); }, - componentWillReceiveProps(nextProps) { - if(this.props.params.pieceId !== nextProps.params.pieceId) { - PieceActions.updatePiece({}); - PieceActions.fetchOne(nextProps.params.pieceId); - } - }, - componentWillUnmount() { // Every time we're leaving the piece detail page, // just reset the piece that is saved in the piece store 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 2025c10b..0425d5d8 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 @@ -21,6 +21,12 @@ import Property from '../../../../../../components/ascribe_forms/property'; import InputTextAreaToggable from '../../../../../../components/ascribe_forms/input_textarea_toggable'; import CollapsibleParagraph from '../../../../../../components/ascribe_collapsible/collapsible_paragraph'; +import IkonotvArtistDetailsForm from '../ascribe_forms/ikonotv_artist_details_form'; +import IkonotvArtworkDetailsForm from '../ascribe_forms/ikonotv_artwork_details_form'; + +import GlobalNotificationModel from '../../../../../../models/global_notification_model'; +import GlobalNotificationActions from '../../../../../../actions/global_notification_actions'; + import HistoryIterator from '../../../../../ascribe_detail/history_iterator'; import Note from '../../../../../ascribe_detail/note'; @@ -44,23 +50,18 @@ let IkonotvPieceContainer = React.createClass({ componentDidMount() { PieceStore.listen(this.onChange); - PieceActions.fetchOne(this.props.params.pieceId); UserStore.listen(this.onChange); - }, - componentWillReceiveProps(nextProps) { - if(this.props.params.pieceId !== nextProps.params.pieceId) { - PieceActions.updatePiece({}); - PieceActions.fetchOne(nextProps.params.pieceId); - } - }, - - componentWillUnmount() { // Every time we're leaving the piece detail page, // just reset the piece that is saved in the piece store // as it will otherwise display wrong/old data once the user loads // the piece detail a second time PieceActions.updatePiece({}); + + this.loadPiece(); + }, + + componentWillUnmount() { PieceStore.unlisten(this.onChange); UserStore.unlisten(this.onChange); }, @@ -159,6 +160,7 @@ let IkonotvPieceContainer = React.createClass({ url={ApiUrls.note_private_piece} currentUser={this.state.currentUser}/> + ); @@ -178,6 +180,11 @@ let IkonotvPieceDetails = React.createClass({ piece: React.PropTypes.object }, + handleSuccess() { + let notification = new GlobalNotificationModel('Artist details successfully updated', 'success', 10000); + GlobalNotificationActions.appendGlobalNotification(notification); + }, + render() { if (this.props.piece && Object.keys(this.props.piece.extra_data).length !== 0){ return ( 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 ae7324b5..11f4d147 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 @@ -7,8 +7,6 @@ import Property from '../../../../../ascribe_forms/property'; import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_toggable'; -//import FurtherDetailsFileuploader from '../../../../../ascribe_detail/further_details_fileuploader'; - import ApiUrls from '../../../../../../constants/api_urls'; import AppConstants from '../../../../../../constants/application_constants'; @@ -25,12 +23,6 @@ let IkonotvArtistDetailsForm = React.createClass({ disabled: React.PropTypes.bool }, - getInitialState() { - return { - isUploadReady: true - }; - }, - getFormData() { let extradata = {}; let formRefs = this.refs.form.refs; @@ -49,18 +41,6 @@ let IkonotvArtistDetailsForm = React.createClass({ }, - uploadStarted() { - this.setState({ - isUploadReady: false - }); - }, - - setIsUploadReady(isReady) { - this.setState({ - isUploadReady: isReady - }); - }, - render() { if(this.props.piece && this.props.piece.id && this.props.piece.extra_data) { return ( 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 1a424011..c4a3be37 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 @@ -23,12 +23,6 @@ let IkonotvArtworkDetailsForm = React.createClass({ disabled: React.PropTypes.bool }, - getInitialState() { - return { - isUploadReady: true - }; - }, - getFormData() { let extradata = {}; let formRefs = this.refs.form.refs; @@ -47,18 +41,6 @@ let IkonotvArtworkDetailsForm = React.createClass({ }, - uploadStarted() { - this.setState({ - isUploadReady: false - }); - }, - - setIsUploadReady(isReady) { - this.setState({ - isUploadReady: isReady - }); - }, - render() { if(this.props.piece && this.props.piece.id && this.props.piece.extra_data) { return (