-
Notifications
You must be signed in to change notification settings - Fork 123
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
feat(TU-13163): Add the duplicate-detected callback #660
Conversation
🥷 Code experts: mathio mathio, Thr44 have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
packages/embed/README.md
Outdated
@@ -159,6 +159,7 @@ Closing and opening a typeform in modal window will restart the progress from th | |||
| [onQuestionChanged](https://codesandbox.io/s/github/Typeform/embed-demo/tree/main/demo-html/callbacks) | function | fires when user navigates between form questions | `undefined` | | |||
| [onHeightChanged](https://codesandbox.io/s/github/Typeform/embed-demo/tree/main/demo-html/callbacks) | function | fires when form question height changes (eg. on navigation between questions or on error message) | `undefined` | | |||
| [onEndingButtonClick](https://codesandbox.io/s/github/Typeform/embed-demo/tree/main/demo-html/callbacks) | function | fires when button on ending screen is clicked, disables button redirect functionality | `undefined` | | |||
| onDuplicateDetected | function | fires when the responder reaches the quota of submission defined in the duplicate prevention setting | `undefined` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would include a link to the help center page here: https://www.typeform.com/help/a/prevent-duplicate-responses-27917825492244/ and also slightly reword it ( respondent is the correct term):
fires when a respondent reaches the submission quota defined in duplicate prevention setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update docs in the repo as well. It is deployed to https://developer.typeform.com/ automatically to update the docs in that place too.
@@ -255,6 +256,9 @@ You can listen to form events by providing callback methods: | |||
|
|||
// for plans with "Redirect from ending screen" feature you also receive `ref`: | |||
console.log(`Ending button clicked in end screen ${ref}`) | |||
}, | |||
onDuplicateDetected: ({ formId }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding an example here 👍
Please add one to the packages/demo-html/public/callbacks.html as well, so we have a runnable example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mathio Do you happen to have access to the test form? We'd need to enable the duplicate prevention feature there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think I do :( Actually, it might be better to create a new form and new HTML page for demo purposes, since this feature would affect other demos when enabled.
[BOT] Preview available with hash |
Quality Gate passedIssues Measures |
# [@typeform/embed-v5.1.0](https://github.com/Typeform/embed/compare/@typeform/embed-v5.0.0...@typeform/embed-v5.1.0) (2024-08-26) ### Features * **TU-13163:** Add the duplicate-detected callback ([#660](#660)) ([90135e7](90135e7))
🎉 This PR is included in version @typeform/embed-v5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What
Typeform supports duplicate prevention. A callback is added to allow developers react to the
duplicate-detected
event.