Add a submit button so the search form works without JavaScript#167
Open
loevgaard wants to merge 1 commit into
Open
Add a submit button so the search form works without JavaScript#167loevgaard wants to merge 1 commit into
loevgaard wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## issue-134-i18n-search-page #167 +/- ##
=============================================================
Coverage ? 48.90%
Complexity ? 800
=============================================================
Files ? 140
Lines ? 2560
Branches ? 0
=============================================================
Hits ? 1252
Misses ? 1308
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b20de3c to
66de828
Compare
1a28b4c to
53e0175
Compare
The search results form (facets + sorting + pagination) rendered with no submit control; all submission was done by the JavaScript auto-submit in search.js, so with JS disabled/blocked/failed a shopper could not apply a filter, change sorting or paginate. Add a real "Apply filters" submit button to _results.html.twig, visible by default (so the GET form works everywhere) and hidden by search.js on init (so the enhanced auto-submit behaviour is unchanged with JS). The apply_filters key is translated into all 12 locales. e2e covers both the JS-enabled (button hidden) and JS-disabled (button applies filters) paths. Closes #122
66de828 to
5f82972
Compare
53e0175 to
1a48b78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The search results form (facets + sorting + pagination) rendered
form_start … form_endwith no submit button anywhere — all submission was done by the JavaScript auto-submit insearch.js. With JavaScript disabled, blocked, or failed to load, a shopper could run the initial query from the URL but couldn't apply a filter, change sorting, or paginate.Add a real "Apply filters" submit button to
_results.html.twig, visible by default (so the plain GET form works everywhere) and hidden bysearch.json init (so the enhanced auto-submit behaviour is unchanged when JS is available). Hiding it in JS — rather than via<noscript>— also covers failed/blocked JS.The
apply_filterskey is translated into all 12 locales.Testing
filters by a brand facet: with JS enabled the fallback button is hidden and checking a facet auto-submits.without javascript(javaScriptEnabled: false): the button is visible; checking a facet and pressing it filters the results.Closes #122
Stacked on #166 (#134).