From a3656410b133d87be50447de175eff6ecd03ee68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 29 Sep 2015 14:25:30 +0200 Subject: [PATCH 01/22] Update component no PieceListStore changes --- .../piece_list_bulk_modal.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js b/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js index 452a9bd8..06fd98a0 100644 --- a/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js +++ b/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js @@ -33,21 +33,25 @@ let PieceListBulkModal = React.createClass({ ); }, - onChange(state) { - this.setState(state); - }, + componentDidMount() { EditionListStore.listen(this.onChange); UserStore.listen(this.onChange); + PieceListStore.listen(this.onChange); UserActions.fetchCurrentUser(); }, componentWillUnmount() { EditionListStore.unlisten(this.onChange); + PieceListStore.unlisten(this.onChange); UserStore.unlisten(this.onChange); }, + onChange(state) { + this.setState(state); + }, + fetchSelectedPieceEditionList() { let filteredPieceIdList = Object.keys(this.state.editionList) .filter((pieceId) => { From d50d0faabe655799e09699a0e3519e34ede118c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 29 Sep 2015 14:58:56 +0200 Subject: [PATCH 02/22] Write generic function for extracting subdomain and implement troughout whole app --- js/app.js | 10 ++++++---- js/components/whitelabel/prize/prize_app.js | 5 ++++- js/components/whitelabel/wallet/wallet_app.js | 4 +++- js/fetchers/license_fetcher.js | 5 ++++- js/fetchers/whitelabel_fetcher.js | 5 ++++- js/third_party/intercom.js | 4 +++- js/third_party/notifications.js | 6 ++++-- js/utils/general_utils.js | 11 +++++++++++ 8 files changed, 39 insertions(+), 11 deletions(-) diff --git a/js/app.js b/js/app.js index 30a57d2b..bd1b839a 100644 --- a/js/app.js +++ b/js/app.js @@ -10,13 +10,15 @@ import fetch from 'isomorphic-fetch'; /* eslint-enable */ import ApiUrls from './constants/api_urls'; -import { updateApiUrls } from './constants/api_urls'; -import appConstants from './constants/application_constants'; + +import AppConstants from './constants/application_constants'; import getRoutes from './routes'; import requests from './utils/requests'; +import { updateApiUrls } from './constants/api_urls'; import { getSubdomainSettings } from './utils/constants_utils'; import { initLogging } from './utils/error_utils'; +import { getSubdomain } from './utils/general_utils'; import EventActions from './actions/event_actions'; @@ -48,11 +50,11 @@ requests.defaults({ class AppGateway { start() { let settings; - let subdomain = window.location.host.split('.')[0]; + let subdomain = getSubdomain(); try { settings = getSubdomainSettings(subdomain); - appConstants.whitelabel = settings; + AppConstants.whitelabel = settings; updateApiUrls(settings.type, subdomain); this.load(settings); } catch(err) { diff --git a/js/components/whitelabel/prize/prize_app.js b/js/components/whitelabel/prize/prize_app.js index f187dd1c..e0be7707 100644 --- a/js/components/whitelabel/prize/prize_app.js +++ b/js/components/whitelabel/prize/prize_app.js @@ -9,6 +9,9 @@ import GlobalNotification from '../../global_notification'; import getRoutes from './prize_routes'; +import { getSubdomain } from '../../../utils/general_utils'; + + let RouteHandler = Router.RouteHandler; let PrizeApp = React.createClass({ @@ -16,7 +19,7 @@ let PrizeApp = React.createClass({ render() { let header = null; - let subdomain = window.location.host.split('.')[0]; + let subdomain = getSubdomain(); let ROUTES = getRoutes(null, subdomain); diff --git a/js/components/whitelabel/wallet/wallet_app.js b/js/components/whitelabel/wallet/wallet_app.js index 2a235cef..bbc58689 100644 --- a/js/components/whitelabel/wallet/wallet_app.js +++ b/js/components/whitelabel/wallet/wallet_app.js @@ -10,6 +10,8 @@ import GlobalNotification from '../../global_notification'; import getRoutes from './wallet_routes'; import classNames from 'classnames'; +import { getSubdomain } from '../../../utils/general_utils'; + let RouteHandler = Router.RouteHandler; @@ -18,7 +20,7 @@ let WalletApp = React.createClass({ mixins: [Router.State], render() { - let subdomain = window.location.host.split('.')[0]; + let subdomain = getSubdomain(); let ROUTES = getRoutes(null, subdomain); let activeRoutes = this.getRoutes().map(elem => 'route--' + elem.name); diff --git a/js/fetchers/license_fetcher.js b/js/fetchers/license_fetcher.js index 6b0cada0..d5b296be 100644 --- a/js/fetchers/license_fetcher.js +++ b/js/fetchers/license_fetcher.js @@ -2,12 +2,15 @@ import requests from '../utils/requests'; +import { getSubdomain } from '../utils/general_utils'; + + let LicenseFetcher = { /** * Fetch the available licenses from the API (might be bound to the subdomain e.g. cc.ascribe.io). */ fetch() { - return requests.get('licenses', {'subdomain': window.location.host.split('.')[0]}); + return requests.get('licenses', {'subdomain': getSubdomain()}); } }; diff --git a/js/fetchers/whitelabel_fetcher.js b/js/fetchers/whitelabel_fetcher.js index 51f4ed0f..7a39f676 100644 --- a/js/fetchers/whitelabel_fetcher.js +++ b/js/fetchers/whitelabel_fetcher.js @@ -2,12 +2,15 @@ import requests from '../utils/requests'; +import { getSubdomain } from '../utils/general_utils'; + + let WhitelabelFetcher = { /** * Fetch the custom whitelabel data from the API. */ fetch() { - return requests.get('whitelabel_settings', {'subdomain': window.location.host.split('.')[0]}); + return requests.get('whitelabel_settings', {'subdomain': getSubdomain()}); } }; diff --git a/js/third_party/intercom.js b/js/third_party/intercom.js index ef284d7b..42ecccf7 100644 --- a/js/third_party/intercom.js +++ b/js/third_party/intercom.js @@ -3,6 +3,8 @@ import alt from '../alt'; import EventActions from '../actions/event_actions'; +import { getSubdomain } from '../utils/general_utils'; + class IntercomHandler { constructor() { @@ -20,7 +22,7 @@ class IntercomHandler { /* eslint-enable */ app_id: 'oboxh5w1', email: profile.email, - subdomain: window.location.host.split('.')[0], + subdomain: getSubdomain(), widget: { activator: '#IntercomDefaultWidget' } diff --git a/js/third_party/notifications.js b/js/third_party/notifications.js index 8887bbe2..eeac1bff 100644 --- a/js/third_party/notifications.js +++ b/js/third_party/notifications.js @@ -5,6 +5,8 @@ import EventActions from '../actions/event_actions'; import NotificationActions from '../actions/notification_actions'; +import { getSubdomain } from '../utils/general_utils'; + class NotificationsHandler { @@ -13,11 +15,11 @@ class NotificationsHandler { this.loaded = false; } - onProfileDidLoad(profile) { + onProfileDidLoad() { if (this.loaded) { return; } - let subdomain = window.location.host.split('.')[0]; + let subdomain = getSubdomain(); if (subdomain === 'ikonotv') { NotificationActions.fetchContractAgreementListNotifications().then( (res) => { diff --git a/js/utils/general_utils.js b/js/utils/general_utils.js index ba2b7752..8f4aebbc 100644 --- a/js/utils/general_utils.js +++ b/js/utils/general_utils.js @@ -221,4 +221,15 @@ export function truncateTextAtCharIndex(text, charIndex, replacement = '...') { truncatedText += text.length > charIndex ? replacement : ''; return truncatedText; +} + +/** + * Extracts the user's subdomain from the browser's window. + * If no subdomain is found (for example on a naked domain), the default "www" is just assumed. + * @return {string} subdomain as a string + */ +export function getSubdomain() { + let { host } = window.location; + let matchedHost = host.match(/(([^.]+)\.)?(.*)\.(.*)/); + return matchedHost[2] || 'www'; } \ No newline at end of file From 550eb2dc0bfafd39e6be1fabd4fa5d3303f10e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 29 Sep 2015 15:23:57 +0200 Subject: [PATCH 03/22] Add fetchPieceList to PieceListBulkModal --- .../ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js b/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js index 06fd98a0..3e5b6495 100644 --- a/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js +++ b/js/components/ascribe_piece_list_bulk_modal/piece_list_bulk_modal.js @@ -39,7 +39,10 @@ let PieceListBulkModal = React.createClass({ EditionListStore.listen(this.onChange); UserStore.listen(this.onChange); PieceListStore.listen(this.onChange); + UserActions.fetchCurrentUser(); + PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, + this.state.orderBy, this.state.orderAsc, this.state.filterBy); }, componentWillUnmount() { From 40095f7fbf06c388b571bf246cc9eec687b2dfc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 29 Sep 2015 15:38:06 +0200 Subject: [PATCH 04/22] throw javascript errors on >= 400 HTTP errors --- js/stores/edition_list_store.js | 1 - js/utils/requests.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/js/stores/edition_list_store.js b/js/stores/edition_list_store.js index 87b4df76..b3b152d3 100644 --- a/js/stores/edition_list_store.js +++ b/js/stores/edition_list_store.js @@ -13,7 +13,6 @@ class EditionListStore { } onUpdateEditionList({pieceId, editionListOfPiece, page, pageSize, orderBy, orderAsc, count, filterBy}) { - /* Basically there are two modes an edition list can be updated. diff --git a/js/utils/requests.js b/js/utils/requests.js index fd676896..3761a7a0 100644 --- a/js/utils/requests.js +++ b/js/utils/requests.js @@ -21,7 +21,7 @@ class Requests { } unpackResponse(response) { - if (response.status >= 500) { + if (response.status >= 400) { throw new Error(response.status + ' - ' + response.statusText + ' - on URL:' + response.url); } From 90cf137c2c6adc1f99e4d0320a37e7a8a76464c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 29 Sep 2015 16:00:58 +0200 Subject: [PATCH 05/22] Integrate error page in app + whitelabel pages --- js/components/error_not_found_page.js | 14 ++++++++++++++ js/components/whitelabel/prize/prize_routes.js | 3 +++ js/components/whitelabel/wallet/wallet_routes.js | 5 +++++ js/routes.js | 4 ++++ 4 files changed, 26 insertions(+) create mode 100644 js/components/error_not_found_page.js diff --git a/js/components/error_not_found_page.js b/js/components/error_not_found_page.js new file mode 100644 index 00000000..6de7c1f0 --- /dev/null +++ b/js/components/error_not_found_page.js @@ -0,0 +1,14 @@ +'use strict'; + +import React from 'react'; + + +let ErrorNotFoundPage = React.createClass({ + render() { + return ( + Hello + ); + } +}); + +export default ErrorNotFoundPage; \ No newline at end of file diff --git a/js/components/whitelabel/prize/prize_routes.js b/js/components/whitelabel/prize/prize_routes.js index d3031774..7ca132e2 100644 --- a/js/components/whitelabel/prize/prize_routes.js +++ b/js/components/whitelabel/prize/prize_routes.js @@ -14,11 +14,13 @@ import PrizePieceContainer from './components/ascribe_detail/prize_piece_contain import EditionContainer from '../../ascribe_detail/edition_container'; import SettingsContainer from './components/prize_settings_container'; import CoaVerifyContainer from '../../../components/coa_verify_container'; +import ErrorNotFoundPage from '../../../components/error_not_found_page'; import App from './prize_app'; import AppConstants from '../../../constants/application_constants'; let Route = Router.Route; +let NotFoundRoute = Router.NotFoundRoute; let baseUrl = AppConstants.baseUrl; @@ -36,6 +38,7 @@ function getRoutes() { + ); } diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index 4aad0ae0..7097a88b 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -14,6 +14,7 @@ import PieceContainer from '../../../components/ascribe_detail/piece_container'; import EditionContainer from '../../../components/ascribe_detail/edition_container'; import SettingsContainer from '../../../components/ascribe_settings/settings_container'; import ContractSettings from '../../../components/ascribe_settings/contract_settings'; +import ErrorNotFoundPage from '../../../components/error_not_found_page'; import CylandLanding from './components/cyland/cyland_landing'; import CylandPieceContainer from './components/cyland/ascribe_detail/cyland_piece_container'; @@ -33,6 +34,7 @@ import WalletApp from './wallet_app'; import AppConstants from '../../../constants/application_constants'; let Route = Router.Route; +let NotFoundRoute = Router.NotFoundRoute; let Redirect = Router.Redirect; let baseUrl = AppConstants.baseUrl; @@ -52,6 +54,7 @@ let ROUTES = { + ), 'cc': ( @@ -68,6 +71,7 @@ let ROUTES = { + ), 'ikonotv': ( @@ -86,6 +90,7 @@ let ROUTES = { + ) }; diff --git a/js/routes.js b/js/routes.js index 1366f205..a8b024d4 100644 --- a/js/routes.js +++ b/js/routes.js @@ -21,11 +21,14 @@ import ContractSettings from './components/ascribe_settings/contract_settings'; import SettingsContainer from './components/ascribe_settings/settings_container'; import CoaVerifyContainer from './components/coa_verify_container'; +import ErrorNotFoundPage from './components/error_not_found_page'; + import RegisterPiece from './components/register_piece'; import AppConstants from './constants/application_constants'; let Route = Router.Route; +let NotFoundRoute = Router.NotFoundRoute; let Redirect = Router.Redirect; let baseUrl = AppConstants.baseUrl; @@ -45,6 +48,7 @@ const COMMON_ROUTES = ( + ); From cda81b6f5bd73abb9832fb7b31c91c7fe4534baf Mon Sep 17 00:00:00 2001 From: diminator Date: Tue, 29 Sep 2015 18:09:34 +0200 Subject: [PATCH 06/22] 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/', From ea4805caa0ae67eab853775aac914e8170753b02 Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 30 Sep 2015 09:14:57 +0200 Subject: [PATCH 07/22] create CoA when not found --- js/actions/coa_actions.js | 46 +++++++++++++++++-------- js/components/ascribe_detail/edition.js | 7 +++- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/js/actions/coa_actions.js b/js/actions/coa_actions.js index 7c6f5118..8249f730 100644 --- a/js/actions/coa_actions.js +++ b/js/actions/coa_actions.js @@ -3,6 +3,7 @@ import alt from '../alt'; import CoaFetcher from '../fetchers/coa_fetcher'; +import Q from 'q'; class CoaActions { constructor() { @@ -13,22 +14,39 @@ class CoaActions { } fetchOne(id) { - CoaFetcher.fetchOne(id) - .then((res) => { - this.actions.updateCoa(res.coa); - }) - .catch((err) => { - console.logGlobal(err); - }); + return Q.Promise((resolve, reject) => { + CoaFetcher.fetchOne(id) + .then((res) => { + if (res.coa) { + this.actions.updateCoa(res.coa); + resolve(res.coa); + } + else { + this.actions.updateCoa(null); + resolve(null); + } + + }) + .catch((err) => { + console.logGlobal(err); + this.actions.updateCoa(null); + reject(err); + }); + }); } + create(edition) { - CoaFetcher.create(edition.bitcoin_id) - .then((res) => { - this.actions.updateCoa(res.coa); - }) - .catch((err) => { - console.logGlobal(err); - }); + return Q.Promise((resolve, reject) => { + CoaFetcher.create(edition.bitcoin_id) + .then((res) => { + this.actions.updateCoa(res.coa); + }) + .catch((err) => { + console.logGlobal(err); + this.actions.updateCoa(null); + reject(err); + }); + }); } } diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 97f9fb3d..aa82beb6 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -338,7 +338,12 @@ let CoaDetails = React.createClass({ componentDidMount() { CoaStore.listen(this.onChange); if(this.props.edition.coa) { - CoaActions.fetchOne(this.props.edition.coa); + CoaActions.fetchOne(this.props.edition.coa) + .then((res) => { + if (res === null){ + CoaActions.create(this.props.edition); + } + }); } else { CoaActions.create(this.props.edition); From 4f6e39699f23fd05d51456f055b0ea6c07bd480e Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 30 Sep 2015 09:46:11 +0200 Subject: [PATCH 08/22] PR getlangtext --- js/components/ascribe_detail/edition.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 832ad386..e0ce16a5 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -277,7 +277,7 @@ let EditionSummary = React.createClass({ className='inline' isInline={true}> @@ -291,7 +291,7 @@ let EditionSummary = React.createClass({ className='inline' isInline={true}> From 99d29449a3482b78a4611757e13fc0de35dbe70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 30 Sep 2015 10:44:38 +0200 Subject: [PATCH 09/22] style 404 page --- js/components/error_not_found_page.js | 11 ++++++++++- sass/main.scss | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/js/components/error_not_found_page.js b/js/components/error_not_found_page.js index 6de7c1f0..32787cb4 100644 --- a/js/components/error_not_found_page.js +++ b/js/components/error_not_found_page.js @@ -6,7 +6,16 @@ import React from 'react'; let ErrorNotFoundPage = React.createClass({ render() { return ( - Hello +
+
+
+

404

+

+ Ups, the page you are looking for does not exist. +

+
+
+
); } }); diff --git a/sass/main.scss b/sass/main.scss index 1e56c7ed..d5fef084 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -480,3 +480,20 @@ hr { border-color: #ccc; } } + +.error-wrapper { + width: 100%; + text-align: center; + + padding: 5% 20% 5% 20%; + + > h1 { + font-size: 10em; + font-weight: 600; + margin-bottom: .25em; + } + + > p { + font-size: 2em; + } +} \ No newline at end of file From dc753caf87808c94c46e4111e0d23ef4e1294137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 30 Sep 2015 11:06:42 +0200 Subject: [PATCH 10/22] Add getLangText to ErrorNotFoundPage --- js/components/error_not_found_page.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/components/error_not_found_page.js b/js/components/error_not_found_page.js index 32787cb4..61f83196 100644 --- a/js/components/error_not_found_page.js +++ b/js/components/error_not_found_page.js @@ -2,6 +2,8 @@ import React from 'react'; +import { getLangText } from '../utils/lang_utils'; + let ErrorNotFoundPage = React.createClass({ render() { @@ -11,7 +13,7 @@ let ErrorNotFoundPage = React.createClass({

404

- Ups, the page you are looking for does not exist. + {getLangText('Ups, the page you are looking for does not exist.')}

From aa908a1c57444f8c52c7f729fb7a515e57335089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 30 Sep 2015 11:09:04 +0200 Subject: [PATCH 11/22] PR Feedback: Simplify subdomain extraction --- js/utils/general_utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/utils/general_utils.js b/js/utils/general_utils.js index 8f4aebbc..2cba98b9 100644 --- a/js/utils/general_utils.js +++ b/js/utils/general_utils.js @@ -230,6 +230,6 @@ export function truncateTextAtCharIndex(text, charIndex, replacement = '...') { */ export function getSubdomain() { let { host } = window.location; - let matchedHost = host.match(/(([^.]+)\.)?(.*)\.(.*)/); - return matchedHost[2] || 'www'; + let tokens = host.split('.'); + return tokens.length > 2 ? tokens[0] : 'www'; } \ No newline at end of file From 7283ae7574ce94cd5c1c904e1226c86a46656c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 30 Sep 2015 11:22:20 +0200 Subject: [PATCH 12/22] PR Feedback: Change API error handling to saver approach --- js/actions/edition_list_actions.js | 5 +++++ js/utils/requests.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/js/actions/edition_list_actions.js b/js/actions/edition_list_actions.js index d13882cd..fb0a2249 100644 --- a/js/actions/edition_list_actions.js +++ b/js/actions/edition_list_actions.js @@ -33,6 +33,10 @@ class EditionListActions { EditionListFetcher .fetch(pieceId, page, pageSize, orderBy, orderAsc, filterBy) .then((res) => { + if(res && !res.editions) { + throw new Error('Piece has no editions to fetch.'); + } + this.actions.updateEditionList({ pieceId, page, @@ -46,6 +50,7 @@ class EditionListActions { resolve(res); }) .catch((err) => { + console.logGlobal(err); reject(err); }); }); diff --git a/js/utils/requests.js b/js/utils/requests.js index 3761a7a0..fd676896 100644 --- a/js/utils/requests.js +++ b/js/utils/requests.js @@ -21,7 +21,7 @@ class Requests { } unpackResponse(response) { - if (response.status >= 400) { + if (response.status >= 500) { throw new Error(response.status + ' - ' + response.statusText + ' - on URL:' + response.url); } From 55f5d959fff8ee20e43861e899449f83e4c2b32b Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 30 Sep 2015 11:26:31 +0200 Subject: [PATCH 13/22] PR fixes --- js/actions/coa_actions.js | 10 ++++------ js/components/ascribe_detail/edition.js | 12 ++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/js/actions/coa_actions.js b/js/actions/coa_actions.js index 8249f730..da279bc6 100644 --- a/js/actions/coa_actions.js +++ b/js/actions/coa_actions.js @@ -13,7 +13,7 @@ class CoaActions { ); } - fetchOne(id) { + fetchOrCreate(id, bitcoinId) { return Q.Promise((resolve, reject) => { CoaFetcher.fetchOne(id) .then((res) => { @@ -22,10 +22,8 @@ class CoaActions { resolve(res.coa); } else { - this.actions.updateCoa(null); - resolve(null); + this.actions.create(bitcoinId); } - }) .catch((err) => { console.logGlobal(err); @@ -35,9 +33,9 @@ class CoaActions { }); } - create(edition) { + create(bitcoinId) { return Q.Promise((resolve, reject) => { - CoaFetcher.create(edition.bitcoin_id) + CoaFetcher.create(bitcoinId) .then((res) => { this.actions.updateCoa(res.coa); }) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index aa82beb6..7f700c42 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -336,17 +336,13 @@ let CoaDetails = React.createClass({ }, componentDidMount() { + let { edition } = this.props; CoaStore.listen(this.onChange); - if(this.props.edition.coa) { - CoaActions.fetchOne(this.props.edition.coa) - .then((res) => { - if (res === null){ - CoaActions.create(this.props.edition); - } - }); + if(edition.coa) { + CoaActions.fetchOrCreate(edition.coa, edition.bitcoin_id); } else { - CoaActions.create(this.props.edition); + CoaActions.create(edition.bitcoin_id); } }, From 44cf707e3472ea1305b08e6f7f3b86306ae9ebed Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 30 Sep 2015 12:12:14 +0200 Subject: [PATCH 14/22] refactoring out edition_actions --- js/components/ascribe_detail/edition.js | 141 ++------------- .../ascribe_detail/edition_actions.js | 170 ++++++++++++++++++ 2 files changed, 184 insertions(+), 127 deletions(-) create mode 100644 js/components/ascribe_detail/edition_actions.js diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 8c718cc9..5a5df656 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -6,15 +6,11 @@ import Router from 'react-router'; import Row from 'react-bootstrap/lib/Row'; import Col from 'react-bootstrap/lib/Col'; import Glyphicon from 'react-bootstrap/lib/Glyphicon'; -import Button from 'react-bootstrap/lib/Button'; import UserActions from '../../actions/user_actions'; import UserStore from '../../stores/user_store'; import CoaActions from '../../actions/coa_actions'; import CoaStore from '../../stores/coa_store'; -import PieceListActions from '../../actions/piece_list_actions'; -import PieceListStore from '../../stores/piece_list_store'; -import EditionListActions from '../../actions/edition_list_actions'; import HistoryIterator from './history_iterator'; @@ -28,23 +24,14 @@ import EditionDetailProperty from './detail_property'; import LicenseDetail from './license_detail'; import EditionFurtherDetails from './further_details'; -import ListRequestActions from './../ascribe_forms/list_form_request_actions'; -import AclButtonList from './../ascribe_buttons/acl_button_list'; -import UnConsignRequestButton from './../ascribe_buttons/unconsign_request_button'; -import DeleteButton from '../ascribe_buttons/delete_button'; - -import GlobalNotificationModel from '../../models/global_notification_model'; -import GlobalNotificationActions from '../../actions/global_notification_actions'; +import EditionActions from './edition_actions'; import Note from './note'; -import AclProxy from '../acl_proxy'; - import ApiUrls from '../../constants/api_urls'; import AppConstants from '../../constants/application_constants'; import { getLangText } from '../../utils/lang_utils'; -import { mergeOptions } from '../../utils/general_utils'; let Link = Router.Link; /** @@ -59,15 +46,11 @@ let Edition = React.createClass({ mixins: [Router.Navigation], getInitialState() { - return mergeOptions( - UserStore.getState(), - PieceListStore.getState() - ); + return UserStore.getState(); }, componentDidMount() { UserStore.listen(this.onChange); - PieceListStore.listen(this.onChange); UserActions.fetchCurrentUser(); }, @@ -82,31 +65,12 @@ let Edition = React.createClass({ CoaActions.flushCoa(); UserStore.unlisten(this.onChange); - PieceListStore.unlisten(this.onChange); }, onChange(state) { this.setState(state); }, - handleDeleteSuccess(response) { - this.refreshCollection(); - - EditionListActions.closeAllEditionLists(); - EditionListActions.clearAllEditionSelections(); - - let notification = new GlobalNotificationModel(response.notification, 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - - this.transitionTo('pieces'); - }, - - refreshCollection() { - PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, - this.state.orderBy, this.state.orderAsc, this.state.filterBy); - EditionListActions.refreshEditionList({pieceId: this.props.edition.parent}); - }, - render() { return ( @@ -123,12 +87,9 @@ let Edition = React.createClass({
- + currentUser={this.state.currentUser} + handleSuccess={this.props.loadEdition}/> @@ -211,25 +172,14 @@ let Edition = React.createClass({ let EditionSummary = React.createClass({ propTypes: { edition: React.PropTypes.object, - handleSuccess: React.PropTypes.func, currentUser: React.PropTypes.object, - handleDeleteSuccess: React.PropTypes.func, - refreshCollection: React.PropTypes.func + handleSuccess: React.PropTypes.func }, handleSuccess() { - this.props.refreshCollection(); this.props.handleSuccess(); }, - showNotification(response){ - this.props.handleSuccess(); - - if (response){ - let notification = new GlobalNotificationModel(response.notification, 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - } - }, getStatus(){ let status = null; if (this.props.edition.status.length > 0){ @@ -244,89 +194,26 @@ let EditionSummary = React.createClass({ return status; }, - getActions(){ - let actions = null; - if (this.props.edition && - this.props.edition.notifications && - this.props.edition.notifications.length > 0){ - actions = ( - ); - } - - else { - actions = ( - - - - -
{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}> - -
-
- - - - -
- -
); - } - return actions; - }, render() { + let { edition } = this.props; return (
+ value={ edition.edition_number + ' ' + getLangText('of') + ' ' + this.props.edition.num_editions} /> - + value={ edition.owner } /> + {this.getStatus()} - {this.getActions()} +
); diff --git a/js/components/ascribe_detail/edition_actions.js b/js/components/ascribe_detail/edition_actions.js new file mode 100644 index 00000000..c1d73dd2 --- /dev/null +++ b/js/components/ascribe_detail/edition_actions.js @@ -0,0 +1,170 @@ +'use strict'; + +import React from 'react'; +import Router from 'react-router'; + +import Row from 'react-bootstrap/lib/Row'; +import Col from 'react-bootstrap/lib/Col'; +import Button from 'react-bootstrap/lib/Button'; + +import EditionListActions from '../../actions/edition_list_actions'; +import PieceListActions from '../../actions/piece_list_actions'; +import PieceListStore from '../../stores/piece_list_store'; + +import Form from './../ascribe_forms/form'; +import Property from './../ascribe_forms/property'; + +import ListRequestActions from './../ascribe_forms/list_form_request_actions'; +import AclButtonList from './../ascribe_buttons/acl_button_list'; +import UnConsignRequestButton from './../ascribe_buttons/unconsign_request_button'; +import DeleteButton from '../ascribe_buttons/delete_button'; + +import GlobalNotificationModel from '../../models/global_notification_model'; +import GlobalNotificationActions from '../../actions/global_notification_actions'; + +import AclProxy from '../acl_proxy'; + +import ApiUrls from '../../constants/api_urls'; + +import { getLangText } from '../../utils/lang_utils'; + +/* + A component that handles all the actions inside of the edition detail + handleSuccess requires a loadEdition action (could be refactored) + */ +let EditionActions = React.createClass({ + propTypes: { + edition: React.PropTypes.object, + currentUser: React.PropTypes.object, + handleSuccess: React.PropTypes.func + }, + + mixins: [Router.Navigation], + + getInitialState() { + return PieceListStore.getState(); + }, + + componentDidMount() { + PieceListStore.listen(this.onChange); + }, + + componentWillUnmount() { + PieceListStore.unlisten(this.onChange); + }, + + onChange(state) { + this.setState(state); + }, + + + handleDeleteSuccess(response) { + this.refreshCollection(); + + EditionListActions.closeAllEditionLists(); + EditionListActions.clearAllEditionSelections(); + + let notification = new GlobalNotificationModel(response.notification, 'success'); + GlobalNotificationActions.appendGlobalNotification(notification); + + this.transitionTo('pieces'); + }, + + refreshCollection() { + PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, + this.state.orderBy, this.state.orderAsc, this.state.filterBy); + EditionListActions.refreshEditionList({pieceId: this.props.edition.parent}); + }, + + handleSuccess(response){ + this.refreshCollection(); + this.props.handleSuccess(); + if (response){ + let notification = new GlobalNotificationModel(response.notification, 'success'); + GlobalNotificationActions.appendGlobalNotification(notification); + } + }, + + render(){ + let {edition, currentUser} = this.props; + + if (edition && + edition.notifications && + edition.notifications.length > 0){ + return ( + ); + } + + else { + return ( + + + + +
+ + +
+
+ +
+ + +
+
+ + + + +
+ +
+ ); + } + } +}); + +export default EditionActions; \ No newline at end of file From 0d6e82a45d3db0c496c6d4cd7d6bb0459f97cead Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 30 Sep 2015 15:08:45 +0200 Subject: [PATCH 15/22] WIP signup/login redirect and redirectAuthenticated --- js/components/ascribe_forms/form_login.js | 21 ++++++++++++++++++++- js/components/ascribe_forms/form_signup.js | 4 ++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js index 79bced6c..dacad32c 100644 --- a/js/components/ascribe_forms/form_login.js +++ b/js/components/ascribe_forms/form_login.js @@ -44,6 +44,10 @@ let LoginForm = React.createClass({ componentDidMount() { UserStore.listen(this.onChange); + let { redirect } = this.getQuery(); + if (redirect !== 'login'){ + this.transitionTo(redirect, null, this.getQuery()); + } }, componentWillUnmount() { @@ -56,6 +60,15 @@ let LoginForm = React.createClass({ // if user is already logged in, redirect him to piece list if(this.state.currentUser && this.state.currentUser.email && this.props.redirectOnLoggedIn) { // FIXME: hack to redirect out of the dispatch cycle + let { redirectAuthenticated } = this.getQuery(); + if ( redirectAuthenticated) { + /* + * redirectAuthenticated contains an arbirary path + * eg pieces/, editions/, collection, settings, ... + * hence transitionTo cannot be used directly + */ + window.location = AppConstants.baseUrl + redirectAuthenticated; + } window.setTimeout(() => this.transitionTo('pieces'), 0); } }, @@ -79,7 +92,13 @@ let LoginForm = React.createClass({ Users on Stack Overflow claim this is a bug in chrome and should be fixed in the future. Until then, we redirect the HARD way, but reloading the whole page using window.location */ - window.location = AppConstants.baseUrl + 'collection'; + let { redirectAuthenticated } = this.getQuery(); + if ( redirectAuthenticated) { + window.location = AppConstants.baseUrl + redirectAuthenticated; + } + else { + window.location = AppConstants.baseUrl + 'collection'; + } } else if(this.props.onLogin) { // In some instances we want to give a callback to an outer container, // to show that the one login action the user triggered actually went through. diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index 790e8e2f..bfcabf1a 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -40,6 +40,10 @@ let SignupForm = React.createClass({ componentDidMount() { UserStore.listen(this.onChange); + let { redirect } = this.getQuery(); + if (redirect !== 'signup'){ + this.transitionTo(redirect, null, this.getQuery()); + } }, componentWillUnmount() { From bbae33a40f9b9022cfd5624bf43592ef2301b808 Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 30 Sep 2015 17:07:18 +0200 Subject: [PATCH 16/22] avoid dispatcherror when switching to signup --- js/components/ascribe_forms/form_signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index bfcabf1a..344787ab 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -55,7 +55,7 @@ let SignupForm = React.createClass({ // if user is already logged in, redirect him to piece list if(this.state.currentUser && this.state.currentUser.email) { - this.transitionTo('pieces'); + window.setTimeout(() => this.transitionTo('pieces')); } }, From dfa01a0dded1d78a8ae7b7cc60492a57403eb444 Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 1 Oct 2015 09:45:12 +0200 Subject: [PATCH 17/22] signup fix consign redirect --- js/components/ascribe_forms/form_signup.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index 344787ab..ded34f7b 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -14,6 +14,7 @@ import Form from './form'; import Property from './property'; import InputCheckbox from './input_checkbox'; +import AppConstants from '../../constants/application_constants'; import ApiUrls from '../../constants/api_urls'; @@ -55,6 +56,15 @@ let SignupForm = React.createClass({ // if user is already logged in, redirect him to piece list if(this.state.currentUser && this.state.currentUser.email) { + let { redirectAuthenticated } = this.getQuery(); + if ( redirectAuthenticated) { + /* + * redirectAuthenticated contains an arbirary path + * eg pieces/, editions/, collection, settings, ... + * hence transitionTo cannot be used directly + */ + window.location = AppConstants.baseUrl + redirectAuthenticated; + } window.setTimeout(() => this.transitionTo('pieces')); } }, @@ -66,6 +76,15 @@ let SignupForm = React.createClass({ this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.'); } else if (response.redirect) { + let { redirectAuthenticated } = this.getQuery(); + if ( redirectAuthenticated) { + /* + * redirectAuthenticated contains an arbirary path + * eg pieces/, editions/, collection, settings, ... + * hence transitionTo cannot be used directly + */ + window.location = AppConstants.baseUrl + redirectAuthenticated; + } this.transitionTo('pieces'); } }, From b233dbb937bae9845db0879b6826fe3ff19eee8f Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 1 Oct 2015 09:49:01 +0200 Subject: [PATCH 18/22] PR fixes --- js/components/ascribe_detail/edition.js | 10 +++++----- .../{edition_actions.js => edition_action_panel.js} | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) rename js/components/ascribe_detail/{edition_actions.js => edition_action_panel.js} (98%) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 5a5df656..62394631 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -24,7 +24,7 @@ import EditionDetailProperty from './detail_property'; import LicenseDetail from './license_detail'; import EditionFurtherDetails from './further_details'; -import EditionActions from './edition_actions'; +import EditionActionPanel from './edition_action_panel'; import Note from './note'; @@ -195,12 +195,12 @@ let EditionSummary = React.createClass({ }, render() { - let { edition } = this.props; + let { edition, currentUser } = this.props; return (
+ value={ edition.edition_number + ' ' + getLangText('of') + ' ' + edition.num_editions} /> {this.getStatus()} -
diff --git a/js/components/ascribe_detail/edition_actions.js b/js/components/ascribe_detail/edition_action_panel.js similarity index 98% rename from js/components/ascribe_detail/edition_actions.js rename to js/components/ascribe_detail/edition_action_panel.js index c1d73dd2..d82a6b8f 100644 --- a/js/components/ascribe_detail/edition_actions.js +++ b/js/components/ascribe_detail/edition_action_panel.js @@ -32,7 +32,7 @@ import { getLangText } from '../../utils/lang_utils'; A component that handles all the actions inside of the edition detail handleSuccess requires a loadEdition action (could be refactored) */ -let EditionActions = React.createClass({ +let EditionActionPanel = React.createClass({ propTypes: { edition: React.PropTypes.object, currentUser: React.PropTypes.object, @@ -57,7 +57,6 @@ let EditionActions = React.createClass({ this.setState(state); }, - handleDeleteSuccess(response) { this.refreshCollection(); @@ -167,4 +166,4 @@ let EditionActions = React.createClass({ } }); -export default EditionActions; \ No newline at end of file +export default EditionActionPanel; \ No newline at end of file From 5f201ad76a4df8af9abd6025f2dbc2d5b2241c1b Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 1 Oct 2015 15:38:37 +0200 Subject: [PATCH 19/22] fix redirect --- js/components/ascribe_forms/form_login.js | 2 +- js/components/ascribe_forms/form_signup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js index dacad32c..290a4de7 100644 --- a/js/components/ascribe_forms/form_login.js +++ b/js/components/ascribe_forms/form_login.js @@ -45,7 +45,7 @@ let LoginForm = React.createClass({ componentDidMount() { UserStore.listen(this.onChange); let { redirect } = this.getQuery(); - if (redirect !== 'login'){ + if (redirect && redirect !== 'login'){ this.transitionTo(redirect, null, this.getQuery()); } }, diff --git a/js/components/ascribe_forms/form_signup.js b/js/components/ascribe_forms/form_signup.js index ded34f7b..0bed7cf9 100644 --- a/js/components/ascribe_forms/form_signup.js +++ b/js/components/ascribe_forms/form_signup.js @@ -42,7 +42,7 @@ let SignupForm = React.createClass({ componentDidMount() { UserStore.listen(this.onChange); let { redirect } = this.getQuery(); - if (redirect !== 'signup'){ + if (redirect && redirect !== 'signup'){ this.transitionTo(redirect, null, this.getQuery()); } }, From 000719e14d094d8c42c7d401a8b248c0e42927d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 6 Oct 2015 16:47:59 +0200 Subject: [PATCH 20/22] Move third party actions/stores to separate dispatcher --- js/actions/application_actions.js | 2 +- js/actions/coa_actions.js | 2 +- js/actions/contract_agreement_list_actions.js | 2 +- js/actions/contract_list_actions.js | 2 +- js/actions/edition_actions.js | 2 +- js/actions/edition_list_actions.js | 2 +- js/actions/event_actions.js | 4 ++-- js/actions/global_notification_actions.js | 2 +- js/actions/license_actions.js | 2 +- js/actions/notification_actions.js | 2 +- js/actions/ownership_actions.js | 2 +- js/actions/piece_actions.js | 2 +- js/actions/piece_list_actions.js | 2 +- js/actions/prize_list_actions.js | 2 +- js/actions/user_actions.js | 2 +- js/actions/wallet_settings_actions.js | 2 +- js/actions/whitelabel_actions.js | 2 +- js/alt.js | 3 ++- js/components/logout_container.js | 2 +- js/components/whitelabel/prize/actions/prize_actions.js | 2 +- js/components/whitelabel/prize/actions/prize_jury_actions.js | 2 +- .../whitelabel/prize/actions/prize_rating_actions.js | 2 +- js/components/whitelabel/prize/stores/prize_jury_store.js | 2 +- js/components/whitelabel/prize/stores/prize_rating_store.js | 2 +- js/components/whitelabel/prize/stores/prize_store.js | 2 +- js/stores/application_store.js | 2 +- js/stores/coa_store.js | 2 +- js/stores/contract_agreement_list_store.js | 2 +- js/stores/contract_list_store.js | 2 +- js/stores/edition_list_store.js | 2 +- js/stores/edition_store.js | 2 +- js/stores/global_notification_store.js | 2 +- js/stores/license_store.js | 2 +- js/stores/notification_store.js | 2 +- js/stores/ownership_store.js | 2 +- js/stores/piece_list_store.js | 2 +- js/stores/piece_store.js | 2 +- js/stores/prize_list_store.js | 2 +- js/stores/user_store.js | 2 +- js/stores/wallet_settings_store.js | 2 +- js/stores/whitelabel_store.js | 2 +- js/third_party/debug.js | 4 ++-- js/third_party/ga.js | 4 ++-- js/third_party/intercom.js | 4 ++-- js/third_party/notifications.js | 4 ++-- js/third_party/raven.js | 4 ++-- 46 files changed, 53 insertions(+), 52 deletions(-) diff --git a/js/actions/application_actions.js b/js/actions/application_actions.js index 733746cf..e7f96275 100644 --- a/js/actions/application_actions.js +++ b/js/actions/application_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import ApplicationFetcher from '../fetchers/application_fetcher'; diff --git a/js/actions/coa_actions.js b/js/actions/coa_actions.js index da279bc6..d3d13290 100644 --- a/js/actions/coa_actions.js +++ b/js/actions/coa_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import CoaFetcher from '../fetchers/coa_fetcher'; import Q from 'q'; diff --git a/js/actions/contract_agreement_list_actions.js b/js/actions/contract_agreement_list_actions.js index 589c1f51..4993b129 100644 --- a/js/actions/contract_agreement_list_actions.js +++ b/js/actions/contract_agreement_list_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import Q from 'q'; import OwnershipFetcher from '../fetchers/ownership_fetcher'; diff --git a/js/actions/contract_list_actions.js b/js/actions/contract_list_actions.js index 5b874caf..1c5c0913 100644 --- a/js/actions/contract_list_actions.js +++ b/js/actions/contract_list_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import OwnershipFetcher from '../fetchers/ownership_fetcher'; import Q from 'q'; diff --git a/js/actions/edition_actions.js b/js/actions/edition_actions.js index 473da0e4..4bdf093a 100644 --- a/js/actions/edition_actions.js +++ b/js/actions/edition_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import EditionFetcher from '../fetchers/edition_fetcher'; diff --git a/js/actions/edition_list_actions.js b/js/actions/edition_list_actions.js index fb0a2249..6f9881ee 100644 --- a/js/actions/edition_list_actions.js +++ b/js/actions/edition_list_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import Q from 'q'; import EditionListFetcher from '../fetchers/edition_list_fetcher.js'; diff --git a/js/actions/event_actions.js b/js/actions/event_actions.js index 8f1def9f..6d8ee12f 100644 --- a/js/actions/event_actions.js +++ b/js/actions/event_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { altThirdParty } from '../alt'; class EventActions { @@ -16,4 +16,4 @@ class EventActions { } } -export default alt.createActions(EventActions); +export default altThirdParty.createActions(EventActions); diff --git a/js/actions/global_notification_actions.js b/js/actions/global_notification_actions.js index b12f7906..2bb8d6e6 100644 --- a/js/actions/global_notification_actions.js +++ b/js/actions/global_notification_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; class GlobalNotificationActions { diff --git a/js/actions/license_actions.js b/js/actions/license_actions.js index bfeacd34..ad9a3d08 100644 --- a/js/actions/license_actions.js +++ b/js/actions/license_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import LicenseFetcher from '../fetchers/license_fetcher'; diff --git a/js/actions/notification_actions.js b/js/actions/notification_actions.js index 9318c922..c3a6db93 100644 --- a/js/actions/notification_actions.js +++ b/js/actions/notification_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import Q from 'q'; import NotificationFetcher from '../fetchers/notification_fetcher'; diff --git a/js/actions/ownership_actions.js b/js/actions/ownership_actions.js index 222309bb..deef2f2d 100644 --- a/js/actions/ownership_actions.js +++ b/js/actions/ownership_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import OwnershipFetcher from '../fetchers/ownership_fetcher'; diff --git a/js/actions/piece_actions.js b/js/actions/piece_actions.js index e3a41f93..7aed13fc 100644 --- a/js/actions/piece_actions.js +++ b/js/actions/piece_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import PieceFetcher from '../fetchers/piece_fetcher'; diff --git a/js/actions/piece_list_actions.js b/js/actions/piece_list_actions.js index ae5ac090..2a4464af 100644 --- a/js/actions/piece_list_actions.js +++ b/js/actions/piece_list_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import Q from 'q'; import PieceListFetcher from '../fetchers/piece_list_fetcher'; diff --git a/js/actions/prize_list_actions.js b/js/actions/prize_list_actions.js index fddf1a04..da2f97df 100644 --- a/js/actions/prize_list_actions.js +++ b/js/actions/prize_list_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import Q from 'q'; import PrizeListFetcher from '../fetchers/prize_list_fetcher'; diff --git a/js/actions/user_actions.js b/js/actions/user_actions.js index 2a2c3c05..9233244d 100644 --- a/js/actions/user_actions.js +++ b/js/actions/user_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import UserFetcher from '../fetchers/user_fetcher'; diff --git a/js/actions/wallet_settings_actions.js b/js/actions/wallet_settings_actions.js index 11a21631..1094c8e2 100644 --- a/js/actions/wallet_settings_actions.js +++ b/js/actions/wallet_settings_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import WalletSettingsFetcher from '../fetchers/wallet_settings_fetcher'; diff --git a/js/actions/whitelabel_actions.js b/js/actions/whitelabel_actions.js index 41ab1421..95d4fc27 100644 --- a/js/actions/whitelabel_actions.js +++ b/js/actions/whitelabel_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import WhitelabelFetcher from '../fetchers/whitelabel_fetcher'; diff --git a/js/alt.js b/js/alt.js index 94786185..5b0fa670 100644 --- a/js/alt.js +++ b/js/alt.js @@ -2,4 +2,5 @@ import Alt from 'alt'; -export default new Alt(); +export let alt = new Alt(); +export let altThirdParty = new Alt(); diff --git a/js/components/logout_container.js b/js/components/logout_container.js index c7769867..70a20034 100644 --- a/js/components/logout_container.js +++ b/js/components/logout_container.js @@ -4,7 +4,7 @@ import React from 'react'; import Router from 'react-router'; import UserActions from '../actions/user_actions'; -import Alt from '../alt'; +import { alt } from '../alt'; import AppConstants from '../constants/application_constants'; let baseUrl = AppConstants.baseUrl; diff --git a/js/components/whitelabel/prize/actions/prize_actions.js b/js/components/whitelabel/prize/actions/prize_actions.js index 5646e2d6..fcd9e91e 100644 --- a/js/components/whitelabel/prize/actions/prize_actions.js +++ b/js/components/whitelabel/prize/actions/prize_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../../../../alt'; +import { alt } from '../../../../alt'; import Q from 'q'; import PrizeFetcher from '../fetchers/prize_fetcher'; diff --git a/js/components/whitelabel/prize/actions/prize_jury_actions.js b/js/components/whitelabel/prize/actions/prize_jury_actions.js index bd0a25af..9bd03f59 100644 --- a/js/components/whitelabel/prize/actions/prize_jury_actions.js +++ b/js/components/whitelabel/prize/actions/prize_jury_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../../../../alt'; +import { alt } from '../../../../alt'; import Q from 'q'; import PrizeJuryFetcher from '../fetchers/prize_jury_fetcher'; diff --git a/js/components/whitelabel/prize/actions/prize_rating_actions.js b/js/components/whitelabel/prize/actions/prize_rating_actions.js index 1e42f8ba..184d84e7 100644 --- a/js/components/whitelabel/prize/actions/prize_rating_actions.js +++ b/js/components/whitelabel/prize/actions/prize_rating_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../../../../alt'; +import { alt } from '../../../../alt'; import Q from 'q'; import PrizeRatingFetcher from '../fetchers/prize_rating_fetcher'; diff --git a/js/components/whitelabel/prize/stores/prize_jury_store.js b/js/components/whitelabel/prize/stores/prize_jury_store.js index 88ed21ac..69d73e3a 100644 --- a/js/components/whitelabel/prize/stores/prize_jury_store.js +++ b/js/components/whitelabel/prize/stores/prize_jury_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../../../../alt'; +import { alt } from '../../../../alt'; import PrizeJuryActions from '../actions/prize_jury_actions'; diff --git a/js/components/whitelabel/prize/stores/prize_rating_store.js b/js/components/whitelabel/prize/stores/prize_rating_store.js index 9b7a2126..d67fa603 100644 --- a/js/components/whitelabel/prize/stores/prize_rating_store.js +++ b/js/components/whitelabel/prize/stores/prize_rating_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../../../../alt'; +import { alt } from '../../../../alt'; import PrizeRatingActions from '../actions/prize_rating_actions'; diff --git a/js/components/whitelabel/prize/stores/prize_store.js b/js/components/whitelabel/prize/stores/prize_store.js index f311e1fe..68cc9264 100644 --- a/js/components/whitelabel/prize/stores/prize_store.js +++ b/js/components/whitelabel/prize/stores/prize_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../../../../alt'; +import { alt } from '../../../../alt'; import PrizeActions from '../actions/prize_actions'; diff --git a/js/stores/application_store.js b/js/stores/application_store.js index 5eb89e24..6fefa573 100644 --- a/js/stores/application_store.js +++ b/js/stores/application_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import ApplicationActions from '../actions/application_actions'; diff --git a/js/stores/coa_store.js b/js/stores/coa_store.js index fa71771e..e76e480e 100644 --- a/js/stores/coa_store.js +++ b/js/stores/coa_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import CoaActions from '../actions/coa_actions'; diff --git a/js/stores/contract_agreement_list_store.js b/js/stores/contract_agreement_list_store.js index ca1d8e6b..aef13850 100644 --- a/js/stores/contract_agreement_list_store.js +++ b/js/stores/contract_agreement_list_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import ContractAgreementListActions from '../actions/contract_agreement_list_actions'; diff --git a/js/stores/contract_list_store.js b/js/stores/contract_list_store.js index 5bc30d3e..ba35978d 100644 --- a/js/stores/contract_list_store.js +++ b/js/stores/contract_list_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import ContractListActions from '../actions/contract_list_actions'; diff --git a/js/stores/edition_list_store.js b/js/stores/edition_list_store.js index b3b152d3..4ccada4e 100644 --- a/js/stores/edition_list_store.js +++ b/js/stores/edition_list_store.js @@ -2,7 +2,7 @@ import React from 'react'; -import alt from '../alt'; +import { alt } from '../alt'; import EditionsListActions from '../actions/edition_list_actions'; class EditionListStore { diff --git a/js/stores/edition_store.js b/js/stores/edition_store.js index 0fa0eb71..14ee4fee 100644 --- a/js/stores/edition_store.js +++ b/js/stores/edition_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import EditionActions from '../actions/edition_actions'; diff --git a/js/stores/global_notification_store.js b/js/stores/global_notification_store.js index bd1bedc6..5a23fe1b 100644 --- a/js/stores/global_notification_store.js +++ b/js/stores/global_notification_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import GlobalNotificationActions from '../actions/global_notification_actions'; diff --git a/js/stores/license_store.js b/js/stores/license_store.js index 42a6bfb5..29063a91 100644 --- a/js/stores/license_store.js +++ b/js/stores/license_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import LicenseActions from '../actions/license_actions'; diff --git a/js/stores/notification_store.js b/js/stores/notification_store.js index 9f6bdecf..ffb3b0af 100644 --- a/js/stores/notification_store.js +++ b/js/stores/notification_store.js @@ -1,7 +1,7 @@ 'use strict'; import React from 'react'; -import alt from '../alt'; +import { alt } from '../alt'; import NotificationActions from '../actions/notification_actions'; diff --git a/js/stores/ownership_store.js b/js/stores/ownership_store.js index eaba7111..6feb2a10 100644 --- a/js/stores/ownership_store.js +++ b/js/stores/ownership_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import OwnershipActions from '../actions/ownership_actions'; diff --git a/js/stores/piece_list_store.js b/js/stores/piece_list_store.js index 8b4254ac..2ba90770 100644 --- a/js/stores/piece_list_store.js +++ b/js/stores/piece_list_store.js @@ -1,7 +1,7 @@ 'use strict'; import React from 'react'; -import alt from '../alt'; +import { alt } from '../alt'; import PieceListActions from '../actions/piece_list_actions'; diff --git a/js/stores/piece_store.js b/js/stores/piece_store.js index 0bebab10..ccef50b1 100644 --- a/js/stores/piece_store.js +++ b/js/stores/piece_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import PieceActions from '../actions/piece_actions'; diff --git a/js/stores/prize_list_store.js b/js/stores/prize_list_store.js index 99ee5d14..87b94f01 100644 --- a/js/stores/prize_list_store.js +++ b/js/stores/prize_list_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import PrizeListActions from '../actions/prize_list_actions'; diff --git a/js/stores/user_store.js b/js/stores/user_store.js index 14eb1f90..da9eac93 100644 --- a/js/stores/user_store.js +++ b/js/stores/user_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import UserActions from '../actions/user_actions'; diff --git a/js/stores/wallet_settings_store.js b/js/stores/wallet_settings_store.js index df4cce99..6449bb24 100644 --- a/js/stores/wallet_settings_store.js +++ b/js/stores/wallet_settings_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import WalletSettingsActions from '../actions/wallet_settings_actions'; diff --git a/js/stores/whitelabel_store.js b/js/stores/whitelabel_store.js index 478b00a2..9db49d4e 100644 --- a/js/stores/whitelabel_store.js +++ b/js/stores/whitelabel_store.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { alt } from '../alt'; import WhitelabelActions from '../actions/whitelabel_actions'; diff --git a/js/third_party/debug.js b/js/third_party/debug.js index 76178266..23fe4d04 100644 --- a/js/third_party/debug.js +++ b/js/third_party/debug.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { altThirdParty } from '../alt'; import EventActions from '../actions/event_actions'; @@ -27,4 +27,4 @@ class DebugHandler { } } -export default alt.createStore(DebugHandler, 'DebugHandler'); +export default altThirdParty.createStore(DebugHandler, 'DebugHandler'); diff --git a/js/third_party/ga.js b/js/third_party/ga.js index f95450cb..e7929191 100644 --- a/js/third_party/ga.js +++ b/js/third_party/ga.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { altThirdParty } from '../alt'; import EventActions from '../actions/event_actions'; class GoogleAnalyticsHandler { @@ -23,4 +23,4 @@ class GoogleAnalyticsHandler { } -export default alt.createStore(GoogleAnalyticsHandler, 'GoogleAnalyticsHandler'); +export default altThirdParty.createStore(GoogleAnalyticsHandler, 'GoogleAnalyticsHandler'); diff --git a/js/third_party/intercom.js b/js/third_party/intercom.js index 42ecccf7..4ab2ff50 100644 --- a/js/third_party/intercom.js +++ b/js/third_party/intercom.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { altThirdParty } from '../alt'; import EventActions from '../actions/event_actions'; import { getSubdomain } from '../utils/general_utils'; @@ -33,4 +33,4 @@ class IntercomHandler { } -export default alt.createStore(IntercomHandler, 'IntercomHandler'); +export default altThirdParty.createStore(IntercomHandler, 'IntercomHandler'); diff --git a/js/third_party/notifications.js b/js/third_party/notifications.js index eeac1bff..90a613b8 100644 --- a/js/third_party/notifications.js +++ b/js/third_party/notifications.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { altThirdParty } from '../alt'; import EventActions from '../actions/event_actions'; import NotificationActions from '../actions/notification_actions'; @@ -35,4 +35,4 @@ class NotificationsHandler { } } -export default alt.createStore(NotificationsHandler, 'NotificationsHandler'); +export default altThirdParty.createStore(NotificationsHandler, 'NotificationsHandler'); diff --git a/js/third_party/raven.js b/js/third_party/raven.js index eeb5b390..3d6ff315 100644 --- a/js/third_party/raven.js +++ b/js/third_party/raven.js @@ -1,6 +1,6 @@ 'use strict'; -import alt from '../alt'; +import { altThirdParty } from '../alt'; import EventActions from '../actions/event_actions'; import Raven from 'raven-js'; @@ -25,4 +25,4 @@ class RavenHandler { } } -export default alt.createStore(RavenHandler, 'RavenHandler'); +export default altThirdParty.createStore(RavenHandler, 'RavenHandler'); From f5c06e070c85ca4d468c4b82e1d05e2a347a5e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 7 Oct 2015 09:31:38 +0200 Subject: [PATCH 21/22] Separate dispatcher logic of whitelabel and user stores --- js/actions/user_actions.js | 4 ++-- js/actions/whitelabel_actions.js | 4 ++-- js/alt.js | 2 ++ js/components/logout_container.js | 7 +++++-- js/stores/user_store.js | 4 ++-- js/stores/whitelabel_store.js | 4 ++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/js/actions/user_actions.js b/js/actions/user_actions.js index 9233244d..661890e9 100644 --- a/js/actions/user_actions.js +++ b/js/actions/user_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altUser } from '../alt'; import UserFetcher from '../fetchers/user_fetcher'; @@ -34,4 +34,4 @@ class UserActions { } } -export default alt.createActions(UserActions); +export default altUser.createActions(UserActions); diff --git a/js/actions/whitelabel_actions.js b/js/actions/whitelabel_actions.js index 95d4fc27..a1460fb8 100644 --- a/js/actions/whitelabel_actions.js +++ b/js/actions/whitelabel_actions.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altWhitelabel } from '../alt'; import WhitelabelFetcher from '../fetchers/whitelabel_fetcher'; @@ -26,4 +26,4 @@ class WhitelabelActions { } } -export default alt.createActions(WhitelabelActions); +export default altWhitelabel.createActions(WhitelabelActions); diff --git a/js/alt.js b/js/alt.js index 5b0fa670..141248c1 100644 --- a/js/alt.js +++ b/js/alt.js @@ -4,3 +4,5 @@ import Alt from 'alt'; export let alt = new Alt(); export let altThirdParty = new Alt(); +export let altUser = new Alt(); +export let altWhitelabel = new Alt(); diff --git a/js/components/logout_container.js b/js/components/logout_container.js index 70a20034..74c16439 100644 --- a/js/components/logout_container.js +++ b/js/components/logout_container.js @@ -4,7 +4,7 @@ import React from 'react'; import Router from 'react-router'; import UserActions from '../actions/user_actions'; -import { alt } from '../alt'; +import { alt, altWhitelabel, altUser, altThirdParty } from '../alt'; import AppConstants from '../constants/application_constants'; let baseUrl = AppConstants.baseUrl; @@ -16,7 +16,10 @@ let LogoutContainer = React.createClass({ componentDidMount() { UserActions.logoutCurrentUser() .then(() => { - Alt.flush(); + alt.flush(); + altWhitelabel.flush(); + altUser.flush(); + altThirdParty.flush(); // kill intercom (with fire) window.Intercom('shutdown'); this.replaceWith(baseUrl); diff --git a/js/stores/user_store.js b/js/stores/user_store.js index da9eac93..8ea18eea 100644 --- a/js/stores/user_store.js +++ b/js/stores/user_store.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altUser } from '../alt'; import UserActions from '../actions/user_actions'; @@ -18,4 +18,4 @@ class UserStore { } } -export default alt.createStore(UserStore, 'UserStore'); +export default altUser.createStore(UserStore, 'UserStore'); diff --git a/js/stores/whitelabel_store.js b/js/stores/whitelabel_store.js index 9db49d4e..017fb98e 100644 --- a/js/stores/whitelabel_store.js +++ b/js/stores/whitelabel_store.js @@ -1,6 +1,6 @@ 'use strict'; -import { alt } from '../alt'; +import { altWhitelabel } from '../alt'; import WhitelabelActions from '../actions/whitelabel_actions'; @@ -15,4 +15,4 @@ class WhitelabelStore { } } -export default alt.createStore(WhitelabelStore, 'WhitelabelStore'); +export default altWhitelabel.createStore(WhitelabelStore, 'WhitelabelStore'); From f38ce126b746a57468301ade0dcd9cba4c3ca6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 12 Oct 2015 10:37:08 +0200 Subject: [PATCH 22/22] Correct handleSuccess of AclButtonList --- .../wallet/components/ascribe_detail/wallet_action_panel.js | 3 +-- .../cyland/ascribe_detail/cyland_piece_container.js | 4 ++++ .../ikonotv/ascribe_buttons/ikonotv_submit_button.js | 1 - .../ikonotv/ascribe_detail/ikonotv_piece_container.js | 5 +++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/js/components/whitelabel/wallet/components/ascribe_detail/wallet_action_panel.js b/js/components/whitelabel/wallet/components/ascribe_detail/wallet_action_panel.js index b00d10cc..3e60c653 100644 --- a/js/components/whitelabel/wallet/components/ascribe_detail/wallet_action_panel.js +++ b/js/components/whitelabel/wallet/components/ascribe_detail/wallet_action_panel.js @@ -49,7 +49,7 @@ let WalletActionPanel = React.createClass({ className="text-center ascribe-button-list" availableAcls={availableAcls} editions={this.props.piece} - handleSuccess={this.loadPiece}> + handleSuccess={this.props.loadPiece}> @@ -58,7 +58,6 @@ let WalletActionPanel = React.createClass({ aclName="acl_wallet_submit"> 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 1be98cfc..047e8cb1 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 @@ -21,6 +21,10 @@ import { getLangText } from '../../../../../../utils/lang_utils'; import { mergeOptions } from '../../../../../../utils/general_utils'; let CylandPieceContainer = React.createClass({ + propTypes: { + params: React.PropTypes.object + }, + getInitialState() { return mergeOptions( PieceStore.getState(), 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 523f9fe2..0a2b46bc 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 @@ -9,7 +9,6 @@ import { getLangText } from '../../../../../../utils/lang_utils'; let IkonotvSubmitButton = React.createClass({ propTypes: { className: React.PropTypes.string, - handleSuccess: React.PropTypes.func, piece: React.PropTypes.object.isRequired }, 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 1194b14a..cc457ea0 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 @@ -22,7 +22,12 @@ import AppConstants from '../../../../../../constants/application_constants'; import { getLangText } from '../../../../../../utils/lang_utils'; import { mergeOptions } from '../../../../../../utils/general_utils'; + let IkonotvPieceContainer = React.createClass({ + propTypes: { + params: React.PropTypes.object + }, + getInitialState() { return mergeOptions( PieceStore.getState(),