-
Notifications
You must be signed in to change notification settings - Fork 608
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
feat(search): ES-466 Facets with & symbol works now #1654
Conversation
Autotagging @bigcommerce/storefront-team @davidchin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @bigcommerce/storefront-team (code in general) and @bigcommerce/security (to verify that there's no injectable parts for product option and custom field values)
We did some testing to ensure it doesn't allow injection, but we didn't go in depth. I'm pretty sure it works, I'd just like independent confirmation.
@@ -3,7 +3,7 @@ | |||
<div | |||
class="accordion-navigation toggleLink {{#unless ../start_collapsed }} is-open {{/unless}}" | |||
role="button" | |||
data-collapsible="#facetedSearch-content--{{hyphenate facet }}"> | |||
data-collapsible="#facetedSearch-content--{{#replace '&' (hyphenate facet) }}{{/replace}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like the idea of doing special characters replaces at the handlebars level. Today we are doing &
tomorrow it is going to be some other special characters.
We should either strip it or escape it at the backend level. Right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't escape &
to be placed in a fragment. There are no other special characters like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are just doing a replace for & in the string for the fragment can't we do that on the backend itself ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have two variables we can key this on, unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed testing and this LGTM! 👍
What?
Faceted search filters that include ampersand (&) breaks 'Show More' links.
With this fix, now we can have Facets with
&
symbol andShow More
link works fine.Tickets / Documentation
Testing Steps:
Custom Field
(with same name like _ Custom & Color _) and with different values for each product and save the Products.show
to 5 items and saveShow More
link for this new filter and the popup window shows all the filter values.Screenshots (if appropriate)
List of all Facets:
Facet with
&
in the name & valueShow More
link displays the popup with filterable valuesOther Facet's
Show More
link works fine too..@bigcommerce/artemis-dt @lord2800 @kwang30