-
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
Objects API registration backend - Improve JSON content field / mapping editor #3688
Closed
21 of 33 tasks
Comments
alextreme
added
triage
Issue needs to be validated. Remove this label if the issue considered valid.
enhancement
owner: den-haag
labels
Dec 13, 2023
|
Refinement: A whiteboard session will be done to see what the exact tasks should be. |
joeribekker
added
blocked
discuss
and removed
triage
Issue needs to be validated. Remove this label if the issue considered valid.
labels
Dec 18, 2023
Attached is an example json-schema definition as provided by the GZAC vendors - this is a good minimal case that must be supported. |
Viicos
added a commit
that referenced
this issue
Jan 31, 2024
Viicos
added a commit
that referenced
this issue
Jan 31, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
Viicos
added a commit
that referenced
this issue
Feb 1, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
Necessary for tests making use of `freezegun`
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
For the multiple file component, create a single file attachment to make sure the component multiplicity is taken into account Adapt submission date after update to the 'now' static variable
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
added a commit
that referenced
this issue
Mar 22, 2024
Accessing dotted-keys like foo.bar in the underlying data structure used by FormioData does not work, the point of FormioData is to abstract this access.
sergei-maertens
added a commit
that referenced
this issue
Mar 22, 2024
Viicos
added a commit
that referenced
this issue
Mar 22, 2024
[#3688] Use Documents URLs as fileupload variables values
Viicos
added a commit
that referenced
this issue
Mar 22, 2024
Viicos
added a commit
that referenced
this issue
Mar 22, 2024
Viicos
added a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
added a commit
that referenced
this issue
Mar 22, 2024
These fields are obsolete and scheduled for removal. Their values have been copied into the respective forms where they were not set explicitly yet.
sergei-maertens
added a commit
that referenced
this issue
Mar 22, 2024
* Updated technical (functional admin) documentation * Documented minimum required version of Objects API 2.2 * Removed distinction between new/legacy - the form fields are marked as required anyway and the nuance is not interesting. * Translated the manual documentation to Dutch * Moved form-level manual documentation into registrations section * Added extra pointers on how to configure this thing, with a bit more logical progression.
sergei-maertens
added a commit
that referenced
this issue
Mar 22, 2024
…ack-to-patch [#3688] Fix payment updates: use PATCH, represent payment as float
Viicos
added a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
pushed a commit
that referenced
this issue
Mar 22, 2024
sergei-maertens
added a commit
that referenced
this issue
Mar 22, 2024
…nvraag-type-v2 [#3688] Remove `productaanvraagType` for v2 options
Closing this as the main feature is done. Further follow up is coordinated via: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thema / Theme
Plugins
Omschrijving / Description
Taiga DH ZGW 539
Currently the JSON Schema of the 'productaanvraag' isn't very strict. This allows the Form Designer in Open Formulieren to easily make changes to the form, however the consequence is that the data in the 'productaanvraag' changes. Fieldname changes for instance cause the data to be placed at a different location or with a different type, leading to problems in GZAC when processing the 'productaanvraag'
As such, the GZAC team would like to adhere to a stricter JSON schema, this to ensure that the fieldnames stay the same. The JSON schema is to be a more rigid contract between Open Formulieren and GZAC.
In order to assist with this Open Formulieren has a 'JSON content editor' field in the Objects API registration backend. This is documented in:
https://open-forms.readthedocs.io/en/latest/manual/templates.html?highlight=Objects%20api#objecten-api-registratie
The problem is that this 'JSON content editor' is rather basic and misses the ability to validate the form against the 'productaanvraag', an editor doesn't know if changes made in the form or in the editor will lead to a valid 'productaanvraag', the only way to currently check this is by manually sending in a form submission. Adding a validator will ensure that changes in the form and editor can be properly verified.
Analysis
The object type definition and the associated json schema is leading. In this user story, we'll update the UI to configure the data sent to the objects API to remove human errors from the process as much as possible and run validation at form-design time rather than see errors during runtime.
This will prepare us in the direction of the new UI design - while staying backwards compatible.
Some topics have no clear answers yet and we will get to them in due time:
Tasks
This rework touches many aspects - please break them up in separate PRs that are easy to review and merge without breaking the current situation.
Phase 1: User interface 1
The changes here are useful for the legacy version too.
Add a field
objecttypes_service
to theObjectsAPIConfig
model. We will use this to retrieve a list of available object types and present them to the user.Add a data migration to try to create this service from existing
objecttype
URLs either inObjectsAPIConfig
or form registration objects. Ideally, this should only yield one base URL, but there could be more. If there are more, pick the first. This API service will be incomplete, since we don't know the API token -> add to release notes this needs to be added.Extend the registration plugin check to check for access to the objecttypen list.
Add API endpoints:
/api/v2/registration/plugins/objects-api/object-types
- give a list of available object types from the configured service/api/v2/registration/plugins/objects-api/object-types/:uuid/versions
- give a list of available versions for a given object typePossibly this can be a single endpoint if that proves to be more practical for the frontend code - let's figure this out from the frontend code.
Replace the RJSF form for the Objects API configuration with a React-based form (similar to the ZGW rework done for zaakeigenschappen & the setup for Camunda configuration)
objecttype
configuration field into a dropdown of available object types. Simple at first, in the future we can upgrade this to react-select with autocomplete/search capabilitiesobjecttype
values being cleared - you may need some conditional logic to present either a dropdown or a text field with the raw value in this transitional period.Phase 2: backend updates 1
The changes here prepare the backend for new/updated UI. Another phase will add additional validation constraints. It
is important we stay backwards compatible to give user time to upgrade to the new mechanisms.
Add a
version
field toObjectsAPIOptionsSerializer
- with a default of1
.is not sufficient)
options["version"] == 1
Extend serializer validation -
content_json
& similar may only be provided if theversion is 1
Ensure that a (resolved) JSON schema for the selected object type is available to the
frontend. This is the
jsonSchema
property in the object type version resource.This may require an additional API endpoint, this may require some processing on the backend
to resolve the schema - alternatively if good frontend libraries exist, those could also
take care of the resolution.
Note
We decided not to implement such validation for now. We expect users to choose a "correct" objecttype version (with a JSON schema other than
{}
for instance). Even if they do, they will end up seeing that no option is available to map form variables to a json path)data_mapping
. The data structure must describe how eachproperty from the above
jsonSchema
is filled with a form variable. It's probablywise to keep a structure similar to the
jsonSchema
, but let's see what works. jsonpathlike expressions are likely going to be problematic with objects/arrays, so ensure we
can map those kind of variables. It's important that we record the
key
of thevariable so we can do a simple lookup in
submission.data[variable_key]
to get to thevariable (this should be a
FormioData
datastructure which usesglom
under the hood).Phase 3: User interface 2
This may be challenging - we want to manage the mapping/registration information from
the variables tab, but the configuration should be persisted in the
options
of theregistration backend(s).
Also keep in mind that multiple registration backend configuration can be provided!
Add a column "Registration" to the variables tab. This applies to all types of
variables: Component, user defined and static.
For each variable/row, show the summary and controls to modify the configuration
(Objects) record > data > foo.bar
(property names may contain periods!)
clickable
the name given to the registration option
options that are not mapped yet.
options.
Phase 4: backend updates 2, validation
The backend needs to validate the configuration made by the frontend and provide useful
feedback.
Validate the data mapping configuration against the specified object type version
schema:
be recursive with nested objects!
type
andformat
fields.openforms.formio.components
to infertype
andformat
for a given component type.
and json-schema type/format too
the blind spots
Serializer validation errors must find their way back to the UI in a user-friendly
way -> highlight the variables tab, highlight the tab where a variable is having errors,
highlight the relevant registration option in the summary and then display the validation
error(s) in the modal.
Validation errors warning about unmapped/missing properties: display them in the
registration tab with the relevant registration option. Possibly in the future we move
this to the variables tab, TBD.
Phase 5: backend updates 3, runtime behaviour
created in the Objects API.
API stack.
Phase ??: harder problems & nice to have
To be fleshed out when the MVP work has been done, so we have a better picture of the
state of things.
Handle non-variable template constructs like documented on https://open-forms.readthedocs.io/en/2.5.1/manual/templates.html#objecten-api-registratie
Attachments - generic treatment or specific mappings?
Notifying of a new(er) version being available for the object type
Payment status update/PATCH call
Helpful tools to upgrade the configuration to new version
indicate a property was "renamed" to make migrating easier
"Try it out" functionality
TODOs found when working on it
------
empty option, which can be confusing.path > to
, and then a string topath > to > otherpath
)The text was updated successfully, but these errors were encountered: