diff --git a/js/actions/piece_list_actions.js b/js/actions/piece_list_actions.js
index a4ab626c..2d5f6447 100644
--- a/js/actions/piece_list_actions.js
+++ b/js/actions/piece_list_actions.js
@@ -8,23 +8,34 @@ import PieceListFetcher from '../fetchers/piece_list_fetcher';
class PieceListActions {
constructor() {
this.generateActions(
- 'updatePieceList'
+ 'updatePieceList',
+ 'updatePieceListRequestActions'
);
}
fetchPieceList(page, pageSize, search, orderBy, orderAsc) {
- PieceListFetcher
- .fetch(page, pageSize, search, orderBy, orderAsc)
- .then((res) => {
- this.actions.updatePieceList({
- page,
- pageSize,
- search,
- orderBy,
- orderAsc,
- 'pieceList': res.pieces,
- 'pieceListCount': res.count
+ return new Promise((resolve, reject) => {
+ PieceListFetcher
+ .fetch(page, pageSize, search, orderBy, orderAsc)
+ .then((res) => {
+ this.actions.updatePieceList({
+ page,
+ pageSize,
+ search,
+ orderBy,
+ orderAsc,
+ 'pieceList': res.pieces,
+ 'pieceListCount': res.count
+ });
+ resolve();
});
+ });
+ }
+ fetchPieceRequestActions() {
+ PieceListFetcher
+ .fetchRequestActions()
+ .then((res) => {
+ this.actions.updatePieceListRequestActions(res.piece_ids);
});
}
diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js
index 27eaf0d0..f7bfa925 100644
--- a/js/components/ascribe_accordion_list/accordion_list_item.js
+++ b/js/components/ascribe_accordion_list/accordion_list_item.js
@@ -1,30 +1,64 @@
'use strict';
import React from 'react';
+import Router from 'react-router';
+
+import Glyphicon from 'react-bootstrap/lib/Glyphicon';
+import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
+import Tooltip from 'react-bootstrap/lib/Tooltip';
+
+import requests from '../../utils/requests';
import { getLangText } from '../../utils/lang_utils';
let AccordionListItem = React.createClass({
+ mixins: [Router.Navigation],
+
propTypes: {
className: React.PropTypes.string,
content: React.PropTypes.object,
children: React.PropTypes.object
},
+ handleClick(event){
+ requests.get('piece_first_edition_id', {'piece_id': this.props.content.id})
+ .then((res) => this.transitionTo('edition', {editionId: res.bitcoin_id}));
+ console.log(event.target);
+ },
+ getGlyphicon(){
+ if (this.props.content.requestAction){
+ return (
+