-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support for shadow fields in app form #744
Comments
I'm moving this from Another way to think about this is 'the generic data model where form values are stored when they don't have a data model binding'. If we go ahead with #345, it might make things way easier. The way I envision that solution is that we keep all current values/state on components in the same location as the rest of the component state in redux (or any other shared state storage), instead of in the Other open questions:
Other terms for this concept:
|
Some references on how this works in Altinn 2: - https://altinn.github.io/docs/tul/vedlegg/a/#altinn-definerte-inputfelt and - https://altinn.github.io/docs/tul/vedlegg/a/#hjelpefelter-verdioverf%C3%B8ringer |
Brønnøysundregistrene ser nytten av å innføre "shadow fields" eller hjelpefelter og kan kommentere litt på hvilke konkrete behov for dette vi har sett i skjemaet brg/rrh-innrapportering:
|
Closing as done. Documentation here: https://docs.altinn.studio/nb/app/development/configuration/shadowfields/ |
Description
We currently only support storing data in the data model. If a shadow field is required to f.ex. store some data needed for f.ex. dynamics in the form, this needs to be part of the data model and as such will also be submitted with the final data (unless app developer writes some custom code to scrub out this kind of data).
We should support the concept of shadow fields, that is, fields that can contain data, but are not connected to the data model in any way.
Additional Information
A first try at defining how we can support this.
<page>.<componentId>
, to make sure keys are unique.applicationMetadata
and use a naming convention, so that we can store/fetch the data using existing data endpoint.The outlined solution supports rendering forms without any data model connection. It also supports a hybrid solution where some fields are connected to data model while others are true shadow fields.
One issue is that it could be difficult to validate the data submitted as shadow fields.
Alternative: Generate a data model from UI schema. This would enforce a contract of WHAT can be submitted/stored as a helper field, and allow for full deserialization and intellisense on server level. In this case we could have the same implementation frontend as suggested above.
Open questions
Tasks
Acceptance Criterias
The text was updated successfully, but these errors were encountered: