From 26e5a24032aa0be3da608593baa0af2fbfc79e5f Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Thu, 22 Oct 2020 15:06:42 -0700 Subject: [PATCH] feat(search): ES-1590 display error message if search fails --- CHANGELOG.md | 1 + lang/en.json | 1 + templates/components/search/heading.html | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e61aa857c3..2d666d7a79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ - Focus not visible on logo element. [#1800](https://github.com/bigcommerce/cornerstone/pull/1800) - Incorrect styles for focused buttons in grid card product item. [#1801](https://github.com/bigcommerce/cornerstone/pull/1801) - Add global region to header. [#1859](https://github.com/bigcommerce/cornerstone/pull/1859) +- Add search message on storefront if search fails on backend. [#1885](https://github.com/bigcommerce/cornerstone/pull/1885) ## 4.10.0 (10-01-2020) - Return heading to product card. [#1848](https://github.com/bigcommerce/cornerstone/pull/1848) diff --git a/lang/en.json b/lang/en.json index 9121ab38e9..42d3797ca2 100755 --- a/lang/en.json +++ b/lang/en.json @@ -819,6 +819,7 @@ "state_error": "There was a problem retrieving states/provinces" }, "search": { + "errorMessage": "There was a problem retrieving your search results. Please try again in a few seconds, or try a different search.", "quick_search": { "input_label": "Search", "input_placeholder": "Search the store" diff --git a/templates/components/search/heading.html b/templates/components/search/heading.html index d348deabc8..4a61c65700 100644 --- a/templates/components/search/heading.html +++ b/templates/components/search/heading.html @@ -1,3 +1,7 @@

- {{{lang 'search.results.count' count=result_count search_query=(sanitize forms.search.query) }}} + {{#if forms.search.search_error}} + {{lang 'search.errorMessage' }} + {{else}} + {{{lang 'search.results.count' count=result_count search_query=(sanitize forms.search.query) }}} + {{/if}}