From cda81b6f5bd73abb9832fb7b31c91c7fe4534baf Mon Sep 17 00:00:00 2001 From: diminator Date: Tue, 29 Sep 2015 18:09:34 +0200 Subject: [PATCH] withdraw consign and acl buttonlist in detail refactor --- js/components/ascribe_detail/edition.js | 68 ++++++++++++++----------- js/constants/api_urls.js | 1 + 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 51884751..832ad386 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -38,6 +38,8 @@ import GlobalNotificationActions from '../../actions/global_notification_actions import Note from './note'; +import AclProxy from '../acl_proxy'; + import ApiUrls from '../../constants/api_urls'; import AppConstants from '../../constants/application_constants'; @@ -216,10 +218,6 @@ let EditionSummary = React.createClass({ refreshCollection: React.PropTypes.func }, - getTransferWithdrawData(){ - return {'bitcoin_id': this.props.edition.bitcoin_id}; - }, - handleSuccess() { this.props.refreshCollection(); this.props.handleSuccess(); @@ -261,30 +259,6 @@ let EditionSummary = React.createClass({ } else { - let withdrawButton = null; - if (this.props.edition.status.length > 0 && this.props.edition.pending_new_owner && this.props.edition.acl.acl_withdraw_transfer) { - withdrawButton = ( -
- -
- ); - } - let unconsignRequestButton = null; - if (this.props.edition.acl.acl_request_unconsign) { - unconsignRequestButton = ( - - ); - } actions = ( @@ -293,11 +267,45 @@ let EditionSummary = React.createClass({ availableAcls={this.props.edition.acl} editions={[this.props.edition]} handleSuccess={this.handleSuccess}> - {withdrawButton} + +
{return {'bitcoin_id': this.props.edition.bitcoin_id}; }} + handleSuccess={this.showNotification} + className='inline' + isInline={true}> + +
+
+ +
{return {'bitcoin_id': this.props.edition.bitcoin_id}; }} + handleSuccess={this.showNotification} + className='inline' + isInline={true}> + +
+
+ + + - {unconsignRequestButton}
); diff --git a/js/constants/api_urls.js b/js/constants/api_urls.js index b8d6713d..2ff689fe 100644 --- a/js/constants/api_urls.js +++ b/js/constants/api_urls.js @@ -38,6 +38,7 @@ let ApiUrls = { 'ownership_consigns': AppConstants.apiEndpoint + 'ownership/consigns/', 'ownership_consigns_confirm': AppConstants.apiEndpoint + 'ownership/consigns/confirm/', 'ownership_consigns_deny': AppConstants.apiEndpoint + 'ownership/consigns/deny/', + 'ownership_consigns_withdraw': AppConstants.apiEndpoint + 'ownership/consigns/withdraw/', 'ownership_loans_pieces': AppConstants.apiEndpoint + 'ownership/loans/pieces/', 'ownership_loans_pieces_confirm': AppConstants.apiEndpoint + 'ownership/loans/pieces/confirm/', 'ownership_loans_pieces_deny': AppConstants.apiEndpoint + 'ownership/loans/pieces/deny/',