-
Notifications
You must be signed in to change notification settings - Fork 26
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
✨ [#4993] Implement fetching select(boxes) options from Referentielijsten #4996
base: master
Are you sure you want to change the base?
✨ [#4993] Implement fetching select(boxes) options from Referentielijsten #4996
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4996 +/- ##
==========================================
+ Coverage 96.62% 96.63% +0.01%
==========================================
Files 761 763 +2
Lines 25961 26068 +107
Branches 3394 3402 +8
==========================================
+ Hits 25084 25191 +107
Misses 611 611
Partials 266 266 ☔ View full report in Codecov by Sentry. |
dbb75e3
to
b82f2ab
Compare
adc42bb
to
9881217
Compare
45ea58b
to
99217fa
Compare
except Exception as e: | ||
if detail := getattr(e, "detail", None): | ||
raise APIException(detail) | ||
raise e |
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 is in preparation to display a proper error message to the user in case the referentielijsten options can't be fetched. I'm not sure if this is the right approach to get a specific message though, it currently looks like this:
Preferably I think the "detail" message should be displayed in the error block, which would require changes in the SDK
99217fa
to
5b99dc0
Compare
# invoke the configured form logic to dynamically update the Formio.js configuration | ||
new_configuration = evaluate_form_logic( | ||
instance.submission, | ||
instance, | ||
instance.submission.data, | ||
**self.context, | ||
) | ||
try: | ||
new_configuration = evaluate_form_logic( | ||
instance.submission, | ||
instance, | ||
instance.submission.data, | ||
**self.context, | ||
) | ||
except Exception as e: | ||
if detail := getattr(e, "detail", None): | ||
raise APIException(detail) | ||
raise e # pragma: no cover |
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.
Currently the philosophy of OF is "continue at all costs" and this breaks. Let's discuss with Joeri what the expected behaviour is here.
I'm also out of the loop now what the service fetch behaviour is 🤔
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.
In the issue this was mentioned:
If the API is unavailable or returns an error, Open Forms must display a user-friendly error message to the end user.
My assumption was to let the form crash, because the user won't be able to select a valid option (because they could not be fetched), which means that they cannot fill out the form. But it might be good to discuss this indeed 👍
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.
I'm also out of the loop now what the service fetch behaviour is 🤔
Double checked this, with service fetch set up to fetch options from referentielijsten it does indeed continue and show no available options (Geen opties om te kiezen
)
…sten this was previously possible with logic and service fetch, but this functionality provides a shortcut to more easily integrate with Re ferentielijsten API
to be used for unittests with VCR and local development
5b99dc0
to
714d33b
Compare
Closes #4993
TODO:
Changes
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Dockerfile/scripts
./bin
folderCommit hygiene