This PR fixes some issues related to presenting a Calendly booking form in an iframe: #374. Specifically:
Calendly requires specific names for the query parameters, but our iframe always calls them 'child' and 'response'. This PR addresses this by allowing researchers to use generateProperties to dynamically generate the iframeSrc URL with the query parameter names/values that they need. (Note: we are considering other solutions to the query parameter name problem for the iframe URL and other links. This is a quick fix in the meantime, and it fixes the more general problem of the iframeSrc parameter not working with generateProperties).
The final form submission button in booking a Calendly appointment was not working in an iframe, though the rest of the booking process does. This was because we did not include the "allow-forms" sandbox attribute for the iframe.
This PR fixes the two issues above by doing the following:
Adds the 'allow-forms' setting to the iframe element in exp-lookit-iframe. This change is needed to be able to schedule a Calendly event from inside an iframe.
Allows researchers to use the frame's generateProperties parameter to generate the iframe source. This allows researchers to dynamically add query parameters/values to the end of the the source URL. (This wasn't possible before because the URL was being modified/set in didReceiveAttrs via addSearchParams before the base frame generated the parameter value, so the URL was undefined and caused an error.)
Moves the function to enable the 'next' button into didInsertElement. It was previously called in the jquery document ready callback, but for some reason the document ready event callback was not being triggered with Calendly iframe links, which meant that the next button was never enabled.
This PR fixes some issues related to presenting a Calendly booking form in an iframe: #374. Specifically:
generateProperties
to dynamically generate theiframeSrc
URL with the query parameter names/values that they need. (Note: we are considering other solutions to the query parameter name problem for the iframe URL and other links. This is a quick fix in the meantime, and it fixes the more general problem of theiframeSrc
parameter not working withgenerateProperties
).This PR fixes the two issues above by doing the following:
exp-lookit-iframe
. This change is needed to be able to schedule a Calendly event from inside an iframe.generateProperties
parameter to generate the iframe source. This allows researchers to dynamically add query parameters/values to the end of the the source URL. (This wasn't possible before because the URL was being modified/set indidReceiveAttrs
viaaddSearchParams
before the base frame generated the parameter value, so the URL was undefined and caused an error.)didInsertElement
. It was previously called in the jquery document ready callback, but for some reason the document ready event callback was not being triggered with Calendly iframe links, which meant that the next button was never enabled.