File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/rating-menu
467
467
grade : {
468
468
items : [ ] ,
469
469
createURL : expect . any ( Function ) ,
470
+ canRefine : false ,
470
471
refine : expect . any ( Function ) ,
471
472
sendEvent : expect . any ( Function ) ,
472
473
hasNoResults : true ,
@@ -546,6 +547,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/rating-menu
546
547
} ,
547
548
] ,
548
549
createURL : expect . any ( Function ) ,
550
+ canRefine : true ,
549
551
refine : expect . any ( Function ) ,
550
552
sendEvent : renderState1 . ratingMenu . grade . sendEvent ,
551
553
hasNoResults : true ,
@@ -581,6 +583,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/rating-menu
581
583
expect ( renderState1 ) . toEqual ( {
582
584
items : [ ] ,
583
585
createURL : expect . any ( Function ) ,
586
+ canRefine : false ,
584
587
refine : expect . any ( Function ) ,
585
588
sendEvent : expect . any ( Function ) ,
586
589
hasNoResults : true ,
@@ -658,6 +661,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/rating-menu
658
661
} ,
659
662
] ,
660
663
createURL : expect . any ( Function ) ,
664
+ canRefine : true ,
661
665
refine : expect . any ( Function ) ,
662
666
sendEvent : renderState1 . sendEvent ,
663
667
hasNoResults : true ,
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ const createSendEvent = ({
66
66
* @property {StarRatingItems[] } items Possible star ratings the user can apply.
67
67
* @property {function(string): string } createURL Creates an URL for the next
68
68
* state (takes the item value as parameter). Takes the value of an item as parameter.
69
+ * @property {boolean } canRefine Indicates if search state can be refined.
69
70
* @property {function(string) } refine Selects a rating to filter the results
70
71
* (takes the filter value as parameter). Takes the value of an item as parameter.
71
72
* @property {boolean } hasNoResults `true` if the last search contains no result.
328
329
return {
329
330
items : facetValues ,
330
331
hasNoResults : results ? results . nbHits === 0 : true ,
332
+ canRefine : facetValues . length > 0 ,
331
333
refine : connectorState . toggleRefinementFactory ( helper ) ,
332
334
sendEvent,
333
335
createURL : connectorState . createURLFactory ( { state, createURL } ) ,
You can’t perform that action at this time.
0 commit comments