See title. Making only changes to the order of fields saves as expected, but if those are the only changes, then clicking "Generer modeller" directly after changing order of fields causes the order to revert back to the old order.
Steps To Reproduce
Navigate to datamodels page
Move a field up or down, and DO NOT make any other changes.
Click "Generer modeller" to generate models and wait for OK response
Re-load the page to re-fetch the model
See that the field has reverted to its old position
Move the field up or down again, and DO NOT make any other changes.
Re-load the page to re-fetch the model
See that the field is in its new updated position
Click "Generer modeller" and wait for OK response
Re-load the page again
See that the field is in its updated position still.
Updated data model is saved as expected when just changing the order of fields, the issue seems to be with "Generer modeller" directly after changing the field order. Making any other changes, or re-loading the page after changing order, seems to resolve the issue.
Looks like there may be some outdated state used when "Generer modeller" is clicked that is causing this? Re-load of model before generating models seems to do the trick. We should ensure that the updated data model is passed to the backend when generating models.
Description of the bug
See title. Making only changes to the order of fields saves as expected, but if those are the only changes, then clicking "Generer modeller" directly after changing order of fields causes the order to revert back to the old order.
Steps To Reproduce
https://github.com/Altinn/altinn-studio/assets/1636323/9f5f121a-3712-4dde-8c52-7de5b33a9603
Additional Information
Updated data model is saved as expected when just changing the order of fields, the issue seems to be with "Generer modeller" directly after changing the field order. Making any other changes, or re-loading the page after changing order, seems to resolve the issue.
Looks like there may be some outdated state used when "Generer modeller" is clicked that is causing this? Re-load of model before generating models seems to do the trick. We should ensure that the updated data model is passed to the backend when generating models.