From 3a812e531dc23a3a255d724df6dee0ed93825e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 5 Jun 2015 15:17:35 +0200 Subject: [PATCH] fix search bug --- .../ascribe_buttons/acl_button_list.js | 19 ++++++++++++++----- .../piece_list_toolbar.js | 2 +- js/components/edition.js | 8 ++++---- js/components/edition_container.js | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/js/components/ascribe_buttons/acl_button_list.js b/js/components/ascribe_buttons/acl_button_list.js index d2f60a1e..a14497cc 100644 --- a/js/components/ascribe_buttons/acl_button_list.js +++ b/js/components/ascribe_buttons/acl_button_list.js @@ -1,3 +1,5 @@ +'use strict'; + import React from 'react'; import UserActions from '../../actions/user_actions'; @@ -6,12 +8,15 @@ import UserStore from '../../stores/user_store'; import AclButton from '../ascribe_buttons/acl_button'; let AclButtonList = React.createClass({ - getInitialState() { - return UserStore.getState(); + propTypes: { + availableAcls: React.PropTypes.array, + editions: React.PropTypes.array, + currentUser: React.PropTypes.object, + handleSuccess: React.PropTypes.func }, - onChange(state) { - this.setState(state); + getInitialState() { + return UserStore.getState(); }, componentDidMount() { @@ -19,10 +24,14 @@ let AclButtonList = React.createClass({ UserActions.fetchCurrentUser(); }, - componentDidUnmount() { + componentWillUnmount() { UserStore.unlisten(this.onChange); }, + onChange(state) { + this.setState(state); + }, + render() { return (
diff --git a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js index a3c8c219..d5a05d5f 100644 --- a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js +++ b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js @@ -32,7 +32,7 @@ let PieceListToolbar = React.createClass({ searchFor() { let searchTerm = this.refs.search.getInputDOMNode().value; - PieceListActions.fetchPieceList(this.state.page, this.pageSize, searchTerm, this.state.orderBy, this.state.orderAsc); + PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, searchTerm, this.state.orderBy, this.state.orderAsc); }, render() { diff --git a/js/components/edition.js b/js/components/edition.js index 8574b3dc..b085481f 100644 --- a/js/components/edition.js +++ b/js/components/edition.js @@ -30,7 +30,7 @@ let Edition = React.createClass({ let extraData = null; if (this.props.edition.digital_work.encoding_urls) { - extraData = this.props.edition.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label } }); + extraData = this.props.edition.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label }; }); } let bitcoinIdValue = ( @@ -63,14 +63,14 @@ let Edition = React.createClass({ 0}> - 0}> - @@ -89,7 +89,7 @@ let Edition = React.createClass({ -