From 78cf40ba6433ff8c5b2e660a14fe671f30e47809 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Mon, 18 Jan 2016 10:53:01 +0100 Subject: [PATCH] Small cosmetic changes --- js/actions/edition_list_actions.js | 4 ++-- js/actions/piece_list_actions.js | 4 ++-- .../accordion_list_item_edition_widget.js | 7 ++++--- .../accordion_list_item_table_editions.js | 4 ++-- .../ascribe_accordion_list/accordion_list_item_wallet.js | 4 ++-- js/components/ascribe_detail/edition_action_panel.js | 4 ++-- js/components/ascribe_detail/piece_container.js | 6 +++--- js/components/piece_list.js | 6 +++--- js/components/register_piece.js | 4 ++-- .../ascribe_accordion_list/accordion_list_item_prize.js | 4 ++-- .../components/ascribe_detail/prize_piece_container.js | 2 +- .../cyland_accordion_list/cyland_accordion_list_item.js | 2 +- .../cyland/cyland_detail/cyland_piece_container.js | 2 +- .../wallet/components/cyland/cyland_register_piece.js | 2 +- .../ikonotv_accordion_list/ikonotv_accordion_list_item.js | 2 +- .../ikonotv/ikonotv_detail/ikonotv_piece_container.js | 2 +- .../wallet/components/ikonotv/ikonotv_register_piece.js | 2 +- .../wallet/components/market/market_register_piece.js | 2 +- js/fetchers/edition_list_fetcher.js | 6 +++--- js/fetchers/piece_list_fetcher.js | 6 +++--- js/stores/edition_list_store.js | 8 ++++---- 21 files changed, 42 insertions(+), 41 deletions(-) diff --git a/js/actions/edition_list_actions.js b/js/actions/edition_list_actions.js index 78f21d94..a52e32b9 100644 --- a/js/actions/edition_list_actions.js +++ b/js/actions/edition_list_actions.js @@ -17,7 +17,7 @@ class EditionListActions { ); } - fetchEditionList({pieceId, page, pageSize, orderBy, orderAsc, filterBy, maxEdition}) { + fetchEditionList({ pieceId, page, pageSize, orderBy, orderAsc, filterBy, maxEdition }) { if ((!orderBy && typeof orderAsc === 'undefined') || !orderAsc) { orderBy = 'edition_number'; orderAsc = true; @@ -39,7 +39,7 @@ class EditionListActions { return Q.Promise((resolve, reject) => { EditionListFetcher - .fetch({pieceId, page, itemsToFetch, orderBy, orderAsc, filterBy}) + .fetch({ pieceId, page, itemsToFetch, orderBy, orderAsc, filterBy }) .then((res) => { if (res && !res.editions) { throw new Error('Piece has no editions to fetch.'); diff --git a/js/actions/piece_list_actions.js b/js/actions/piece_list_actions.js index 75abfd8f..c52ef5e2 100644 --- a/js/actions/piece_list_actions.js +++ b/js/actions/piece_list_actions.js @@ -15,7 +15,7 @@ class PieceListActions { ); } - fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}) { + fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }) { // To prevent flickering on a pagination request, // we overwrite the piecelist with an empty list before // pieceListCount === -1 defines the loading state @@ -34,7 +34,7 @@ class PieceListActions { // afterwards, we can load the list return Q.Promise((resolve, reject) => { PieceListFetcher - .fetch({page, pageSize, search, orderBy, orderAsc, filterBy}) + .fetch({ page, pageSize, search, orderBy, orderAsc, filterBy }) .then((res) => { this.actions.updatePieceList({ page, diff --git a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js index c4d3163d..2bb8b2d0 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js @@ -19,9 +19,10 @@ import { getLangText } from '../../utils/lang_utils'; let AccordionListItemEditionWidget = React.createClass({ propTypes: { - className: React.PropTypes.string, piece: React.PropTypes.object.isRequired, toggleCreateEditionsDialog: React.PropTypes.func.isRequired, + + className: React.PropTypes.string, onPollingSuccess: React.PropTypes.func }, @@ -54,11 +55,11 @@ let AccordionListItemEditionWidget = React.createClass({ const { filterBy, isEditionListOpenForPieceId } = this.state; const isEditionListOpen = isEditionListOpenForPieceId[pieceId] ? isEditionListOpenForPieceId[pieceId].show : false; - if(isEditionListOpen) { + if (isEditionListOpen) { EditionListActions.toggleEditionList(pieceId); } else { EditionListActions.toggleEditionList(pieceId); - EditionListActions.fetchEditionList({pieceId, filterBy}); + EditionListActions.fetchEditionList({ pieceId, filterBy }); } }, diff --git a/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js index 4a3af40d..3b0bb02e 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js @@ -82,11 +82,11 @@ let AccordionListItemTableEditions = React.createClass({ EditionListActions.fetchEditionList({ pieceId, - page: page + 1, pageSize, orderBy, orderAsc, - filterBy + filterBy, + page: page + 1 }); }, render() { 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 aa52d8be..f6712d37 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_wallet.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_wallet.js @@ -90,10 +90,10 @@ let AccordionListItemWallet = React.createClass({ onPollingSuccess(pieceId) { const { filterBy, orderAsc, orderBy, page, pageSize, search } = this.state; - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); EditionListActions.toggleEditionList(pieceId); - let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000); + const notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000); GlobalNotificationActions.appendGlobalNotification(notification); }, diff --git a/js/components/ascribe_detail/edition_action_panel.js b/js/components/ascribe_detail/edition_action_panel.js index 289e0a33..71bf38fe 100644 --- a/js/components/ascribe_detail/edition_action_panel.js +++ b/js/components/ascribe_detail/edition_action_panel.js @@ -81,8 +81,8 @@ let EditionActionPanel = React.createClass({ refreshCollection() { const { filterBy, orderAsc, orderBy, page, pageSize, search } = this.state; - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); - EditionListActions.refreshEditionList({pieceId: this.props.edition.parent}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); + EditionListActions.refreshEditionList({ pieceId: this.props.edition.parent }); }, handleSuccess(response) { diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 183c56f4..1f136cb7 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -144,14 +144,14 @@ let PieceContainer = React.createClass({ const { filterBy, orderAsc, orderBy, page, pageSize, search } = this.state; PieceActions.updateProperty({key: 'num_editions', value: 0}); - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); this.toggleCreateEditionsDialog(); }, handleDeleteSuccess(response) { const { filterBy, orderAsc, orderBy, page, pageSize, search } = this.state; - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); // since we're deleting a piece, we just need to close // all editions dialogs and not reload them @@ -192,7 +192,7 @@ let PieceContainer = React.createClass({ // btw.: It's not sufficient to just set num_editions to numEditions, since a single accordion // list item also uses the firstEdition property which we can only get from the server in that case. // Therefore we need to at least refetch the changed piece from the server or on our case simply all - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); let notification = new GlobalNotificationModel('Editions successfully created', 'success', 10000); GlobalNotificationActions.appendGlobalNotification(notification); diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 779050f3..666d1b54 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -214,14 +214,14 @@ let PieceList = React.createClass({ applyOrderBy(orderBy) { const { filterBy, orderAsc, page, pageSize, search } = this.state; - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); }, loadPieceList({ page, filterBy = this.state.filterBy, search = this.state.search }) { const { orderAsc, pageSize } = this.state; const orderBy = this.state.orderBy || this.props.orderBy; - return PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + return PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); }, fetchSelectedPieceEditionList() { @@ -249,7 +249,7 @@ let PieceList = React.createClass({ handleAclSuccess() { const { filterBy, orderBy, orderAsc, page, pageSize, search } = this.state; - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); this.fetchSelectedPieceEditionList() .forEach((pieceId) => { diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 7246cbe0..19a340ba 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -73,13 +73,13 @@ let RegisterPiece = React.createClass( { // once the user was able to register a piece successfully, we need to make sure to keep // the piece list up to date - PieceListActions.fetchPieceList({page, pageSize, search, orderBy, orderAsc, filterBy}); + PieceListActions.fetchPieceList({ page, pageSize, search, orderBy, orderAsc, filterBy }); this.history.push(`/pieces/${response.piece.id}`); }, getSpecifyEditions() { - if(this.state.whitelabel && this.state.whitelabel.acl_create_editions || Object.keys(this.state.whitelabel).length === 0) { + if (this.state.whitelabel && this.state.whitelabel.acl_create_editions || Object.keys(this.state.whitelabel).length === 0) { return (