From 45fc0c910c0e3b7065e621d74ca2e1b1a6b47844 Mon Sep 17 00:00:00 2001 From: nmanu1 <88398086+nmanu1@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:54:27 -0400 Subject: [PATCH 1/2] Keep full page map location filter for pagination (#1180) This PR updates the vertical full page map so that location static filters applied when searching on map move (or Search This Area) are not automatically cleared immediately after conducting the search. We need this filter to remain present if users paginate to the next set of results so that they don't see different (or no) results on the next page. The corresponding techops shows an example of this. But, we do want the filter to be removed if a new search is conducted (see PR #819 where the removal behavior was initially added). So, this is now done when a query update is detected as long as it wasn't triggered from pagination (i.e. a new search is conducted by clicking the Search button, typing Enter in the search bar, clearing the search bar using the X button, or adding/removing a static filter or facet). For map interactions that trigger a new search, the static filter removal is already handled because we set a new static filter for the new map location that replaces the previous one. Note: it's still possible to get into a bad state via browser navigation (back/forward/refresh) because we don't properly respect the location filter in the URL. This will be fixed in a separate [item](https://yexttest.atlassian.net/browse/WAT-3958). J=TECHOPS-11475 TEST=manual Tested these changes on the site in the techops as well as our test site and saw that a search with an NLP location filter can be conducted as expected both before and after any map interactions that apply a static location filter. Pagination after a map interaction no longer drops the static location filter. --- static/js/theme-map/VerticalFullPageMapOrchestrator.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/theme-map/VerticalFullPageMapOrchestrator.js b/static/js/theme-map/VerticalFullPageMapOrchestrator.js index f9b3e5af6..de70bd500 100644 --- a/static/js/theme-map/VerticalFullPageMapOrchestrator.js +++ b/static/js/theme-map/VerticalFullPageMapOrchestrator.js @@ -8,6 +8,7 @@ import ZoomTriggers from './Maps/ZoomTriggers.js'; import PanTriggers from './Maps/PanTriggers.js'; import MobileStates from './MobileStates'; +import QueryTriggers from '../constants/query-triggers.js'; import StorageKeys from '../constants/storage-keys.js'; /** @@ -184,7 +185,13 @@ class VerticalFullPageMapOrchestrator extends ANSWERS.Component { this.core.storage.registerListener({ eventType: 'update', storageKey: StorageKeys.QUERY, - callback: () => this.updateMostRecentSearchState() + callback: () => { + const queryTrigger = this.core.storage.get(StorageKeys.QUERY_TRIGGER); + if (queryTrigger !== QueryTriggers.PAGINATION) { + this.core.clearStaticFilterNode('SearchThisArea'); + } + this.updateMostRecentSearchState(); + } }); const searchThisAreaToggleEls = this._container.querySelectorAll('.js-searchThisAreaToggle'); @@ -680,7 +687,6 @@ class VerticalFullPageMapOrchestrator extends ANSWERS.Component { useFacets: true }); this.updateMostRecentSearchState(); - this.core.clearStaticFilterNode('SearchThisArea'); } /** From b2c96cd026f82d054b869a1e605bd207fbb1d0db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:14:42 -0400 Subject: [PATCH 2/2] Update Package Version to v1.33.7 (#1179) *An automated PR which updates the version number in package.json and package-lock.json files* --------- Co-authored-by: github-actions[bot] Co-authored-by: Nidhi Manu --- package-lock.json | 4 ++-- package.json | 2 +- static/package-lock.json | 4 ++-- static/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b2f10640..7067ef1e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "answers-hitchhiker-theme", - "version": "1.33.6", + "version": "1.33.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "answers-hitchhiker-theme", - "version": "1.33.6", + "version": "1.33.7", "devDependencies": { "@axe-core/puppeteer": "^4.5.2", "@babel/core": "^7.9.6", diff --git a/package.json b/package.json index d31ff7e47..9916f7a6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "answers-hitchhiker-theme", - "version": "1.33.6", + "version": "1.33.7", "description": "A starter Search theme for hitchhikers", "keywords": [ "jambo", diff --git a/static/package-lock.json b/static/package-lock.json index 9e7665f02..2020581ae 100644 --- a/static/package-lock.json +++ b/static/package-lock.json @@ -1,12 +1,12 @@ { "name": "answers-hitchhiker-theme", - "version": "1.33.6", + "version": "1.33.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "answers-hitchhiker-theme", - "version": "1.33.6", + "version": "1.33.7", "license": "BSD-3-Clause", "dependencies": { "@vimeo/player": "^2.15.3", diff --git a/static/package.json b/static/package.json index 41fb1b7e9..20540b1a7 100644 --- a/static/package.json +++ b/static/package.json @@ -1,6 +1,6 @@ { "name": "answers-hitchhiker-theme", - "version": "1.33.6", + "version": "1.33.7", "description": "Toolchain for use with the HH Theme", "main": "Gruntfile.js", "scripts": {