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

Feature/4980 add json schema to submitted data of json dump plugin #5007

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from

Conversation

viktorvanwijk
Copy link
Contributor

Closes #4980

Changes

Added JSON schema definition to the submitted data of the JSON dump registration plugin

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

Plugin name did not make sense before
API endpoint is relative, name should reflect that
It should match the corresponding property of the serializer (which is 'service' and not 'service_select')
Not relevant anymore or duplicates
Wrong place and doesn't look great
…n plugin

Need to include all form variables listed in the options to a values dictionary
The content of the attachment is now added to the result
Now includes a check on the generated values dictionary for easy testing
This is a requirement of the plugin
The user might want to send it to just the api root of the service
Makes more sense to keep static variables dict close to where it's used
The previous size was not big enough to show all elements without scroll bars
Required for simulating a receiving service
It is sufficient to only pass the relative endpoint to the .post method
This check if redundant, as the for loop will never be executed anyway if the query set is empty
It is closely related to the serializer
…pes only

Only ORC type services are relevant for this plugin
Will check the connection to the configured service
…n editor

The field 'formVariables' is read-only, so need an extra const to modify its value. Note, this didn't show up in storybook testing, only in manual functional testing
…lugin

Just as an example of what will be implemented in #4980
* Use VCR instead of mock now
* Added check on the response
* Added check on attachment encoding
* Use VCR instead of mock now
* Add test for invalid response from API endpoint
PR feedback: global config checks are not really useful for this plugin right now.
A bit more descriptive and avoids possible naming conflicts
formData will be an empty object if we add a new object, which means the default values for the configuration fields are missing
* Add required and noManageChildProps to ServiceSelect and FormVariableSelect because they are required and need to prevent some Field props being passed down to the children
* Remove max length of FormioVariableKeyField: it is based on a text field which has no length constraints
* Remove id field from RelativeAPIEndpoint TextInput: is managed automatically
* Remove Required from JSONDumpOptions: required is the default for TypedDict
* Add default value for relative_api_endpoint: guarantees that the key is always present, which gives a strict type definition
* Remove content type headers: is set automatically when using the json kwargs
* Replace 'Included/Not Included' text with icons: makes it easier for the user to see whether it is included.
The requests.Response object is not JSON serializable, so need to just add the json of it.
…data

It is neater to build up what needs to be processed first, before doing the processing
There was a bug with the previous attachment processing, where attachments would get overwritten if multiple were uploaded
The schema for the registration variables are left out for now, as they can't be selected in the JSON dump plugin options
…f variables to include

Also updated the JSON dump plugin
- Add test for JSON schemas of formio components
- Add test for form to JSON schema
Also add support for user-defined variables
@viktorvanwijk viktorvanwijk force-pushed the feature/4980-add-json-schema-to-submitted-data-of-json-dump-plugin branch from 0740d05 to 7997531 Compare January 10, 2025 11:21
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.

Add JSON Schema definition of the submitted data to the JSON registration backend plugin
1 participant