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

Ensure that no form variables are created for soft required errors #4910

Conversation

sergei-maertens
Copy link
Member

Closes #4884

The soft required errors component should have the same behaviour like the content component, as it holds no submission values and is purely client-side behaviour.

Formio itself excludes the content component when looping over a configuration with eachComponent, so we need to add this same logic to our own code since Formio is not aware of our custom component semantics.

In the backend, we extend the behaviour for content components to the softRequiredErrors component to ensure no variables are created in the database either.

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
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

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

… errors

The soft required errors component should have the same behaviour like
the content component, as it holds no submission values and is purely
client-side behaviour.

Formio itself excludes the content component when looping over a
configuration with eachComponent, so we need to add this same logic
to our own code since Formio is not aware of our custom component
semantics.

In the backend, we extend the behaviour for content components to the
softRequiredErrors component to ensure no variables are created in
the database either.
@sergei-maertens
Copy link
Member Author

I couldn't find existing tests for this and it's so specific/tied to Formio that I don't really know where to start either.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.57%. Comparing base (0dd2174) to head (db8d6fe).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4910   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files         757      757           
  Lines       25750    25750           
  Branches     3383     3383           
=======================================
  Hits        24869    24869           
  Misses        616      616           
  Partials      265      265           

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

@sergei-maertens sergei-maertens merged commit 3a70208 into master Dec 12, 2024
34 checks passed
@sergei-maertens sergei-maertens deleted the issue/4884-ignore-soft-required-errors-component-variables branch December 12, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Soft required errors should not add a component form variable
2 participants