From 51dd2d05d553a99dc087da3aedc361f37d97f4bc Mon Sep 17 00:00:00 2001 From: Dinh Anh Date: Thu, 20 May 2021 09:26:51 +0700 Subject: [PATCH 1/3] Fix a bug from original source where the searchMode is not included in URL after the map has changed --- src/containers/SearchPage/SearchPage.helpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/containers/SearchPage/SearchPage.helpers.js b/src/containers/SearchPage/SearchPage.helpers.js index 1a2336b9d1..6745e831b6 100644 --- a/src/containers/SearchPage/SearchPage.helpers.js +++ b/src/containers/SearchPage/SearchPage.helpers.js @@ -33,10 +33,12 @@ export const validURLParamForExtendedData = (queryParamName, paramValueRaw, filt if (['SelectSingleFilter', 'SelectMultipleFilter'].includes(filterConfig.type)) { // Pick valid select options only const allowedValues = filterConfig.config.options.map(o => o.key); + const searchMode = filterConfig.config.searchMode; const valueArray = parseSelectFilterOptions(paramValue); const validValues = intersection(valueArray, allowedValues).join(','); - return validValues.length > 0 ? { [queryParamName]: validValues } : {}; + return validValues.length > 0 ? { [queryParamName]: searchMode ? `${searchMode}:${validValues}` : validValues } + : {}; } else if (filterConfig.type === 'PriceFilter') { // Restrict price range to correct min & max const valueArray = paramValue ? paramValue.split(',') : []; From ff36fcb2be6b911826bd41d76249eb5460dc1e68 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Fri, 28 May 2021 14:24:55 +0300 Subject: [PATCH 2/3] yarn run format --- src/containers/SearchPage/SearchPage.helpers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/containers/SearchPage/SearchPage.helpers.js b/src/containers/SearchPage/SearchPage.helpers.js index 6745e831b6..210f8705be 100644 --- a/src/containers/SearchPage/SearchPage.helpers.js +++ b/src/containers/SearchPage/SearchPage.helpers.js @@ -37,8 +37,9 @@ export const validURLParamForExtendedData = (queryParamName, paramValueRaw, filt const valueArray = parseSelectFilterOptions(paramValue); const validValues = intersection(valueArray, allowedValues).join(','); - return validValues.length > 0 ? { [queryParamName]: searchMode ? `${searchMode}:${validValues}` : validValues } - : {}; + return validValues.length > 0 + ? { [queryParamName]: searchMode ? `${searchMode}:${validValues}` : validValues } + : {}; } else if (filterConfig.type === 'PriceFilter') { // Restrict price range to correct min & max const valueArray = paramValue ? paramValue.split(',') : []; From ef6424fc5482018a21f72743f73ce6921290137e Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Fri, 28 May 2021 14:25:41 +0300 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d4ff3c17..0b65d5e925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +- [fix] searchMode (has_all/has_any) disappeared, when search-by-moving-the-map was used. + [#1443](https://github.com/sharetribe/ftw-daily/pull/1443) + ## [v8.1.1] 2021-04-20 - [change] Update jose to v3.11.4 [#1433](https://github.com/sharetribe/ftw-daily/pull/1433)