-
Notifications
You must be signed in to change notification settings - Fork 77
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
Adding default_value and hidden properties to custom privacy request fields #4370
Conversation
last_name: { | ||
label: "Last name", | ||
value: "", | ||
}, | ||
color: { | ||
label: "Color", | ||
value: "blue", | ||
}, | ||
tenant_id: { | ||
label: "Tenant ID", | ||
value: "123", | ||
}, |
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.
Verifying a few scenarios with this check
- A non-required field still contains a value, even if it's an empty string
- A field with a
default_value
can be overwritten in the form - A hidden field with a
default_value
is still included with the entered form values in the request
if (field.hidden && field.default_value === undefined) { | ||
return { | ||
isValid: false, | ||
message: `Default value required for hidden field '${key}' in action '${action.policy_key}'`, |
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.
This error message doesn't surface completely, but I see that's a known issue #3171
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.
this doesn't appear to be working—I set a value to hidden
without a default_value
but it still says isValid = true
!
I think forEach
return
s don't work quite as we expect them to here: https://stackoverflow.com/questions/56129153/how-to-return-a-value-from-foreach
<Text fontSize="sm" color="gray.600" mb={4}> | ||
{action.description} | ||
</Text> | ||
<ModalBody maxHeight={400} overflowY="auto"> |
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.
Updating the popup to scroll if the form body exceeds 400px
Passing run #5060 ↗︎Details:
Review all test suite changes for PR #4370 ↗︎ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4370 +/- ##
=======================================
Coverage 87.04% 87.04%
=======================================
Files 328 328
Lines 20267 20267
Branches 2608 2608
=======================================
Hits 17642 17642
Misses 2162 2162
Partials 463 463 ☔ View full report in Codecov by Sentry. |
eec6512
to
f32b016
Compare
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.
if (field.hidden && field.default_value === undefined) { | ||
return { | ||
isValid: false, | ||
message: `Default value required for hidden field '${key}' in action '${action.policy_key}'`, |
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.
this doesn't appear to be working—I set a value to hidden
without a default_value
but it still says isValid = true
!
I think forEach
return
s don't work quite as we expect them to here: https://stackoverflow.com/questions/56129153/how-to-return-a-value-from-foreach
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
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.
🙌
Description Of Changes
Adding the ability to support hidden custom privacy request fields. This requires the addition of a default value so I added two new properties
default_value
andhidden
.I also limited the height of the privacy request form field and added scrolling.
Code Changes
smoke_test.cy.ts
Steps to Confirm
nox -s "fides_env(test)"
Pre-Merge Checklist
CHANGELOG.md