From 52ae348e57d759683caf88f9aa6b16786f7046fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 14:07:29 +0200 Subject: [PATCH] dynamic acl for acl_submit --- js/components/ascribe_detail/piece_container.js | 5 +---- .../ascribe_detail/ikonotv_piece_container.js | 15 ++++++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 62fc9b11..b4ec2bf2 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -84,11 +84,8 @@ let PieceContainer = React.createClass({ IT SHOULD BE REMOVED AND REPLACED WITH A BETTER SOLUTION ASAP! - ALSO, WE ENABLED THE LOAN BUTTON FOR IKONOTV TO LET THEM LOAN ON A PIECE LEVEL - */ - let subdomain = window.location.host.split('.')[0]; - if(subdomain !== 'ikonotv' && state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') { + if(state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') { let pieceState = mergeOptions({}, state.piece); pieceState.acl.acl_loan = false; 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 bc84249f..8980f6b4 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 @@ -28,6 +28,7 @@ import DetailProperty from '../../../../../ascribe_detail/detail_property'; import GlobalNotificationModel from '../../../../../../models/global_notification_model'; import GlobalNotificationActions from '../../../../../../actions/global_notification_actions'; +import AclProxy from '../../../../../acl_proxy'; import AppConstants from '../../../../../../constants/application_constants'; @@ -99,7 +100,7 @@ let IkonotvPieceContainer = React.createClass({ } else { - // This is just because we're inserting a custom acl_loan button + //We need to disable the normal acl_loan because we're inserting a custom acl_loan button let availableAcls; if(this.state.piece && this.state.piece.acl && typeof this.state.piece.acl.acl_loan !== 'undefined') { @@ -114,10 +115,14 @@ let IkonotvPieceContainer = React.createClass({ availableAcls={availableAcls} editions={this.state.piece} handleSuccess={this.loadPiece}> - + + +