Analysis: Shadow fields/helper fields #9927
Labels
kind/analysis
Used when an issue needs to be analysed before it becomes a user story.
status/ready-for-analysis
Status: Used for issues that are ready for analysis - functional or technical.
This is a specification task, related to Altinn/app-frontend-react#744.
We need to determine what to support, and how we are going to support it.
Specifically:
Overview of possible solutions.
1. Shadow fields as part of the data model - The Altinn 2 way
Shadow fields must be defined as a part of the data model, with a specific naming convention. On process next, the app template automatically removes the shadow fields from the form data, so that these are not submitted.
Pros
ProcessDataWrite
)Cons
2. Explicitly define a data model for shadow fields
Similar to the above solution, but here the app developer must define a separate data model for shadow fields.
Pros
Cons
3. No data model for shadow fields
Allow shadow fields to be stored as a generic set of key-value-pairs. This way there is no need to create data model for shadow fields. Any frontend components without data model binding could have values mapped to a shadow field.
For repeating groups, the values could be stored as a key/value pair where the key is a string and the value is an array.
Pros
Cons
Conclusion
We will go with alternative 1 as the first solution. This covers the requirements, and solves the problem in the same way as Altinn 2. Other pros are that it will be easy to implement, allowing us to spend our time on more pressing areas. It is important to note that by selecting alternative 1, we do not restrict ourselves to only this solution, and could f.ex. implement alternative 3 as a solution in parallel in the future. Answering the open questions for this analysis:
The text was updated successfully, but these errors were encountered: