-
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
⚡️ Disable pagination when requesting form definitions in the admin #3542
Conversation
f745aab
to
6c6b746
Compare
9e641a4
to
2ecce2a
Compare
I think we can get rid of this? open-forms/src/openforms/forms/api/filters.py Lines 34 to 42 in cc8fe70
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3542 +/- ##
=======================================
Coverage 95.92% 95.92%
=======================================
Files 670 670
Lines 21527 21529 +2
Branches 2485 2485
=======================================
+ Hits 20649 20651 +2
Misses 609 609
Partials 269 269
☔ View full report in Codecov by Sentry. |
we can deprecate it, but removing it is a breaking change and requires a new major version of the API |
Couldn't get e2e tests to work. My best guess (and I was able to reproduce only once locally but unfortunately the timeout closed the test browser) is that this happens when form definitions are loaded, and the e2e test clicks on the select element on a precise timing where the select options HTML elements don't have time to load, which kind of breaks React's reactivity. Edit: I'm able to reproduce ~ 1/5th of the time, but can't really do much as console isn't opened on startup and I can't see the requests made. Dirty solution: |
src/openforms/js/components/admin/form_design/form-creation-form.js
Outdated
Show resolved
Hide resolved
e914693
to
a5ad3f8
Compare
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.
Can you also deprecate that filter_queryset
thing doing the OR
filter? A warnings.warn(..., DeprecationWarning)
is fine & add it to the list of things to remove in #3283
src/openforms/js/components/admin/form_design/form-creation-form.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/form-creation-form.js
Outdated
Show resolved
Hide resolved
Shouldn't we deprecate the OpenAPI query parameters instead? Or you only want the OR filter to have a |
Only the OR filter behaviour, the query params themselves are obviously still used, just not at the same time (anymore). |
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.
Please rebase your PR in a couple of atomic commits :) then it's good to merge!
9659ca9
to
3bea98b
Compare
3bea98b
to
91a4dd4
Compare
Fixes #3491
I'm a bit frustrated by this issue, as what I wanted to do initially was:
path?include=url,name,internal_name
(as only these three fields are required by theNewStepFormDefinitionPicker
component)First one would be doable with https://github.com/wimglenn/djangorestframework-queryfields but it would add an extra dependency not updated in 7 years.
Or another solution suggested by @joeribekker:
@action
) to only fetch the required fields, but it would not inherit from the currently definedfilterset_class
.I ended up using a custom pagination class, that would understand
page_size=0
to mean no pagination. We will have to see if this is viable with a lot of form definitions in the db