question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

item.label not present for Range under CurrentRefinement

See original GitHub issue
yep

My Range component is the same that the component provided in the documentation…

I suppose that we missed associate label field 😄

live demo at https://windtoday.co

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Kikobeatscommented, Jan 26, 2017

Oh sorry, I did something wrong but now CurrentRefinements#transformItems works as expected, I did this workaround:

function isRange (item) {
  return item.currentRefinement.max && item.currentRefinement.min
}

function transformRange (item) {
  return {
    currentRefinement: item.currentRefinement,
    label: `${item.attributeName}: `,
    items: [{'label': item.label, value: item.value}]
  }
}

function transformItems (items) {
  return items.map(function (item) {
    if (isRange(item)) item = transformRange(item)
    return item
  })
}

I detect if the item is a Range (based on the item fields) and I’m mapping the item interface to be as the rest of the non Range items.

My point is, could be possible encapsulate this inside Range component?

That also avoid the conditional rendering inside CurrentRefinements, just providing one interface to implement.

0reactions
mthuretcommented, Apr 11, 2017

React InstantSearch has been moved here: https://github.com/algolia/react-instantsearch This issue has either been rewritten or placed inside our backlog.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ais-current-refinements | Vue InstantSearch - Algolia
A Vue InstantSearch widget for showing a list of currently active search refinements.
Read more >
Algolia: Change label of currentRefinements item
As a result my currentRefinements widget shows true or false instead of a better text like "Only on sale". Is there a way...
Read more >
Structure refinement in PHENIX
If there is no such atoms in input PDB file, then no occupancies will be refined. Other model parameters, such as B-factors or...
Read more >
The Coot User Manual - MRC Laboratory of Molecular Biology
5.17.3 Mutating to a Non-Standard Residue.................... 38 ... 11.12.4 set-model-fit-refine-place-atom-at-pointer-label.......... 81.
Read more >
Details
Treat as Range: This check box indicates whether or not the refinement values should be treated as a range. If this check box...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found