diff --git a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js index a0779c3b..edb29e85 100644 --- a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js +++ b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js @@ -95,7 +95,9 @@ let PieceListToolbarFilterWidget = React.createClass({
  • {label}:
  • - {items.map((param, j) => { + {items.map((paramItem) => { + let itemLabel; + let param; // As can be seen in the PropTypes, a param can either // be a string or an object of the shape: @@ -106,22 +108,22 @@ let PieceListToolbarFilterWidget = React.createClass({ // } // // This is why we need to distinguish between both here. - if (typeof param !== 'string') { - label = param.label; - param = param.key; + if (typeof paramItem !== 'string') { + param = paramItem.key; + itemLabel = paramItem.label; } else { - param = param; - label = param.split('acl_')[1].replace(/_/g, ' '); + param = paramItem; + itemLabel = paramItem.split('acl_')[1].replace(/_/g, ' '); } return (
  • - {getLangText(label)} + {getLangText(itemLabel)} {this.props.orderParams.map((param) => { return ( -
    -
  • -
    - - {getLangText(param.replace('_', ' '))} - - -1} /> -
    -
  • - +
  • +
    + + {getLangText(param.replace('_', ' '))} + + -1} /> +
    +
  • ); })}