Altinn / Altinn/app-frontend-react

Handle summary2 for custom components

Open
#2,879 0 comments 0 reactions 0 assignees View on GitHub
area/summary kind/feature-request
Dominant language
TypeScript
Stars
21
Forks
33
Avg merge
6d 23h
Merged PRs (30d)
3

Description

### Description

We need a way of rendering custom components in PDF / summary2.

PR: https://github.com/Altinn/app-frontend-react/pull/2840

These are the options for handling summary for custom components:
1. Just rendering a simple summary component using displayData (the same as old summary)
- Not all custom components use formdata so it will not work for those cases
- Also for DIBK they data from several fields and need a specific format with linebreaks and commas
2. Simply render the custom component summary2 the same as in the app
- This might cause custom components in existing apps to now appear in summaries and PDFs in apps using summary2
3. Render the custom component summary2 the same as the app, but introduce a property that you need to set in order for the component to render in summary.
4. Simply render custom component summary2 the same as in the app, but programmatically give the component a property telling it it is now rendered using summary2. The App developer will have to check the property and change the layout of the component if they wish. (Ex: removing input field)
5. combo of 3 and 4 to prevent breaking change

Option 2 and 4 is a breaking change, but might be fine as not many apps are using custom components and summary2 is somewhat open for making breaking changes.

Option 3 prevents making a breaking change, but the extra property for explicitly showing the component in summary might be a bit confusing.

We have decided to go for option 4

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Review PR #2840 and the existing summary2 path for custom components, including how PDF rendering reaches it. Done means custom components render in summary2 and PDFs as they do in the app, while receiving an indication that they are being rendered in summary2, as specified by option 4.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.