From 5688bde3c70e514104f021af18934b9ddebbd8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 24 Aug 2015 16:13:37 +0200 Subject: [PATCH 01/17] update readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6fae0011..270c4a5f 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,11 @@ gulp serve Additionally, to work on the white labeling functionality, you need to edit your `/etc/hosts` file and add: ``` -127.0.0.1 localhost.com -127.0.0.1 cc.localhost.com +127.0.0.1 localhost.com +127.0.0.1 cc.localhost.com +127.0.0.1 cyland.localhost.com +127.0.0.1 ikonotv.localhost.com +127.0.0.1 sluice.localhost.com ``` From cd49a9c4027fab83abd4387c8479c77fcce9f6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 25 Aug 2015 16:33:26 +0200 Subject: [PATCH 02/17] Create generic links in nav using routes --- js/components/header.js | 5 +- js/components/nav_routes_links.js | 65 +++++++++++++++++++ .../ikonotv/ikonotv_register_piece.js | 4 +- .../ikonotv/ikonotv_request_loan.js | 16 +++++ js/components/whitelabel/wallet/wallet_app.js | 9 ++- .../whitelabel/wallet/wallet_routes.js | 2 + js/utils/general_utils.js | 17 +++++ sass/main.scss | 5 +- 8 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 js/components/nav_routes_links.js create mode 100644 js/components/whitelabel/wallet/components/ikonotv/ikonotv_request_loan.js diff --git a/js/components/header.js b/js/components/header.js index 2effa7fe..6c2dfac8 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -20,6 +20,7 @@ import NavItemLink from 'react-router-bootstrap/lib/NavItemLink'; import HeaderNotificationDebug from './header_notification_debug'; +import NavRoutesLinks from './nav_routes_links'; import { mergeOptions } from '../utils/general_utils'; import { getLangText } from '../utils/lang_utils'; @@ -27,7 +28,8 @@ import { getLangText } from '../utils/lang_utils'; let Header = React.createClass({ propTypes: { - showAddWork: React.PropTypes.bool + showAddWork: React.PropTypes.bool, + routes: React.PropTypes.element }, mixins: [Router.State], @@ -129,6 +131,7 @@ let Header = React.createClass({ {account} {signup} + diff --git a/js/components/nav_routes_links.js b/js/components/nav_routes_links.js new file mode 100644 index 00000000..0e03e0fe --- /dev/null +++ b/js/components/nav_routes_links.js @@ -0,0 +1,65 @@ +'use strict'; + +import React from 'react'; + +import Nav from 'react-bootstrap/lib/Nav'; +import DropdownButton from 'react-bootstrap/lib/DropdownButton'; +import MenuItemLink from 'react-router-bootstrap/lib/MenuItemLink'; +import NavItemLink from 'react-router-bootstrap/lib/NavItemLink'; + +import { sanitizeList } from '../utils/general_utils'; + + +let NavRoutesLinks = React.createClass({ + propTypes: { + routes: React.PropTypes.element + }, + + extractLinksFromRoutes(node, i) { + + node = node.props; + + let links = node.children.map((child, j) => { + + // check if this a candidate for a link generation + if(child.props.headerTitle && typeof child.props.headerTitle === 'string') { + + // also check if it is a candidate for generating a dropdown menu + if(child.props.children && child.props.children.length > 0) { + return ( + + {this.extractLinksFromRoutes(child, i++)} + + ); + } else if(i === 1) { + // if the node's child is actually a node of level one (a child of a node), we're + // returning a DropdownButton matching MenuItemLink + return ( + {child.props.headerTitle} + ); + } else if(i === 0) { + return ( + {child.props.headerTitle} + ); + } else { + return null; + } + } else { + return null; + } + }); + + // remove all nulls from the list of generated links + return sanitizeList(links); + }, + + render() { + return ( + + ); + } +}); + +export default NavRoutesLinks; \ No newline at end of file diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js index 33cc576c..814b0f01 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js @@ -55,14 +55,14 @@ let IkonotvRegisterPiece = React.createClass({ render() { - if (this.state.currentUser && + /* if (this.state.currentUser && this.state.whitelabel && this.state.whitelabel.user && this.state.currentUser.email === this.state.whitelabel.user){ return ( ); - } + } */ return (
+ ); + } +}); + +export default IkonotvRequestLoan; \ No newline at end of file diff --git a/js/components/whitelabel/wallet/wallet_app.js b/js/components/whitelabel/wallet/wallet_app.js index f31ec429..06bac15f 100644 --- a/js/components/whitelabel/wallet/wallet_app.js +++ b/js/components/whitelabel/wallet/wallet_app.js @@ -7,21 +7,26 @@ import Footer from '../../footer'; import GlobalNotification from '../../global_notification'; +import getRoutes from './wallet_routes'; + let RouteHandler = Router.RouteHandler; let WalletApp = React.createClass({ mixins: [Router.State], render() { - let header = null; let subdomain = window.location.host.split('.')[0]; + let ROUTES = getRoutes(null, subdomain); + + let header = null; if ((this.isActive('landing') || this.isActive('login') || this.isActive('signup')) && (['ikonotv', 'cyland']).indexOf(subdomain) > -1) { header = (
); } else { - header =
; + header =
; } + return (
{header} diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 435b1695..941c5a9c 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -21,6 +21,7 @@ import CylandPieceList from './components/cyland/cyland_piece_list'; import IkonotvPieceList from './components/ikonotv/ikonotv_piece_list'; import IkonotvRegisterPiece from './components/ikonotv/ikonotv_register_piece'; +import IkonotvRequestLoan from './components/ikonotv/ikonotv_request_loan'; import CCRegisterPiece from './components/cc/cc_register_piece'; @@ -69,6 +70,7 @@ let ROUTES = { + diff --git a/js/utils/general_utils.js b/js/utils/general_utils.js index 70c94a97..15b0e85f 100644 --- a/js/utils/general_utils.js +++ b/js/utils/general_utils.js @@ -26,6 +26,23 @@ export function sanitize(obj, filterFn) { return obj; } +/** + * Removes all falsy values (undefined, null, false, ...) from a list/array + * @param {array} l the array to sanitize + * @return {array} the sanitized array + */ +export function sanitizeList(l) { + let sanitizedList = []; + + for(let i = 0; i < l.length; i++) { + if(l[i]) { + sanitizedList.push(l[i]); + } + } + + return sanitizedList; +} + /** * Sums up a list of numbers. Like a Epsilon-math-kinda-sum... */ diff --git a/sass/main.scss b/sass/main.scss index fed435f0..229c04c8 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -100,10 +100,9 @@ hr { } .img-brand { - padding: 0; - height: 45px; - margin: 5px 0 5px 0; + height: 60px; } + .truncate { white-space: nowrap; width: 4em; From 9d7a9bd028a10669533848244b4b7b33c37e8bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 27 Aug 2015 14:34:15 +0200 Subject: [PATCH 03/17] add router/navigation integration into whole project --- js/components/ascribe_app.js | 7 +++--- js/components/header.js | 7 ------ js/components/nav_routes_links.js | 7 ++++-- js/components/routes.js | 25 ------------------- js/components/whitelabel/prize/prize_app.js | 8 +++++- .../whitelabel/prize/prize_routes.js | 4 +-- .../whitelabel/wallet/wallet_routes.js | 14 +++++------ js/routes.js | 17 +++++++++---- 8 files changed, 37 insertions(+), 52 deletions(-) delete mode 100644 js/components/routes.js diff --git a/js/components/ascribe_app.js b/js/components/ascribe_app.js index b4a894a3..789399b0 100644 --- a/js/components/ascribe_app.js +++ b/js/components/ascribe_app.js @@ -6,15 +6,16 @@ import Header from '../components/header'; import Footer from '../components/footer'; import GlobalNotification from './global_notification'; -// let Link = Router.Link; -let RouteHandler = Router.RouteHandler; +import getRoutes from '../routes'; +let RouteHandler = Router.RouteHandler; + let AscribeApp = React.createClass({ render() { return (
-
+
diff --git a/js/components/header.js b/js/components/header.js index 6c2dfac8..4cd8e4b0 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -93,8 +93,6 @@ let Header = React.createClass({ render() { let account = null; let signup = null; - let collection = null; - let addNewWork = null; if (this.state.currentUser.username){ account = ( @@ -103,9 +101,6 @@ let Header = React.createClass({ {getLangText('Log out')} ); - - collection = {getLangText('COLLECTION')}; - addNewWork = this.props.showAddWork ? + {getLangText('NEW WORK')} : null; } else { account = {getLangText('LOGIN')}; @@ -126,8 +121,6 @@ let Header = React.createClass({ diff --git a/js/components/nav_routes_links.js b/js/components/nav_routes_links.js index 0e03e0fe..9a266ba8 100644 --- a/js/components/nav_routes_links.js +++ b/js/components/nav_routes_links.js @@ -16,6 +16,9 @@ let NavRoutesLinks = React.createClass({ }, extractLinksFromRoutes(node, i) { + if(!node) { + return; + } node = node.props; @@ -35,11 +38,11 @@ let NavRoutesLinks = React.createClass({ // if the node's child is actually a node of level one (a child of a node), we're // returning a DropdownButton matching MenuItemLink return ( - {child.props.headerTitle} + {child.props.headerTitle} ); } else if(i === 0) { return ( - {child.props.headerTitle} + {child.props.headerTitle} ); } else { return null; diff --git a/js/components/routes.js b/js/components/routes.js deleted file mode 100644 index 8b230a5a..00000000 --- a/js/components/routes.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -import React from 'react'; -import Router from 'react-router'; - -import App from './ascribe_app'; -import AppConstants from '../constants/application_constants'; - -let Route = Router.Route; -let Redirect = Router.Redirect; -let baseUrl = AppConstants.baseUrl; - - -function getRoutes(commonRoutes) { - return ( - - - - {commonRoutes} - - ); -} - - -export default getRoutes; diff --git a/js/components/whitelabel/prize/prize_app.js b/js/components/whitelabel/prize/prize_app.js index dec859fc..29763ab3 100644 --- a/js/components/whitelabel/prize/prize_app.js +++ b/js/components/whitelabel/prize/prize_app.js @@ -7,6 +7,8 @@ import Header from '../../header'; import Footer from '../../footer'; import GlobalNotification from '../../global_notification'; +import getRoutes from './prize_routes'; + let RouteHandler = Router.RouteHandler; let PrizeApp = React.createClass({ @@ -14,10 +16,14 @@ let PrizeApp = React.createClass({ render() { let header = null; + let subdomain = window.location.host.split('.')[0]; + + let ROUTES = getRoutes(null, subdomain); + if (this.isActive('landing') || this.isActive('login') || this.isActive('signup')) { header = ; } else { - header =
; + header =
; } return ( diff --git a/js/components/whitelabel/prize/prize_routes.js b/js/components/whitelabel/prize/prize_routes.js index 1384d26b..a389cb83 100644 --- a/js/components/whitelabel/prize/prize_routes.js +++ b/js/components/whitelabel/prize/prize_routes.js @@ -29,8 +29,8 @@ function getRoutes() { - - + + diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 941c5a9c..a315bf3d 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -41,8 +41,8 @@ let ROUTES = { - - + + @@ -56,8 +56,8 @@ let ROUTES = { - - + + @@ -70,9 +70,9 @@ let ROUTES = { - - - + + + diff --git a/js/routes.js b/js/routes.js index 65dfbaac..f76e4b45 100644 --- a/js/routes.js +++ b/js/routes.js @@ -5,7 +5,8 @@ import Router from 'react-router'; import getPrizeRoutes from './components/whitelabel/prize/prize_routes'; import getWalletRoutes from './components/whitelabel/wallet/wallet_routes'; -import getDefaultRoutes from './components/routes'; + +import App from './components/ascribe_app'; import PieceList from './components/piece_list'; import PieceContainer from './components/ascribe_detail/piece_container'; @@ -23,19 +24,25 @@ import RegisterPiece from './components/register_piece'; import PrizesDashboard from './components/ascribe_prizes_dashboard/prizes_dashboard'; +import AppConstants from './constants/application_constants'; + let Route = Router.Route; +let Redirect = Router.Redirect; +let baseUrl = AppConstants.baseUrl; const COMMON_ROUTES = ( - + + + - + + - @@ -51,7 +58,7 @@ function getRoutes(type, subdomain) { } else if(type === 'wallet') { routes = getWalletRoutes(COMMON_ROUTES, subdomain); } else { - routes = getDefaultRoutes(COMMON_ROUTES); + routes = COMMON_ROUTES; } return routes; From 64d23f82dffae7fdd92f2028c00810ba68f6cd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 27 Aug 2015 14:47:33 +0200 Subject: [PATCH 04/17] refactoring of the general architecture --- .../components/ikonotv/ikonotv_landing.js | 13 +++ .../ikonotv/ikonotv_register_piece.js | 80 ------------------- .../whitelabel/wallet/wallet_routes.js | 7 +- 3 files changed, 17 insertions(+), 83 deletions(-) create mode 100644 js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js delete mode 100644 js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js new file mode 100644 index 00000000..9893da0d --- /dev/null +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js @@ -0,0 +1,13 @@ +'use strict'; + +import React from 'react'; + +let IkonotvLanding = React.createClass({ + render() { + return ( + This is a landing page placeholder + ); + } +}); + +export default IkonotvLanding; \ No newline at end of file diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js deleted file mode 100644 index 814b0f01..00000000 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -import React from 'react'; -import Router from 'react-router'; - -import WhitelabelActions from '../../../../../actions/whitelabel_actions'; -import WhitelabelStore from '../../../../../stores/whitelabel_store'; - -import PieceListStore from '../../../../../stores/piece_list_store'; -import PieceListActions from '../../../../../actions/piece_list_actions'; - -import UserStore from '../../../../../stores/user_store'; -import UserActions from '../../../../../actions/user_actions'; - -import PieceStore from '../../../../../stores/piece_store'; -import PieceActions from '../../../../../actions/piece_actions'; - -import ContractForm from './ascribe_forms/ikonotv_contract_form'; -import RegisterPieceForm from '../../../../../components/ascribe_forms/form_register_piece'; -import Property from '../../../../../components/ascribe_forms/property'; -import InputCheckbox from '../../../../../components/ascribe_forms/input_checkbox'; - -import GlobalNotificationModel from '../../../../../models/global_notification_model'; -import GlobalNotificationActions from '../../../../../actions/global_notification_actions'; - -import { getLangText } from '../../../../../utils/lang_utils'; -import { mergeOptions } from '../../../../../utils/general_utils'; - - -let IkonotvRegisterPiece = React.createClass({ - - mixins: [Router.Navigation], - - getInitialState(){ - return mergeOptions( - UserStore.getState(), - WhitelabelStore.getState()); - }, - - componentDidMount() { - UserStore.listen(this.onChange); - WhitelabelStore.listen(this.onChange); - UserActions.fetchCurrentUser(); - WhitelabelActions.fetchWhitelabel(); - }, - - componentWillUnmount() { - UserStore.unlisten(this.onChange); - WhitelabelStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - - - render() { - /* if (this.state.currentUser && - this.state.whitelabel && - this.state.whitelabel.user && - this.state.currentUser.email === this.state.whitelabel.user){ - return ( - - ); - } */ - return ( -
- -
- ); - - } -}); - - -export default IkonotvRegisterPiece; diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index a315bf3d..133d66ac 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -12,13 +12,14 @@ import PieceList from '../../../components/piece_list'; import PieceContainer from '../../../components/ascribe_detail/piece_container'; import EditionContainer from '../../../components/ascribe_detail/edition_container'; import SettingsContainer from '../../../components/settings_container'; +import RegisterPiece from '../../../components/register_piece'; -// specific components import CylandLanding from './components/cyland/cyland_landing'; import CylandPieceContainer from './components/cyland/ascribe_detail/cyland_piece_container'; import CylandRegisterPiece from './components/cyland/cyland_register_piece'; import CylandPieceList from './components/cyland/cyland_piece_list'; +import IkonotvLanding from './components/ikonotv/ikonotv_landing'; import IkonotvPieceList from './components/ikonotv/ikonotv_piece_list'; import IkonotvRegisterPiece from './components/ikonotv/ikonotv_register_piece'; import IkonotvRequestLoan from './components/ikonotv/ikonotv_request_loan'; @@ -65,13 +66,13 @@ let ROUTES = { ), 'ikonotv': ( - + - + From 65148e24de68c91e1fe817d4d6fca0ebaa1c341a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 27 Aug 2015 14:56:49 +0200 Subject: [PATCH 05/17] remove contract form from ikonotv codebase and integrate it into ascribe-core --- .../contract_form.js} | 18 +++++++++--------- .../components/ikonotv/ikonotv_request_loan.js | 2 +- .../whitelabel/wallet/wallet_routes.js | 1 - 3 files changed, 10 insertions(+), 11 deletions(-) rename js/components/{whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_contract_form.js => ascribe_forms/contract_form.js} (86%) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_contract_form.js b/js/components/ascribe_forms/contract_form.js similarity index 86% rename from js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_contract_form.js rename to js/components/ascribe_forms/contract_form.js index 2d56ac6f..91f1d487 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_forms/ikonotv_contract_form.js +++ b/js/components/ascribe_forms/contract_form.js @@ -2,20 +2,20 @@ import React from 'react'; -import Property from '../../../../../ascribe_forms/property'; +import Property from './property'; -import LoanContractListActions from '../../../../../../actions/loan_contract_list_actions'; -import LoanContractListStore from '../../../../../../stores/loan_contract_list_store'; +import LoanContractListActions from '../../actions/loan_contract_list_actions'; +import LoanContractListStore from '../../stores/loan_contract_list_store'; -import GlobalNotificationModel from '../../../../../../models/global_notification_model'; -import GlobalNotificationActions from '../../../../../../actions/global_notification_actions'; +import GlobalNotificationModel from '../../models/global_notification_model'; +import GlobalNotificationActions from '../../actions/global_notification_actions'; -import Form from '../../../../../ascribe_forms/form'; +import Form from './form'; -import ApiUrls from '../../../../../../constants/api_urls'; +import ApiUrls from '../../constants/api_urls'; -import { getLangText } from '../../../../../../utils/lang_utils'; -import { mergeOptions } from '../../../../../../utils/general_utils'; +import { getLangText } from '../../utils/lang_utils'; +import { mergeOptions } from '../../utils/general_utils'; let ContractForm = React.createClass({ diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_request_loan.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_request_loan.js index 78f8b3b4..e9c61f51 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_request_loan.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_request_loan.js @@ -2,7 +2,7 @@ import React from 'react'; -import ContractForm from './ascribe_forms/ikonotv_contract_form'; +import ContractForm from '../../../../../components/ascribe_forms/contract_form'; let IkonotvRequestLoan = React.createClass({ diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 133d66ac..d5937710 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -21,7 +21,6 @@ import CylandPieceList from './components/cyland/cyland_piece_list'; import IkonotvLanding from './components/ikonotv/ikonotv_landing'; import IkonotvPieceList from './components/ikonotv/ikonotv_piece_list'; -import IkonotvRegisterPiece from './components/ikonotv/ikonotv_register_piece'; import IkonotvRequestLoan from './components/ikonotv/ikonotv_request_loan'; import CCRegisterPiece from './components/cc/cc_register_piece'; From 86efb66663404e335f27ff94da1df19154e5ce3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 27 Aug 2015 17:33:51 +0200 Subject: [PATCH 06/17] add collapsible appendix to send contract form --- js/components/ascribe_forms/contract_form.js | 24 ++++++++++--------- .../whitelabel/wallet/wallet_routes.js | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/js/components/ascribe_forms/contract_form.js b/js/components/ascribe_forms/contract_form.js index 91f1d487..5b811cf6 100644 --- a/js/components/ascribe_forms/contract_form.js +++ b/js/components/ascribe_forms/contract_form.js @@ -2,8 +2,6 @@ import React from 'react'; -import Property from './property'; - import LoanContractListActions from '../../actions/loan_contract_list_actions'; import LoanContractListStore from '../../stores/loan_contract_list_store'; @@ -11,6 +9,9 @@ import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; import Form from './form'; +import Property from './property'; +import PropertyCollapsible from './property_collapsible'; +import InputTextAreaToggable from './input_textarea_toggable'; import ApiUrls from '../../constants/api_urls'; @@ -96,7 +97,7 @@ let ContractForm = React.createClass({ buttons={} spinner={ @@ -104,7 +105,7 @@ let ContractForm = React.createClass({ }>
-

{getLangText('CONTRACT FORM')}

+

{getLangText('Contract form')}

{this.getContracts()} - - - + checkboxLabel={getLangText('Add appendix to the contract')}> + {getLangText('Appendix')} + + ); } diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index d5937710..6836ec66 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -70,7 +70,7 @@ let ROUTES = { - + From 9a9aa68ca9ecd4774aa19a0f92026bfc28a75b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 11:13:28 +0200 Subject: [PATCH 07/17] fix lazy evalutaion of loan form --- js/components/ascribe_forms/form_loan.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/components/ascribe_forms/form_loan.js b/js/components/ascribe_forms/form_loan.js index f9b866a3..276ff492 100644 --- a/js/components/ascribe_forms/form_loan.js +++ b/js/components/ascribe_forms/form_loan.js @@ -68,8 +68,12 @@ let LoanForm = React.createClass({ return this.props.id; }, - handleOnBlur(event) { - LoanContractActions.fetchLoanContract(event.target.value); + handleOnChange(event) { + let potentialEmail = event.target.value; + + if(potentialEmail.match(/.*@.*/)) { + LoanContractActions.fetchLoanContract(potentialEmail); + } }, getContractCheckbox() { @@ -151,7 +155,7 @@ let LoanForm = React.createClass({ Date: Fri, 28 Aug 2015 12:11:29 +0200 Subject: [PATCH 08/17] add: Loan form for Ikonotv --- .../ikonotv_accordion_list_item.js | 17 ++++---- .../ascribe_buttons/ikonotv_submit_button.js | 41 +++++++++++++++++-- .../wallet/constants/wallet_api_urls.js | 4 +- .../whitelabel/wallet/wallet_routes.js | 5 ++- 4 files changed, 50 insertions(+), 17 deletions(-) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js index 2be45ce3..ecab34fb 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js @@ -14,8 +14,11 @@ import GlobalNotificationModel from '../../../../../../models/global_notificatio import GlobalNotificationActions from '../../../../../../actions/global_notification_actions'; import IkonotvSubmitButton from '../ascribe_buttons/ikonotv_submit_button'; + import AclProxy from '../../../../../acl_proxy'; +import AclButton from '../../../../../ascribe_buttons/acl_button'; + import { getLangText } from '../../../../../../utils/lang_utils'; import { mergeOptions } from '../../../../../../utils/general_utils'; @@ -61,16 +64,10 @@ let IkonotvAccordionListItem = React.createClass({ getSubmitButtons() { return ( -
- - - -
+ ); }, diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js index d3f4c0e3..ae5ba094 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js @@ -1,10 +1,18 @@ 'use strict'; import React from 'react'; +import Moment from 'moment'; import classNames from 'classnames'; import ModalWrapper from '../../../../../ascribe_modal/modal_wrapper'; +import LoanForm from '../../../../../ascribe_forms/form_loan'; + +import Property from '../../../../../ascribe_forms/property'; +import InputCheckbox from '../../../../../ascribe_forms/input_checkbox'; + +import ApiUrls from '../../../../../../constants/api_urls'; + import { getLangText } from '../../../../../../utils/lang_utils'; let IkonotvSubmitButton = React.createClass({ @@ -24,16 +32,43 @@ let IkonotvSubmitButton = React.createClass({ }, render() { + + let today = new Moment(); + let enddate = new Moment(); + enddate.add(1, 'years'); + return ( - + title={getLangText('Loan to IkonoTV archive')}> + + + + + {' ' + getLangText('I agree to the Terms of Service of IkonoTV Archive') + ' '} + ( + {getLangText('read')} + ) + + + + ); } }); -export default IkonotvSubmitButton; \ No newline at end of file +export default IkonotvSubmitButton; diff --git a/js/components/whitelabel/wallet/constants/wallet_api_urls.js b/js/components/whitelabel/wallet/constants/wallet_api_urls.js index c1b101a1..22d4017e 100644 --- a/js/components/whitelabel/wallet/constants/wallet_api_urls.js +++ b/js/components/whitelabel/wallet/constants/wallet_api_urls.js @@ -13,8 +13,8 @@ function getWalletApiUrls(subdomain) { } else if (subdomain === 'ikonotv'){ return { - 'pieces_list': walletConstants.walletApiEndpoint + subdomain + '/pieces/', - 'piece': walletConstants.walletApiEndpoint + subdomain + '/pieces/${piece_id}/' + 'pieces_list': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/', + 'piece': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/${piece_id}/' }; } return {}; diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 6836ec66..9532299c 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -65,12 +65,13 @@ let ROUTES = { ), 'ikonotv': ( - + + - + From 2c26aab8cc262803353d89d6da71d7280c63d206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 12:20:36 +0200 Subject: [PATCH 09/17] add exception for loaning a piece for ikonotv --- js/components/ascribe_detail/piece_container.js | 5 ++++- js/components/whitelabel/wallet/constants/wallet_api_urls.js | 4 ++-- js/components/whitelabel/wallet/wallet_routes.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 3739a508..2c6da4a9 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -84,8 +84,11 @@ 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 + */ - if(state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') { + let subdomain = window.location.host.split('.')[0]; + if(subdomain !== 'ikonotv' && 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/constants/wallet_api_urls.js b/js/components/whitelabel/wallet/constants/wallet_api_urls.js index 22d4017e..c1b101a1 100644 --- a/js/components/whitelabel/wallet/constants/wallet_api_urls.js +++ b/js/components/whitelabel/wallet/constants/wallet_api_urls.js @@ -13,8 +13,8 @@ function getWalletApiUrls(subdomain) { } else if (subdomain === 'ikonotv'){ return { - 'pieces_list': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/', - 'piece': walletConstants.walletApiEndpoint + 'cyland' + '/pieces/${piece_id}/' + 'pieces_list': walletConstants.walletApiEndpoint + subdomain + '/pieces/', + 'piece': walletConstants.walletApiEndpoint + subdomain + '/pieces/${piece_id}/' }; } return {}; diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 9532299c..ec5b9787 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -74,7 +74,7 @@ let ROUTES = { - + From e9d0311f589a5f96ecdf492419870af130fa31ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 12:33:00 +0200 Subject: [PATCH 10/17] custom ikonotv piece page --- .../ascribe_detail/piece_container.js | 1 + .../ikonotv_accordion_list_item.js | 2 +- .../ascribe_buttons/ikonotv_submit_button.js | 2 +- .../ascribe_detail/ikonotv_piece_container.js | 165 ++++++++++++++++++ .../whitelabel/wallet/wallet_routes.js | 4 +- 5 files changed, 170 insertions(+), 4 deletions(-) create mode 100644 js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 2c6da4a9..62fc9b11 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -205,6 +205,7 @@ let PieceContainer = React.createClass({ ); } }, + render() { if('title' in this.state.piece) { return ( diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js index ecab34fb..8a4ed893 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js @@ -65,7 +65,7 @@ let IkonotvAccordionListItem = React.createClass({ getSubmitButtons() { return ( ); diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js index ae5ba094..a73871dd 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js @@ -25,7 +25,7 @@ let IkonotvSubmitButton = React.createClass({ getSubmitButton() { return ( ); 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 new file mode 100644 index 00000000..d88f42a5 --- /dev/null +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_detail/ikonotv_piece_container.js @@ -0,0 +1,165 @@ +'use strict'; + +import React from 'react'; + +import PieceActions from '../../../../../../actions/piece_actions'; +import PieceStore from '../../../../../../stores/piece_store'; +import PieceListActions from '../../../../../../actions/piece_list_actions'; +import UserStore from '../../../../../../stores/user_store'; + +import Piece from '../../../../../../components/ascribe_detail/piece'; + +import ListRequestActions from '../../../../../ascribe_forms/list_form_request_actions'; +import AclButtonList from '../../../../../ascribe_buttons/acl_button_list'; +import DeleteButton from '../../../../../ascribe_buttons/delete_button'; + +import CollapsibleParagraph from '../../../../../../components/ascribe_collapsible/collapsible_paragraph'; + +import IkonotvSubmitButton from '../ascribe_buttons/ikonotv_submit_button'; + +import HistoryIterator from '../../../../../ascribe_detail/history_iterator'; + +import DetailProperty from '../../../../../ascribe_detail/detail_property'; + + +import GlobalNotificationModel from '../../../../../../models/global_notification_model'; +import GlobalNotificationActions from '../../../../../../actions/global_notification_actions'; + + +import AppConstants from '../../../../../../constants/application_constants'; + +import { getLangText } from '../../../../../../utils/lang_utils'; +import { mergeOptions } from '../../../../../../utils/general_utils'; + + +let IkonotvPieceContainer = React.createClass({ + getInitialState() { + return mergeOptions( + PieceStore.getState(), + UserStore.getState() + ); + }, + + 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({}); + PieceStore.unlisten(this.onChange); + UserStore.unlisten(this.onChange); + }, + + onChange(state) { + this.setState(state); + }, + + loadPiece() { + PieceActions.fetchOne(this.props.params.pieceId); + }, + + handleSubmitSuccess(response) { + PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, + this.state.orderBy, this.state.orderAsc, this.state.filterBy); + + let notification = new GlobalNotificationModel(response.notification, 'success', 10000); + GlobalNotificationActions.appendGlobalNotification(notification); + }, + + getActions(){ + if (this.state.piece && + this.state.piece.request_action && + this.state.piece.request_action.length > 0) { + return ( + + ); + } + else { + + // This is just 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') { + // make a copy to not have side effects + availableAcls = mergeOptions({}, this.state.piece.acl); + availableAcls.acl_loan = false; + } + + return ( + + + + + ); + } + }, + + render() { + if('title' in this.state.piece) { + return ( + +
+

{this.state.piece.title}

+ + +
+
+ } + subheader={ +
+ + +
+
+ } + buttons={this.getActions()}> + + 0}> + + + + ); + } else { + return ( +
+ +
+ ); + } + } +}); + +export default IkonotvPieceContainer; diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index ec5b9787..40f092d6 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -19,9 +19,9 @@ import CylandPieceContainer from './components/cyland/ascribe_detail/cyland_piec import CylandRegisterPiece from './components/cyland/cyland_register_piece'; import CylandPieceList from './components/cyland/cyland_piece_list'; -import IkonotvLanding from './components/ikonotv/ikonotv_landing'; import IkonotvPieceList from './components/ikonotv/ikonotv_piece_list'; import IkonotvRequestLoan from './components/ikonotv/ikonotv_request_loan'; +import IkonotvPieceContainer from './components/ikonotv/ascribe_detail/ikonotv_piece_container'; import CCRegisterPiece from './components/cc/cc_register_piece'; @@ -74,7 +74,7 @@ let ROUTES = { - + From 5219dd5cf711c07e79c81c2a5d036f1e828644e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 12:40:00 +0200 Subject: [PATCH 11/17] fix bug + enable contract --- .../ikonotv/ascribe_buttons/ikonotv_submit_button.js | 2 +- .../ikonotv/ascribe_detail/ikonotv_piece_container.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js index a73871dd..40d65a2b 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_buttons/ikonotv_submit_button.js @@ -58,7 +58,7 @@ let IkonotvSubmitButton = React.createClass({ {' ' + getLangText('I agree to the Terms of Service of IkonoTV Archive') + ' '} - ( + ( {getLangText('read')} ) 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 d88f42a5..bc84249f 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 @@ -4,7 +4,10 @@ import React from 'react'; import PieceActions from '../../../../../../actions/piece_actions'; import PieceStore from '../../../../../../stores/piece_store'; + import PieceListActions from '../../../../../../actions/piece_list_actions'; +import PieceListStore from '../../../../../../stores/piece_list_store'; + import UserStore from '../../../../../../stores/user_store'; import Piece from '../../../../../../components/ascribe_detail/piece'; @@ -36,7 +39,8 @@ let IkonotvPieceContainer = React.createClass({ getInitialState() { return mergeOptions( PieceStore.getState(), - UserStore.getState() + UserStore.getState(), + PieceListStore.getState() ); }, @@ -44,6 +48,7 @@ let IkonotvPieceContainer = React.createClass({ PieceStore.listen(this.onChange); PieceActions.fetchOne(this.props.params.pieceId); UserStore.listen(this.onChange); + PieceListStore.listen(this.onChange); }, componentWillReceiveProps(nextProps) { @@ -61,6 +66,7 @@ let IkonotvPieceContainer = React.createClass({ PieceActions.updatePiece({}); PieceStore.unlisten(this.onChange); UserStore.unlisten(this.onChange); + PieceListStore.unlisten(this.onChange); }, onChange(state) { @@ -143,7 +149,6 @@ let IkonotvPieceContainer = React.createClass({
} buttons={this.getActions()}> - 0}> From d40b671b45aea0ad539d2285d703e8473284acd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 12:48:48 +0200 Subject: [PATCH 12/17] remove ikonotv boilerplate landing page --- .../wallet/components/ikonotv/ikonotv_landing.js | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js deleted file mode 100644 index 9893da0d..00000000 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_landing.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -import React from 'react'; - -let IkonotvLanding = React.createClass({ - render() { - return ( - This is a landing page placeholder - ); - } -}); - -export default IkonotvLanding; \ No newline at end of file From 680cc8572fa62fed84acf6ce82d20f052859e744 Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 28 Aug 2015 13:52:58 +0200 Subject: [PATCH 13/17] ikonotv acl_submit --- .../ikonotv_accordion_list_item.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js index 8a4ed893..267b09f1 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js @@ -64,10 +64,14 @@ let IkonotvAccordionListItem = React.createClass({ getSubmitButtons() { return ( - + + + ); }, From 1b730573c7a8e6d26a893bb71a3f515cb561fe7c Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 28 Aug 2015 13:58:24 +0200 Subject: [PATCH 14/17] ikonotv acl_submitted + refactor --- .../ikonotv_accordion_list_item.js | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js index 267b09f1..bb47af0f 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js @@ -64,14 +64,26 @@ let IkonotvAccordionListItem = React.createClass({ getSubmitButtons() { return ( - - - +
+ + + + + + +
); }, From 02e105d2b80b2771c488c730191872cbcd75e886 Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 28 Aug 2015 14:00:50 +0200 Subject: [PATCH 15/17] text refactor --- .../ascribe_accordion_list/ikonotv_accordion_list_item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js index bb47af0f..c0a239cb 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ascribe_accordion_list/ikonotv_accordion_list_item.js @@ -79,7 +79,7 @@ let IkonotvAccordionListItem = React.createClass({ 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 16/17] 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}> - + + + From ddfc8b9621808521e2209d4f0b2a2fe9239218f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 28 Aug 2015 14:27:02 +0200 Subject: [PATCH 17/17] minor fixes --- js/components/ascribe_detail/piece_container.js | 2 ++ .../wallet/components/cyland/cyland_register_piece.js | 2 ++ .../ikonotv/ascribe_detail/ikonotv_piece_container.js | 1 + 3 files changed, 5 insertions(+) diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index b4ec2bf2..7297825d 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -84,6 +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 + */ if(state && state.piece && state.piece.acl && typeof state.piece.acl.acl_loan !== 'undefined') { 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 8a092bdf..d1363a51 100644 --- a/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js +++ b/js/components/whitelabel/wallet/components/cyland/cyland_register_piece.js @@ -216,6 +216,8 @@ let CylandRegisterPiece = React.createClass({ gallery="Cyland Archive" startdate={today} enddate={datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain} + showStartDate={false} + showEndDate={false} showPersonalMessage={false} handleSuccess={this.handleLoanSuccess}>