diff --git a/js/components/ascribe_accordion_list/accordion_list_item_wallet.js b/js/components/ascribe_accordion_list/accordion_list_item_wallet.js index 638e9bb3..6f3139a3 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_wallet.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_wallet.js @@ -7,20 +7,19 @@ import Glyphicon from 'react-bootstrap/lib/Glyphicon'; import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; import Tooltip from 'react-bootstrap/lib/Tooltip'; -import AccordionListItemPiece from './accordion_list_item_piece'; -import AccordionListItemEditionWidget from './accordion_list_item_edition_widget'; -import CreateEditionsForm from '../ascribe_forms/create_editions_form'; - -import PieceListActions from '../../actions/piece_list_actions'; -import PieceListStore from '../../stores/piece_list_store'; - -import WhitelabelStore from '../../stores/whitelabel_store'; - import EditionListActions from '../../actions/edition_list_actions'; import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; +import PieceListActions from '../../actions/piece_list_actions'; +import PieceListStore from '../../stores/piece_list_store'; + +import AccordionListItemPiece from './accordion_list_item_piece'; +import AccordionListItemEditionWidget from './accordion_list_item_edition_widget'; +import CreateEditionsForm from '../ascribe_forms/create_editions_form'; + + import AclProxy from '../acl_proxy'; import { getLangText } from '../../utils/lang_utils'; @@ -30,6 +29,7 @@ import { mergeOptions } from '../../utils/general_utils'; let AccordionListItemWallet = React.createClass({ propTypes: { content: React.PropTypes.object.isRequired, + whitelabel: React.PropTypes.object.isRequired, className: React.PropTypes.string, thumbnailPlaceholder: React.PropTypes.func, @@ -41,22 +41,19 @@ let AccordionListItemWallet = React.createClass({ getInitialState() { return mergeOptions( + PieceListStore.getState(), { showCreateEditionsDialog: false - }, - PieceListStore.getState(), - WhitelabelStore.getState() + } ); }, componentDidMount() { PieceListStore.listen(this.onChange); - WhitelabelStore.listen(this.onChange); }, componentWillUnmount() { PieceListStore.unlisten(this.onChange); - WhitelabelStore.unlisten(this.onChange); }, onChange(state) { @@ -64,7 +61,7 @@ let AccordionListItemWallet = React.createClass({ }, getGlyphicon() { - if (this.props.content.notifications && this.props.content.notifications.length){ + if (this.props.content.notifications && this.props.content.notifications.length) { return ( , diff --git a/js/components/ascribe_detail/edition_container.js b/js/components/ascribe_detail/edition_container.js index 00b40ef5..1001be55 100644 --- a/js/components/ascribe_detail/edition_container.js +++ b/js/components/ascribe_detail/edition_container.js @@ -84,8 +84,8 @@ let EditionContainer = React.createClass({ }, render() { + const { actionPanelButtonListType, currentUser, furtherDetailsType, whitelabel } = this.props; const { edition, coaMeta } = this.state; - const { actionPanelButtonListType, currentUser, furtherDetailsType } = this.props; if (Object.keys(edition).length && edition.id) { setDocumentTitle([edition.artist_name, edition.title].join(', ')); @@ -93,11 +93,12 @@ let EditionContainer = React.createClass({ return ( EditionActions.fetchEdition(this.props.params.editionId)} /> + edition={edition} + furtherDetailsType={furtherDetailsType} + loadEdition={() => EditionActions.fetchEdition(this.props.params.editionId)} + whitelabel={whitelabel} /> ); } else { return ( diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 4a4663bb..3a4484ef 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -268,7 +268,8 @@ let PieceList = React.createClass({ customSubmitButton, customThumbnailPlaceholder, filterParams, - orderParams } = this.props; + orderParams, + whitelabel } = this.props; const loadingElement = ; @@ -276,6 +277,7 @@ let PieceList = React.createClass({ const availableAcls = getAvailableAcls(selectedEditions, (aclName) => aclName !== 'acl_view'); setDocumentTitle(getLangText('Collection')); + return (
+ thumbnailPlaceholder={customThumbnailPlaceholder} + whitelabel={whitelabel}> diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 49f191c7..5ee192aa 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -6,9 +6,6 @@ import { History } from 'react-router'; import Col from 'react-bootstrap/lib/Col'; import Row from 'react-bootstrap/lib/Row'; -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'; diff --git a/js/components/whitelabel/wallet/components/cyland/cyland_buttons/cyland_submit_button.js b/js/components/whitelabel/wallet/components/cyland/cyland_buttons/cyland_submit_button.js index 45b8c45e..2a881fbd 100644 --- a/js/components/whitelabel/wallet/components/cyland/cyland_buttons/cyland_submit_button.js +++ b/js/components/whitelabel/wallet/components/cyland/cyland_buttons/cyland_submit_button.js @@ -7,39 +7,19 @@ import Button from 'react-bootstrap/lib/Button'; import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'; -import WhitelabelActions from '../../../../../../actions/whitelabel_actions'; -import WhitelabelStore from '../../../../../../stores/whitelabel_store'; - import { getLangText } from '../../../../../../utils/lang_utils'; let CylandSubmitButton = React.createClass({ propTypes: { - className: React.PropTypes.string, - handleSuccess: React.PropTypes.func, piece: React.PropTypes.object.isRequired, - username: React.PropTypes.string - }, - getInitialState() { - return WhitelabelStore.getState(); - }, - - componentDidMount() { - WhitelabelStore.listen(this.onChange); - WhitelabelActions.fetchWhitelabel(); - }, - - componentWillUnmount() { - WhitelabelStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); + className: React.PropTypes.string, + handleSuccess: React.PropTypes.func }, render() { - const { piece, className } = this.props; + const { className, piece } = this.props; return ( - + diff --git a/js/components/whitelabel/wallet/components/market/market_buttons/market_submit_button.js b/js/components/whitelabel/wallet/components/market/market_buttons/market_submit_button.js index d8ef4c41..c0f58380 100644 --- a/js/components/whitelabel/wallet/components/market/market_buttons/market_submit_button.js +++ b/js/components/whitelabel/wallet/components/market/market_buttons/market_submit_button.js @@ -3,6 +3,8 @@ import React from 'react'; import classNames from 'classnames'; +import PieceActions from '../../../../../../actions/piece_actions'; + import MarketAdditionalDataForm from '../market_forms/market_additional_data_form'; import AclFormFactory from '../../../../../ascribe_forms/acl_form_factory'; @@ -12,10 +14,6 @@ import ModalWrapper from '../../../../../ascribe_modal/modal_wrapper'; import AclProxy from '../../../../../acl_proxy'; -import PieceActions from '../../../../../../actions/piece_actions'; -import WhitelabelActions from '../../../../../../actions/whitelabel_actions'; -import WhitelabelStore from '../../../../../../stores/whitelabel_store'; - import ApiUrls from '../../../../../../constants/api_urls'; import { getAclFormMessage, getAclFormDataId } from '../../../../../../utils/form_utils'; @@ -24,30 +22,14 @@ import { getLangText } from '../../../../../../utils/lang_utils'; let MarketSubmitButton = React.createClass({ propTypes: { availableAcls: React.PropTypes.object.isRequired, - currentUser: React.PropTypes.object, + currentUser: React.PropTypes.object.isRequired, editions: React.PropTypes.array.isRequired, handleSuccess: React.PropTypes.func.isRequired, + whitelabel: React.PropTypes.object.isRequired, + className: React.PropTypes.string, }, - getInitialState() { - return WhitelabelStore.getState(); - }, - - componentDidMount() { - WhitelabelStore.listen(this.onChange); - - WhitelabelActions.fetchWhitelabel(); - }, - - componentWillUnmount() { - WhitelabelStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - canEditionBeSubmitted(edition) { if (edition && edition.extra_data && edition.other_data) { const { extra_data, other_data } = edition; @@ -90,8 +72,14 @@ let MarketSubmitButton = React.createClass({ }, render() { - const { availableAcls, currentUser, className, editions, handleSuccess } = this.props; - const { whitelabel: { name: whitelabelName = 'Market', user: whitelabelAdminEmail } } = this.state; + const { + availableAcls, + currentUser, + className, + editions, + handleSuccess, + whitelabel: { name: whitelabelName = 'Market', user: whitelabelAdminEmail } } = this.props; + const { solePieceId, canSubmit } = this.getAggregateEditionDetails(); const message = getAclFormMessage({ aclName: 'acl_consign', @@ -106,6 +94,7 @@ let MarketSubmitButton = React.createClass({ {getLangText('CONSIGN TO %s', whitelabelName.toUpperCase())} ); + const consignForm = (