Skip to content

Commit

Permalink
Version 1.21.1 (#822)
Browse files Browse the repository at this point in the history
### Bugfixes
- Fix a race condition on the full page map (#786)
- Fixed a bug on the full page map where NLP filters in the search query would not work properly after a 'Search this Area' search was performed (#819)
  • Loading branch information
cea2aj authored Jun 7, 2021
2 parents ab7481a + fb69140 commit ba45252
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 40 deletions.
1 change: 1 addition & 0 deletions layouts/html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<script>
document.addEventListener('DOMContentLoaded', function () {
{{> script/on-document-load}}
initAnswers();
});
</script>
<script src="{{relativePath}}/bundle.js" data-webpack-inline></script>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "answers-hitchhiker-theme",
"version": "1.21.0",
"version": "1.21.1",
"description": "A starter answers theme for hitchhikers",
"scripts": {
"test": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --verbose",
Expand Down
2 changes: 0 additions & 2 deletions script/partials/sdk-js-script-tags.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
<script
src="{{> script/partials/sdk-url sdkAsset="answers-modern.min.js" locale=locale sdkVersion=sdkVersion}}"
type="module"
onload="initAnswers()"
></script>
<script
src="{{> script/partials/sdk-url sdkAsset="answers.min.js" locale=locale sdkVersion=sdkVersion}}"
nomodule
onload="initAnswers()"
defer
></script>
3 changes: 2 additions & 1 deletion static/js/theme-map/VerticalFullPageMapOrchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class VerticalFullPageMapOrchestrator extends ANSWERS.Component {
* The default zoom level for the map
* @type {number}
*/
this.defaultZoom = this.providerOptions.zoom || 14;
this.defaultZoom = this.providerOptions.zoom || 4;

/**
* The current zoom level of the map
Expand Down Expand Up @@ -597,6 +597,7 @@ class VerticalFullPageMapOrchestrator extends ANSWERS.Component {
useFacets: true
});
this.updateMostRecentSearchState();
this.core.clearStaticFilterNode('SearchThisArea');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion static/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "answers-hitchhiker-theme",
"version": "1.21.0",
"version": "1.21.1",
"description": "Toolchain for use with the HH Theme",
"main": "Gruntfile.js",
"scripts": {
Expand Down
30 changes: 5 additions & 25 deletions templates/vertical-full-page-map/page-setup.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
function addFullPageMap() {
{{> theme-components/theme-map/script}}
{{> theme-components/vertical-full-page-map/script}}
}

if (window.locatorBundleLoaded) {
addFullPageMap();
} else {
const locatorBundleScript = document.querySelector('script#js-answersLocatorBundleScript');
locatorBundleScript.onload = () => {
window.locatorBundleLoaded = true;
locatorBundleScript.dispatchEvent(new Event('vertical-full-page-map-bundle-loaded'));
addFullPageMap();
}
}
{{> theme-components/theme-map/script}}
{{> theme-components/vertical-full-page-map/script}}

/**
* Registers listeners on the card once the locator bundle is loaded
* Registers listeners on the card
*
* @param {ANSWERS.Component} card A location card
*/
function registerVerticalFullPageMapCardListeners(card) {
if (window.locatorBundleLoaded) {
new VerticalFullPageMap.CardListenerAssigner({card: card}).addListenersToCard();
return;
}
const verticalFullPageMapScript = document.querySelector('script#js-verticalFullPageMapScript');
verticalFullPageMapScript.addEventListener('vertical-full-page-map-bundle-loaded', () => {
new VerticalFullPageMap.CardListenerAssigner({card: card}).addListenersToCard();
});
function registerVerticalFullPageMapCardListeners(card) {
new VerticalFullPageMap.CardListenerAssigner({card: card}).addListenersToCard();
}
3 changes: 1 addition & 2 deletions templates/vertical-full-page-map/page.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
{{> templates/vertical-full-page-map/script/locationbias modifier="main" }}
{{> templates/vertical-full-page-map/script/locationbias modifier="mobileMap" }}
{{/script/core }}
<script id="js-answersLocatorBundleScript" src="{{relativePath}}/locator-bundle.js"
onload="window.locatorBundleLoaded = true;" defer></script>
<script id="js-answersLocatorBundleScript" src="{{relativePath}}/locator-bundle.js" defer></script>
<div class="Answers AnswersVerticalMap CollapsibleFilters VerticalFullPageMap VerticalFullPageMap--mobileListView js-answersVerticalFullPageMap">
<div class="Answers-content">
<div class="Answers-contentWrap js-locator-contentWrap" role="region" aria-label="{{ translate phrase="Main location search" }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- locations_full_page_map_with_filters.html.hbs
+++ locations_full_page_map_with_filters.html.hbs
--- templates/vertical-full-page-map/page.html.hbs 2021-05-24 14:53:55.000000000 -0400
+++ test-site/pages/locations_full_page_map_with_filters.html.hbs 2021-05-24 14:58:17.000000000 -0400
@@ -1,7 +1,7 @@
{{#> layouts/html pageWrapperCss="YxtPage-wrapper--mobileListView" }}
{{#> script/core }}
Expand Down
4 changes: 0 additions & 4 deletions tests/script/partials/sdk-js-script-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@ const hbs = require('../../test-utils/hbs');
const defaultOutput = `<script
src="https://assets.sitescdn.net/answers/v1.8/answers-modern.min.js"
type="module"
onload="initAnswers()"
></script>
<script
src="https://assets.sitescdn.net/answers/v1.8/answers.min.js"
nomodule
onload="initAnswers()"
defer
></script>`;

const jaOutput = `<script
src="https://assets.sitescdn.net/answers/v1.8/ja-answers-modern.min.js"
type="module"
onload="initAnswers()"
></script>
<script
src="https://assets.sitescdn.net/answers/v1.8/ja-answers.min.js"
nomodule
onload="initAnswers()"
defer
></script>`;

Expand Down

0 comments on commit ba45252

Please sign in to comment.