mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
fix search bug
This commit is contained in:
parent
7f82d49278
commit
3a812e531d
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import UserActions from '../../actions/user_actions';
|
import UserActions from '../../actions/user_actions';
|
||||||
@ -6,12 +8,15 @@ import UserStore from '../../stores/user_store';
|
|||||||
import AclButton from '../ascribe_buttons/acl_button';
|
import AclButton from '../ascribe_buttons/acl_button';
|
||||||
|
|
||||||
let AclButtonList = React.createClass({
|
let AclButtonList = React.createClass({
|
||||||
getInitialState() {
|
propTypes: {
|
||||||
return UserStore.getState();
|
availableAcls: React.PropTypes.array,
|
||||||
|
editions: React.PropTypes.array,
|
||||||
|
currentUser: React.PropTypes.object,
|
||||||
|
handleSuccess: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(state) {
|
getInitialState() {
|
||||||
this.setState(state);
|
return UserStore.getState();
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -19,10 +24,14 @@ let AclButtonList = React.createClass({
|
|||||||
UserActions.fetchCurrentUser();
|
UserActions.fetchCurrentUser();
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUnmount() {
|
componentWillUnmount() {
|
||||||
UserStore.unlisten(this.onChange);
|
UserStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onChange(state) {
|
||||||
|
this.setState(state);
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
|
@ -32,7 +32,7 @@ let PieceListToolbar = React.createClass({
|
|||||||
|
|
||||||
searchFor() {
|
searchFor() {
|
||||||
let searchTerm = this.refs.search.getInputDOMNode().value;
|
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() {
|
render() {
|
||||||
|
@ -30,7 +30,7 @@ let Edition = React.createClass({
|
|||||||
let extraData = null;
|
let extraData = null;
|
||||||
|
|
||||||
if (this.props.edition.digital_work.encoding_urls) {
|
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 = (
|
let bitcoinIdValue = (
|
||||||
@ -63,14 +63,14 @@ let Edition = React.createClass({
|
|||||||
<CollapsibleEditionDetails
|
<CollapsibleEditionDetails
|
||||||
title="Provenance/Ownership History"
|
title="Provenance/Ownership History"
|
||||||
show={this.props.edition.ownership_history && this.props.edition.ownership_history.length > 0}>
|
show={this.props.edition.ownership_history && this.props.edition.ownership_history.length > 0}>
|
||||||
<EditionDetailHistoryIterator
|
<EditionDetailHistoryIterator
|
||||||
history={this.props.edition.ownership_history} />
|
history={this.props.edition.ownership_history} />
|
||||||
</CollapsibleEditionDetails>
|
</CollapsibleEditionDetails>
|
||||||
|
|
||||||
<CollapsibleEditionDetails
|
<CollapsibleEditionDetails
|
||||||
title="Loan History"
|
title="Loan History"
|
||||||
show={this.props.edition.loan_history && this.props.edition.loan_history.length > 0}>
|
show={this.props.edition.loan_history && this.props.edition.loan_history.length > 0}>
|
||||||
<EditionDetailHistoryIterator
|
<EditionDetailHistoryIterator
|
||||||
history={this.props.edition.loan_history} />
|
history={this.props.edition.loan_history} />
|
||||||
</CollapsibleEditionDetails>
|
</CollapsibleEditionDetails>
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ let Edition = React.createClass({
|
|||||||
|
|
||||||
<CollapsibleEditionDetails
|
<CollapsibleEditionDetails
|
||||||
title="Delete Actions">
|
title="Delete Actions">
|
||||||
<Button
|
<Button
|
||||||
bsStyle="danger"
|
bsStyle="danger"
|
||||||
onClick={this.props.deleteEdition}>
|
onClick={this.props.deleteEdition}>
|
||||||
Remove this artwork from your list
|
Remove this artwork from your list
|
||||||
|
@ -45,7 +45,7 @@ let EditionContainer = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Edition
|
<Edition
|
||||||
edition={this.state.edition}
|
edition={this.state.edition}
|
||||||
currentUser={this.state.currentUser}
|
currentUser={this.state.currentUser}
|
||||||
deleteEdition={this.deleteEdition}/>
|
deleteEdition={this.deleteEdition}/>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user