-
Notifications
You must be signed in to change notification settings - Fork 20
Allow Category tree on vtex legacy Filters and fixes url with the same page on Department Filters #179
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
base: main
Are you sure you want to change the base?
Allow Category tree on vtex legacy Filters and fixes url with the same page on Department Filters #179
Changes from all commits
f284516
f83e942
f4c9d61
9c443aa
9c09915
f1690d7
191b4e5
9bfb0a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -447,11 +447,6 @@ export const legacyFacetToFilter = ( | |
| const pathSet = new Set(pathSegments); | ||
|
|
||
| const getLink = (facet: LegacyFacet, selected: boolean) => { | ||
| // Do not allow removing root facet to avoid going back to home page | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing this line causes the aforementioned bug
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tlgimenes I don't understand this comment, can you explain? this line of code in the verification makes all the returned filters have the wrong url when it is a department: https://australroupas.deco.site/masculino?O=OrderByScoreDESC |
||
| if (mapSegments.length === 1) { | ||
| return `${url.pathname}${url.search}`; | ||
| } | ||
|
|
||
| const index = pathSegments.findIndex((s) => s === facet.Value); | ||
| const newMap = selected | ||
| ? [...mapSegments.filter((_, i) => i !== index)] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.