Skip to content

HBM-103 Embedding search portal

Kirsi Jokela requested to merge HBM-103-embedding-search-portal into dev

In this PR

Creation of parameters which can be used to embed the search page on an iframe. Removal of hero and header components when the parameters are being used.

Related ticket

HBM-103

To test

If new to project please check set-up instructions here: https://version.helsinki.fi/hbm/brain-and-mind

make fresh

To run in localhost:

make build-js-search-dev

Before you proceed to test, please note:

If testing on Firefox, this browser may result in a CORS error: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSDidNotSucceed

If testing in Firefox, you may see this error in your console.

Screenshot_2023-04-21_at_7.59.15

If this happens, visit the https://bnm.docker.so/initial-frontend-data directly and accept the risk. Then you should be able to proceed as below.

Screenshot_2023-04-20_at_20.22.42

1. Test that the parameter works

  • After the project is up and running on localhost, change the url to include parameters '?embed=true'

Screenshot_2023-04-20_at_12.37.49

See that the hero and footer elements below are not shown on the page:

Screenshot_2023-04-20_at_12.43.35

2. Test it as an iframe on the browser

  • Go to https://helsinkibrainandmind.fi/research/
  • Open developer tools and inspect the site. Right click and choose 'Edit as HTML'. Please note this example is from Chrome browser and opening the Dev Tools may be different on your browser.

Screenshot_2023-04-20_at_12.53.46

  • Add an Iframe anywhere on the site:
<iframe width="100%" height="300" src="http://localhost:8080/?embed=true">
</iframe>
  • Check that the iframe that appears does not include the hero nor the footer (as in the steps above):

Screenshot_2023-04-20_at_13.06.56

  • Try making a search on the page and see that it still returns results (for example by checking the Industrial Collaboration Only checkbox and clicking the Search button):

Screenshot_2023-04-20_at_13.18.09

Edited by Kirsi Jokela

Merge request reports

Loading