Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in v1.29.5 #1119

Merged
merged 4 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.30.0",
"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.30.0",
"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.