mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Fix React warnings
This commit is contained in:
parent
0f8094ef55
commit
989fd8ea5c
@ -90,10 +90,8 @@ let PieceListToolbarFilterWidget = React.createClass({
|
||||
label also iterate over its items, to get all filterable options */}
|
||||
{this.props.filterParams.map(({ label, items }, i) => {
|
||||
return (
|
||||
<div>
|
||||
<li
|
||||
style={{'textAlign': 'center'}}
|
||||
key={i}>
|
||||
<div key={label}>
|
||||
<li style={{'textAlign': 'center'}}>
|
||||
<em>{label}:</em>
|
||||
</li>
|
||||
{items.map((param, j) => {
|
||||
@ -117,7 +115,7 @@ let PieceListToolbarFilterWidget = React.createClass({
|
||||
|
||||
return (
|
||||
<li
|
||||
key={j}
|
||||
key={param}
|
||||
onClick={this.filterBy(param)}
|
||||
className="filter-widget-item">
|
||||
<div className="checkbox-line">
|
||||
|
@ -62,9 +62,8 @@ let PieceListToolbarOrderWidget = React.createClass({
|
||||
</li>
|
||||
{this.props.orderParams.map((param) => {
|
||||
return (
|
||||
<div>
|
||||
<div key={param}>
|
||||
<li
|
||||
key={param}
|
||||
onClick={this.orderBy(param)}
|
||||
className="filter-widget-item">
|
||||
<div className="checkbox-line">
|
||||
@ -85,4 +84,4 @@ let PieceListToolbarOrderWidget = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
export default PieceListToolbarOrderWidget;
|
||||
export default PieceListToolbarOrderWidget;
|
||||
|
@ -3,15 +3,15 @@
|
||||
import React from 'react';
|
||||
|
||||
|
||||
let TableItemAclFiltered = React.createClass({
|
||||
const TableItemAclFiltered = React.createClass({
|
||||
propTypes: {
|
||||
content: React.PropTypes.object,
|
||||
notifications: React.PropTypes.string
|
||||
notifications: React.PropTypes.array
|
||||
},
|
||||
|
||||
render() {
|
||||
var availableAcls = ['acl_consign', 'acl_loan', 'acl_transfer', 'acl_view', 'acl_share', 'acl_unshare', 'acl_delete'];
|
||||
if (this.props.notifications && this.props.notifications.length > 0){
|
||||
const availableAcls = ['acl_consign', 'acl_loan', 'acl_transfer', 'acl_view', 'acl_share', 'acl_unshare', 'acl_delete'];
|
||||
if (this.props.notifications && this.props.notifications.length) {
|
||||
return (
|
||||
<span>
|
||||
{this.props.notifications[0].action_str}
|
||||
@ -19,15 +19,14 @@ let TableItemAclFiltered = React.createClass({
|
||||
);
|
||||
}
|
||||
|
||||
let filteredAcls = Object.keys(this.props.content).filter((key) => {
|
||||
return availableAcls.indexOf(key) > -1 && this.props.content[key];
|
||||
});
|
||||
|
||||
filteredAcls = filteredAcls.map((acl) => acl.split('acl_')[1]);
|
||||
const filteredAcls = Object.keys(this.props.content)
|
||||
.filter((key) => availableAcls.indexOf(key) > -1 && this.props.content[key])
|
||||
.map((acl) => acl.split('acl_')[1])
|
||||
.join('/');
|
||||
|
||||
return (
|
||||
<span>
|
||||
{filteredAcls.join('/')}
|
||||
{filteredAcls}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user