File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,7 @@ class RefinementList extends React.Component {
65
65
render ( ) {
66
66
return (
67
67
< div className = { cx ( this . props . cssClasses . list ) } >
68
- { this . props . facetValues
69
- . slice ( 0 , this . props . limit )
70
- . map ( this . _generateFacetItem , this ) }
68
+ { this . props . facetValues . map ( this . _generateFacetItem , this ) }
71
69
</ div >
72
70
) ;
73
71
}
@@ -84,7 +82,6 @@ RefinementList.propTypes = {
84
82
React . PropTypes . arrayOf ( React . PropTypes . string )
85
83
] )
86
84
} ) ,
87
- limit : React . PropTypes . number ,
88
85
facetValues : React . PropTypes . array ,
89
86
Template : React . PropTypes . func ,
90
87
toggleRefinement : React . PropTypes . func . isRequired ,
@@ -96,7 +93,6 @@ RefinementList.defaultProps = {
96
93
item : null ,
97
94
list : null
98
95
} ,
99
- limit : 1000 ,
100
96
facetNameKey : 'name'
101
97
} ;
102
98
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ var defaultTemplates = {
22
22
* @param {String } options.facetName Name of the attribute for faceting
23
23
* @param {String } options.operator How to apply refinements. Possible values: `or`, `and`
24
24
* @param {String[] } [options.sortBy=['count:desc']] How to sort refinements. Possible values: `count|isRefined|name:asc|desc`
25
- * @param {String } [options.limit=100 ] How much facet values to get
25
+ * @param {String } [options.limit=1000 ] How much facet values to get
26
26
* @param {Object } [options.cssClasses] CSS classes to add to the wrapping elements: root, list, item
27
27
* @param {String|String[] } [options.cssClasses.root] CSS class to add to the root element
28
28
* @param {String|String[] } [options.cssClasses.list] CSS class to add to the list element
@@ -44,7 +44,7 @@ function refinementList({
44
44
facetName = null ,
45
45
operator = null ,
46
46
sortBy = [ 'count:desc' ] ,
47
- limit = 100 ,
47
+ limit = 1000 ,
48
48
cssClasses = {
49
49
root : null ,
50
50
list : null ,
@@ -75,6 +75,13 @@ function refinementList({
75
75
}
76
76
77
77
return {
78
+ init : ( state , helper ) => {
79
+ // set the maxValuesPerFacet to max(limit, currentValue)
80
+ var maxValuesPerFacet = helper . getQueryParameter ( 'maxValuesPerFacet' ) ;
81
+ if ( ! maxValuesPerFacet || limit > maxValuesPerFacet ) {
82
+ helper . setQueryParameter ( 'maxValuesPerFacet' , limit ) ;
83
+ }
84
+ } ,
78
85
getConfiguration : ( ) => ( {
79
86
[ operator === 'and' ? 'facets' : 'disjunctiveFacets' ] : [ facetName ]
80
87
} ) ,
You can’t perform that action at this time.
0 commit comments