Altinn / Altinn/app-frontend-react
QueryParam prefill, enable stateless-to-instance flow with shared data model and attachments
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description
**Context**
We initially implemented url param data prefill with the requirement that you can only link to a stateless task. This is because we dont want to allow automatic creation of an instance with prefilled data as this is a potential security risk.
However, service owners are not happy about this as it will often require an extra step for users.
We discussed three potential solutions:
1. Do nothing – insist that a stateless step is used
2. Allow submitting data from the stateless step
3. Allow linking to stateful steps as an opt-in feature.
We concluded that alternative 2 best covers the requirements for now and in the future.
### Additional Information
Implementation:
- Should be able to transition from stateless step to submitted form (InstantiationButton or another button must also trigger process/next afterward)
- Must be able to use the same data model + layoutSet + attachments in both stateless and instance modes
- Instantiation must use createMultiPart to upload data model(s), attachments, etc.
- FileUpload must be updated to support stateless mode
- FileUploadWithTag might need to be supported? Along with multiPart support to apply tags to an attachment. Can probably be removed (and deprecate the component?)
- Data processing APIs (with validation) for multiple data models at once in stateless. Do not include attachments, but include metadata for them? Might need to include previousData + patch to make this more similar to stateful
- Anonymous stateless can mostly behave the same, but we should prevent FileUpload* and InstantiationButton from functioning there
Contributor guide
Research direction
Start by tracing the existing QueryParam prefill flow and the InstantiationButton, FileUpload, and FileUploadWithTag entry points. Read how createMultiPart and the stateless data-processing APIs currently handle models and attachments. Done means a non-anonymous stateless step can submit the shared data model, layout, and attachments, while anonymous stateless mode prevents FileUpload* and InstantiationButton use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100