-
Notifications
You must be signed in to change notification settings - Fork 72
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
Privacy experience form #3219
Privacy experience form #3219
Conversation
b27ad02
to
412739c
Compare
Passing run #1786 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
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 played around with all the example experiences the original PR had and was able to edit everything as expected. I like the implementation for dynamically showing different parts of the form.
I think it was a good choice to not attempt a dynamic validation schema like I did with the custom fields 😅 At least not for the first pass. I wish that formik supported that pattern better.
haha yeah, I thought I could get away with no ValidationSchema, but it turns out we probably do want some validation #3226 so I might have to restructure how this works |
878b7e8
to
f90a54a
Compare
2321456
to
c617ed7
Compare
I refactored the form logic a bit in order to accommodate required fields (somewhat dynamic validation schemas—not to the same extent you had to do @TheAndrewJackson in custom fields, since they don't change on user input, just depending on what data is received). I added a hook |
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.
Solid refactor. The new hook cleans the logic up a lot. It's helpful that the validation logic doesn't need to change based on a drop down option! It's still dynamic but not as dynamic as the custom fields form which is nice.
I had a suspicion my hook was being called more than I wanted it to be and it turned out to be true! so I refactored one more time 😅 this time rules are passed around as props, but I think it works pretty well since the same set of rules get passed everywhere |
Closes #3126
Code Changes
PrivacyExperienceForm.tsx
PrivacyNoticeForm.tsx
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
https://www.loom.com/share/556bc39d3f6b4f7ca50a4c2cef14929a
Screen.Recording.2023-05-04.at.11.31.28.AM.mov