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

WIP: Field validation #40

Draft
wants to merge 61 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c458ee2
Add class for 'Fields' to simplify custom logic and use it for filter…
JeffersonBledsoe Sep 22, 2023
d6aa386
Fix non-required fields
JeffersonBledsoe Sep 24, 2023
17697d8
Fix reading incorrect internal value
JeffersonBledsoe Sep 24, 2023
b9bb05f
Fix values not displayign
JeffersonBledsoe Sep 24, 2023
3c45a3a
Use @property for 'value'
JeffersonBledsoe Sep 24, 2023
70a17f1
Fix some existing behaviours
JeffersonBledsoe Sep 25, 2023
9bf7879
Add test for custom_field_id
JeffersonBledsoe Sep 25, 2023
624170d
Fix custom field ID
JeffersonBledsoe Sep 25, 2023
3ea20ae
Fix inconsistent use of field_id in requess
JeffersonBledsoe Sep 25, 2023
b3ca7da
Restore support for falling back to field_id if label doesn't exist
JeffersonBledsoe Sep 25, 2023
e821e3f
Fix data storing
JeffersonBledsoe Sep 25, 2023
cd8e9bb
Fix custom_field_id in data export
JeffersonBledsoe Sep 25, 2023
bd40e5c
Merge branch 'main' into custom-label-mapping
JeffersonBledsoe Sep 25, 2023
e1994e0
Add tests for display values
JeffersonBledsoe Sep 26, 2023
b5c75da
Fix catalog using display value for storage
JeffersonBledsoe Sep 26, 2023
f2ff588
Fix XML using external value
JeffersonBledsoe Sep 27, 2023
2cf29d3
Update frontend field name
JeffersonBledsoe Sep 27, 2023
810d675
Test fix
JeffersonBledsoe Sep 27, 2023
9a76a5c
Initial validation support
JeffersonBledsoe Dec 12, 2023
c184b55
Fix HTTP response code
JeffersonBledsoe Dec 12, 2023
bd1e2d0
Fix crash when no validations are set
JeffersonBledsoe Dec 12, 2023
5524684
Readme
JeffersonBledsoe Dec 15, 2023
ac749fb
Typo fix
JeffersonBledsoe Dec 15, 2023
8df42f5
Initial serializer for validation settings
JeffersonBledsoe Dec 19, 2023
94cd023
Add "ignore" to list of internal ignored fields
JeffersonBledsoe Dec 20, 2023
97b1815
Fix serializer deleting the actual validation object's settings
JeffersonBledsoe Dec 20, 2023
ff79791
Fix IPloneSiteRoot import
JeffersonBledsoe Dec 21, 2023
2dcd6fb
Fix validations not occurign
JeffersonBledsoe Dec 22, 2023
afc6b7d
Able to return nice error messages
JeffersonBledsoe Dec 22, 2023
83ad017
WIP: Custom validation
JeffersonBledsoe Dec 22, 2023
262fce7
Merge branch 'main' into custom-label-mapping
JeffersonBledsoe Jan 8, 2024
30adf28
Add test for custom field ID and ensuring it isn't used in emails
JeffersonBledsoe Jan 9, 2024
47ede0b
Fix using field_id in XML
JeffersonBledsoe Jan 9, 2024
3785922
Remove upgrades and test files from coverage
JeffersonBledsoe Jan 9, 2024
adb24a4
Improve tests for sending and storing custom fields
JeffersonBledsoe Jan 11, 2024
c778d90
Fix for storing CSVs
JeffersonBledsoe Jan 11, 2024
1f301f7
Merge branch 'custom-label-mapping' into field-validation
JeffersonBledsoe Jan 12, 2024
a109261
Merge branch 'main' into field-validation
JeffersonBledsoe Jan 12, 2024
b4ac3e1
Quick messy test for validation
JeffersonBledsoe Jan 15, 2024
6606bc1
Fix settings saving (still need to get the correct type information f…
JeffersonBledsoe Jan 15, 2024
731d331
Overhaul how we're passing settings back and forth
JeffersonBledsoe Jan 17, 2024
70d9aaf
Fix setting deserialization after overhall
JeffersonBledsoe Jan 17, 2024
bec2107
Fix settings not being passed to validators
JeffersonBledsoe Jan 17, 2024
61b020a
Fix bad settings appearing in UI
JeffersonBledsoe Jan 17, 2024
2899a93
Fix crash on serializing existing fields
JeffersonBledsoe Jan 18, 2024
e98dd67
Fix type of validations
JeffersonBledsoe Jan 18, 2024
ac67bdd
Fix characters validation behaviour
JeffersonBledsoe Jan 18, 2024
38e9f9b
Fix bad attribute
JeffersonBledsoe Jan 18, 2024
0251d4b
Fix passing type information to the frontend and reduce some complexi…
JeffersonBledsoe Jan 26, 2024
41a7cda
Remove validations and settings if the field type doesn't allow for v…
JeffersonBledsoe Jan 26, 2024
d54879d
Don't include `inNumericRange` as the code isn't great currently
JeffersonBledsoe Jan 29, 2024
7178369
Fix exceptions for existing forms
JeffersonBledsoe Feb 5, 2024
b35cb89
Temp test fix
JeffersonBledsoe Feb 5, 2024
caebd31
Don't validate if the field shouldn't be shown
JeffersonBledsoe Mar 12, 2024
77bd00b
Fix for validations without settings save
JeffersonBledsoe Mar 13, 2024
30a619d
Skip validating non-required fields
JeffersonBledsoe Mar 19, 2024
976e0f0
Fix bad breakpoint... whoops!
JeffersonBledsoe Mar 27, 2024
d5e052f
Server-validate required field
JeffersonBledsoe Apr 2, 2024
3251e4f
Fix hidden fields sometimes validating when they are hidden
JeffersonBledsoe Apr 8, 2024
7df5dda
Number of words validator
JeffersonBledsoe Apr 16, 2024
bb953ba
Handle not installing the validations library correctly
JeffersonBledsoe Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix custom_field_id in data export
JeffersonBledsoe committed Sep 25, 2023
commit cd8e9bb97148e9a4a9ec8cf19e51fa75f6246429
5 changes: 4 additions & 1 deletion src/collective/volto/formsupport/datamanager/catalog.py
Original file line number Diff line number Diff line change
@@ -80,7 +80,10 @@ def add(self, data):
)
return None

fields = {x["field_id"]: x["label"] for x in form_fields}
fields = {
x["field_id"]: x.get("custom_field_id", x.get("label", x["field_id"]))
for x in form_fields
}
record = Record()
fields_labels = {}
fields_order = []