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

🐛 [#4241] Fix validation of field with nested key in fieldset #4329

Merged
merged 2 commits into from
May 27, 2024

Conversation

stevenbal
Copy link
Contributor

@stevenbal stevenbal commented May 24, 2024

Closes #4241

Changes

  • Fix validation of field with nested key in fieldset

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh.sh
    • Ran ./bin/compilemessages_js.sh
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@stevenbal stevenbal added the needs-backport Fix must be backported to stable release branch label May 24, 2024
@stevenbal stevenbal marked this pull request as draft May 24, 2024 13:20
@stevenbal stevenbal marked this pull request as draft May 24, 2024 13:20
@stevenbal stevenbal force-pushed the issue/4241-fieldsets-backend-validation branch from e3efb21 to 6017d38 Compare May 24, 2024 14:08
Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.25%. Comparing base (d9a5bd3) to head (83dd777).
Report is 744 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4329      +/-   ##
==========================================
- Coverage   96.27%   96.25%   -0.02%     
==========================================
  Files         731      731              
  Lines       23735    23741       +6     
  Branches     2797     2800       +3     
==========================================
+ Hits        22850    22853       +3     
- Misses        616      617       +1     
- Partials      269      271       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevenbal stevenbal force-pushed the issue/4241-fieldsets-backend-validation branch 2 times, most recently from 510f629 to 3575b29 Compare May 24, 2024 15:19
if self.mode != RenderModes.export or not is_layout_component(self.component):
if self.mode != RenderModes.export or (
not is_layout_component(self.component)
and self.component["type"] != "editgrid"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergei-maertens I do have to add this check here explicitly after I added the editgrid check to is_layout_component

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we shoved editgrid in there in a weird way, I'm glad it's not worse than this

@stevenbal stevenbal marked this pull request as ready for review May 24, 2024 15:27
Comment on lines +162 to +164
if component["type"] == "editgrid":
return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a FIXME that this isn't the neatest way to handle this? 😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it

@stevenbal stevenbal force-pushed the issue/4241-fieldsets-backend-validation branch from 3575b29 to 83dd777 Compare May 27, 2024 07:30
@stevenbal
Copy link
Contributor Author

stevenbal commented May 27, 2024

@sergei-maertens I'm not sure why codecov is failing here, if I put a breakpoint after line 99 locally, I see that this case is executed in the openforms.formio tests: https://app.codecov.io/gh/open-formulieren/open-forms/pull/4329/blob/src/openforms/formio/serializers.py

EDIT: nvm, it's the project codecov you mentioned that went down, so it's probably not an issue?

@sergei-maertens sergei-maertens merged commit 69b95dc into master May 27, 2024
26 of 27 checks passed
@sergei-maertens sergei-maertens deleted the issue/4241-fieldsets-backend-validation branch May 27, 2024 09:40
sergei-maertens pushed a commit that referenced this pull request May 27, 2024
by not adding a serializer field for layout components

Backport-of: #4329
@sergei-maertens
Copy link
Member

Backported to 2.6 with 4bf6f06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport Fix must be backported to stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend validation not applied for components inside fieldsets (with a nested key)
2 participants