Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CurrentRefinedValues widget bug? #1130

Closed
Maaark opened this issue Jul 7, 2016 · 11 comments
Closed

CurrentRefinedValues widget bug? #1130

Maaark opened this issue Jul 7, 2016 · 11 comments

Comments

@Maaark
Copy link

Maaark commented Jul 7, 2016

When you visit [URL1] first and afterwards [URL2] the current refined values aren't shown anymore and the sort by widget has an issue as well.

I get this error in the console:
index.js:959Uncaught Error: merkFull is not defined in the facets attribute of the helper configuration

Which is true, I haven't defined it in searchParameters.facets, but when I do I can't select other values in this refinementList. Shouldn't the same code that gathers the values from the url define the facets in the helper or so? Or am I doing something wrong?

Both URL's are non public test sites. You can find the url's at http://codepen.io/Maaark123/pen/GqvBqb

@vvo
Copy link
Contributor

vvo commented Jul 8, 2016

Hi, thanks for your question.

Here's how you are using current refined values

search.addWidget(
  instantsearch.widgets.currentRefinedValues({
    container: '#current-refined-values',
    clearAll: false,
    templates: {... },
    onlyListedAttributes: true,
    attributes: [{name: 'prijs', label: 'Prijs'}, {name: 'merkFull'}, {name: 'merkCat'},{name: 'carType'}, {name: 'loadIndexDisplay'}, {name: 'speedIndexDisplay'}, {name: '_tags'}, {name: 'aanbevolen', label: 'Aanbevolen door'}, {name: 'brandstofverbruik', label: 'Brandstofverbruik'}, {name: 'grip', label: 'Grip'}, {name: 'rolgeluid', label: 'Max. Rolgeluid (dB)'}]
  })
);

But merkFull is not defined as a facet so why would we want the user to be able to clear it?

Thanks

@Maaark
Copy link
Author

Maaark commented Jul 8, 2016

I'm not sure if I understand you.

MerkFull is a refinementList and works as expected (and can be cleared in the currentRefinements). We have set the urlsync option to true, so we want the show the same state when a user refreshes the page for example.

When you now refresh the page you will get this error, but we want it to work exactly the same as it did without the refresh.

Not sure if it's the currentRefinements that causes this.

Another question about the currentRefinementsList, is it possible to edit the template a bit more? We've edited the template and added a cross to delete the selection and we now only want to have the cross clickable.

@vvo
Copy link
Contributor

vvo commented Jul 8, 2016

Another question about the currentRefinementsList, is it possible to edit the template a bit more? We've edited the template and added a cross to delete the selection and we now only want to have the cross clickable.

Please can you open separate issues.

@Maaark
Copy link
Author

Maaark commented Jul 8, 2016

@vvo Done

@vvo vvo self-assigned this Jul 20, 2016
@vvo
Copy link
Contributor

vvo commented Jul 20, 2016

@Maaark I am following this issue back, I cannot find the urls anymore. But nevermind, could you create a jsFiddle with the least amount of code needed to reproduce the error? That would help me.

I understand that it means digging inside the error and almost solving it but I believe since you can reproduce it on your environement, with some try and console.log() and code commenting you should be able to generate a simple jsFiddle using your data or fake data so that we can really understand how to simply trigger this bug.

Thanks.

@Maaark
Copy link
Author

Maaark commented Jul 21, 2016

@vvo
http://codepen.io/Maaark123/pen/akYqWQ - not really working since it doesn't append data to the url (urlsync: true), so I think it's impossible to see the issue via this url?

It might be better to share our test environment url with you. So you can see it in action. Can I share the url's with you per email? How can I reach you?

@vvo
Copy link
Contributor

vvo commented Jul 25, 2016

I can download the codepen example and see the url bug. Just confirm me what are the steps to reproduce the behavior and what are you expecting instead.

@Maaark
Copy link
Author

Maaark commented Jul 25, 2016

In the example, click on Michelin => url should change, refresh the page
and see in the console the error.

After the refresh the other brands arent shown anymore, even when you
deselect Michelin.

Is it clear what I mean?

On Jul 25, 2016 10:54 AM, "Vincent Voyer" notifications@github.com wrote:

I can download the codepen example and see the url bug. Just confirm me
what are the steps to reproduce the behavior and what are you expecting
instead.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1130 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB0tQAsP4y3-mmpNNfpFNLgdcrSimO2aks5qZHmwgaJpZM4JHfQE
.

@vvo
Copy link
Contributor

vvo commented Jul 25, 2016

@Maaark We found the bug and will publish a new version tomorrow morning CET. Thanks A LOT for your patience and feedback

@vvo
Copy link
Contributor

vvo commented Jul 25, 2016

In the meantime, to fix your issue, you can do this:

    searchRefinements1 = {maat: ['235 / 50 R18'],isZomerband: [1],}
    searchRefinements2 = {maat: ['235 / 50 R18'],isZomerband: [1],}

And then use

        facetsRefinements: window.searchRefinements1,
        disjunctiveFacetsRefinements: window.searchRefinements2,

(Same thing for facets and disjunctiveFacets options

vvo pushed a commit that referenced this issue Jul 25, 2016
Fixes #1130

Thanks a lot @Morhaus for your help when debugging
vvo pushed a commit that referenced this issue Jul 25, 2016
Fixes #1130

Thanks a lot @Morhaus for your help when debugging
@Maaark
Copy link
Author

Maaark commented Jul 25, 2016

@vvo Great! I will apply it to our test environment in the afternoon, will let you know if it worked.

@vvo vvo closed this as completed in #1148 Jul 26, 2016
vvo added a commit that referenced this issue Jul 26, 2016
Fixes #1130

Thanks a lot @Morhaus for your help when debugging
vvo pushed a commit that referenced this issue Jul 26, 2016
<a name="1.7.0"></a>
# [1.7.0](v1.6.4...v1.7.0) (2016-07-26)

### Bug Fixes

* **searchParameters:** avoid mutating provided objects (#1148) ([0ea3bef](0ea3bef)), closes [#1130](#1130)

### Features

* **toggle:** Provide a better default widget (#1146) ([d54107e](d54107e)), closes [#1096](#1096) [#919](#919)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants