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

Fixed metadata variables are not shown in options of JSON dump registration backend #5087

Closed
Tracked by #5102
viktorvanwijk opened this issue Feb 6, 2025 · 0 comments · Fixed by #5094
Closed
Tracked by #5102

Comments

@viktorvanwijk
Copy link
Contributor

viktorvanwijk commented Feb 6, 2025

When adding a new JSON dump backend, all initial options are filled in by the frontend. Because initial value of fixed metadata variables is set to an empty list (see code) and the fixed metadata variables field in the serializer is not set to read only, they will be overwritten when saving the form, resulting in a permanent empty list of fixed variables.

Image

I see three options:

  • Add the default fixed metadata variables to the frontend: doesn't seem like the right thing to do at all
  • Make the fixed metadata variables field in the serializer read only: prevents overwriting it with an empty list, but the initial options when adding the backend plugin would still be empty. Also, getting the value for this field in the backend is tricky, because read-only fields are not in the validated_data of the serializer.
  • Add some extra endpoints to src/openforms/registrations/api/urls.py like is done for Camunda/Objects API/ZGW APIs/... to retrieve extra information from the backend: probably the best option
@viktorvanwijk viktorvanwijk self-assigned this Feb 6, 2025
@viktorvanwijk viktorvanwijk moved this from Todo to In Progress in Development Feb 6, 2025
viktorvanwijk added a commit that referenced this issue Feb 7, 2025
Because the initial value of fixed metadata variables is set to an empty list and the fixed metadata variables field in the serializer was not set to read only, they would be overwritten when saving the form, resulting in a permanent empty list of fixed variables.

This fix adds an API endpoint to fetch the default fixed variables dynamically in the frontend. This means they will be available directly when setting up the plugin for the first time.
viktorvanwijk added a commit that referenced this issue Feb 7, 2025
…ables table of JSON dump plugin

If the JSON dump plugin was not completely initialized yet (selected but not saved), and the user navigated to the registration variables of the variables table, the backend options would be an empty object, causing a crash.
viktorvanwijk added a commit that referenced this issue Feb 10, 2025
Because the initial value of fixed metadata variables is set to an empty list and the fixed metadata variables field in the serializer was not set to read only, they would be overwritten when saving the form, resulting in a permanent empty list of fixed variables.

This fix adds an API endpoint to fetch the default fixed variables dynamically in the frontend. This means they will be available directly when setting up the plugin for the first time.
viktorvanwijk added a commit that referenced this issue Feb 10, 2025
…ables table of JSON dump plugin

If the JSON dump plugin was not completely initialized yet (selected but not saved), and the user navigated to the registration variables of the variables table, the backend options would be an empty object, causing a crash.
viktorvanwijk added a commit that referenced this issue Feb 10, 2025
Because the initial value of fixed metadata variables is set to an empty list and the fixed metadata variables field in the serializer was not set to read only, they would be overwritten when saving the form, resulting in a permanent empty list of fixed variables.

This fix adds an API endpoint to fetch the default fixed variables dynamically in the frontend. This means they will be available directly when setting up the plugin for the first time.
viktorvanwijk added a commit that referenced this issue Feb 10, 2025
…ables table of JSON dump plugin

If the JSON dump plugin was not completely initialized yet (selected but not saved), and the user navigated to the registration variables of the variables table, the backend options would be an empty object, causing a crash.
@viktorvanwijk viktorvanwijk moved this from In Progress to Implemented in Development Feb 10, 2025
viktorvanwijk added a commit that referenced this issue Feb 13, 2025
Because the initial value of fixed metadata variables is set to an empty list and the fixed metadata variables field in the serializer was not set to read only, they would be overwritten when saving the form, resulting in a permanent empty list of fixed variables.

This fix adds an API endpoint to fetch the default fixed variables dynamically in the frontend. This means they will be available directly when setting up the plugin for the first time.
viktorvanwijk added a commit that referenced this issue Feb 13, 2025
…ables table of JSON dump plugin

If the JSON dump plugin was not completely initialized yet (selected but not saved), and the user navigated to the registration variables of the variables table, the backend options would be an empty object, causing a crash.
@github-project-automation github-project-automation bot moved this from Implemented to Done in Development Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
1 participant