Skip to content

Commit

Permalink
Version 1.29.5
Browse files Browse the repository at this point in the history
### Fixes

* fix iframe.js not working with hash URL links (#1115)
* Cherry-picks #1112 to remove IE11 acceptance testing.
  • Loading branch information
oshi97 authored Dec 12, 2022
2 parents 223c682 + aa6f741 commit 4e80bc0
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 92 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/acceptance_browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,3 @@ jobs:
- run: npm run build-test-site
- name: Run Acceptance Tests
run: ./.github/run_browserstack_acceptance.sh browserstack:firefox
browserstack-ie11-acceptance-tests:
name: IE11 Acceptance Tests (Browserstack)
runs-on: ubuntu-latest
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm ci
- run: npm run setup-test-site
- run: npm run build-test-site
- name: Run Acceptance Tests
run: ./.github/run_browserstack_acceptance.sh browserstack:ie@11.0 3
4 changes: 2 additions & 2 deletions 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.29.4",
"version": "1.29.5",
"description": "A starter Search theme for hitchhikers",
"keywords": [
"jambo",
Expand Down
26 changes: 21 additions & 5 deletions static/js/iframe-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ export function generateIFrame(domain, answersExperienceFrame) {
// For Safari
document.body.scrollTop = 0;
});

window.onpopstate = function() {
iframe.contentWindow.location.replace(calcFrameSrc());
};

registerPopStateListener();
containerEl.appendChild(iframe);

// Notify iframe of a click event on parent window
Expand Down Expand Up @@ -135,6 +131,26 @@ export function generateIFrame(domain, answersExperienceFrame) {
}, '#answers-frame');
}

function registerPopStateListener() {
let previousLocationHref = window.location.href;

/**
* Reloads the iframe with a recalculated src URL.
* Does not reload the iframe if the URL has only changed its hash param.
*/
function popStateListener() {
/** @param {string} url */
function getURLWithoutHash(url) {
return url.split('#')[0];
}
if (getURLWithoutHash(previousLocationHref) !== getURLWithoutHash(window.location.href)) {
iframe.contentWindow.location.replace(calcFrameSrc());
}
previousLocationHref = window.location.href;
}
window.addEventListener('popstate', popStateListener);
}

/**
* Sends data to the answers iframe if possible. Otherwise the message is queued
* so that it can be sent when the iframe initializes.
Expand Down
4 changes: 2 additions & 2 deletions 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.29.4",
"version": "1.29.5",
"description": "Toolchain for use with the HH Theme",
"main": "Gruntfile.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions test-site/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ webpack-config.js
!config/global_config.json
!config/locale_config.json
!config/index.json
!config/index.ar.json
!config/index.es.json
!pages/index.html.hbs
!public/iframe_test.html
!public/overlay.html
13 changes: 1 addition & 12 deletions tests/acceptance/suites/client-sdk-http-header.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {
PORT,
UNIVERSAL_AUTOCOMPLETE_URL_REGEX,
UNIVERSAL_SEARCH_URL_REGEX,
VERTICAL_SEARCH_URL_REGEX,
VERTICAL_AUTOCOMPLETE_URL_REGEX
} from '../constants';
import { PORT } from '../constants';
import { SearchRequestLogger } from '../searchrequestlogger';
import { registerIE11NoCacheHook } from '../../test-utils/testcafe';
import packageJson from '../../../package.json';

const verticalSearchLogger = (new SearchRequestLogger()).createVerticalSearchLogger();
Expand All @@ -16,8 +9,6 @@ fixture`Client-SDK header works on vertical searches/autocomplete`
.page(`http://localhost:${PORT}/people`)
.requestHooks(verticalSearchLogger, verticalAutocompleteLogger)
.beforeEach(async t => {
await registerIE11NoCacheHook(t, VERTICAL_SEARCH_URL_REGEX);
await registerIE11NoCacheHook(t, VERTICAL_AUTOCOMPLETE_URL_REGEX);
await t.resizeWindow(1600, 900);
})

Expand All @@ -39,8 +30,6 @@ fixture`Client-SDK header works on universal searches/autocomplete`
.page(`http://localhost:${PORT}`)
.requestHooks(universalSearchLogger, universalAutocompleteLogger)
.beforeEach(async t => {
await registerIE11NoCacheHook(t, UNIVERSAL_SEARCH_URL_REGEX);
await registerIE11NoCacheHook(t, UNIVERSAL_AUTOCOMPLETE_URL_REGEX);
await t.resizeWindow(1600, 900);
})

Expand Down
4 changes: 0 additions & 4 deletions tests/acceptance/suites/vertical-full-page-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import VerticalResults from '../blocks/verticalresults';
import ThemeMap from '../blocks/thememap';
import Pagination from '../blocks/pagination';
import SearchRequestLogger from '../searchrequestlogger';
import { VERTICAL_SEARCH_URL_REGEX } from '../constants';
import { registerIE11NoCacheHook } from '../../test-utils/testcafe';
import CollapsibleFilters from '../blocks/collapsiblefilters';

const verticalSearchLogger = SearchRequestLogger.createVerticalSearchLogger();
Expand All @@ -14,7 +12,6 @@ fixture`Vertical Full Page Map`
.page(`http://localhost:${PORT}/locations_full_page_map`)
.requestHooks(verticalSearchLogger)
.beforeEach(async t => {
await registerIE11NoCacheHook(t, VERTICAL_SEARCH_URL_REGEX);
await t.resizeWindow(1600, 900);
})

Expand Down Expand Up @@ -83,7 +80,6 @@ fixture`Vertical Full Page Map with Filters`
.page(`http://localhost:${PORT}/locations_full_page_map_with_filters`)
.requestHooks(verticalSearchLogger)
.beforeEach(async t => {
await registerIE11NoCacheHook(t, VERTICAL_SEARCH_URL_REGEX);
await t.resizeWindow(1600, 900);
})

Expand Down
31 changes: 0 additions & 31 deletions tests/test-utils/ie11nocachehook.js

This file was deleted.

18 changes: 0 additions & 18 deletions tests/test-utils/testcafe.js

This file was deleted.

0 comments on commit 4e80bc0

Please sign in to comment.