ENG-3415: New Privacy Center Form Field Types#7931
Draft
mikeGarifullin wants to merge 1 commit intomainfrom
Draft
ENG-3415: New Privacy Center Form Field Types#7931mikeGarifullin wants to merge 1 commit intomainfrom
mikeGarifullin wants to merge 1 commit intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
d44e6b9 to
fbcf0de
Compare
fbcf0de to
7e19391
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3415
Description Of Changes
Adds
checkbox,checkbox_group,textarea, andfilecustom field types to the Privacy Center request form config. Also fixes a bug where falsy custom field values (False,0,"",[]) were silently dropped during persistence — required for checkbox fields where an uncheckedFalsevalue is meaningful.Code Changes
privacy_center_config.py— ExtendedCustomPrivacyRequestField.field_typeliteral withcheckbox,checkbox_group,textarea; addedFileCustomPrivacyRequestField(withallowed_mime_types,max_size_bytes) and wired it into the discriminated union; addedmodel_validatorrequiringcheckbox_groupto have at least one optionredis_cache.py— AddedStrictBooltoMultiValueunion beforeStrictInt(Pythonboolis a subclass ofint, so it must be matched first to avoidTrue/Falsecoercing to1/0)privacy_request.py— Fixedif item.value:→if item.value is not None:inpersist_custom_privacy_request_fieldsandmigrate_hashed_fieldsto allow falsy values throughattachment.py— AddedAttachmentType.user_providedenum valueclients/privacy-center/config/examples/customFields.json— Updated example config with new field typesSteps to Confirm
/api/v1/privacy-requestwithcustom_privacy_request_fieldscontaining:checkboxfield withvalue: trueand another withvalue: falsecheckbox_groupfield withvalue: ["Option A", "Option B"]textareafield with a multi-line string valuefalsecheckbox value persists (was previously silently dropped)field_type: "file"config entries are validated correctly:hidden: trueandoptionsboth raise aValidationErrorcheckbox_groupwithoutoptionsraises aValidationErrorPre-Merge Checklist
CHANGELOG.mdupdated