-
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
👽 [#4693] Integrate Objects API prefill modal with backend #4799
👽 [#4693] Integrate Objects API prefill modal with backend #4799
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4799 +/- ##
==========================================
+ Coverage 96.58% 96.60% +0.02%
==========================================
Files 749 749
Lines 25540 25540
Branches 3377 3377
==========================================
+ Hits 24668 24674 +6
+ Misses 608 604 -4
+ Partials 264 262 -2 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
c725d4c
to
7436b8f
Compare
@sergei-maertens I'm trying to fix the issue with the react-select menu being clipped, but I'm not sure how to fix it. I've tried setting a z-index, but that alone doesn't fix the issue. If I try using current situation Any ideas on how this can be fixed? Changing the menuPlacement to |
49af4a9
to
175af2c
Compare
@sergei-maertens I've made the placement bottom and set a maxMenuHeight for the selects used in the modal to avoid overflow issues (efb307d) |
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/forms/objects_api/ObjectTypeSelect.js
Outdated
Show resolved
Hide resolved
0b8256e
to
5e646cc
Compare
5e646cc
to
33836d3
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.
I've noticed a couple more things when checking this out locally to look into the dropdown issue:
- I'm missing the code structure from the registrations app a bit - now there's a single file with a number of components for the Objects API form, all in the
variables/prefill
folder. Perhaps building out a sub-structure like inregistrations
with a directory per plugin ID would be better to manage the code, and we can then split out the individual components. - When resetting the api group in the prefill form, the selected object type and version are not reset, only the variables mapping. This leads to hidden form state that is not accurately represented in the UI and is confusing at the least and dangerous at most.
- The form field/button to copy the settings from a registration backend I haven't tested yet, but I found the UI controls to be in an odd place. I would expect that to be the first thing I see, visually separated from the rest of the fields since they also affect API group, object type and object type version, not just the variables mapping. And a paragraph with some explanation of what it actually does would go a long way for users to decide what they want to do to configure. Additionally, the 'copy' language should maybe be more along the lines of 'synchronize', since this would also be the mechanism to update the prefill config after the registration variables config/mapping is updated without having to manage everything manually afterwards
- The help texts for fields now have the registration field help texts, those either need to be removed for the prefill plugin, or overridden with prefill-specific content. Now it's just confusing instead of making things more clear.
8e23cf3
to
4716f4b
Compare
Rebased on master - I will now look at the state again and do a thorough review! |
I'm not happy yet with the "copy configuration" button and this is a tough nut to crack. After some discussion/debate with Joeri, we've settled on something like this:
Please also set up the styling properly so that the link and button are nicely aligned. |
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.
We should go through these remarks tomorrow :)
Let's get this PR wrapped up before we tackle the other one.
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/ObjectsAPIFields.js
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/prefill/PrefillConfigurationForm.js
Outdated
Show resolved
Hide resolved
a9da278
to
97b7f23
Compare
that allows the user to copy the configuration used by the Form's registration backend
* remove unnecessary prefill prefix from options in javascript code * remove trailing comments * use variable for computed name in VariableMapping * add dropdown to select a registration backend instead of always picking first * also copy variablesmapping when clicking copy button * use setValues to set formik values at once, instead of multiple calls of setFieldValue
* use new confirmation modal for prefill config copy button warning * add decorator for reactselect to fix storybook tests * move default prefill fields and objects api fields to separate directories * allow passing help texts/labels to reused Objects API fields (since they are no longer registration specific) * fix confirmation check for objects API prefill fields (previously the value was changed before clicking accept) * move initialization of Objects API prefill options to ObjectsAPIFields component (was previously in generic component)
and automatically hide the select after copying
because the options menu is now portaled and appended to document.body, the query in the tests should change as well
1e6ab24
to
7a0cdc9
Compare
This was a leftover in case window.confirm is/was used - this has all been replaced with the custom confirmation hook and modal which must always be async. Discussed via Slack.
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.
Let's merge this so we can get it tested in the alpha release!
4dfcbda
to
86eb49b
Compare
The tests broke because of react-select now *always* being rendered in a portal. Added a helper that encapsulates this logic so that we don't need to worry about this in our actual test code.
86eb49b
to
5e269c9
Compare
Closes #4693
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
Commit hygiene