Skip to content

feat(TU-3717): Expose method to fetch form details in callback #4

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

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

mathio
Copy link
Contributor

@mathio mathio commented Dec 6, 2023

The callback method now receives fetchFormDetails async method. You can use it to additional form details:

window.tfEmbedAdmin.selectForm({
  callback: async ({ action, formId, fetchFormDetails }) => {
    // it is up to you to display loading interface in your app, eg. spinner or skeleton screen
    const { title, url } = await fetchFormDetails()
    console.log(`You selected form named ${title}. You can visit it at ${url}.`)
  },
})

Run demo on port localhost:1337 instead of 9090 as the former one is allowed to use embed admin in an iframe.

@mathio mathio requested a review from a team December 6, 2023 12:35
@mathio mathio force-pushed the form-details branch 2 times, most recently from c420230 to 7fa775d Compare December 6, 2023 12:47
@mathio mathio changed the title feat(TU-3717): Fetch form details when selected feat(TU-3717): Expose method to fetch form details in callback Dec 6, 2023
@typeform-ops-gha
Copy link

[BOT] Preview available with hash 35bae71d2d77294cfe9eb66306e02bb52c356591 here.

@mathio mathio merged commit f667d42 into main Dec 6, 2023
@mathio mathio deleted the form-details branch December 6, 2023 15:21
@typeform-ops-gha
Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants