open-forms icon indicating copy to clipboard operation
open-forms copied to clipboard

Rethink admin Javascript to save a form

Open sergei-maertens opened this issue 1 year ago • 2 comments

Currently we perform a bunch of parallel requests in the frontend to save a form after/during editing it:

https://github.com/open-formulieren/open-forms/blob/ffd32bc0729c80f2a620efb5c4d4dd16c709ff89/src/openforms/js/components/admin/form_design/data/complete-form.js#L394

One big drawback is that the form variables are saved after the form detail call (form create or update), but the registration backends/registration backend options are included in the latter. This means that the validation of registration backend options cannot check for form variables, since they are only saved later, which is not good for our input validation.

There are two options to be explored:

  • break the registration backends saving out into its own call
  • replace all the individual calls with one big endpoint to save the entire form

Tasks

  • [ ] Check benefits/drawbacks of each option
  • [ ] Decide if we can tackle this when implementing the new design or before that
  • [ ] Pick the best option

sergei-maertens avatar Feb 27 '24 11:02 sergei-maertens