Altinn / Altinn/app-frontend-react
AttachmentList option "includePDF" removes other attachments from AttachmentList.dataTypeIds.
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description of the bug
When using AttachmentList-component the option "includePDF", doesnt seem to work as expected.
If the value "true" is added to the option "includePDF" it will ignore any other attachments from the AttachmentList.dataTypeIds.
Example: AttachmentList with dataTypeIds "datatype1, datatype2", will show a list of attachments with one attachment beeing datatype1 and one attachment is datatype2. If you add the option "includePDF: true" add "ref-data-as-pdf" to the dataTypeIds list, then it will ignore datatype1 and datatype2 from the attachmentlist view.
### Steps To Reproduce
1. Have your applicationmetadata.json include the standard "ref-data-as-pdf" with "enablePdfCreation": true.
2. Add a component AttachmentList to a JSON Layout in ui/layouts
3. Add an attachment ID to the AttachmentList (another then "ref-data-as-pdf").
4. Add "ref-data-as-pdf" ID to the AttachmentList.
5. Check result view and see that only the attachment that is not "ref-data-as-pdf" is shown in the list.
6. Add the option includePDF:true to the AttachmentList.
7. Check result view and see that only the attachment that is "ref-data-as-pdf" is shown in the list.
From my view you can not get both the attachment and the generated PDF to show up in the same list.
### Additional Information
_No response_
Contributor guide
Research direction
Start by locating the AttachmentList component and the handling for the includePDF option. Reproduce the issue with dataTypeIds containing both ref-data-as-pdf and another attachment type, using the applicationmetadata.json and JSON Layout setup described. Done means both the generated PDF and the other configured attachments appear in AttachmentList.dataTypeIds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100