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

feat: Added Pin Protection to forms #1142

Merged
merged 39 commits into from
Oct 16, 2023

Conversation

piyushgarg-dev
Copy link
Contributor

@piyushgarg-dev piyushgarg-dev commented Oct 14, 2023

What does this PR do?

This PR adds a feature to protect the surveys using a 4-digit PIN and viewers need to enter a PIN to record a response.

Fixes #1089

Forbricks_PIN.mp4

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Create a new Form / Survey
  • Go to Settings and expand the Response Options
  • Toggle the PIN option
  • Add PIN to Survey

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

@vercel
Copy link

vercel bot commented Oct 14, 2023

@piyushgarg-dev is attempting to deploy a commit to the formbricks Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added ❗️ migrations enhancement New feature or request formtribe-2023 Issues related to Formtribe 2023 hackathon hacktoberfest complete these issues to gather points for Hacktoberfest labels Oct 14, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2023

Thank you for following the naming conventions for pull request titles! 🙏

@jobenjada
Copy link
Member

jobenjada commented Oct 14, 2023

Works really well, thanks a lot! :)

Matti will merge it as soon as our merge pipeline is back up and running 🚀

@mattinannt
Copy link
Member

@piyushgarg-dev thanks a lot for this feature and the documentation of it on youtube :-)
You used the npm package react-otp-input for this. We already have built an OTP input for our 2 factor authentication feature (packages/ui/OTPInput/index.tsx). Is it possible that you use this for this feature as well?
If so, please change the code base to use this to reduce frontend packages and avoid an increase in bundle size.

impolska742 and others added 7 commits October 16, 2023 09:47
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Signed-off-by: aryabyte21 <arya2001bhosale@gmail.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
mattinannt and others added 16 commits October 16, 2023 09:48
Signed-off-by: aryabyte21 <arya2001bhosale@gmail.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
…ion (formbricks#1166)

Co-authored-by: Digvijay Gupta <digvijaygupta@Digvijays-MacBook-Pro.local>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
…1120 & Doc's navbar was not responsive formbricks#1129 (formbricks#1123)

Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
…ion (formbricks#1166)

Co-authored-by: Digvijay Gupta <digvijaygupta@Digvijays-MacBook-Pro.local>
Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
@piyushgarg-dev
Copy link
Contributor Author

Hi @mattinannt 👋🏻
Thanks for the feedback. I have re-used the packages/ui/OTPInput/index.tsx component for the PIN input. Also, I have added one extra optional prop for disabled.

Thanks 🙏🏻

@mattinannt
Copy link
Member

@piyushgarg-dev thanks a lot for making the changes :-) 💪🎉
I only update a few smaller things to follow current code conventions better. I will merge the feature into main now :-)

@mattinannt mattinannt added this pull request to the merge queue Oct 16, 2023
Merged via the queue into formbricks:main with commit 5e5723d Oct 16, 2023
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request formtribe-2023 Issues related to Formtribe 2023 hackathon hacktoberfest complete these issues to gather points for Hacktoberfest ❗️ migrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE][FormTribe 🔥][500 Points] PIN protected surveys