From f3ea3460bbba46cc484efa24a5652acbfd4c07a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 15 Jul 2015 17:22:28 +0200 Subject: [PATCH 1/2] reload piece list after clicking on create editions --- js/components/ascribe_buttons/create_editions_button.js | 3 --- js/components/ascribe_detail/piece.js | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/js/components/ascribe_buttons/create_editions_button.js b/js/components/ascribe_buttons/create_editions_button.js index beeb1e97..ac6fe543 100644 --- a/js/components/ascribe_buttons/create_editions_button.js +++ b/js/components/ascribe_buttons/create_editions_button.js @@ -5,7 +5,6 @@ import React from 'react'; import EditionListActions from '../../actions/edition_list_actions'; import EditionListStore from '../../stores/edition_list_store'; -import { getAvailableAcls } from '../../utils/acl_utils'; import { getLangText } from '../../utils/lang_utils'; import classNames from 'classnames'; @@ -65,8 +64,6 @@ let CreateEditionsButton = React.createClass({ render: function () { let piece = this.props.piece; - let availableAcls = getAvailableAcls(piece); - if (!piece.acl.acl_editions || piece.num_editions > 0){ return null; } diff --git a/js/components/ascribe_detail/piece.js b/js/components/ascribe_detail/piece.js index 51f902b3..9ad80e1c 100644 --- a/js/components/ascribe_detail/piece.js +++ b/js/components/ascribe_detail/piece.js @@ -79,6 +79,7 @@ let Piece = React.createClass({ handleEditionCreationSuccess() { PieceActions.updateProperty({key: 'num_editions', value: 0}); + PieceListStore.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc); this.toggleCreateEditionsDialog(); }, From fb609afd283e9c8e58e3e14d51c558ce7dd654ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Wed, 15 Jul 2015 17:32:51 +0200 Subject: [PATCH 2/2] loading feedback for edition button --- .../accordion_list_item.js | 6 ++++-- .../accordion_list_item_edition_widget.js | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 8a77c7bd..2820cce3 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -65,8 +65,10 @@ let AccordionListItem = React.createClass({ getGlyphicon(){ if (this.props.content.requestAction) { return ( - {getLangText('You have actions pending in one of your editions')}}> + {getLangText('You have actions pending in one of your editions')}}> ); } 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 abd6e7b2..7e108ae0 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 @@ -58,9 +58,19 @@ let AccordionListItemEditionWidget = React.createClass({ let isEditionListOpen = this.state.isEditionListOpenForPieceId[pieceId] ? this.state.isEditionListOpenForPieceId[pieceId].show : false; if(isEditionListOpen) { - return ( - - ); + // this is the loading feedback for the editions + // button. + // + // PLEASE FUTURE TIM, DO NOT FUCKING REMOVE IT AGAIN! + if(typeof this.state.editionList[pieceId] === 'undefined') { + return ( + + ); + } else { + return ( + + ); + } } else { return (